import { MatchSorterOptions } from 'match-sorter';
import { TreeSelectFieldNode } from '../types';
/**
 * Filter function for narrowing tree options against a search value.
 * Receives the full options tree and returns the (possibly pruned) tree to display.
 */
export type TreeSyncFilterFn = (options: TreeSelectFieldNode[], searchValue: string) => TreeSelectFieldNode[];
/**
 * Recursively populates `childCount` (number of immediate children) on every
 * loaded branch that doesn't already declare one, returning a new tree.
 *
 * This is computed from the full static `options` *before* any search filter
 * runs, so the count reflects the real child set rather than the filtered
 * subset. `computeCheckStates` relies on `childCount` to detect that a branch
 * is only partially represented (e.g. during search) and avoid showing a
 * partially-selected branch as fully checked.
 *
 * @param nodes - The tree nodes to process.
 * @returns A new array of nodes with childCount set on branch nodes.
 */
export declare function applyChildCounts(nodes: TreeSelectFieldNode[]): TreeSelectFieldNode[];
/**
 * Default tree-aware filter. Matches on label and searchText, preserving
 * ancestors of matched nodes.
 */
export declare function defaultTreeSyncFilter(nodes: TreeSelectFieldNode[], searchValue: string): TreeSelectFieldNode[];
/**
 * Coerces a `TreeSyncFilterFn` or `MatchSorterOptions` into a
 * `TreeSyncFilterFn`. When given options, the resulting filter flattens the
 * tree, runs match-sorter, and prunes the original tree to keep ancestors of
 * matched nodes.
 */
export declare function toTreeSyncFilterFn(filter: TreeSyncFilterFn | MatchSorterOptions<TreeSelectFieldNode>): TreeSyncFilterFn;
