diff --git a/types/random-obj-key/index.d.ts b/types/random-obj-key/index.d.ts new file mode 100644 index 0000000000..dfe12ca6f6 --- /dev/null +++ b/types/random-obj-key/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for random-obj-key 1.0 +// Project: https://github.com/sindresorhus/random-obj-key +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = randomObjKey; + +declare function randomObjKey(input: TObj): keyof TObj; diff --git a/types/random-obj-key/random-obj-key-tests.ts b/types/random-obj-key/random-obj-key-tests.ts new file mode 100644 index 0000000000..b12cf282ea --- /dev/null +++ b/types/random-obj-key/random-obj-key-tests.ts @@ -0,0 +1,4 @@ +import randomObjKey = require('random-obj-key'); + +// $ExpectType "foo" | "bar" +randomObjKey({ foo: true, bar: true }); diff --git a/types/random-obj-key/tsconfig.json b/types/random-obj-key/tsconfig.json new file mode 100644 index 0000000000..aaaf33ba98 --- /dev/null +++ b/types/random-obj-key/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "random-obj-key-tests.ts" + ] +} diff --git a/types/random-obj-key/tslint.json b/types/random-obj-key/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/random-obj-key/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }