import type { UnknownAction } from '@reduxjs/toolkit';
import type { ThunkDispatch } from 'redux-thunk';
import { type CommerceAPIClient, type CommerceAPIResponse } from '../../../api/commerce/commerce-api-client.js';
import type { CommerceAPIErrorStatusResponse } from '../../../api/commerce/commerce-api-error-response.js';
import type { FilterableCommerceAPIRequest } from '../../../api/commerce/common/request.js';
import type { CommerceSearchRequest } from '../../../api/commerce/search/request.js';
import type { SearchCommerceSuccessResponse } from '../../../api/commerce/search/response.js';
import type { ClientThunkExtraArguments } from '../../../app/thunk-extra-arguments.js';
import type { CommerceDidYouMeanSection, CommerceQuerySection, CommerceSearchSection, TriggerSection } from '../../../state/state-sections.js';
import { type StateNeededForFilterableCommerceAPIRequest } from '../common/filterable-commerce-api-request-builder.js';
import type { QuerySearchCommerceAPIThunkReturn } from './search-actions.js';
interface FetchedResponse {
    response: CommerceAPIResponse<SearchCommerceSuccessResponse>;
    duration: number;
    queryExecuted: string;
    requestExecuted: FilterableCommerceAPIRequest;
}
export type StateNeededByExecuteSearch = StateNeededForFilterableCommerceAPIRequest & CommerceSearchSection & CommerceQuerySection & CommerceDidYouMeanSection & TriggerSection;
export interface AsyncThunkConfig {
    getState: () => StateNeededByExecuteSearch;
    dispatch: ThunkDispatch<StateNeededByExecuteSearch, ClientThunkExtraArguments<CommerceAPIClient> & {
        apiClient?: CommerceAPIClient | undefined;
    }, UnknownAction>;
    rejectWithValue: (err: CommerceAPIErrorStatusResponse) => unknown;
    extra: ClientThunkExtraArguments<CommerceAPIClient>;
}
type ValidReturnTypeFromProcessingStep<RejectionType> = QuerySearchCommerceAPIThunkReturn | RejectionType;
export declare class AsyncSearchThunkProcessor<RejectionType> {
    private config;
    constructor(config: AsyncThunkConfig);
    process(fetched: FetchedResponse): Promise<ValidReturnTypeFromProcessingStep<RejectionType>>;
    fetchFromAPI(request: FilterableCommerceAPIRequest | CommerceSearchRequest): Promise<{
        response: CommerceAPIResponse<SearchCommerceSuccessResponse>;
        duration: number;
        queryExecuted: string;
        requestExecuted: FilterableCommerceAPIRequest | CommerceSearchRequest;
    }>;
    private processSuccessResponse;
    private processQueryErrorOrContinue;
    private processQueryCorrectionsOrContinue;
    private processQueryTriggersOrContinue;
    private automaticallyRetryQueryWithTriggerModification;
    private get dispatch();
    private get rejectWithValue();
    private getState;
    private get navigatorContext();
    private getCurrentQuery;
    private getSuccessResponse;
    private get extra();
    private onUpdateQueryForCorrection;
}
export {};
