import { type IdModel, type ListModelApi, QueryWrapper } from '@oinone/kunlun-engine';
import { type Converter, type OioListItem, type ReturnPromise } from '@oinone/kunlun-shared';
import { SelectMode } from '@oinone/kunlun-vue-ui-common';
export interface ListInitOptions {
    model: string;
    rsql: string;
    checkedKeys: string[];
}
export interface ListState<T> {
    mode: SelectMode;
    storage: Record<string, OioListItem<T>>;
    data: OioListItem<T>[];
    count: number;
    loading: boolean;
    checkedKeys: string[];
    checkedItems: OioListItem<T>[];
    lastCheckedKeys?: string[];
    lastCheckedItems?: OioListItem<T>[];
    submitCheckedKeys?: string[];
    submitCheckedItems?: OioListItem<T>[];
}
export interface ListStateProps {
    mode?: SelectMode | keyof typeof SelectMode;
    getCheckedKeys?: () => string[] | undefined;
    getSearchValue?: () => string | null | undefined;
}
export type ListStateLoadFunction<T extends IdModel> = (state: ListState<T>, service: ListModelApi<T>, queryWrapper: QueryWrapper) => ReturnPromise<T[]>;
export declare function useListState<T extends IdModel>(initOptions: {
    service: ListModelApi<T>;
    props?: ListStateProps;
    initState?: Converter<ListState<T>, ListState<T>>;
    load?: ListStateLoadFunction<T>;
    convertListData?: (list: T[]) => OioListItem<T>[];
    initListState?: (state: ListState<T>, options?: ListInitOptions) => void;
    searchListState?: (state: ListState<T>, options?: ListInitOptions) => void;
}): {
    state: ListState<T>;
    filterData: import("vue").ComputedRef<OioListItem<T>[]>;
    checkedAll: import("vue").ComputedRef<boolean>;
    halfCheckedAll: import("vue").ComputedRef<boolean>;
    init: (options?: Partial<ListInitOptions>) => Promise<ListState<T>>;
    search: (options?: Partial<ListInitOptions>) => Promise<ListState<T>>;
    onChecked: (item: OioListItem, checked: boolean) => void;
    onCheckedAll: (items: OioListItem[], checked: boolean) => void;
};
