import { TypeChecker } from "https://dotland.deno.dev/x/ts_morph@18.0.0/mod.ts";
Wrapper around the TypeChecker.
Methods
Gets the ambient module symbols (ex. modules in the @types folder or node_modules).
Gets the base type of a literal type.
For example, for a number literal type it will return the number type.
Gets the constant value of a declaration.
Gets the contextual type of an expression.
Gets the local target symbol of the provided export specifier.
Gets the export symbol of a local symbol with a corresponding export symbol. Otherwise returns the input symbol.
The following is from the compiler API documentation:
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 resolved signature from a node or returns undefined if the signature can't be resolved.
Gets the resolved signature from a node or throws if the signature cannot be resolved.
Gets a signature from a node.
Gets the symbol at the specified location or undefined if none exists.
Gets the symbols in the scope of the provided node.
Note: This will always return the local symbols. If you want the export symbol from a local symbol, then
use the #getExportSymbolOfSymbol(symbol)
method.
Gets the type arguments from a type reference.
Gets the type of a symbol at the specified location.