diff --git a/types/p-whilst/index.d.ts b/types/p-whilst/index.d.ts new file mode 100644 index 0000000000..26efc254fa --- /dev/null +++ b/types/p-whilst/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for p-whilst 1.0 +// Project: https://github.com/sindresorhus/p-whilst#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = pWhilst; + +declare function pWhilst(condition: () => boolean, action: () => any): Promise; diff --git a/types/p-whilst/p-whilst-tests.ts b/types/p-whilst/p-whilst-tests.ts new file mode 100644 index 0000000000..fe9caa86a3 --- /dev/null +++ b/types/p-whilst/p-whilst-tests.ts @@ -0,0 +1,5 @@ +import pWhilst = require('p-whilst'); + +let count = 0; + +pWhilst(() => count < 5, () => count++).then(() => {}); diff --git a/types/p-whilst/tsconfig.json b/types/p-whilst/tsconfig.json new file mode 100644 index 0000000000..bcc9fd3dab --- /dev/null +++ b/types/p-whilst/tsconfig.json @@ -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" + ] +} diff --git a/types/p-whilst/tslint.json b/types/p-whilst/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/p-whilst/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }