@flanksource/clicky-ui
Version:
Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.
17 lines • 493 B
TypeScript
export type SortDir = "asc" | "desc";
export type SortState = {
key: string;
dir: SortDir;
};
export type UseSortOptions<T> = {
defaultKey?: string;
defaultDir?: SortDir;
resolvers?: Record<string, (item: T) => unknown>;
};
export type UseSortReturn<T> = {
sorted: T[];
sort: SortState | null;
toggle: (key: string) => void;
};
export declare function useSort<T>(items: T[], options?: UseSortOptions<T>): UseSortReturn<T>;
//# sourceMappingURL=use-sort.d.ts.map