TaskWorker
Interface: TaskWorker
Section titled “Interface: TaskWorker”Extends
Section titled “Extends”Worker
Properties
Section titled “Properties”id: number;Defined in
Section titled “Defined in”packages/vibrant-worker/src/common.ts:20
idle: boolean;Defined in
Section titled “Defined in”packages/vibrant-worker/src/common.ts:21
onerror
Section titled “onerror”onerror: null | (this, ev) => any;Inherited from
Section titled “Inherited from”Worker.onerror
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:2419
onmessage
Section titled “onmessage”onmessage: null | (this, ev) => any;Inherited from
Section titled “Inherited from”Worker.onmessage
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25812
onmessageerror
Section titled “onmessageerror”onmessageerror: null | (this, ev) => any;Inherited from
Section titled “Inherited from”Worker.onmessageerror
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25814
Methods
Section titled “Methods”addEventListener()
Section titled “addEventListener()”Call Signature
Section titled “Call Signature”addEventListener<K>( type, listener, options?): voidAppends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options’s capture.
When set to true, options’s capture prevents callback from being invoked when the event’s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event’s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event’s eventPhase attribute value is AT_TARGET.
When set to true, options’s passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options’s once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options’s signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target’s event listener list and is not appended if it has the same type, callback, and capture.
Type Parameters
Section titled “Type Parameters”• K extends keyof WorkerEventMap
Parameters
Section titled “Parameters”K
listener
Section titled “listener”(this, ev) => any
options?
Section titled “options?”boolean | AddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.addEventListener
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25828
Call Signature
Section titled “Call Signature”addEventListener( type, listener, options?): voidAppends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options’s capture.
When set to true, options’s capture prevents callback from being invoked when the event’s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event’s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event’s eventPhase attribute value is AT_TARGET.
When set to true, options’s passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options’s once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options’s signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target’s event listener list and is not appended if it has the same type, callback, and capture.
Parameters
Section titled “Parameters”string
listener
Section titled “listener”EventListenerOrEventListenerObject
options?
Section titled “options?”boolean | AddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.addEventListener
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25829
dispatchEvent()
Section titled “dispatchEvent()”dispatchEvent(event): booleanDispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Parameters
Section titled “Parameters”Event
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Worker.dispatchEvent
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:8309
postMessage()
Section titled “postMessage()”Call Signature
Section titled “Call Signature”postMessage(message, transfer): voidClones message and transmits it to worker’s global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned.
Parameters
Section titled “Parameters”message
Section titled “message”any
transfer
Section titled “transfer”Transferable[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.postMessage
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25820
Call Signature
Section titled “Call Signature”postMessage(message, options?): voidParameters
Section titled “Parameters”message
Section titled “message”any
options?
Section titled “options?”StructuredSerializeOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.postMessage
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25821
removeEventListener()
Section titled “removeEventListener()”Call Signature
Section titled “Call Signature”removeEventListener<K>( type, listener, options?): voidRemoves the event listener in target’s event listener list with the same type, callback, and options.
Type Parameters
Section titled “Type Parameters”• K extends keyof WorkerEventMap
Parameters
Section titled “Parameters”K
listener
Section titled “listener”(this, ev) => any
options?
Section titled “options?”boolean | EventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.removeEventListener
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25830
Call Signature
Section titled “Call Signature”removeEventListener( type, listener, options?): voidRemoves the event listener in target’s event listener list with the same type, callback, and options.
Parameters
Section titled “Parameters”string
listener
Section titled “listener”EventListenerOrEventListenerObject
options?
Section titled “options?”boolean | EventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.removeEventListener
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25831
terminate()
Section titled “terminate()”terminate(): voidAborts worker’s associated global environment.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Worker.terminate
Defined in
Section titled “Defined in”node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25827