class Worker
extends EventTarget
import { Worker } from "https://deno.land/x/deno@v1.32.3/cli/tsc/dts/lib.deno.shared_globals.d.ts";
Constructors
new
Worker(specifier: string | URL, options?: WorkerOptions)Properties
optional
onerror: (e: ErrorEvent) => voidoptional
onmessage: (e: MessageEvent) => voidoptional
onmessageerror: (e: MessageEvent) => voidMethods
addEventListener<K extends keyof WorkerEventMap>(): void
type: K,
listener: (this: Worker, ev: WorkerEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
addEventListener(): void
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
postMessage(message: any, transfer: Transferable[]): void
postMessage(message: any, options?: StructuredSerializeOptions): void
removeEventListener<K extends keyof WorkerEventMap>(): void
type: K,
listener: (this: Worker, ev: WorkerEventMap[K]) => any,
options?: boolean | EventListenerOptions,
removeEventListener(): void
terminate(): void