/** * TypeScript fast (checker-free) parse implementation. * * The exact parse (`parse.ts`) calls `ts.createProgram` and forces * `program.getTypeChecker()` — the single most expensive operation in a cold * graph build (it binds every file: parent pointers for the walk + symbol * tables for the resolver). Fast mode avoids both the Program and the checker. * * Fast mode needs the parent pointers but NOT the symbol table: it * resolves edges syntactically (name + import graph) and never calls the * checker. So this path skips `createProgram`/`getTypeChecker` entirely * and parses each file standalone via * `ts.createSourceFile(..., setParentNodes: true)` — `setParentNodes` * populates parent pointers without binding or a checker, the cheap * substitute for the forced `getTypeChecker()`. * * Per contract invariant I-7 (parseProject is total over `files`): every * file either parses into the map or surfaces a structured ParseError. * Standalone `createSourceFile` always returns a (possibly partial) * tree; syntactic problems surface via the node's internal * `parseDiagnostics`, which we read per file. */ import ts from 'typescript'; import type { ParseInput, ParseOutput } from '@opensip-cli/graph'; /** * Fast-flavored parsed project: a per-file map of standalone * `ts.SourceFile`s (abs path → SF), with no `ts.Program` and no type * checker. The `kind: 'fast'` discriminant lets the walk and resolve * stages branch against {@link import('./parse.js').TsParsed}. */ export interface TypescriptFastParsedProject { readonly kind: 'fast'; /** Absolute file path → standalone source file (parent pointers set). */ readonly sourceFiles: ReadonlyMap; } /** * Parse each input file into a standalone `ts.SourceFile` with parent * pointers, building no Program and constructing no type checker. */ export declare function parseProjectFast(input: ParseInput): ParseOutput; //# sourceMappingURL=parse-fast.d.ts.map