mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
[p-whilst] add typings (#18882)
This commit is contained in:
committed by
Mohamed Hegazy
parent
38c1dc49ff
commit
2dd27af843
8
types/p-whilst/index.d.ts
vendored
Normal file
8
types/p-whilst/index.d.ts
vendored
Normal 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
types/p-whilst/p-whilst-tests.ts
Normal file
5
types/p-whilst/p-whilst-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import pWhilst = require('p-whilst');
|
||||
|
||||
let count = 0;
|
||||
|
||||
pWhilst(() => count < 5, () => count++).then(() => {});
|
||||
22
types/p-whilst/tsconfig.json
Normal file
22
types/p-whilst/tsconfig.json
Normal 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
types/p-whilst/tslint.json
Normal file
1
types/p-whilst/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user