tcmts.core.ts

Types

TypeChecker type
TypeScript 6's name for it

Server

compiler () => API<false>
The compiler process this process talks to, started on first use and kept for its life.
compilerBinary () => string | undefined
The compiler binary: TypeScript 7's own, or tsrs's (`TCM_TYPESCRIPT=tsrs`: the project's tsrs package, else one installed alongside tcm), or one named by path.
parse (fileName: string, text: string) => SourceFile
Parse some code on its own, outside any program (TypeScript 6's `createSourceFile`).
require Require

Shared

FUNCTION_LIKE Set<SyntaxKind>
api API<false> | undefined
canHaveModifiers (node: Node) => boolean
declarationOf (symbol: Symbol) => Node | undefined
A symbol's declaration, as a node (fetched from the compiler: its value declaration, else its first).
forEachChild <T>(node: Node, cbNode: (node: Node) => T, cbNodes?: ((nodes: NodeArray<Node>) => T) | undefined) =…
A node's children, as `ts.forEachChild` gave them.
getModifiers (node: Node) => readonly Modifier[] | undefined
A node's modifiers, decorators left out.
isClassLike (node: Node | undefined) => boolean
isFunctionLike (node: Node | undefined) => boolean
Functions, methods, accessors, constructors and their signatures (TypeScript 6's `isFunctionLike`).
isOmitted (node: Node) => boolean
A hole in an array pattern, `[, x]`: an omitted expression, or (as TypeScript 7 parses it) a binding element with no name.
isOptionalChain (node: Node) => boolean
`a?.b`, and the parts of the chain after it (`a?.b.c`).
isTypeOnlyImport (clause: { phaseModifier?: SyntaxKind | undefined; } | undefined) => boolean
`import type { … }`
keepByteOrderMarks (decoder: object) => void
TypeScript 7's API decodes each string it reads (a file's text, a literal's) with a TextDecoder that drops a leading byte order mark, so the literal "\uFEFFx" would read as "x". Put it back, in the decoder's class (the API and each program have one).
version string