import { AthenaTableOrder } from '../../../../athena/table-query-executor.js'; export type AthenaTableSortDirection = "asc" | "desc"; export interface AthenaTableSortDescriptor { columnId: string; direction: AthenaTableSortDirection; } /** * Sorting state: a single descriptor, a multi-column list, or null (unsorted). * Prefer arrays for multi-column; single objects remain supported for back-compat. */ export type AthenaTableSortingState = AthenaTableSortDescriptor | AthenaTableSortDescriptor[] | null; export declare function normalizeSortingState(sorting: AthenaTableSortingState | undefined): AthenaTableSortDescriptor[]; /** * Denormalize to a stable wire format: null, single object (len 1), or array (len > 1). * Keeps back-compat for consumers/stores that only expect one column. */ export declare function denormalizeSortingState(descriptors: readonly AthenaTableSortDescriptor[]): AthenaTableSortingState; export declare function getColumnSortDirection(sorting: AthenaTableSortingState | undefined, columnId: string): AthenaTableSortDirection | null; export declare function getColumnSortPriority(sorting: AthenaTableSortingState | undefined, columnId: string): number | null; /** * Toggle sort for a column. * - Without multi: replaces the sort list with this column (asc → desc → clear). * - With multi (shift/alt): adds/updates/removes that column while keeping others. */ export declare function toggleColumnSortingState(current: AthenaTableSortingState | undefined, columnId: string, options?: { multi?: boolean; }): AthenaTableSortingState; export interface SortingColumnOrderMapEntry { /** Physical DB / gateway column name used in orderBy */ column: string; /** Optional table column id used in UI sorting state */ columnId?: string; } /** * Map UI sorting state to gateway `orderBy` entries. * `columnMap` keys are UI column ids → physical column names. */ export declare function sortingStateToOrderBy(sorting: AthenaTableSortingState | undefined, columnMap?: ReadonlyMap | Record): AthenaTableOrder[]; export declare function orderByToSortingState(orderBy: AthenaTableOrder | readonly AthenaTableOrder[] | undefined, reverseColumnMap?: ReadonlyMap | Record): AthenaTableSortingState; export declare function isSortingStateEqual(left: AthenaTableSortingState | undefined, right: AthenaTableSortingState | undefined): boolean;