import { ThunkDispatch, AnyAction } from '@reduxjs/toolkit';
import { SearchOptions } from '../../../api/search/search-api-client.js';
import { InsightAPIClient, InsightAPIErrorStatusResponse } from '../../../api/service/insight/insight-api-client.js';
import { InsightQueryRequest } from '../../../api/service/insight/query/query-request.js';
import { ClientThunkExtraArguments } from '../../../app/thunk-extra-arguments.js';
import { AnalyticsAsyncThunk } from '../../analytics/analytics-utils.js';
import { ExecuteSearchThunkReturn } from '../../search/legacy/search-actions.js';
import { ErrorResponse, MappedSearchRequest, SuccessResponse } from '../../search/search-mappings.js';
import { 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>, AnyAction>;
    rejectWithValue: (err: InsightAPIErrorStatusResponse) => unknown;
    extra: ClientThunkExtraArguments<InsightAPIClient>;
    analyticsAction: AnalyticsAsyncThunk | null;
}
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: SuccessResponse | ErrorResponse;
        duration: number;
        queryExecuted: string;
        requestExecuted: InsightQueryRequest;
    }>;
    process(fetched: FetchedResponse, mappedRequest: MappedSearchRequest<InsightQueryRequest>): Promise<ValidReturnTypeFromProcessingStep<RejectionType>>;
    private processQueryErrorOrContinue;
    private processQueryCorrectionsOrContinue;
    private processLegacyDidYouMeanAutoCorrection;
    private processNextDidYouMeanAutoCorrection;
    private automaticallyRetryQueryWithCorrection;
    private processSuccessResponse;
    private getSuccessResponse;
    private getStateAfterResponse;
    private logOriginalAnalyticsQueryBeforeAutoCorrection;
    private get extra();
    private getState;
    private get dispatch();
    private get rejectWithValue();
    private getCurrentQuery;
    private get analyticsAction();
}
export {};
