import sortBy from 'lodash/sortBy'; export interface TItem { id: string; } export type TSortDirection = 'asc' | 'desc'; export type TSortingState = { items: Item[]; sortedBy?: string; sortDirection?: TSortDirection; }; export type TSortingFn = typeof sortBy; declare const useSorting: (items: Item[], field?: string, sortDirection?: TSortDirection, sortingFunction?: TSortingFn) => { items: Item[]; sortedBy: string | undefined; sortDirection: TSortDirection | undefined; onSortChange: (fieldKey: string) => void; }; export default useSorting;