mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Create type definition for object-keys module (#27307)
This commit is contained in:
committed by
Andy
parent
710912817e
commit
661a25ec4c
Vendored
+13
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user