File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ export type TransferList = Transferable[]
7676/** Worker instance. Either a web worker or a node.js Worker provided by `worker_threads` or `tiny-worker`. */
7777export interface Worker extends EventTarget {
7878 postMessage ( value : any , transferList ?: TransferList ) : void
79- terminate ( callback ?: ( error ?: Error , exitCode ?: number ) => void ) : void
79+ /** In nodejs 10+ return type is Promise while with tiny-worker and in browser return type is void */
80+ terminate ( callback ?: ( error ?: Error , exitCode ?: number ) => void ) : void | Promise < number >
8081}
81-
8282export interface ThreadsWorkerOptions extends WorkerOptions {
8383 /** Prefix for the path passed to the Worker constructor. Web worker only. */
8484 _baseURL ?: string
@@ -102,7 +102,7 @@ export interface ThreadsWorkerOptions extends WorkerOptions {
102102export declare class WorkerImplementation extends EventTarget implements Worker {
103103 constructor ( path : string , options ?: ThreadsWorkerOptions )
104104 public postMessage ( value : any , transferList ?: TransferList ) : void
105- public terminate ( ) : void
105+ public terminate ( ) : void | Promise < number >
106106}
107107
108108/** Class to spawn workers from a blob or source string. */
You can’t perform that action at this time.
0 commit comments