Skip to content

TaskWorker

Interface: TaskWorker

Extends

  • Worker

Properties

id

id: number;

Defined in

packages/vibrant-worker/src/common.ts:20


idle

idle: boolean;

Defined in

packages/vibrant-worker/src/common.ts:21


onerror

onerror: null | (this, ev) => any;

MDN Reference

Inherited from

Worker.onerror

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:2419


onmessage

onmessage: null | (this, ev) => any;

MDN Reference

Inherited from

Worker.onmessage

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25812


onmessageerror

onmessageerror: null | (this, ev) => any;

MDN Reference

Inherited from

Worker.onmessageerror

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25814

Methods

addEventListener()

Call Signature

addEventListener<K>(
type,
listener,
options?): void

Appends 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.

MDN Reference

Type Parameters

K extends keyof WorkerEventMap

Parameters
type

K

listener

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

Worker.addEventListener

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25828

Call Signature

addEventListener(
type,
listener,
options?): void

Appends 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.

MDN Reference

Parameters
type

string

listener

EventListenerOrEventListenerObject

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

Worker.addEventListener

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25829


dispatchEvent()

dispatchEvent(event): boolean

Dispatches 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.

MDN Reference

Parameters

event

Event

Returns

boolean

Inherited from

Worker.dispatchEvent

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:8309


postMessage()

Call Signature

postMessage(message, transfer): void

Clones 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.

MDN Reference

Parameters
message

any

transfer

Transferable[]

Returns

void

Inherited from

Worker.postMessage

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25820

Call Signature

postMessage(message, options?): void
Parameters
message

any

options?

StructuredSerializeOptions

Returns

void

Inherited from

Worker.postMessage

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25821


removeEventListener()

Call Signature

removeEventListener<K>(
type,
listener,
options?): void

Removes the event listener in target’s event listener list with the same type, callback, and options.

MDN Reference

Type Parameters

K extends keyof WorkerEventMap

Parameters
type

K

listener

(this, ev) => any

options?

boolean | EventListenerOptions

Returns

void

Inherited from

Worker.removeEventListener

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25830

Call Signature

removeEventListener(
type,
listener,
options?): void

Removes the event listener in target’s event listener list with the same type, callback, and options.

MDN Reference

Parameters
type

string

listener

EventListenerOrEventListenerObject

options?

boolean | EventListenerOptions

Returns

void

Inherited from

Worker.removeEventListener

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25831


terminate()

terminate(): void

Aborts worker’s associated global environment.

MDN Reference

Returns

void

Inherited from

Worker.terminate

Defined in

node_modules/.pnpm/typescript@5.6.3/node_modules/typescript/lib/lib.dom.d.ts:25827