//#region src/convert/boundSpec.d.ts /** The maximum traversal depth, counted in visited values, not tree levels. */ export declare const MAX_TRAVERSAL_DEPTH = 64; /** * The element-nesting ceiling a caller observes. `boundNode` visits an element * and its `children` array separately, so one level of nesting spends two of * {@link MAX_TRAVERSAL_DEPTH}; it runs before the conversion walk and is never * the looser of the two. A root array costs one more level than a root object. */ export declare const MAX_ELEMENT_DEPTH: number; /** * The maximum number of entries kept at any single level (root, or a * `children` array at any depth) of the raw spec, before it ever reaches * `normalizeSpec`. Bounds a hostile array's reported `length` so the pre-pass * can never be made to walk further than this regardless of what the array * claims about itself. */ export declare const CHILDREN_CAP = 200; /** * The total number of nodes {@link boundSpec} will visit across one walk, * regardless of how many times a shared reference recurs. Bounds the * combinatorial work a DAG of shared or self-referential nodes would * otherwise force even though each individual array stays within * {@link CHILDREN_CAP}. */ export declare const NODE_BUDGET = 5000; export type ClampReason = "children" | "budget" | "cycle" | "depth"; /** Renders the warning detail a protocol reports for one {@link ClampReason}. */ export declare function clampReasonDetail(reason: ClampReason): string; /** * Produces a bounded plain copy of a raw generative-ui spec before it * reaches `normalizeSpec`, whose own traversal of the root array or any * `children` array walks the full reported length of a hostile proxied * array before any per-field cap downstream ever applies. Every array * (root, or `children` at any depth) is capped to {@link CHILDREN_CAP} * entries by index, which bounds a proxy however it fabricates `length` or * replaces its array methods; recursion itself is capped at * {@link MAX_TRAVERSAL_DEPTH}. Every object is returned as a plain copy whose * `children` came from a single read, because a record that answers * `[[HasProperty]]` and `[[Get]]`, or two `[[Get]]`s, differently would * otherwise hand the bound one value and `normalizeSpec` another, skipping * every bound here for that subtree. `onClamp` fires once per level that was * truncated, receiving the reason for that truncation: `"children"`, * `"depth"`, `"budget"`, or `"cycle"`. The walk also spends a total budget of * {@link NODE_BUDGET} nodes, so shared references cannot multiply work * exponentially, and a node that is its own ancestor is cut to `null`. */ export declare function boundSpec(spec: unknown, onClamp: (reason: ClampReason) => void): unknown; //#endregion //# sourceMappingURL=boundSpec.d.ts.map