class Worker
extends EventTarget

Constructors

new
Worker(specifier: string, options?: WorkerOptions)

Properties

optional
onerror: (e: ErrorEvent) => void
optional
onmessage: (e: MessageEvent) => void
optional
onmessageerror: (e: MessageEvent) => void

Methods

addEventListener<K extends keyof WorkerEventMap>(
type: K,
listener: (this: Worker, ev: WorkerEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
postMessage(message: any, transfer: ArrayBuffer[]): void
postMessage(message: any, options?: PostMessageOptions): void
removeEventListener<K extends keyof WorkerEventMap>(
type: K,
listener: (this: Worker, ev: WorkerEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
terminate(): void