Merge pull request #32055 from Kallu609/master

add typings for js-levenshtein
This commit is contained in:
Daniel Rosenwasser
2019-01-15 17:13:44 -08:00
committed by GitHub
4 changed files with 32 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for js-levenshtein 1.1
// 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 = levenshtein;
@@ -0,0 +1,3 @@
import levenshtein = require('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" }