Skip to main content
Worker - Workers - Web documentation
interface Worker
extends EventTarget
Private

Properties

onerror: (
this: Worker,
) => any | null
onmessage: () => any | null
onmessageerror: () => any | null

Methods

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