import type { CoreEngine } from '../../../app/engine.js';
import { type SortCriterion } from '../../../features/sort-criteria/criteria.js';
import { type Controller } from '../../controller/headless-controller.js';
export interface SortProps {
    /**
     * The initial state that should be applied to this `Sort` controller.
     */
    initialState?: SortInitialState;
}
export interface SortInitialState {
    /**
     * The initial sort criterion to register in state.
     */
    criterion?: SortCriterion | SortCriterion[];
}
/**
 * The `Sort` controller manages how the results are sorted.
 *
 * Example: [sort.fn.tsx](https://github.com/coveo/ui-kit/blob/main/packages/samples/headless-react/src/components/sort/sort.fn.tsx)
 *
 * @group Controllers
 * @category Sort
 */
export interface Sort extends Controller {
    /**
     * Updates the sort criterion and executes a new search.
     *
     * @param criterion - The new sort criterion.
     */
    sortBy(criterion: SortCriterion | SortCriterion[]): void;
    /**
     * Verifies whether the specified sort criterion is the currently active one.
     *
     * @param criterion - The sort criterion to evaluate.
     * Can be a single criterion or an array of criteria.
     * The criteria in an array will be applied sequentially. For example, if there's a tie on the 1st criterion, the API uses the 2nd criterion to break the tie. However, this only works when combining:
     * `SortByRelevancy` followed by one or more `SortByField` or `SortByDate` criteria.
     * `SortByQRE` followed by one or more `SortByField` or `SortByDate` criteria.
     * Two or more `SortByField` criteria.
     * A single `SortByDate` criterion and one or more `SortByField` criteria in any order.
     *
     * Examples:
     * * `SortByRelevancy`, `SortByField`
     * * `SortByQRE`, `SortByField`
     * * `SortByDate`, `SortByField`, `SortByField`
     *
     * @returns `true` if the specified sort criterion is the currently active one; `false` otherwise.
     */
    isSortedBy(criterion: SortCriterion | SortCriterion[]): boolean;
    /**
     * A scoped and simplified part of the headless state that is relevant to the `Sort` controller.
     */
    state: SortState;
}
/**
 * A scoped and simplified part of the headless state that is relevant to the `Sort` controller.
 *
 * @group Controllers
 * @category Sort
 */
export interface SortState {
    /**
     * The current sort criteria.
     */
    sortCriteria: string;
}
/**
 * Creates a `Sort` controller instance.
 *
 * @param engine - The headless engine.
 * @param props - The configurable `Sort` controller properties.
 * @returns A `Sort` controller instance.
 */
export declare function buildCoreSort(engine: CoreEngine, props: SortProps): Sort;
