import { ComputedQuery, ComputedQueryFull, FiltersMap, KeyedItem } from '../model';
import { CollectionState } from './CollectionState';
import { Order, QueryResultSimulation } from './QueryResultSimulation';
import { TypedEmitter } from '../util';
import { CollectionOptimisticProcessorHelpers } from './CollectionOptimisticHelpers';
import { CollectionOptimisticActionsState } from './CollectionOptimisticActionsState';
import { QueryState } from './QueryState';
interface Optimistic<T, F extends FiltersMap> {
    _orderByMode: 'orders' | 'moves';
    readonly state: CollectionOptimisticActionsState<T>;
    readonly events: TypedEmitter<{
        reprocess: () => void;
        updated: () => void;
    }>;
    readonly query: QueryState<F>;
}
export interface CollectionOptimisticProcessorParams<T, F extends FiltersMap> extends Partial<QueryResultSimulation<T, F>> {
    readonly collection: CollectionState<T, F>;
    readonly optimistic: Optimistic<T, F>;
}
export declare class CollectionOptimisticProcessor<T, F extends FiltersMap> {
    readonly collection: CollectionState<T, F>;
    readonly processorHelpers: CollectionOptimisticProcessorHelpers<T, F>;
    readonly optimistic: Optimistic<T, F>;
    readonly resultSimulationDefault: QueryResultSimulation<T, F>;
    readonly predicate: (computedQuery: ComputedQuery<F>) => (item: T) => boolean;
    readonly orderBy: (computedQuery: ComputedQuery<F>) => Order<T>[];
    constructor(params: CollectionOptimisticProcessorParams<T, F>);
    _register(): void;
    reprocess(): void;
    removeSelectionIfExists(): void;
    beforeAddNewPages({ pages, currentItemsMap, originQuery, }: {
        pages: T[][];
        currentItemsMap: Map<string, KeyedItem<T>>;
        originQuery: ComputedQueryFull<F>;
    }): T[][];
    beforeSetTotal({ total, originQuery, }: {
        total: number;
        originQuery: ComputedQuery<F>;
    }): number;
}
export {};
//# sourceMappingURL=CollectionOptimisticProcessor.d.ts.map