import { type GoodDataSdkError } from "@gooddata/sdk-ui";
import { type IDashboardQueryFailed, type IDashboardQueryRejected } from "../events/general.js";
import { type DashboardQueries } from "../queries/index.js";
/**
 * @public
 */
export type QueryProcessingPendingState = {
    status: "pending";
    error: undefined;
    result: undefined;
};
/**
 * @public
 */
export type QueryProcessingRunningState = {
    status: "running";
    error: undefined;
    result: undefined;
};
/**
 * @public
 */
export type QueryProcessingErrorState = {
    status: "error";
    error: GoodDataSdkError;
    result: undefined;
};
/**
 * @public
 */
export type QueryProcessingRejectedState = {
    status: "rejected";
    error: undefined;
    result: undefined;
};
/**
 * @public
 */
export type QueryProcessingSuccessState<TResult> = {
    status: "success";
    error: undefined;
    result: TResult;
};
/**
 * @public
 */
export type QueryProcessingState<TResult> = QueryProcessingPendingState | QueryProcessingRunningState | QueryProcessingErrorState | QueryProcessingRejectedState | QueryProcessingSuccessState<TResult>;
/**
 * @internal
 */
export type UseDashboardQueryProcessingResult<TQueryCreatorArgs extends any[], TQueryResult> = QueryProcessingState<TQueryResult> & {
    run: (...args: TQueryCreatorArgs) => void;
};
/**
 * @internal
 */
export type QueryProcessingStatus = QueryProcessingState<any>["status"];
/**
 * @internal
 */
export declare const useDashboardQueryProcessing: <TQuery extends DashboardQueries, TQueryResult, TQueryCreatorArgs extends any[]>({ queryCreator, onSuccess, onError, onRejected, onBeforeRun, }: {
    queryCreator: (...args: TQueryCreatorArgs) => TQuery;
    onSuccess?: ((result: TQueryResult) => void) | undefined;
    onError?: ((event: IDashboardQueryFailed) => void) | undefined;
    onRejected?: ((event: IDashboardQueryRejected) => void) | undefined;
    onBeforeRun?: ((query: TQuery) => void) | undefined;
}) => UseDashboardQueryProcessingResult<TQueryCreatorArgs, TQueryResult>;
//# sourceMappingURL=useDashboardQueryProcessing.d.ts.map