declare type Comparator = (a: T, b: T) => number; interface ComparatorDictionary { [key: string]: Comparator; } interface Sorting { field: keyof T; inverted?: boolean; } declare type InitialSorting = string | Sorting; interface ThSortableProps { onSort: () => void; isSorted: boolean; isSortedDesc?: boolean; sortPriority?: number; } declare type ThSortablePropsGetter = (fieldName: keyof T) => ThSortableProps; export declare type UseThSortable = (objects: T[], maxSortedFields?: number, initialSorting?: InitialSorting[], specialFieldComparators?: ComparatorDictionary) => [T[], ThSortablePropsGetter]; /** * Returns a sorted version of the objects parameter, * and a function to get ThSortableProps. * * @param objects The original array of objects to be sorted. * @param maxSortedFields The maximum number of sorting criteria. * @param initialSorting The initial sorting array, expressed as [[string]] or [[Sorting]]. * When using [[string]] format, the value is the name of the object's property, * prefix with '!' to invert the sorting. * @param specialFieldComparators A dictionary object for special object's property comparators. */ export declare const useThSortable: UseThSortable; export {};