From 82eb617a22233dccf438976a427334d9d2f69b02 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Thu, 16 Jan 2020 11:18:08 +1300 Subject: [PATCH] feat: Add typings for sorted-object (#41549) Signed-off-by: Richie Bendall --- types/sorted-object/index.d.ts | 8 ++++++++ types/sorted-object/sorted-object-tests.ts | 3 +++ types/sorted-object/tsconfig.json | 23 ++++++++++++++++++++++ types/sorted-object/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/sorted-object/index.d.ts create mode 100644 types/sorted-object/sorted-object-tests.ts create mode 100644 types/sorted-object/tsconfig.json create mode 100644 types/sorted-object/tslint.json diff --git a/types/sorted-object/index.d.ts b/types/sorted-object/index.d.ts new file mode 100644 index 0000000000..98344e38f1 --- /dev/null +++ b/types/sorted-object/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for sorted-object 2.0 +// Project: https://github.com/domenic/sorted-object#readme +// Definitions by: Richie Bendall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function sortedObject(input: object): object; + +export = sortedObject; diff --git a/types/sorted-object/sorted-object-tests.ts b/types/sorted-object/sorted-object-tests.ts new file mode 100644 index 0000000000..870c239924 --- /dev/null +++ b/types/sorted-object/sorted-object-tests.ts @@ -0,0 +1,3 @@ +import sortedObject = require("sorted-object"); + +sortedObject({ b: 2, a: 1 }); // $ExpectType object diff --git a/types/sorted-object/tsconfig.json b/types/sorted-object/tsconfig.json new file mode 100644 index 0000000000..d0ea173d05 --- /dev/null +++ b/types/sorted-object/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sorted-object-tests.ts" + ] +} diff --git a/types/sorted-object/tslint.json b/types/sorted-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sorted-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }