mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
[defined] add typings (#18910)
This commit is contained in:
committed by
Mohamed Hegazy
parent
3484077f01
commit
76ef71bda5
@@ -0,0 +1,7 @@
|
||||
import defined = require('defined');
|
||||
|
||||
const opts = { x: undefined, y : false, w : 4 };
|
||||
// $ExpectType number | boolean | undefined
|
||||
defined<boolean | number | undefined>(opts.x, opts.y, opts.w, 100);
|
||||
// $ExpectType any
|
||||
defined(opts.x, opts.y, opts.w, 100);
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for defined 1.0
|
||||
// Project: https://github.com/substack/defined
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = defined;
|
||||
|
||||
declare function defined<T>(...args: T[]): T;
|
||||
declare function defined(...args: any[]): any;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"defined-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user