Merge pull request #31435 from BendingBender/p-is-promise

[p-is-promise] Add types
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 09:35:07 -08:00
committed by GitHub
4 changed files with 38 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for p-is-promise 2.0
// Project: https://github.com/sindresorhus/p-is-promise#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = pIsPromise;
declare function pIsPromise(promise: any): promise is Promise<any>;
+6
View File
@@ -0,0 +1,6 @@
import pIsPromise = require('p-is-promise');
// $ExpectType boolean
pIsPromise(Promise.resolve('🦄'));
// $ExpectType boolean
pIsPromise('🦄');
+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",
"p-is-promise-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }