mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Fix typo and make ExtendedKeyOptions more restrictive
This commit is contained in:
Vendored
+9
-7
@@ -19,12 +19,10 @@ declare namespace matchSorter {
|
||||
}
|
||||
}
|
||||
|
||||
interface ExtendedKeyOptions<T> {
|
||||
minRanking?: number;
|
||||
maxRanking?: number;
|
||||
treshold?: number;
|
||||
key: string | ((item: T) => string);
|
||||
}
|
||||
type ExtendedKeyOptions<T> = { key: string | ((item: T) => string) } & (
|
||||
| { minRanking: number; threshold?: number }
|
||||
| { maxRanking: number; threshold?: number }
|
||||
| { threshold: number });
|
||||
|
||||
interface Options<T> {
|
||||
keys?: Array<string | ((item: T) => string) | ExtendedKeyOptions<T>>;
|
||||
@@ -39,6 +37,10 @@ interface Options<T> {
|
||||
* @param options - Some options to configure the sorter
|
||||
* @return the new sorted array
|
||||
*/
|
||||
declare function matchSorter<T>(items: ReadonlyArray<T>, value: string, options?: Options<T>): T[];
|
||||
declare function matchSorter<T>(
|
||||
items: ReadonlyArray<T>,
|
||||
value: string,
|
||||
options?: Options<T>
|
||||
): T[];
|
||||
|
||||
export = matchSorter;
|
||||
|
||||
Reference in New Issue
Block a user