import { FiltersMap } from './filter';
import { ComputedQuery } from './computedQuery';
import { ComputedResult } from './computedResult';
export type OnResultUpdated<F extends FiltersMap> = (params: {
    query: ComputedQuery<F>;
    result: ComputedResult;
}) => unknown;
type OnNewPageAdded<F extends FiltersMap> = (params: {
    totalNewItems: number;
    result: {
        total: number;
        available: number;
    };
    query: ComputedQuery<F>;
}) => unknown;
export interface CollectionEvents<F extends FiltersMap> {
    /** When the first page of items is ready */
    readonly onInitialPageFetched?: OnResultUpdated<F>;
    /** When fetching new items as a result new search */
    readonly onSearch?: (params: {
        query: ComputedQuery<F>;
    }) => unknown;
    /** When the result of a search is ready */
    readonly onSearchResults?: OnResultUpdated<F>;
    /** When starting to load the next page of items */
    readonly onNewPageStart?: (params: {
        query: ComputedQuery<F>;
    }) => void | undefined | null | OnNewPageAdded<F>;
    /** When the result of the next page is ready */
    readonly onNewPageAdded?: OnNewPageAdded<F>;
    /** When `fetchData` throws an error. Return `true` from this function if the error was reported and shouldn't be reported again internally. */
    readonly onError?: (params: {
        err: unknown;
        isOnline: boolean;
    }) => boolean | undefined | null | void;
}
export {};
//# sourceMappingURL=collectionEvents.d.ts.map