import { Dispatch, SetStateAction } from 'react';
import { ForestChangeItem, ForestItem, ForestParams } from '@/lib/types/item-forest';
import { ObjectId } from '@/lib/types/models';
import { Item } from '@/lib/models';
declare type Item = ForestItem;
export interface CustomArray<T> extends Array<T> {
    __hash?: any;
}
declare type UseItemReturn = {
    offset: number;
    setOffset: Dispatch<SetStateAction<number>>;
    limit: number;
    data: CustomArray<any>;
    list: CustomArray<any>;
    setLimit: Dispatch<SetStateAction<number>>;
    total: number;
    isValidating: boolean;
    handleForestChange: (itemId: ObjectId, original: ForestChangeItem, target: ForestChangeItem) => void;
    mutate: any;
    itemsMutate: any;
    hitIds?: ObjectId[];
    rows?: ObjectId[];
    loadingEnd: boolean;
};
declare type UseItem = (params: ForestParams) => UseItemReturn;
declare class ItemCache {
    private __array;
    private __total;
    private __useCache;
    private __mapIndex;
    private __mapIds;
    constructor();
    getAncestorsByDepths(depths: number[], cacheIndex: number): string[];
    getHash(): any;
    setNewHash(): void;
    set(cursor: number, data: any[]): void;
    setItems(data: Item[], depths: number[]): void;
    setTotal(total: number): void;
    filterNeedLoadItems(keys: string[]): string[];
    setKeys(keys: string[]): void;
    useCache(enable: any): void;
    resetIndexRefMap(): void;
    sort(currentIndex: any, nextIndex: any, moveLength: any): void;
    data(): CustomArray<any>;
}
export declare const cache: ItemCache;
declare const useItems: UseItem;
export default useItems;
