TypeScript definitions for fuzzyset library (#15860)

* pdf def file

* fuzzyset

* fuzzyset

* fuzzyset

* dtslint

* dtslint

* dtslint

* fuzzyset renamed to fuzzyset.js

* fuzzyset ok$

* fuzzyset ok
This commit is contained in:
Louis Grignon 2017-04-20 16:33:59 +02:00 committed by Andy
parent a15b6bf327
commit abdfe2a6aa
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import FuzzySet = require('fuzzyset');
const fuzzyset: FuzzySet = FuzzySet(['coucou', 'foo', 'bar', 'toto']);
const results = fuzzyset.get('foo');
fuzzyset.length();
fuzzyset.isEmpty();
fuzzyset.values();

17
types/fuzzyset/index.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
// Type definitions for fuzzset 1.0
// Project: https://github.com/washt/fuzzyset
// Definitions by: Louis Grignon <https://github.com/lgrignon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface FuzzySet {
get(candidate: string): Array<[number, string]>;
add(value: string): boolean;
length(): number;
isEmpty(): boolean;
values(): string[];
}
declare function FuzzySet(source: string[], useLevenshtein?: boolean, gramSizeLower?: number, gramSizeUpper?: number): FuzzySet;
export = FuzzySet;
export as namespace FuzzySet;

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"fuzzyset-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }