mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 08:58:23 +08:00
Add fast-levenshtein type definition (#11647)
This commit is contained in:
committed by
Mohamed Hegazy
parent
d3b7ecb1fb
commit
82ed03dce3
13
fast-levenshtein/fast-levenshtein-tests.ts
Normal file
13
fast-levenshtein/fast-levenshtein-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as fastLevenshtein from 'fast-levenshtein';
|
||||
|
||||
declare const boolVal: boolean;
|
||||
declare const strVal: string;
|
||||
|
||||
// option datas tests
|
||||
let opts: fastLevenshtein.LevenshteinOptions = {};
|
||||
|
||||
opts.useCollator = boolVal;
|
||||
|
||||
// API tests
|
||||
fastLevenshtein.get(strVal, strVal);
|
||||
fastLevenshtein.get(strVal, strVal, opts);
|
||||
10
fast-levenshtein/index.d.ts
vendored
Normal file
10
fast-levenshtein/index.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// Type definitions for fast-levenshtein
|
||||
// Project: https://github.com/hiddentao/fast-levenshtein
|
||||
// Definitions by: Mizunashi Mana <https://github.com/mizunashi-mana>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface LevenshteinOptions {
|
||||
useCollator?: boolean;
|
||||
}
|
||||
|
||||
export function get(str1: string, str2: string, opts?: LevenshteinOptions): number;
|
||||
19
fast-levenshtein/tsconfig.json
Normal file
19
fast-levenshtein/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"fast-levenshtein-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user