/** * Search node matching the predicate on the current depth prior to moving to the next depth level * * @param root Tree root * @param predicate Search condition for the target tree node * @returns Matching node and a tree depth where this node was found */ export declare function breadthFirstSearch(root: T, predicate: (current: TreeNode | any) => boolean, depth?: number): BreadthFirstResult; /** * Breadth-first tree node */ export declare type TreeNode = { child?: TreeNode[]; } & Record; /** * Bredth-first search result */ export interface BreadthFirstResult { /** * Matching node */ node: T; /** * Tree depth where this node was found */ depth: number; }