forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse.d.ts
28 lines (25 loc) · 735 Bytes
/
fuse.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Type definitions for Fuse.js 1.1.5
// Project: https://github.com/krisk/Fuse
// Definitions by: Greg Smith <https://github.com/smrq/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Fuse {
constructor(list: any[], options?: fuse.IFuseOptions);
search(pattern: string): any[];
}
declare module fuse {
interface IFuseOptions extends ISearchOptions {
caseSensitive?: boolean;
includeScore?: boolean;
shouldSort?: boolean;
searchFn?: any;
sortFn?: (a: {score: number}, b: {score: number}) => number;
getFn?: (obj: any, path: string) => any;
keys?: string[];
}
interface ISearchOptions {
location?: number;
distance?: number;
threshold?: number;
maxPatternLength?: number;
}
}