diff --git a/types/natural-compare-lite/index.d.ts b/types/natural-compare-lite/index.d.ts new file mode 100644 index 0000000000..5e1a10bbdb --- /dev/null +++ b/types/natural-compare-lite/index.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function naturalCompare(a: string, b: string): number; + +declare global { + interface StringConstructor { + naturalCompare: typeof naturalCompare; + } +} + +export = naturalCompare; diff --git a/types/natural-compare-lite/natural-compare-lite-tests.ts b/types/natural-compare-lite/natural-compare-lite-tests.ts new file mode 100644 index 0000000000..dc483b4bcd --- /dev/null +++ b/types/natural-compare-lite/natural-compare-lite-tests.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import compare = require("natural-compare-lite"); + +['a', 's', 'd'].sort(compare); + +['a', 's', 'd'].sort(String.naturalCompare); diff --git a/types/natural-compare-lite/tsconfig.json b/types/natural-compare-lite/tsconfig.json new file mode 100644 index 0000000000..e3ed3ac1e0 --- /dev/null +++ b/types/natural-compare-lite/tsconfig.json @@ -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" + ] +} diff --git a/types/natural-compare-lite/tslint.json b/types/natural-compare-lite/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/natural-compare-lite/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/natural-compare/index.d.ts b/types/natural-compare/index.d.ts new file mode 100644 index 0000000000..57e0999157 --- /dev/null +++ b/types/natural-compare/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for natural-compare 1.4.0 +// Project: https://github.com/litejs/natural-compare-lite +// Definitions by: Doniyor Aliyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function naturalCompare(a: string, b: string): number; + +declare global { + interface StringConstructor { + naturalCompare: typeof naturalCompare; + } +} + +export = naturalCompare; diff --git a/types/natural-compare/natural-compare-tests.ts b/types/natural-compare/natural-compare-tests.ts new file mode 100644 index 0000000000..59e7d53163 --- /dev/null +++ b/types/natural-compare/natural-compare-tests.ts @@ -0,0 +1,10 @@ +// Type definitions for natural-compare 1.4.0 +// Project: https://github.com/litejs/natural-compare-lite +// Definitions by: Doniyor Aliyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import compare = require("natural-compare"); + +['a', 's', 'd'].sort(compare); + +['a', 's', 'd'].sort(String.naturalCompare); diff --git a/types/natural-compare/tsconfig.json b/types/natural-compare/tsconfig.json new file mode 100644 index 0000000000..81322d5590 --- /dev/null +++ b/types/natural-compare/tsconfig.json @@ -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" + ] +} diff --git a/types/natural-compare/tslint.json b/types/natural-compare/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/natural-compare/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}