/** * Compile every documentation stage the way the dev server does. * * `parseSdoc` validates the sdoc grammar; it can't see a Svelte syntax error * inside an example, an import that points nowhere, or a stage that throws at * compile time — those surface only when the route is opened. This runs the * real generators (`generateIframeComponent` / `generatePageComponent`) over * every preview, example, page, and layout body and compiles the result with * the Svelte compiler, so a broken stage is caught before anyone opens it. * * What it does NOT catch: type errors (the compiler doesn't type-check) and * anything that only fails at runtime. */ export interface CheckProblem { /** Project-relative .sdoc path */ file: string; /** Entity title the stage belongs to */ entity?: string; /** Which stage: a preview label, an example title, or the body */ stage?: string; /** 'grammar' (parser), 'compile' (Svelte), 'import' (unresolved path), or * 'component' (a `component={…}` that traces to no component file) */ kind: 'grammar' | 'compile' | 'import' | 'component'; severity: 'error' | 'warning'; message: string; /** 1-based line in the .sdoc file, when it maps back confidently */ line?: number; /** Diagnostic code, when the source provides one */ code?: string; } export interface CheckResult { ok: boolean; checked: { files: number; stages: number; }; problems: CheckProblem[]; } /** Check one `.sdoc` file: grammar, imports, and every stage's compilation. */ export declare function checkDocFile(filePath: string, cwd: string): Promise; /** Check many `.sdoc` files, merging the results. */ export declare function checkDocFiles(files: string[], cwd: string): Promise; /** * One problem, the way `sdocs check` prints it: where it is, then the message * indented under it — compile messages are often several lines, because they * carry the compiler's own frame. */ export declare function formatProblem(p: CheckProblem): string;