/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Lossless decomposition (#493) — the typed-`unknown`-span primitive. Every byte of the input belongs to * exactly one segment: a span some node covers, or an `unknown` run the model left all-O. Those all-O runs * are what `decodeAsJSON` silently drops (the JSON-hides-gaps trap) — surfacing them lets a consumer route * them to fallback logic, display them, or aggregate them as the self-reporting corpus-gap detector. * * This is the PURE primitive: it reads `tree.raw` + node `[start,end)` ranges and returns the complement. * It mutates nothing and changes no serializer — wiring `unknown` into the JSON/XML/tuple contracts + the * demo is the focused follow-up (#493). Byte-stable by construction, so it ships ahead of that work. */ import type { AddressTree } from "./types.ts"; export interface UnknownSpan { kind: "unknown"; value: string; /** * Inclusive start char offset into `tree.raw`. */ start: number; /** * Exclusive end char offset into `tree.raw`. */ end: number; } /** * One tile of the lossless decomposition: a run that some node covers, or an `unknown` gap. */ export interface LosslessSegment { kind: "covered" | "unknown"; value: string; start: number; end: number; } /** * Tile `tree.raw` into maximal covered/unknown runs, in source order. The concatenation of the segment values * reproduces `tree.raw` exactly — that is the #493 round-trip invariant ({@link isLossless}). */ export declare function losslessSegments(tree: AddressTree): LosslessSegment[]; /** * The all-O runs no node covers, as typed `unknown` spans, in source order. The complement of the node coverage over * `tree.raw`. */ export declare function unknownSpans(tree: AddressTree): UnknownSpan[]; /** * The #493 round-trip guarantee: concatenating the lossless segments (covered + unknown), in order, reproduces the * original input. Holds by construction unless a node span overshoots the input bounds. */ export declare function isLossless(tree: AddressTree): boolean; //# sourceMappingURL=unknown-spans.d.ts.map