import { Id, Obj } from '../types'; import { NodeType, SortInfo } from '../components/tree'; /** * ------------------------------------------------------------------------ * 统一处理树形搜索 */ export type UseTreeSearchParams = { nodes?: N[]; primaryKey?: keyof N; labelKey?: keyof N; childrenKey?: keyof N; searchTokenKey?: keyof N; defaultExpanded?: V[]; expanded?: V[]; onExpandedChange?(expanded: V[], nodeValue: V, isExpand: boolean): void; defaultSearchValue?: string; searchValue?: string; onSearchChange?(searchValue: string): void; }; export declare function useTreeSearch({ nodes, primaryKey, labelKey, childrenKey, searchTokenKey, defaultExpanded, expanded, onExpandedChange, defaultSearchValue, searchValue, onSearchChange }: UseTreeSearchParams): { expandedSet: Set; setInnerExpanded: import("react").Dispatch>; toggleExpanded: (value: V) => void; innerSearchValue: import("react").RefObject; deferredSearchValue: string; setInnerSearchValue: import("react").Dispatch>; filteredTreeData: N[] | undefined; }; /** * 得到排序后的树结构 */ export declare function sortTreeNodes, V extends Id = Id>(props: { nodes: N[]; primaryKey?: keyof N; childrenKey?: keyof N; }, sortInfo: SortInfo): N[];