import type { CommerceEngine } from '../../../../app/commerce-engine/commerce-engine.js';
import { buildFieldsSortCriterion, buildRelevanceSortCriterion, SortBy, type SortByFields, type SortByFieldsFields, type SortByRelevance, type SortCriterion, SortDirection } from '../../../../features/commerce/sort/sort.js';
import { type Controller } from '../../../controller/headless-controller.js';
import type { FetchProductsActionCreator } from '../common.js';
export type { SortByFields, SortByFieldsFields, SortByRelevance, SortCriterion };
export { buildFieldsSortCriterion, buildRelevanceSortCriterion, SortBy, SortDirection, };
export interface SortProps {
    /**
     * The initial state that should be applied to this `Sort` sub-controller.
     */
    initialState?: SortInitialState;
}
export interface CoreSortProps extends SortProps {
    fetchProductsActionCreator: FetchProductsActionCreator;
}
export interface SortInitialState {
    /**
     * The initial sort criterion to register in state.
     */
    criterion?: SortCriterion;
}
/**
 * The `Sort` sub-controller lets you sort the products in a commerce interface.
 *
 * @group Sub-controllers
 * @category Sort
 */
export interface Sort extends Controller {
    /**
     * Updates the sort criterion and executes a new query.
     *
     * @param criterion - The new sort criterion.
     */
    sortBy(criterion: SortCriterion): void;
    /**
     * Verifies whether the specified sort criterion is the currently active one.
     *
     * @param criterion - The sort criterion to evaluate.
     * @returns `true` if the specified sort criterion is the currently active one; `false` otherwise.
     */
    isSortedBy(criterion: SortCriterion): boolean;
    /**
     * Verifies whether the specified sort criterion is available.
     *
     * @param criterion - The sort criterion to look for.
     * @returns `true` if the specified sort criterion is available; `false` otherwise.
     */
    isAvailable(criterion: SortCriterion): boolean;
    /**
     * A scoped and simplified part of the headless state that is relevant to the `Sort` sub-controller.
     */
    state: SortState;
}
/**
 * The state of the `Sort` sub-controller.
 *
 * @group Sub-controllers
 * @category Sort
 */
export interface SortState {
    /**
     * The current sort criterion.
     */
    appliedSort: SortCriterion;
    /**
     * The available sort criteria.
     */
    availableSorts: SortCriterion[];
}
/**
 * @internal
 * Creates a core `Sort` sub-controller instance for commerce solution types.
 *
 * @param engine - The headless commerce engine.
 * @param props - The configurable `Sort` sub-controller properties.
 * @returns A `Sort` sub-controller instance.
 */
export declare function buildCoreSort(engine: CommerceEngine, props: CoreSortProps): Sort;
