import type { UnknownAction } from '@reduxjs/toolkit';
import type { ThunkDispatch } from 'redux-thunk';
import type { SearchRequest } from '../../../api/search/search/search-request.js';
import { type SearchAPIClient } from '../../../api/search/search-api-client.js';
import type { SearchAPIErrorWithStatusCode } from '../../../api/search/search-api-error-response.js';
import type { SearchOrigin } from '../../../api/search/search-metadata.js';
import type { ClientThunkExtraArguments } from '../../../app/thunk-extra-arguments.js';
import type { AdvancedSearchQueriesSection, CategoryFacetSection, ConfigurationSection, ContextSection, DateFacetSection, DebugSection, DidYouMeanSection, FacetOptionsSection, FacetOrderSection, FacetSection, FieldsSection, FoldingSection, NumericFacetSection, PaginationSection, PipelineSection, QuerySection, QuerySetSection, SearchHubSection, SearchSection, SortSection, TriggerSection } from '../../../state/state-sections.js';
import type { AnalyticsAsyncThunk } from '../../analytics/analytics-utils.js';
import { type ErrorResponse, type MappedSearchRequest, type SuccessResponse } from '../search-mappings.js';
import type { ExecuteSearchThunkReturn } from './search-actions.js';
export type StateNeededByExecuteSearch = ConfigurationSection & Partial<QuerySection & AdvancedSearchQueriesSection & PaginationSection & SortSection & FacetSection & NumericFacetSection & CategoryFacetSection & DateFacetSection & ContextSection & DidYouMeanSection & FieldsSection & PipelineSection & SearchHubSection & QuerySetSection & FacetOptionsSection & FacetOrderSection & DebugSection & SearchSection & FoldingSection & TriggerSection>;
interface FetchedResponse {
    response: SuccessResponse | ErrorResponse;
    duration: number;
    queryExecuted: string;
    requestExecuted: SearchRequest;
}
type ValidReturnTypeFromProcessingStep<RejectionType> = ExecuteSearchThunkReturn | RejectionType;
export interface AsyncThunkConfig {
    getState: () => StateNeededByExecuteSearch;
    dispatch: ThunkDispatch<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient> & {
        searchAPIClient?: SearchAPIClient | undefined;
    }, UnknownAction>;
    rejectWithValue: (err: SearchAPIErrorWithStatusCode) => unknown;
    analyticsAction: AnalyticsAsyncThunk | null;
    extra: ClientThunkExtraArguments<SearchAPIClient>;
}
type QueryCorrectionCallback = (modification: string) => void;
interface FetchFromAPIOptions {
    origin: SearchOrigin;
    disableAbortWarning?: boolean;
}
export declare class AsyncSearchThunkProcessor<RejectionType> {
    private config;
    private onUpdateQueryForCorrection;
    constructor(config: AsyncThunkConfig, onUpdateQueryForCorrection?: QueryCorrectionCallback);
    fetchFromAPI({ mappings, request }: MappedSearchRequest, options: FetchFromAPIOptions): Promise<{
        response: ErrorResponse | SuccessResponse;
        duration: number;
        queryExecuted: string;
        requestExecuted: SearchRequest;
    }>;
    process(fetched: FetchedResponse): Promise<ValidReturnTypeFromProcessingStep<RejectionType>>;
    private processQueryErrorOrContinue;
    private processQueryCorrectionsOrContinue;
    private processLegacyDidYouMeanAutoCorrection;
    private processModernDidYouMeanAutoCorrection;
    private logOriginalAnalyticsQueryBeforeAutoCorrection;
    private processQueryTriggersOrContinue;
    private getStateAfterResponse;
    private processSuccessResponse;
    private getSuccessResponse;
    private automaticallyRetryQueryWithCorrection;
    private automaticallyRetryQueryWithTriggerModification;
    private getCurrentQuery;
    private get extra();
    private getState;
    private get dispatch();
    private get analyticsAction();
    private get rejectWithValue();
}
export {};
