Add types for random-obj-key

This commit is contained in:
Dimitri Benin 2018-12-03 01:07:20 +01:00
parent efbcbdebaf
commit a7f31adfd5
4 changed files with 37 additions and 0 deletions

9
types/random-obj-key/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for random-obj-key 1.0
// Project: https://github.com/sindresorhus/random-obj-key
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export = randomObjKey;
declare function randomObjKey<TObj extends { [key: string]: any }>(input: TObj): keyof TObj;

View File

@ -0,0 +1,4 @@
import randomObjKey = require('random-obj-key');
// $ExpectType "foo" | "bar"
randomObjKey({ foo: true, bar: true });

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }