From e8e967a8f2ec2218ec380e54777375f2ff053987 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 19 Nov 2018 16:27:36 +0000 Subject: [PATCH] Restore types for p-wait-for v1.0 (#30640) --- types/p-wait-for/v1/index.d.ts | 8 ++++++++ types/p-wait-for/v1/p-wait-for-tests.ts | 6 ++++++ types/p-wait-for/v1/tsconfig.json | 26 +++++++++++++++++++++++++ types/p-wait-for/v1/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/p-wait-for/v1/index.d.ts create mode 100644 types/p-wait-for/v1/p-wait-for-tests.ts create mode 100644 types/p-wait-for/v1/tsconfig.json create mode 100644 types/p-wait-for/v1/tslint.json diff --git a/types/p-wait-for/v1/index.d.ts b/types/p-wait-for/v1/index.d.ts new file mode 100644 index 0000000000..5e8f88d413 --- /dev/null +++ b/types/p-wait-for/v1/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for p-wait-for 1.0 +// Project: https://github.com/sindresorhus/p-wait-for#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = pWaitFor; + +declare function pWaitFor(condition: () => PromiseLike | boolean, interval?: number): Promise; diff --git a/types/p-wait-for/v1/p-wait-for-tests.ts b/types/p-wait-for/v1/p-wait-for-tests.ts new file mode 100644 index 0000000000..587d08d5a5 --- /dev/null +++ b/types/p-wait-for/v1/p-wait-for-tests.ts @@ -0,0 +1,6 @@ +import pWaitFor = require('p-wait-for'); + +pWaitFor(() => Promise.resolve(false)).then(() => {}); +pWaitFor(() => Promise.resolve(true), 1).then(() => {}); +pWaitFor(() => false).then(() => {}); +pWaitFor(() => true, 1).then(() => {}); diff --git a/types/p-wait-for/v1/tsconfig.json b/types/p-wait-for/v1/tsconfig.json new file mode 100644 index 0000000000..2d81275cae --- /dev/null +++ b/types/p-wait-for/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "p-wait-for": [ "p-wait-for/v1" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "p-wait-for-tests.ts" + ] +} diff --git a/types/p-wait-for/v1/tslint.json b/types/p-wait-for/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/p-wait-for/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }