From 2dd27af843b60ed0e24dc26ea48db0d20e5249db Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 14 Aug 2017 19:14:32 +0200 Subject: [PATCH] [p-whilst] add typings (#18882) --- types/p-whilst/index.d.ts | 8 ++++++++ types/p-whilst/p-whilst-tests.ts | 5 +++++ types/p-whilst/tsconfig.json | 22 ++++++++++++++++++++++ types/p-whilst/tslint.json | 1 + 4 files changed, 36 insertions(+) create mode 100644 types/p-whilst/index.d.ts create mode 100644 types/p-whilst/p-whilst-tests.ts create mode 100644 types/p-whilst/tsconfig.json create mode 100644 types/p-whilst/tslint.json 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" }