Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript types #10

Open
thomassuckow opened this issue Mar 9, 2020 · 2 comments
Open

Typescript types #10

thomassuckow opened this issue Mar 9, 2020 · 2 comments

Comments

@thomassuckow
Copy link

Should have typescript types, at least on @types

@thomassuckow
Copy link
Author

thomassuckow commented Mar 9, 2020

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;
}

@skeggse
Copy link
Contributor

skeggse commented Mar 9, 2020

You're welcome to file a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants