import { ComputedQueryFull, DataResultKeyed, FiltersMap, KeyedItem, QueryResult, QueryResultStatus } from '../model';
import { FetchTotalState } from './FetchTotalState';
interface ProcessedResult<T> {
    processed: T;
    unprocessed: T;
}
type Pages<T> = ProcessedResult<T[][]>;
type Totals = ProcessedResult<number>;
export interface QueryResultStateParams<T, F extends FiltersMap> {
    itemKey: (item: T) => string;
    originQuery: ComputedQueryFull<F>;
    fetchTotal?: FetchTotalState<T, F>;
}
export declare class QueryResultState<T, F extends FiltersMap> implements QueryResult<T> {
    readonly itemKey: (item: T) => string;
    readonly _pagesAtom: import("mobx").IAtom;
    _pages: Pages<T>;
    _totals: Totals;
    _supportTotal: boolean;
    _hasNext?: boolean | null;
    readonly fetchTotal?: FetchTotalState<T, F>;
    get pages(): T[][];
    get _keyedItemsMap(): Map<string, KeyedItem<T>>;
    available: number | null;
    status: QueryResultStatus<DataResultKeyed<T>, unknown>;
    originQuery: ComputedQueryFull<F>;
    constructor(params: QueryResultStateParams<T, F>);
    init(): () => void;
    get errorStatus(): import("../model").QueryResultStatusError<DataResultKeyed<T>, unknown> | null;
    private setNewPages;
    get keyedItems(): KeyedItem<T>[];
    get itemsKeys(): string[];
    get isEmptyAndNotFetching(): boolean;
    get isEmpty(): boolean;
    get items(): T[];
    get total(): number;
    get totalStatus(): import("../model").QueryStatusValue;
    get supportTotal(): boolean;
    get hasNext(): boolean | null | undefined;
    get fetchedAll(): boolean;
    get isFetching(): boolean | undefined;
    get(key: string): KeyedItem<T> | undefined;
    has(key: string): boolean;
    private createRollbackFn;
    changeItems(newItems: T[]): {
        rollback: () => boolean;
    } | undefined;
    addItems(newItems: T[]): {
        rollback: () => void;
    };
    clear(): void;
    addPages(morePages: Pages<T>): void;
    setTotals(totals: Totals): void;
    setSupportTotal(supportTotal: boolean): void;
    setHasNext(hasNext?: boolean | null): void;
    setPages(pages: Pages<T>): void;
    slice(start?: number, end?: number): void;
    get hasAvailableItems(): boolean;
    get asComputed(): {
        total: number;
        available: number;
    };
    get size(): number;
}
export {};
//# sourceMappingURL=QueryResultState.d.ts.map