import { BaseFacetSearchResult } from '../../../../../api/search/facet-search/base/base-facet-search-response.js';
import { CategoryFacetSearchResult } from '../../../../../api/search/facet-search/category-facet-search/category-facet-search-response.js';
import { CommerceEngine } from '../../../../../app/commerce-engine/commerce-engine.js';
import { ControllerDefinitionOption, SolutionType, SubControllerDefinitionWithoutProps } from '../../../../../app/commerce-ssr-engine/types/common.js';
import { LocationFacetValue, RegularFacetValue } from '../../../../../features/commerce/facets/facet-set/interfaces/response.js';
import { CategoryFacet, CategoryFacetState } from '../category/headless-commerce-category-facet.js';
import { DateFacet, DateFacetState, DateFacetValue } from '../date/headless-commerce-date-facet.js';
import { CategoryFacetValue, FacetType, CoreCommerceFacet } from '../headless-core-commerce-facet.js';
import { LocationFacet, LocationFacetState } from '../location/headless-commerce-location-facet.js';
import { NumericFacet, NumericFacetValue, NumericFacetState } from '../numeric/headless-commerce-numeric-facet.js';
import { RegularFacet, RegularFacetState } from '../regular/headless-commerce-regular-facet.js';
import { FacetGenerator as CSRFacetGenerator, MappedGeneratedFacetController } from './headless-commerce-facet-generator.js';
export type { BaseFacetSearchResult, CategoryFacet, CategoryFacetState, CategoryFacetValue, CategoryFacetSearchResult, CoreCommerceFacet, DateFacet, DateFacetValue, DateFacetState, NumericFacet, NumericFacetValue, NumericFacetState, RegularFacet, RegularFacetState, RegularFacetValue, LocationFacet, LocationFacetState, LocationFacetValue, MappedGeneratedFacetController, };
export type FacetGeneratorState = MappedFacetStates;
export type MappedFacetStates = Array<MappedFacetState[FacetType]>;
export type { FacetType };
export type MappedFacetState = {
    [T in FacetType]: T extends 'numericalRange' ? NumericFacetState : T extends 'regular' ? RegularFacetState : T extends 'dateRange' ? DateFacetState : T extends 'hierarchical' ? CategoryFacetState : T extends 'location' ? LocationFacetState : never;
};
/**
 * @group Definers
 */
export declare function defineFacetGenerator<TOptions extends ControllerDefinitionOption | undefined>(options?: TOptions): SubControllerDefinitionWithoutProps<FacetGenerator, TOptions>;
/**
 * The `FacetGenerator` headless sub-controller creates commerce facet sub-controllers from the Commerce API search or
 * product listing response.
 *
 * Commerce facets are not requested by the implementer, but rather pre-configured through the Coveo Merchandising Hub
 * (CMH). The implementer is only responsible for leveraging the facet controllers created by this sub-controller to
 * properly render facets in their application.
 */
export interface FacetGenerator extends Omit<CSRFacetGenerator, 'state' | 'facets'> {
    /**
     * The state of each every facet returned by the Commerce API.
     *
     * In a server-side rendering (SSR) scenario, you must use this state to render the facet UI components before the
     * facet controller is hydrated on the client side.
     *
     * Once the facet generator controller has been hydrated, you must use the `getFacetController` method to retrieve
     * the individual facet controllers and subscribe to their respective states.
     */
    state: FacetGeneratorState;
    /**
     * Builds a facet controller for the specified facet ID.
     *
     * @param facetId The unique identifier of the facet.
     * @param facetType The type of facet to build.
     * @returns A facet controller of the specified type, or `undefined` if the facet does not exist in the state.
     */
    getFacetController: <T extends FacetType>(facetId: string, facetType: T) => MappedGeneratedFacetController[T] | undefined;
}
export interface FacetGeneratorOptions {
    props: FacetGeneratorProps;
}
export interface FacetGeneratorProps {
    solutionType: SolutionType;
}
/**
 * Creates a `FacetGenerator` sub-controller for server-side rendering purposes (SSR).
 *
 * @param engine - The SSR commerce engine.
 * @param options - The facet generator options used internally.
 * @returns A `FacetGenerator` sub-controller.
 */
export declare function buildFacetGenerator(engine: CommerceEngine, options: FacetGeneratorOptions): FacetGenerator;
