/** * Tree flattening + the reader-mode transcript row model. Pure and total. * `flattenVisible` order is the contract every renderer (tree, waterfall, * transcript) shares, so selection/keyboard indices agree across views. */ import type { FlatSpan, TraceSpan, TranscriptRow } from "./types.js"; /** * Above this many visible rows, renderers switch from the recursive path to * the react-virtual flat-list (blueprint Corner 2 Q9; langfuse uses 350, the * lens origin uses 200 — virtualization only when it earns its complexity). */ export declare const VIRTUALIZE_THRESHOLD = 200; /** * Depth-first flatten of ALL spans (ignores collapse) — resolve-by-id / envelope input. Cycle-safe: * a self-referential or repeated child is visited at most once (a malformed trace cannot stack-overflow). */ export declare function flattenAll(root: TraceSpan): TraceSpan[]; /** * Depth-first flatten of VISIBLE spans (a node in `collapsed` contributes no descendants). Cycle-safe: * each span id is emitted at most once. */ export declare function flattenVisible(root: TraceSpan, collapsed: Set): FlatSpan[]; /** * Flatten a span tree into the ordered reader-mode transcript feed. Pre-order * walk so `span`-row order matches `flattenVisible`. A fan-out node emits a * `group-header` row BEFORE its child rows so the view can collapse the group. */ export declare function toTranscriptRows(root: TraceSpan): TranscriptRow[];