[p-whilst] add typings (#18882)

This commit is contained in:
Dimitri Benin
2017-08-14 19:14:32 +02:00
committed by Mohamed Hegazy
parent 38c1dc49ff
commit 2dd27af843
4 changed files with 36 additions and 0 deletions

8
types/p-whilst/index.d.ts vendored Normal file
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>;

View File

@@ -0,0 +1,5 @@
import pWhilst = require('p-whilst');
let count = 0;
pWhilst(() => count < 5, () => count++).then(() => {});

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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }