[p-whilst] add typings (#18882)

This commit is contained in:
Dimitri Benin
2017-08-14 10:14:32 -07:00
committed by Mohamed Hegazy
parent 38c1dc49ff
commit 2dd27af843
4 changed files with 36 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for p-whilst 1.0
// Project: https://github.com/sindresorhus/p-whilst#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = pWhilst;
declare function pWhilst(condition: () => boolean, action: () => any): Promise<void>;
+5
View File
@@ -0,0 +1,5 @@
import pWhilst = require('p-whilst');
let count = 0;
pWhilst(() => count < 5, () => count++).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-whilst-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }