TypeChecker
Functions
Follow all aliases to get the original symbol.
Gets the intrinsic any
type. There are multiple types that act as any
used internally in the compiler, so the type returned by this function should not be used in equality checks to determine if another type is any
. Instead, use type.flags & TypeFlags.Any
.
If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. Otherwise returns its input. For example, at export type T = number;
: - getSymbolAtLocation
at the location T
will return the exported symbol for T
. - But the result of getSymbolsInScope
will contain the local symbol for T
, not the exported symbol. - Calling getExportSymbolOfSymbol
on that local symbol will return the exported symbol.
Follow a single alias to get the immediately aliased symbol.
Gets the intrinsic never
type. There are multiple types that act as never
used internally in the compiler, so the type returned by this function should not be used in equality checks to determine if another type is never
. Instead, use type.flags & TypeFlags.Never
.
Gets the intrinsic null
type. There are multiple types that act as null
used internally in the compiler, so the type returned by this function should not be used in equality checks to determine if another type is null
. Instead, use type.flags & TypeFlags.Null
.
returns unknownSignature in the case of an error. returns undefined if the node is not valid.
The function returns the value (local variable) symbol of an identifier in the short-hand property assignment. This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
Gets the intrinsic undefined
type. There are multiple types that act as undefined
used internally in the compiler depending on compiler options, so the type returned by this function should not be used in equality checks to determine if another type is undefined
. Instead, use type.flags & TypeFlags.Undefined
.
Note that the resulting nodes cannot be checked.
True if this type is assignable to ReadonlyArray<any>
.
True if this type is the Array
or ReadonlyArray
type from lib.d.ts. This function will not return true if passed a type which extends Array
(for example, the TypeScript AST's NodeArray
type).
True if this type is a tuple type. This function will not return true if passed a type which extends from a tuple.
Returns true if the "source" type is assignable to the "target" type.
Depending on the operation performed, it may be appropriate to throw away the checker if the cancellation token is triggered. Typically, if it is used for error checking and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.
Note that the resulting nodes cannot be checked.