mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Add types for known
This commit is contained in:
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for known 2.0
|
||||
// Project: https://github.com/sindresorhus/known#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = known;
|
||||
|
||||
declare function known<T extends object>(object: T): T;
|
||||
@@ -0,0 +1,8 @@
|
||||
import known = require('known');
|
||||
|
||||
const obj = { foo: true };
|
||||
|
||||
const obj2 = known(obj);
|
||||
|
||||
obj2.foo;
|
||||
obj2.bar; // $ExpectError
|
||||
@@ -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",
|
||||
"known-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user