From 1cff126231aaa40f67b2c53c288de2d54a50baa1 Mon Sep 17 00:00:00 2001 From: Steffi Hasler Date: Fri, 2 Feb 2018 15:44:23 +0100 Subject: [PATCH] add working typings --- es6-promise-pool.d.ts | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/es6-promise-pool.d.ts b/es6-promise-pool.d.ts index cff044b..b3b32cc 100644 --- a/es6-promise-pool.d.ts +++ b/es6-promise-pool.d.ts @@ -1,18 +1,24 @@ -interface Options { - promise?: PromiseLike -} +// fix 2018-01-08 + +export = PromisePool declare class PromisePool extends EventTarget { - constructor( - source: () => PromiseLike|void, - concurrency: number, - options?: Options - ) - concurrency(concurrency: number): number - size(): number - active(): boolean - promise(): PromiseLike - start(): PromiseLike + // skip GeneratorFunction as that is documented to be deprecated starting v3 + constructor( + source: IterableIterator> | Promise | (() => (Promise | void)) | A, + concurrency: number, + options?: PromisePool.Options + ) + + concurrency(concurrency: number): number + size(): number + active(): boolean + promise(): PromiseLike + start(): PromiseLike } -export default PromisePool \ No newline at end of file +declare namespace PromisePool { + export interface Options { + promise?: Promise + } +}