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.
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.
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.
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).
Returns true if the "source" type is assignable to the "target" type.
declareconstabcLiteral: ts.Type; // Type of "abc" declareconststringType: ts.Type; // Type of string
isTypeAssignableTo(abcLiteral, abcLiteral); // true; "abc" is assignable to "abc" isTypeAssignableTo(abcLiteral, stringType); // true; "abc" is assignable to string isTypeAssignableTo(stringType, abcLiteral); // false; string is not assignable to "abc" isTypeAssignableTo(stringType, stringType); // true; string is assignable to string
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.
Follow all aliases to get the original symbol.