Create type definition for object-keys module (#27307)

This commit is contained in:
Vitor Luiz Cavalcanti
2018-07-23 08:58:47 -07:00
committed by Andy
parent 710912817e
commit 661a25ec4c
4 changed files with 54 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for object-keys 1.0
// Project: https://github.com/ljharb/object-keys#readme
// Definitions by: Vitor Luiz Cavalcanti <https://github.com/VitorLuizC>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare function objectKeys(object: object): string[];
declare namespace objectKeys {
function shim(): typeof objectKeys;
}
export = objectKeys;
+17
View File
@@ -0,0 +1,17 @@
import keys = require('object-keys');
keys({ A: 1, B: 2, C: 3 });
// => string[]
keys.shim();
// typeof keys
keys([ 0, 1, 2, 3 ]);
// => string[]
keys(() => 0);
// => string[]
function testArguments() {
keys(arguments);
}
+23
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",
"object-keys-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }