forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse.d.ts
29 lines (26 loc) · 800 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
29
// Type definitions for Fuse.js 2.2.0
// Project: https://github.com/krisk/Fuse
// Definitions by: Greg Smith <https://github.com/smrq/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class Fuse {
constructor(list: any[], options?: fuse.IFuseOptions);
search(pattern: string): any[];
}
declare namespace fuse {
interface IFuseOptions extends ISearchOptions {
caseSensitive?: boolean;
include?: string[];
shouldSort?: boolean;
searchFn?: any;
sortFn?: (a: {score: number}, b: {score: number}) => number;
getFn?: (obj: any, path: string) => any;
keys?: string[] | { name:string; weight:number} [];
verbose?:boolean;
}
interface ISearchOptions {
location?: number;
distance?: number;
threshold?: number;
maxPatternLength?: number;
}
}