import { IndexPath } from './indexPath.js'; import { BaseOptions, TraversalDirection } from './options.js'; export type FindOptions = BaseOptions & { /** * Return `true` to include this node in the results. */ predicate: (node: T, indexPath: IndexPath) => boolean; direction?: TraversalDirection; }; export type FindOptionsTyped = BaseOptions & { /** * Return `true` to include this node in the results. */ predicate: (node: T, indexPath: IndexPath) => node is S; direction?: TraversalDirection; }; /** * Find a node matching a predicate function. */ export declare function find(node: T, options: FindOptions): T | undefined; export declare function find(node: T, options: FindOptionsTyped): S | undefined; /** * Find all nodes matching a predicate function. */ export declare function findAll(node: T, options: FindOptions): T[]; export declare function findAll(node: T, options: FindOptionsTyped): S[]; /** * Find the `IndexPath` of a node matching a predicate function. */ export declare function findPath(node: T, options: FindOptions): IndexPath | undefined; /** * Find the `IndexPath` of all nodes matching a predicate function. */ export declare function findAllPaths(node: T, options: FindOptions): IndexPath[];