/** * Shared decoding for the out-of-process parsers (Go's `go/ast`, Python's * `ast`). * * Both emit `{"symbols": [...], "refs": [...]}` from a single run, so symbols * and cross-references cost one child process rather than two — the same * one-walk-yields-both shape the in-process TypeScript parser has. * * The older array-only payload (`[{name, kind, …}]`) is still accepted: parser * scripts are written to a temp file that can outlive the process that wrote * it, and a stale script must degrade to "symbols but no edges", never to a * hard parse failure that drops the file from the index entirely. */ import type { Symbol as IndexSymbol, Ref, SymbolLang } from './schema.js'; interface RawParsedSymbol { name: string; kind: string; line: number; col: number; signature: string; scope: string; /** First line of the declaration's doc comment / docstring. */ doc: string; } /** Map decoded parser symbols onto index rows for `file`. */ export declare function toIndexSymbols(raw: readonly RawParsedSymbol[], file: string, lang: SymbolLang): IndexSymbol[]; interface ParsedParserOutput { symbols: RawParsedSymbol[]; refs: Ref[]; } /** Decode a parser child process's stdout. Never throws. */ export declare function parseParserOutput(stdout: string, lang: SymbolLang): ParsedParserOutput; /** * Decode a BATCH parser child process's stdout (P3.8): one envelope with a * per-file results array. Per-file entries carry an optional `error` (the * file failed inside the batch; the caller falls back to the single-file * parser). Never throws — a malformed envelope yields []. */ interface BatchFileOutput { file: string; /** Set when this file failed inside the batch (e.g. syntax error). */ error?: string | undefined; symbols: RawParsedSymbol[]; refs: Ref[]; } export declare function parseParserBatchOutput(stdout: string, lang: SymbolLang): BatchFileOutput[]; export {}; //# sourceMappingURL=parser-output.d.ts.map