[p-wait-for] add typings (#18881)

This commit is contained in:
Dimitri Benin
2017-08-14 10:15:25 -07:00
committed by Mohamed Hegazy
parent 2dd27af843
commit 86d85e9134
4 changed files with 37 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for p-wait-for 1.0
// Project: https://github.com/sindresorhus/p-wait-for#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = pWaitFor;
declare function pWaitFor(condition: () => PromiseLike<boolean> | boolean, interval?: number): Promise<void>;
+6
View File
@@ -0,0 +1,6 @@
import pWaitFor = require('p-wait-for');
pWaitFor(() => Promise.resolve(false)).then(() => {});
pWaitFor(() => Promise.resolve(true), 1).then(() => {});
pWaitFor(() => false).then(() => {});
pWaitFor(() => true, 1).then(() => {});
+22
View File
@@ -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",
"p-wait-for-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }