/** * Fenced-code tracker — THE definition of "am I inside a code fence". * Server-safe: no React, no DOM. * * Lives in its own module because it is a GENERAL CommonMark fence machine * with two unrelated consumers: the heading scanner * (`utils/markdown-heading-id`) and the streaming block splitter * (`components/ui/markdown/streaming`). It used to live inside * `markdown-heading-id`, which meant a streaming renderer imported its fence * state machine from a module named after heading slugs. `markdown-heading-id` * re-exports these names so the public `utils` surface is unchanged. */ /** True when `line` is a CommonMark blank line (spaces/tabs only, `\r`-tolerant). */ export declare function isBlankLine(line: string): boolean; /** * What one source line is, relative to fenced code: * - `open` — this line opened a fence * - `close` — this line closed the open fence * - `inside`— this line is fence content (including a would-be delimiter that * does NOT close the open fence: wrong marker char, too short, or * carrying an info string) * - `text` — this line is ordinary markdown outside any fence * * NOTE: no consumer discriminates the three non-`text` roles today — both the * heading scanner and the streaming splitter only test `!== 'text'`, and the * closer-haystack mask below only tests `=== 'open'` / `=== 'close'`. The * four-value union is kept because the state machine already computes the * distinction for free and a future consumer (e.g. fence-aware syntax * post-processing) would otherwise have to re-derive it. */ export type FenceLineRole = 'open' | 'close' | 'inside' | 'text'; export interface FenceTracker { /** Advance across one raw source line (mutates) and classify it. */ push(line: string): FenceLineRole; /** Marker CHARACTER of the currently open fence (`` ` `` / `~`), or null. */ openChar(): string | null; /** Run length of the currently open fence (a closer must be ≥ this). */ openLength(): number; } /** A fresh fenced-code state machine. Server-safe: no React, no DOM. */ export declare function createFenceTracker(): FenceTracker; //# sourceMappingURL=markdown-fences.d.ts.map