import { Logger } from 'pino';
import { CommerceThunkExtraArguments } from '../../app/commerce-thunk-extra-arguments.js';
import { CommerceAppState } from '../../state/commerce-app-state.js';
import { PlatformEnvironment } from '../../utils/url-utils.js';
import { PreprocessRequest } from '../preprocess-request.js';
import { SpecificFacetSearchResponse } from '../search/facet-search/specific-facet-search/specific-facet-search-response.js';
import { CommerceAPIErrorResponse, CommerceAPIErrorStatusResponse } from './commerce-api-error-response.js';
import { FilterableCommerceAPIRequest } from './common/request.js';
import { CommerceSuccessResponse } from './common/response.js';
import { CommerceFacetSearchRequest, FacetSearchType } from './facet-search/facet-search-request.js';
import { CommerceRecommendationsRequest } from './recommendations/recommendations-request.js';
import { RecommendationsCommerceSuccessResponse } from './recommendations/recommendations-response.js';
import { QuerySuggestRequest } from './search/query-suggest/query-suggest-request.js';
import { QuerySuggestSuccessResponse } from './search/query-suggest/query-suggest-response.js';
import { CommerceSearchRequest } from './search/request.js';
import { SearchCommerceSuccessResponse } from './search/response.js';
export interface CommerceFacetSearchAPIClient {
    facetSearch(req: CommerceFacetSearchRequest, facetSearchOrigin: string): Promise<CommerceAPIResponse<SpecificFacetSearchResponse>>;
}
export interface AsyncThunkCommerceOptions<T extends Partial<CommerceAppState>> {
    state: T;
    rejectValue: CommerceAPIErrorStatusResponse;
    extra: CommerceThunkExtraArguments;
}
export interface CommerceAPIClientOptions {
    logger: Logger;
    preprocessRequest: PreprocessRequest;
}
export type CommerceAPIResponse<T> = CommerceAPISuccessResponse<T> | CommerceAPIErrorResponse;
export interface CommerceAPISuccessResponse<T> {
    success: T;
}
export declare const isErrorResponse: <T>(r: CommerceAPIResponse<T>) => r is CommerceAPIErrorResponse;
export declare class CommerceAPIClient implements CommerceFacetSearchAPIClient {
    private options;
    constructor(options: CommerceAPIClientOptions);
    getProductListing(req: FilterableCommerceAPIRequest): Promise<CommerceAPIResponse<CommerceSuccessResponse>>;
    search(req: CommerceSearchRequest): Promise<CommerceAPIResponse<SearchCommerceSuccessResponse>>;
    getRecommendations(req: CommerceRecommendationsRequest): Promise<CommerceAPIResponse<RecommendationsCommerceSuccessResponse>>;
    productSuggestions(req: CommerceSearchRequest): Promise<CommerceAPIResponse<SearchCommerceSuccessResponse>>;
    querySuggest(req: QuerySuggestRequest): Promise<CommerceAPIResponse<QuerySuggestSuccessResponse>>;
    facetSearch(req: CommerceFacetSearchRequest, type: FacetSearchType): Promise<CommerceAPIResponse<SpecificFacetSearchResponse>>;
    plan(req: CommerceSearchRequest): Promise<CommerceAPIResponse<CommerceSuccessResponse>>;
    private query;
}
export declare function getCommerceApiBaseUrl(organizationId: string, environment?: PlatformEnvironment): string;
