import { TableColumn, TableRow, TableSortDirection, TableWidgetData } from './types'; /** * Compares two values with a consistent ordering across primitive types. * Strings use locale comparison; numbers subtract; booleans rank false < true; * objects/arrays compare by JSON serialization. Null/undefined sort to the end * regardless of direction. */ export declare function compareValues(a: unknown, b: unknown, direction: TableSortDirection): number; /** Returns a new array sorted by the named column. Does not mutate the input. */ export declare function sortRows(rows: readonly T[], columnId: string, direction: TableSortDirection): T[]; /** Returns the slice for the requested page. Out-of-range pages return []. */ export declare function paginateRows(rows: readonly T[], page: number, pageSize: number): T[]; /** * Resolves the effective column list. When the widget store has a * `columnOrder` set (e.g. ChangeColumn was used), the column array is * reordered to match. Unknown ids in the order are skipped; columns not * present in the order keep their original relative position at the end. */ export declare function resolveColumns(columns: readonly TableColumn[], columnOrder: readonly string[] | undefined): readonly TableColumn[]; /** Applies sort and pagination to the input data. Pure. */ export declare function deriveVisibleRows(rows: readonly T[], options: { sort?: { columnId: string | null; direction: TableSortDirection; }; page: number; pageSize: number; }): { sorted: readonly T[]; visible: T[]; }; export declare function tableDataToCsv(data: TableWidgetData, columns: readonly TableColumn[]): string;