mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-01-12 22:46:38 +08:00
SortFunction signature should match Array.sort (#29468)
-1 and 1 aren't the only numbers allowed. Any number less than or greater than 0 will sort the item properly. This enables shortcuts like (a, b) => a - b; Restricting the signature to -1 | 0 | 1 is a mistake.
This commit is contained in:
2
types/react-table/index.d.ts
vendored
2
types/react-table/index.d.ts
vendored
@@ -27,7 +27,7 @@ export type SortedChangeFunction = (newSorted: SortingRule[], column: any, addit
|
||||
export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void;
|
||||
export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void;
|
||||
export type ResizedChangeFunction = (newResized: Resize[], event: any) => void;
|
||||
export type SortFunction = (a: any, b: any, desc: any) => -1 | 0 | 1;
|
||||
export type SortFunction = (a: any, b: any, desc: any) => number;
|
||||
|
||||
export interface Resize {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user