//#region src/examples.d.ts /** * `@glissade/scene/examples` — the runnable example corpus (§0.24 onboarding, * card `8jQ9rNqStGDL`). The single highest agent-onboarding cost is STALE * examples: prose that drifts from the runtime, which a cold agent can't * glance-test. The fix is to make canonical examples EXECUTABLE and surfaced from * the same place the doctest harness runs them, so they can't go stale. * * Each {@link ApiExample} carries a copy-pasteable `code` string (what * `describe({ examples: true })` surfaces) AND an executable `run` thunk against * the REAL API (what `examples.test.ts` asserts never throws). The two sit * adjacent and are kept in lockstep; the `run` guard is what fails CI the moment * an example's API drifts (a renamed export, a changed shape). * * Tree-shaking: this module is OFF the base scene index (its own subpath entry), * so a scene that never imports it pays zero bytes. Importing it REGISTERS the * corpus with `describe()` via {@link registerExamples} (the value-type-registry * pattern) — describe never imports examples, so the base embed + IIFE stay lean. */ /** One runnable example, attached to its describe-key (node type / builder method * / helper name). `code` is surfaced; `run` is the executed drift guard. */ interface ApiExample { /** The describe-key this attaches to: a node type ('Rect'), builder method * ('to'), or helper name ('splitText'). */ key: string; /** The copy-pasteable snippet `describe({ examples: true })` surfaces. */ code: string; /** Executes the SAME call against the real API — the doctest harness asserts it * never throws, so the surfaced `code` can't reference a drifted API. */ run: () => void; } declare const EXAMPLES: readonly ApiExample[]; /** * Rewrite an npm `import`-form snippet to the no-build IIFE form: every export is * `window.glissade.`, so `import { Rect, timeline } from '@glissade/scene'` * becomes `const { Rect, timeline } = window.glissade`. The body is unchanged, so * the snippet runs verbatim in a no-build `