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