import { IndexPath } from './indexPath.js'; import { BaseOptions } from './options.js'; export type MapOptions = BaseOptions & { /** * Transform the node into a different value. */ transform: (node: T, transformedChildren: U[], indexPath: IndexPath) => U; }; /** * Map each node into a new node. * * The shape of the tree remains the same. You can omit nodes from the tree by * filtering them out of the `transformedChildren` argument. The root can't be omitted. */ export declare function map(node: T, options: MapOptions): U; export type FlatMapOptions = BaseOptions & { /** * Transform the node into an array of new nodes. */ transform: (node: T, transformedChildren: U[], indexPath: IndexPath) => U[]; }; /** * Map each node into an array of new nodes. * * You can omit nodes from the tree by returning an empty array from the `transform` function. * The first element of the returned top-level array will be the new root. */ export declare function flatMap(node: T, options: FlatMapOptions): U;