promise-pool icon indicating copy to clipboard operation
promise-pool copied to clipboard

Typescript types

Open thomassuckow opened this issue 4 years ago • 2 comments

Should have typescript types, at least on @types

thomassuckow avatar Mar 09 '20 21:03 thomassuckow

declare module "@mixmaxhq/promise-pool" {
  interface PromisePoolOptions {
    /**
     * default: 4
     */
    numConcurrent?: number;
    /**
     * default: 1
     */
    maxPending?: number;
  }

  class PromisePool {
    constructor(config?: PromisePoolOptions);

    start<A extends any[]>(fn: (...args: A) => Promise<void>, ...args: A): Promise<void>;

    flush(): Promise<Error[]>;
  }
  export = PromisePool;
}

thomassuckow avatar Mar 09 '20 21:03 thomassuckow

You're welcome to file a PR!

skeggse avatar Mar 09 '20 23:03 skeggse