import type { Doc } from './docs'; import type { ExampleBakes } from '../render'; export interface ExampleProblem { filename: string; title: string; lang: string; error: string; snippet: string; } export interface ExampleCheck { /** * Blocks that failed to build for a real reason (a tjs/TS syntax error, a * transpile failure). These FAIL the build — broken code shouldn't ship. */ problems: ExampleProblem[]; /** * Blocks that reference a package the environment can't provide (a non-context * import, no import-resolver). The code isn't broken, it just can't run here — * almost always illustrative code that should be tagged `typescript` (display- * only) rather than `ts`. These WARN and are treated as display-only; they do * NOT fail the build. (Enable `importResolver`, or tag the block display-only, * to silence the warning.) */ warnings: ExampleProblem[]; /** * Build-time transpiled JS for `tjs` blocks, grouped by doc filename, each keyed * by exact source text. The renderer embeds a doc's bakes as hidden scripts (so * the pre-rendered page RUNS without the tjs transpiler), and they're attached to * each Doc in docs.json so client-side SPA navigation gets them too. Only `tjs` is * baked: its build transform is identical to the runtime one, so the bytes match. * See self-contained-examples-plan.md. */ bakes: Map; } /** * Transpile-check every executable block in the corpus. Returns the problems and * the `tjs` bakes (which it computes anyway while checking — no double transpile). */ export declare function checkExamples(docs: Doc[], opts?: { contextKeys?: string[]; importPrefix?: string; }): Promise; /** Format problems for a build log. */ export declare function formatExampleProblems(problems: ExampleProblem[]): string;