import { AsyncThunkOptions } from '../../app/async-thunk-options.js';
import { ClientThunkExtraArguments } from '../../app/thunk-extra-arguments.js';
import { SearchAppState } from '../../state/search-app-state.js';
import { BaseParam } from '../platform-service-params.js';
import { FacetSearchRequest } from './facet-search/facet-search-request.js';
import { FacetSearchResponse } from './facet-search/facet-search-response.js';
import { FieldDescription, FieldDescriptionsResponseSuccess } from './fields/fields-response.js';
import { HtmlAPIClientOptions } from './html/html-api-client.js';
import { HtmlRequest } from './html/html-request.js';
import { PlanRequest } from './plan/plan-request.js';
import { PlanResponseSuccess, Plan } from './plan/plan-response.js';
import { QuerySuggestRequest } from './query-suggest/query-suggest-request.js';
import { QuerySuggestSuccessResponse, QuerySuggest } from './query-suggest/query-suggest-response.js';
import { RecommendationRequest } from './recommendation/recommendation-request.js';
import { PostprocessFacetSearchResponseMiddleware, PostprocessQuerySuggestResponseMiddleware, PostprocessSearchResponseMiddleware } from './search-api-client-middleware.js';
import { SearchAPIErrorWithStatusCode } from './search-api-error-response.js';
import { SearchOrigin } from './search-metadata.js';
import { SearchRequest } from './search/search-request.js';
import { Search, SearchResponseSuccess } from './search/search-response.js';
export interface FacetSearchAPIClient {
    facetSearch(req: FacetSearchRequest): Promise<FacetSearchResponse>;
}
export interface SearchOptions {
    disableAbortWarning?: boolean;
    origin: SearchOrigin;
}
export type AllSearchAPIResponse = Plan | Search | QuerySuggest | FieldDescription;
export interface AsyncThunkSearchOptions<T extends Partial<SearchAppState>> extends AsyncThunkOptions<T, ClientThunkExtraArguments<SearchAPIClient>> {
    rejectValue: SearchAPIErrorWithStatusCode;
}
export interface SearchAPIClientOptions extends HtmlAPIClientOptions {
    postprocessSearchResponseMiddleware: PostprocessSearchResponseMiddleware;
    postprocessQuerySuggestResponseMiddleware: PostprocessQuerySuggestResponseMiddleware;
    postprocessFacetSearchResponseMiddleware: PostprocessFacetSearchResponseMiddleware;
}
export type SearchAPIClientResponse<T> = {
    success: T;
} | {
    error: SearchAPIErrorWithStatusCode;
};
export declare class SearchAPIClient implements FacetSearchAPIClient {
    private options;
    constructor(options: SearchAPIClientOptions);
    plan(req: PlanRequest): Promise<SearchAPIClientResponse<PlanResponseSuccess>>;
    querySuggest(req: QuerySuggestRequest): Promise<SearchAPIClientResponse<QuerySuggestSuccessResponse>>;
    private apiCallsQueues;
    search(req: SearchRequest, options?: SearchOptions): Promise<SearchAPIClientResponse<SearchResponseSuccess>>;
    facetSearch(req: FacetSearchRequest): Promise<FacetSearchResponse>;
    recommendations(req: RecommendationRequest): Promise<{
        success: SearchResponseSuccess;
        error?: undefined;
    } | {
        error: SearchAPIErrorWithStatusCode;
        success?: undefined;
    }>;
    html(req: HtmlRequest): Promise<{
        success: string;
        error?: undefined;
    } | {
        error: SearchAPIErrorWithStatusCode;
        success?: undefined;
    }>;
    fieldDescriptions(req: BaseParam): Promise<{
        success: FieldDescriptionsResponseSuccess;
        error?: undefined;
    } | {
        error: SearchAPIErrorWithStatusCode;
        success?: undefined;
    }>;
}
export declare const isSuccessResponse: <T>(r: SearchAPIClientResponse<T>) => r is {
    success: T;
};
export declare const isErrorResponse: <T>(r: SearchAPIClientResponse<T>) => r is {
    error: SearchAPIErrorWithStatusCode;
};
export declare function isSuccessSearchResponse(body: unknown): body is SearchResponseSuccess;
export declare function shimResponse(response: SearchResponseSuccess): SearchResponseSuccess;
