/** * * `capText` is the only absolute guarantee in the snapshot pipeline: the * pruner (`snapshot-pruner.ts`) bounds node count and depth, but only a byte * ceiling bounds the rendered string. These are module constants, not options * (tech-doc ยง12). */ /** Hard ceiling for page text returned by `peaks web text`. */ export declare const MAX_TEXT_BYTES = 8192; /** Hard ceiling for the rendered snapshot returned by `peaks web snap`. */ export declare const MAX_SNAP_BYTES = 4096; /** Maximum number of real (non-marker) nodes emitted by the pruner. */ export declare const MAX_SNAP_NODES = 120; /** Maximum tree depth emitted by the pruner. */ export declare const MAX_SNAP_DEPTH = 6; export interface CappedText { readonly text: string; readonly truncated: boolean; /** UTF-8 bytes removed from the input. `0` when nothing was truncated. */ readonly droppedBytes: number; } /** * Cut `text` down to at most `capBytes` UTF-8 bytes. * * Three properties the AC2 tests pin: * - the returned string's byte length is **never** greater than `capBytes` * (the truncation marker is reserved out of the budget, not added on top); * - a multi-byte codepoint is never split (the cut backs off the UTF-8 * continuation bytes), so the result is always valid UTF-8; * - the cut lands on a line boundary when one exists, so the caller never * gets a half-line. */ export declare function capText(text: string, capBytes: number): CappedText;