import { IndexPath } from './indexPath.js'; import { BaseOptions, TraversalDirection } from './options.js'; export declare const SKIP = "skip"; export declare const STOP = "stop"; export type EnterReturnValue = void | 'skip' | 'stop'; export type LeaveReturnValue = void | 'stop'; export type VisitOptions = BaseOptions & { onEnter?(node: T, indexPath: IndexPath): EnterReturnValue; onLeave?(node: T, indexPath: IndexPath): LeaveReturnValue; direction?: TraversalDirection; }; /** * Visit each node in the tree, calling an optional `onEnter` and `onLeave` for each. * * From `onEnter`: * * - return nothing or `undefined` to continue * - return `"skip"` to skip the children of that node and the subsequent `onLeave` * - return `"stop"` to end traversal * * From `onLeave`: * * - return nothing or `undefined` to continue * - return `"stop"` to end traversal */ export declare function visit(node: T, options: VisitOptions): void;