/** Depth limits for untrusted trees: a request page, a template tree, a proposal payload and their props. */ /** Deepest node tree, through `children`, that a request page, a template tree or a proposal payload may have; the top node is level 1. */ export declare const MAX_TREE_DEPTH = 200; /** Deepest nesting of objects and arrays in one node's props (or an update's `set`); the props object is level 1. */ export declare const MAX_PROPS_DEPTH = 32; export type DepthIssue = { path: (string | number)[]; message: string; }; /** * Nesting depth of objects and arrays in `value`: a scalar is 0, `{}` and `[]` are 1. It is walked with an explicit * stack, so a hostile input can't overflow the call stack, and it stops at the first branch deeper than `limit` * (returning that depth), so a cycle ends the walk too. Only the values `into` accepts are entered. */ export declare function nestingDepth(value: unknown, limit: number, into?: (value: unknown) => boolean): number; /** * The first place a compact tree is too deep, walked without recursion: `children` deeper than `MAX_TREE_DEPTH` * (reported at the top node) or a node's `props` deeper than `MAX_PROPS_DEPTH` (reported at those props). The path is * relative to `root`, e.g. `['children', 0, 'props']`. Only the props values `into` accepts are entered. */ export declare function findDepthIssue(root: unknown, into?: (value: unknown) => boolean): DepthIssue | undefined;