import { type IdModel, QueryWrapper, type TreeModelApi } from '@oinone/kunlun-engine';
import { type Converter, type OioTreeNode, type ReturnPromise } from '@oinone/kunlun-shared';
import { SelectMode } from '@oinone/kunlun-vue-ui-common';
export interface TreeInitContext<T = unknown> {
    storage: Record<string, OioTreeNode<T>>;
    count: number;
    checkedKeys: string[];
    checkedNodes: OioTreeNode[];
    expandedKeys: string[];
    expandedAll: boolean;
}
export interface TreeInitOptions {
    model: string;
    rsql: string;
    checkedKeys: string[];
}
export interface TreeState<T = unknown> {
    mode: SelectMode;
    storage: Record<string, OioTreeNode<T>>;
    data: OioTreeNode<T>[];
    count: number;
    loading: boolean;
    checkedKeys: string[];
    checkedNodes: OioTreeNode<T>[];
    expandedKeys: string[];
    lastCheckedKeys: string[];
}
export interface TreeStateProps {
    mode?: SelectMode | keyof typeof SelectMode;
    getCheckedKeys?: () => string[] | undefined;
    getSearchValue?: () => string | null | undefined;
}
export type TreeStateLoadFunction<T extends IdModel> = (state: TreeState<T>, service: TreeModelApi<T>, queryWrapper: QueryWrapper) => ReturnPromise<T[]>;
export declare function useTreeState<T extends IdModel>(initOptions: {
    service: TreeModelApi<T>;
    props?: TreeStateProps;
    initState?: Converter<TreeState<T>, TreeState<T>>;
    load?: TreeStateLoadFunction<T>;
    convertTreeData?: (list: T[]) => OioTreeNode<T>[];
    initTreeState?: (state: TreeState<T>, options: TreeInitOptions) => void;
    searchTreeState?: (state: TreeState<T>, options: TreeInitOptions) => void;
}): {
    state: TreeState<T>;
    filterData: import("vue").ComputedRef<OioTreeNode<T>[]>;
    checkedAll: import("vue").ComputedRef<boolean>;
    halfCheckedAll: import("vue").ComputedRef<boolean>;
    init: (options?: Partial<TreeInitOptions>) => Promise<TreeState<T>>;
    search: (options?: Partial<TreeInitOptions>) => Promise<TreeState<T>>;
    onUpdateExpandedKeys: (keys: string[]) => void;
    onChecked: (node: OioTreeNode, checked: boolean) => void;
    onCheckedStrictly: (node: OioTreeNode, checked: boolean) => void;
    onCheckedAll: (nodes: OioTreeNode[], checked: boolean) => void;
};
