mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Add type definitions for Fuse.js
This commit is contained in:
Vendored
+28
@@ -0,0 +1,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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user