Skip to content

Commit

Permalink
export the Proxy type, use workerpool's Promise` (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Dec 19, 2023
1 parent 8693022 commit 66edf85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.js
Expand Up @@ -4,6 +4,11 @@ const {platform, isMainThread, cpus} = require('./environment');
/** @typedef {import("./types.js").WorkerPoolOptions} WorkerPoolOptions */
/** @typedef {import("./types.js").WorkerRegisterOptions} WorkerRegisterOptions */

/**
* @template { { [k: string]: (...args: any[]) => any } } T
* @typedef {import('./types.js').Proxy<T>} Proxy<T>
*/

/**
* @overload
* Create a new worker pool
Expand Down
2 changes: 1 addition & 1 deletion src/types.js
Expand Up @@ -39,7 +39,7 @@

/**
* @template { { [k: string]: (...args: any[]) => any } } T
* @typedef {{ [M in keyof T]: (...args: Parameters<T[M]>) => Promise<ReturnType<T[M]>>; }} Proxy<T>
* @typedef {{ [M in keyof T]: (...args: Parameters<T[M]>) => import('./Promise.js').Promise<ReturnType<T[M]>>; }} Proxy<T>
*/

module.exports = {}

0 comments on commit 66edf85

Please sign in to comment.