import { type Reducer } from "@reduxjs/toolkit";
import { type Saga } from "redux-saga";
import { type IDashboardQuery } from "../../queries/base.js";
import { type IDashboardQueryService } from "./queryService.js";
/**
 * Query processing component has multiple pieces that need to be integrated into the redux store.
 */
export interface IQueryProcessingModule {
    /**
     * Query services may store the results in state for caching purposes. All services that use caching implement
     * the cache as a separate slice of the internal `_queryCache` part of the state. This reducer is a combined
     * reducer including all the appropriate slice reducers.
     */
    queryCacheReducer: Reducer<any>;
    /**
     * A single saga is in place to handle query processing requests. Query requests will be processed concurrently.
     */
    rootQueryProcessor: Saga;
}
/**
 * @internal
 */
export declare const QueryEnvelopeActionPrefix = "__Q";
type QueryEnvelopeEventHandlers<TQuery extends IDashboardQuery, TQueryResult> = {
    onStart: (query: TQuery) => void;
    onSuccess: (result: TQueryResult) => void;
    onError: (err: Error) => void;
};
type QueryEnvelope<TQuery extends IDashboardQuery, TQueryResult> = Readonly<QueryEnvelopeEventHandlers<TQuery, TQueryResult>> & {
    readonly type: string;
    readonly query: IDashboardQuery;
    readonly refresh?: boolean;
};
/**
 * @internal
 */
export declare function queryEnvelope<TQuery extends IDashboardQuery, TQueryResult>(query: TQuery, eventHandlers?: Partial<QueryEnvelopeEventHandlers<TQuery, TQueryResult>>, refresh?: boolean): QueryEnvelope<TQuery, TQueryResult>;
/**
 * @internal
 */
export declare function queryEnvelopeWithPromise<TQuery extends IDashboardQuery, TQueryResult>(query: TQuery, refresh?: boolean): {
    promise: Promise<TQueryResult>;
    envelope: QueryEnvelope<TQuery, TQueryResult>;
};
/**
 * Creates components that should be integrated into the dashboard store in order to facilitate query processing.
 *
 * @param queryServices - query services use to initialize the components
 */
export declare function createQueryProcessingModule(queryServices: IDashboardQueryService<any, any>[]): IQueryProcessingModule;
export {};
//# sourceMappingURL=queryProcessing.d.ts.map