Enum camo_typescript::Type
source · pub enum Type {
Builtin(BuiltinType),
Path(TypePath),
Object(ObjectType),
Literal(LiteralType),
Array(ArrayType),
Union(UnionType),
Intersection(IntersectionType),
}
Expand description
Represents a type use, e. g. in an interface definition, function type definition, or type alias.
Variants§
Builtin(BuiltinType)
A built-in type like number
or string
.
Path(TypePath)
A path to some type.
Includes simple names like MyType
.
Object(ObjectType)
An object type.
Literal(LiteralType)
A literal type.
Array(ArrayType)
An array type.
Union(UnionType)
A union type, combining multiple cases.
Intersection(IntersectionType)
An intersection type, combining two types.
Trait Implementations§
source§impl From<BuiltinType> for Type
impl From<BuiltinType> for Type
source§fn from(value: BuiltinType) -> Self
fn from(value: BuiltinType) -> Self
Converts to this type from the input type.
source§impl From<IntersectionType> for Type
impl From<IntersectionType> for Type
source§fn from(value: IntersectionType) -> Self
fn from(value: IntersectionType) -> Self
Converts to this type from the input type.
source§impl From<LiteralType> for Type
impl From<LiteralType> for Type
source§fn from(value: LiteralType) -> Self
fn from(value: LiteralType) -> Self
Converts to this type from the input type.
source§impl From<ObjectType> for Type
impl From<ObjectType> for Type
source§fn from(value: ObjectType) -> Self
fn from(value: ObjectType) -> Self
Converts to this type from the input type.