import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
import { type SearchOptions } from '../../api/search/search-api-client.js';
import type { InsightAPIClient, InsightAPIErrorStatusResponse } from '../../api/service/insight/insight-api-client.js';
import type { InsightQueryRequest } from '../../api/service/insight/query/query-request.js';
import type { ClientThunkExtraArguments } from '../../app/thunk-extra-arguments.js';
import type { ExecuteSearchThunkReturn } from '../search/search-actions.js';
import { type ErrorResponse, type MappedSearchRequest, type SuccessResponse } from '../search/search-mappings.js';
import type { StateNeededByExecuteSearch } from './insight-search-actions.js';
interface FetchedResponse {
    response: SuccessResponse | ErrorResponse;
    duration: number;
    queryExecuted: string;
    requestExecuted: InsightQueryRequest;
}
type ValidReturnTypeFromProcessingStep<RejectionType> = ExecuteSearchThunkReturn | RejectionType;
export interface AsyncThunkConfig {
    getState: () => StateNeededByExecuteSearch;
    dispatch: ThunkDispatch<StateNeededByExecuteSearch, ClientThunkExtraArguments<InsightAPIClient>, UnknownAction>;
    rejectWithValue: (err: InsightAPIErrorStatusResponse) => unknown;
    extra: ClientThunkExtraArguments<InsightAPIClient>;
}
type QueryCorrectionCallback = (modification: string) => void;
export declare class AsyncInsightSearchThunkProcessor<RejectionType> {
    private config;
    private onUpdateQueryForCorrection;
    constructor(config: AsyncThunkConfig, onUpdateQueryForCorrection?: QueryCorrectionCallback);
    fetchFromAPI({ request, mappings }: MappedSearchRequest<InsightQueryRequest>, options?: SearchOptions): Promise<{
        response: ErrorResponse | SuccessResponse;
        duration: number;
        queryExecuted: string;
        requestExecuted: InsightQueryRequest;
    }>;
    process(fetched: FetchedResponse): Promise<ValidReturnTypeFromProcessingStep<RejectionType>>;
    private processQueryErrorOrContinue;
    private processQueryCorrectionsOrContinue;
    private processLegacyDidYouMeanAutoCorrection;
    private processNextDidYouMeanAutoCorrection;
    private automaticallyRetryQueryWithCorrection;
    private processSuccessResponse;
    private getSuccessResponse;
    private get extra();
    private getState;
    private get dispatch();
    private get rejectWithValue();
    private getCurrentQuery;
}
export {};
