mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
27 lines
808 B
TypeScript
27 lines
808 B
TypeScript
// Type definitions for fuzzy-search 2.1
|
|
// Project: https://github.com/wouter2203/fuzzy-search#readme
|
|
// Definitions by: Alex Deas <https://github.com/alex-deas>
|
|
// BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.8
|
|
|
|
declare class FuzzySearch<T extends object | string> {
|
|
haystack: T[];
|
|
keys: string[];
|
|
options: Required<FuzzySearch.Options>;
|
|
|
|
static isMatch(item: string, query: string, caseSensitive: boolean): number;
|
|
|
|
constructor(haystack: T[], keys?: string[], options?: FuzzySearch.Options);
|
|
search(needle?: string): T[];
|
|
}
|
|
|
|
declare namespace FuzzySearch {
|
|
interface Options {
|
|
caseSensitive?: boolean;
|
|
sort?: boolean;
|
|
}
|
|
}
|
|
|
|
export = FuzzySearch;
|