added types for js-levenshtein

This commit is contained in:
Kallu609
2019-01-11 04:24:10 +02:00
parent 86fa899b1f
commit 0d53a4bb7e
4 changed files with 38 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for js-levenshtein 1.1.6
// Project: https://github.com/gustf/js-levenshtein
// Definitions by: Kallu609 <https://github.com/Kallu609>
// Pyry Rouvila <https://github.com/naftis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Calculates Levenshtein distance between two strings
*/
declare function levenshtein(compareFrom: string, compareTo: string): number;
export default levenshtein;
@@ -0,0 +1,9 @@
// Type definitions for js-levenshtein 1.1.6
// Project: https://github.com/gustf/js-levenshtein
// Definitions by: Kallu609 <https://github.com/Kallu609>
// Pyry Rouvila <https://github.com/naftis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import levenshtein from 'js-levenshtein';
levenshtein('kittens', 'mittens'); // $ExpectType number
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "js-levenshtein-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }