/** * Block-level parser: source → `BlockNode[]`. * * Line-oriented with a small open-container model. The key streaming-safety * rule lives here: a blank line only separates blocks at the top level and * *outside* an open fenced code block — a blank line inside ``` does not close * it. An unterminated fence parses as a `codeBlock` with `closed: false` and is * still rendered, so streaming code dumps don't flicker when the closing fence * finally arrives. * * Keys are assigned by the caller through a `KeyGen` so nested blocks (list * items, blockquote contents) get stable, unique keys for reconciliation. */ import type { BlockNode } from '../ast.js'; import type { ParserInlineExtension } from './extensions.js'; /** Monotonic key generator so every block (incl. nested) gets a unique key. */ export interface KeyGen { next(): string; } export declare function makeKeyGen(prefix: string): KeyGen; /** Parse a complete (or partial) source string into block nodes. */ export declare function parseBlocks(src: string, keys?: KeyGen, extensions?: readonly ParserInlineExtension[]): BlockNode[];