import type { PropType, Ref } from 'vue'; import type { DataTableCompareFunction, InternalDataTableHeader } from '../types.js'; import type { InternalItem } from '../../../composables/filter.js'; export declare const makeDataTableSortProps: (defaults?: Defaults | undefined) => { initialSortOrder: unknown extends Defaults["initialSortOrder"] ? { type: PropType<'asc' | 'desc'>; default: string; validator: (v: any) => boolean; } : Omit<{ type: PropType<'asc' | 'desc'>; default: string; validator: (v: any) => boolean; }, "default" | "type"> & { type: PropType; default: unknown extends Defaults["initialSortOrder"] ? "asc" | "desc" : Defaults["initialSortOrder"] | NonNullable<"asc" | "desc">; }; sortBy: unknown extends Defaults["sortBy"] ? { type: PropType; default: () => never[]; } : Omit<{ type: PropType; default: () => never[]; }, "default" | "type"> & { type: PropType; default: unknown extends Defaults["sortBy"] ? readonly SortItem[] : readonly SortItem[] | Defaults["sortBy"]; }; customKeySort: unknown extends Defaults["customKeySort"] ? PropType> : { type: PropType : Record | Defaults["customKeySort"]>; default: unknown extends Defaults["customKeySort"] ? Record : Record | Defaults["customKeySort"]; }; multiSort: unknown extends Defaults["multiSort"] ? { type: PropType; default: boolean; } : Omit<{ type: PropType; default: boolean; }, "default" | "type"> & { type: PropType; default: unknown extends Defaults["multiSort"] ? boolean | MultiSortProps : Defaults["multiSort"] | NonNullable; }; mustSort: unknown extends Defaults["mustSort"] ? BooleanConstructor : { type: PropType; default: unknown extends Defaults["mustSort"] ? boolean : boolean | Defaults["mustSort"]; }; }; export type SortItem = { key: string; order?: boolean | 'asc' | 'desc'; }; export type MultiSortProps = { key?: 'ctrl'; mode?: MultiSortMode; modifier?: 'alt' | 'shift'; }; export type MultiSortMode = 'append' | 'prepend'; type SortProps = { initialSortOrder: 'asc' | 'desc'; sortBy: readonly SortItem[]; 'onUpdate:sortBy': ((value: any) => void) | undefined; multiSort: boolean | MultiSortProps; mustSort: boolean; }; export declare function createSort(props: SortProps): { initialSortOrder: Readonly>; sortBy: Ref & { readonly externalValue: readonly SortItem[]; }; multiSort: Readonly>; mustSort: Readonly>; }; export declare function provideSort(options: { initialSortOrder: Ref<'asc' | 'desc'>; sortBy: Ref; multiSort: Ref; mustSort: Ref; page?: Ref; }): { sortBy: Ref; toggleSort: (column: InternalDataTableHeader, event?: KeyboardEvent | PointerEvent, mandatory?: boolean) => void; isSorted: (column: InternalDataTableHeader) => boolean; }; export declare function useSort(): { sortBy: Ref; toggleSort: (column: InternalDataTableHeader, event?: KeyboardEvent | PointerEvent, mandatory?: boolean) => void; isSorted: (column: InternalDataTableHeader) => boolean; }; export declare function useSortedItems(props: { customKeySort: Record | undefined; }, items: Ref, sortBy: Ref, options?: { transform?: (item: T) => {}; sortFunctions?: Ref | undefined>; sortRawFunctions?: Ref | undefined>; }): { sortedItems: import("vue").ComputedRef; }; export declare function sortItems(items: T[], sortByItems: readonly SortItem[], locale: string, options?: { transform?: (item: T) => Record; sortFunctions?: Record; sortRawFunctions?: Record; }): T[];