forked from krisk/Fuse
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
37 lines (33 loc) · 973 Bytes
/
index.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
30
31
32
33
34
35
36
37
// Type definitions for Fuse.js 3.2.0
export = Fuse;
export as namespace Fuse;
interface SearchOpts {
limit?: number
}
declare class Fuse<T> {
constructor(list: ReadonlyArray<T>, options?: Fuse.FuseOptions<T>)
search(pattern: string, opts?: SearchOpts): T[];
setCollection(list: ReadonlyArray<T>): ReadonlyArray<T>;
}
declare namespace Fuse {
export interface FuseOptions<T> {
id?: string;
caseSensitive?: boolean;
includeMatches?: boolean;
includeScore?: boolean;
shouldSort?: boolean;
sortFn?: (a: { score: number }, b: { score: number }) => number;
getFn?: (obj: any, path: string) => any;
keys?: (keyof T)[] | { name: keyof T; weight: number }[];
verbose?: boolean;
tokenize?: boolean;
tokenSeparator?: RegExp;
matchAllTokens?: boolean;
location?: number;
distance?: number;
threshold?: number;
maxPatternLength?: number;
minMatchCharLength?: number;
findAllMatches?: boolean;
}
}