From e8ba41e4e2d402c16a47b8443cacc9cd861cce67 Mon Sep 17 00:00:00 2001 From: Johannes Fahrenkrug Date: Fri, 11 Nov 2016 15:21:45 -0500 Subject: [PATCH 1/2] Add type definition for keymirror --- keymirror/index.d.ts | 7 +++++++ keymirror/keymirror-tests.ts | 3 +++ keymirror/tsconfig.json | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 keymirror/index.d.ts create mode 100644 keymirror/keymirror-tests.ts create mode 100644 keymirror/tsconfig.json diff --git a/keymirror/index.d.ts b/keymirror/index.d.ts new file mode 100644 index 0000000000..e8c28c6d34 --- /dev/null +++ b/keymirror/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for keymirror 0.1.1 +// Project: https://github.com/STRML/keyMirror +// Definitions by: Johannes Fahrenkrug +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function KeyMirror(obj: Object): Object; +export = KeyMirror; diff --git a/keymirror/keymirror-tests.ts b/keymirror/keymirror-tests.ts new file mode 100644 index 0000000000..ace29f9947 --- /dev/null +++ b/keymirror/keymirror-tests.ts @@ -0,0 +1,3 @@ +import keyMirror = require('keymirror'); + +keyMirror({key1: null, key2: null}); diff --git a/keymirror/tsconfig.json b/keymirror/tsconfig.json new file mode 100644 index 0000000000..ce57da7581 --- /dev/null +++ b/keymirror/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keymirror-tests.ts" + ] +} From 71ddd7d62b56281185bcf49cc7c8b4762d4e712e Mon Sep 17 00:00:00 2001 From: Johannes Fahrenkrug Date: Mon, 14 Nov 2016 16:03:55 -0500 Subject: [PATCH 2/2] Improve type definition for keymirror --- keymirror/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keymirror/index.d.ts b/keymirror/index.d.ts index e8c28c6d34..1f2b6c01da 100644 --- a/keymirror/index.d.ts +++ b/keymirror/index.d.ts @@ -3,5 +3,5 @@ // Definitions by: Johannes Fahrenkrug // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function KeyMirror(obj: Object): Object; +declare function KeyMirror(obj: {}): { [key: string]: string }; export = KeyMirror;