Class TypeScript::Type

A static type in the TypeScript type system.

Types are generally not associated with a specific location or AST node. For instance, there may be many AST nodes representing different uses of the number keyword, but there only exists one number type.

Direct supertypes

Known direct subtypes

Predicates

getAConstructorSignature

Gets a constructor call signature.

getAFunctionSignature

Gets a function call signature.

getAMethodOverload

Gets a signature of the method of the given name.

getASignature

Gets a signature of the given kind.

getChild

Gets the ith child of this type.

getConstructorSignature

Gets the nth constructor call signature.

getFunctionSignature

Gets the nth function call signature.

getKind

Gets the kind of this type, which is an integer value denoting how the type is stored in the database.

getLastConstructorSignature

Gets the last constructor call signature.

getLastFunctionSignature

Gets the last function call signature.

getLastSignature

Gets the last signature of the given kind.

getMethod

Gets the last signature of the method of the given name.

getMethodOverload

Gets the nth overload signature of the given method.

getNumConstructorSignature

Gets the number of constructor call signatures.

getNumFunctionSignature

Gets the number of function call signatures.

getNumSignature

Gets the number of signatures of the given kind.

getNumberIndexType

Gets the type of the number index signature on this type, such as T in the type { [n: number]: T }.

getProperty

Gets the type of the given property of this type.

getSignature

Gets the nth signature of the given kind present on this type.

getStringIndexType

Gets the type of the string index signature on this type, such as T in the type { [s: string]: T }.

hasUnderlyingType

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

hasUnderlyingType

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

hasUnderlyingTypeName

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

toString

Gets a string representation of this type.

unfold

Repeatedly unfolds union and intersection types and gets any of the underlying types, or this type itself if it is not a union or intersection.