import { Type } from "https://deno.land/x/ts_morph@16.0.0/mod.ts";
Properties
Gets the underlying compiler type.
Methods
Gets the alias symbol if it exists.
Gets the alias symbol if it exists, or throws.
Gets the alias type arguments.
Gets the apparent properties of the type.
Gets an apparent property.
Gets the apparent type.
Gets the array element type or returns undefined if it doesn't exist (ex. for T[]
it would be T
).
Gets the array element type or throws if it doesn't exist (ex. for T[]
it would be T
).
Gets the base type of a literal type.
For example, for a number literal type it will return the number type.
Gets the base types.
Gets the call signatures.
Gets the constraint or returns undefined if it doesn't exist.
Gets the constraint or throws if it doesn't exist.
Gets the construct signatures.
Gets the default type or returns undefined if it doesn't exist.
Gets the default type or throws if it doesn't exist.
Gets the intersection types (ex. for T & U
it returns the array [T, U]
).
Gets the fresh type of the literal or returns undefined if this is not a literal type.
Note: I have no idea what this means. Please help contribute to these js docs if you know.
Gets the fresh type of the literal or throws if this is not a literal type.
Note: I have no idea what this means. Please help contribute to these js docs if you know.
Gets the regular type of the literal or returns undefined if this is not a literal type.
Note: I have no idea what this means. Please help contribute to these js docs if you know.
Gets the regular type of the literal or throws if this is not a literal type.
Note: I have no idea what this means. Please help contribute to these js docs if you know.
Gets the value of a literal or returns undefined if this is not a literal type.
Gets the value of the literal or throws if this is not a literal type.
Gets the non-nullable type.
Gets the number index type.
Gets the object flags.
Gets the properties of the type.
Gets a property or returns undefined if it does not exist.
Gets a property or returns undefined if it does not exist.
Gets a property or throws if it doesn't exist.
Gets a property or throws if it doesn't exist.
Gets the string index type.
Gets the symbol of the type or throws.
Returns the generic type when the type is a type reference, returns itself when it's already a generic type, or otherwise returns undefined.
For example:
- Given type reference
Promise<string>
returnsPromise<T>
. - Given generic type
Promise<T>
returns the samePromise<T>
. - Given
string
returnsundefined
.
Returns the generic type when the type is a type reference, returns itself when it's already a generic type, or otherwise throws an error.
For example:
- Given type reference
Promise<string>
returnsPromise<T>
. - Given generic type
Promise<T>
returns the samePromise<T>
. - Given
string
throws an error.
Gets the type text.
Gets the individual element types of the tuple.
Gets type arguments.
Gets the union types (ex. for T | U
it returns the array [T, U]
).
Gets if this is an anonymous type.
Gets if this is an any type.
Gets if this is an array type.
Gets if this is a boolean type.
Gets if this is a boolean literal type.
Gets if this is a class type.
Gets if this is a class or interface type.
Gets if this is an enum type.
Gets if this is an enum literal type.
Gets if this is an interface type.
Gets if this is an intersection type.
Gets if this is a literal type.
Gets if this is a never type.
Gets if this is the null type.
Gets if the type is possibly null or undefined.
Gets if this is a number type.
Gets if this is a number literal type.
Gets if this is an object type.
Gets if this is a readonly array type.
Gets if this is a string type.
Gets if this is a string literal type.
Gets if this is a template literal type.
Gets if this is a tuple type.
Gets if this is a type parameter.
Gets if this is the undefined type.
Gets if this is a union type.
Gets if this is a union or intersection type.
Gets if this is the unknown type.