/** * TypeScript parseProject implementation. * * Lifts `ts.createProgram` + the eager `getTypeChecker()` call out of * the orchestrator (where they used to live in cli/orchestrate.ts: * buildAndResolveCatalog) into the adapter, so the orchestrator no * longer imports `'typescript'` after PR 3 of plan * local planning notes * * Per contract invariant I-7 (parseProject is total over `files`): * every file in `input.files` either parses successfully or surfaces * in `parseErrors`. The TypeScript compiler reports parse problems * via diagnostic streams rather than throwing; we surface those that * the program emits at the file level into a structured ParseError * list. */ import ts from 'typescript'; import { type TypescriptFastParsedProject } from './parse-fast.js'; import type { ParseInput, ParseOutput } from '@opensip-cli/graph'; /** Parsed TS project (exact tier): the live tsc {@link ts.Program} instance. */ export interface TypescriptParsedProject { readonly program: ts.Program; } /** * The adapter-internal parsed-project shape, discriminated by tier so the * walk and resolve stages can branch: * - exact: `{ kind: 'exact', program }` — the live `ts.Program`; the checker * is constructed lazily by the resolve stage. * - fast: `{ kind: 'fast', sourceFiles }` — standalone source files, no checker. * The engine treats this as opaque `unknown`; only the TS adapter introspects it. */ export type TsParsed = ({ readonly kind: 'exact'; } & TypescriptParsedProject) | TypescriptFastParsedProject; /** * Parse the project for the requested resolution tier. `fast` skips the * Program + checker entirely (see {@link parseProjectFast}); `exact` * builds the Program and lets the resolve stage construct the checker only * when semantic edge resolution actually needs it. */ export declare function parseProject(input: ParseInput): ParseOutput; //# sourceMappingURL=parse.d.ts.map