@toolpad/utils
Version:
Shared utilities used by Toolpad packages.
6 lines • 327 B
TypeScript
export interface Comparator<T> {
(a: T, b: T): number;
}
export declare function defaultComparator<T>(a: T, b: T): number;
export declare function alphabeticComparator(a: string, b: string): number;
export declare function createPropComparator<T, K extends keyof T>(propName: K, comparator?: Comparator<T[K]>): Comparator<T>;