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