import { BasePlugin } from '../base.plugin';
import type { ColumnRegular, DimensionRows, PluginProviders } from "../../types/index";
import type { SortingColumnMap, SortingColumnOrder, SortingConfig, SortingOrder, SortingOrderFunction } from './sorting.types';
export * from './sorting.types';
export * from './sorting.func';
export * from './sorting.sign';
/**
 * Lifecycle
 * 1. @event `beforesorting` - Triggered when sorting just starts. Nothing has happened yet. This can be triggered from a column or from the source. If the type is from rows, the column will be undefined.
 * 2. @event `beforesourcesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted.
 * 3. @event `beforesortingapply` - Triggered before the sorting data is applied to the data source. You can prevent this event, and the data will not be sorted. This event is only called from a column sorting click.
 * 4. @event `aftersortingapply` - Triggered after sorting has been applied and completed. This event occurs for both row and column sorting.
 *
 * Note: If you prevent an event, it will not proceed to the subsequent steps.
 */
export declare class SortingPlugin extends BasePlugin {
    revogrid: HTMLRevoGridElement;
    /**
     * Current sorting order per column property.
     */
    sorting?: SortingOrder;
    /**
     * Comparator functions indexed by column property.
     *
     * Multiple columns can be sorted at the same time.
     */
    sortingFunc?: SortingOrderFunction;
    /**
     * Column metadata for the current sorting state.
     *
     * Used internally to optimize default sorting without changing comparator
     * functions or their public API contract.
     */
    private sortingColumns?;
    /**
     * Active sorting priority in click/config insertion order.
     *
     * Required for numeric column props because object key iteration does not
     * preserve insertion order for integer-like keys.
     */
    private sortingOrder?;
    /**
     * Delayed sorting promise registered in the grid render job queue.
     */
    sortingPromise: (() => void) | null;
    /**
     * Debounced sorting entry point.
     *
     * Sorting can be requested by column changes, source changes, and header
     * clicks in quick succession, so the actual sort is delayed and coalesced.
     */
    postponeSort: import("lodash").DebouncedFunc<(order?: SortingOrder, comparison?: SortingOrderFunction, sortingColumns?: SortingColumnMap, sortingOrder?: SortingColumnOrder, ignoreViewportUpdate?: boolean) => void>;
    constructor(revogrid: HTMLRevoGridElement, providers: PluginProviders, config?: SortingConfig);
    /**
     * Creates mutable sorting maps from current state when additive sorting is requested.
     */
    private createSortingState;
    /**
     * Stores normalized sorting state, clearing inactive empty maps.
     */
    private setSortingState;
    /**
     * Adds or replaces a column in a sorting state.
     */
    private setColumnSorting;
    /**
     * Removes a column from a sorting state.
     */
    private clearColumnSorting;
    /**
     * Normalizes external sorting configuration into internal order,
     * comparator, and column metadata maps.
     */
    private applySortingConfig;
    /**
     * Schedules sorting before the next render.
     *
     * @param order - Active sorting order by column property.
     * @param sortingFunc - Comparator functions by column property.
     * @param sortingColumns - Column metadata by property.
     * @param sortingOrder - Active sorting priority in click/config insertion order.
     * @param ignoreViewportUpdate - Skips dimension position recalculation when true.
     */
    startSorting(order?: SortingOrder, sortingFunc?: SortingOrderFunction, ignoreViewportUpdate?: boolean): void;
    startSorting(order?: SortingOrder, sortingFunc?: SortingOrderFunction, sortingColumns?: SortingColumnMap, sortingOrder?: SortingColumnOrder, ignoreViewportUpdate?: boolean): void;
    /**
     * Applies sorting requested by a sortable header click.
     *
     * @param column - Column that initiated sorting.
     * @param additive - If true, add/remove this column from the current multi-sort state.
     */
    headerclick(column: ColumnRegular, additive: boolean): void;
    /**
     * Applies sorting state produced by a header click.
     */
    private applyHeaderSorting;
    /**
     * Runs a scheduled sort and resolves the render-blocking sorting promise.
     *
     * @param order - Active sorting order by column property.
     * @param comparison - Comparator functions by column property.
     * @param sortingColumns - Column metadata by property.
     * @param sortingOrder - Active sorting priority in click/config insertion order.
     * @param ignoreViewportUpdate - Skips dimension position recalculation when true.
     */
    runSorting(order?: SortingOrder, comparison?: SortingOrderFunction, ignoreViewportUpdate?: boolean): void;
    runSorting(order?: SortingOrder, comparison?: SortingOrderFunction, sortingColumns?: SortingColumnMap, sortingOrder?: SortingColumnOrder, ignoreViewportUpdate?: boolean): void;
    /**
     * Sorts row proxy indexes by sorting functions.
     *
     * @requires proxyItems applied to row store
     * @requires source applied to row store
     *
     * @param sorting - per column sorting
     * @param sortingFunc - Comparator functions by column property.
     * @param sortingColumns - Column metadata by property.
     * @param sortingOrder - Active sorting priority in click/config insertion order.
     * @param types - Row stores to sort.
     * @param ignoreViewportUpdate - Skips dimension position recalculation when true.
     */
    sort(sorting?: SortingOrder, sortingFunc?: SortingOrderFunction, types?: DimensionRows[], ignoreViewportUpdate?: boolean): void;
    sort(sorting?: SortingOrder, sortingFunc?: SortingOrderFunction, sortingColumns?: SortingColumnMap, sortingOrder?: SortingColumnOrder, types?: DimensionRows[], ignoreViewportUpdate?: boolean): void;
}
