Added type definition for natural-compare

This commit is contained in:
doniyor2109
2019-02-15 11:47:32 +05:00
parent b429791b8b
commit 9beda1efac
8 changed files with 100 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for natural-compare-lite 1.4.0
// Project: https://github.com/litejs/natural-compare-lite
// Definitions by: Doniyor Aliyev <https://github.com/doniyor2109>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function naturalCompare(a: string, b: string): number;
declare global {
interface StringConstructor {
naturalCompare: typeof naturalCompare;
}
}
export = naturalCompare;
@@ -0,0 +1,10 @@
// Type definitions for natural-compare-lite 1.4.0
// Project: https://github.com/litejs/natural-compare-lite
// Definitions by: Doniyor Aliyev <https://github.com/doniyor2109>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import compare = require("natural-compare-lite");
['a', 's', 'd'].sort(compare);
['a', 's', 'd'].sort(String.naturalCompare);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"natural-compare-lite-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for natural-compare 1.4.0
// Project: https://github.com/litejs/natural-compare-lite
// Definitions by: Doniyor Aliyev <https://github.com/doniyor2109>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function naturalCompare(a: string, b: string): number;
declare global {
interface StringConstructor {
naturalCompare: typeof naturalCompare;
}
}
export = naturalCompare;
@@ -0,0 +1,10 @@
// Type definitions for natural-compare 1.4.0
// Project: https://github.com/litejs/natural-compare-lite
// Definitions by: Doniyor Aliyev <https://github.com/doniyor2109>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import compare = require("natural-compare");
['a', 's', 'd'].sort(compare);
['a', 's', 'd'].sort(String.naturalCompare);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"natural-compare-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}