import { type ReactNode } from "react"; import type { TraceSpan } from "../../../lib/trace/types.js"; /** Shared render context threaded to every row (kills per-node prop duplication). */ export interface SpanTreeRenderCtx { selectedId: string | null; collapsed: Set; showMetrics?: boolean; bounds?: { startNs: bigint; endNs: bigint; }; onSelect: (id: string) => void; onToggle: (id: string) => void; renderBadge?: (span: TraceSpan) => ReactNode; } export interface SpanTreeProps extends Omit { /** Root span of the trace. */ root: TraceSpan; /** Collapse toggle (controlled). */ onToggleCollapse: (id: string) => void; /** Visible-row count at/above which the virtualized path engages. Default 200. */ virtualizeThreshold?: number; className?: string; "aria-label"?: string; } /** * SpanTree — an accessible, controllable tree of trace spans with full * WAI-ARIA APG TreeView semantics (treeitem / level / posinset / setsize / * selected / expanded / group). Renders recursively for small traces and * switches to a virtualized flat-list at/above `virtualizeThreshold`. The * container is keyboard-navigable (↑/↓ move, Home/End jump, Enter/Space * select). Fully controlled: selection + collapse live in the consumer. */ export declare function SpanTree({ root, selectedId, onSelect, collapsed, onToggleCollapse, showMetrics, bounds, virtualizeThreshold, renderBadge, className, "aria-label": ariaLabel, }: SpanTreeProps): import("react").JSX.Element;