interface BroadcastChannel
extends EventTarget
Represents a named channel that any
BroadcastChannel with the same name (across workers or isolates
in the same Deno process) can use to send and receive messages, allowing
one-to-many communication between execution contexts.
Properties #
#onmessage: ((this: BroadcastChannel,ev: MessageEvent,) => any) | null #onmessageerror: ((this: BroadcastChannel,ev: MessageEvent,) => any) | null Methods #
#postMessage(message: any): void Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.
#addEventListener<K extends keyof BroadcastChannelEventMap>(type: K,listener: (this: BroadcastChannel,ev: BroadcastChannelEventMap[K],) => any,options?: boolean | AddEventListenerOptions,): void #addEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | AddEventListenerOptions,): void #removeEventListener<K extends keyof BroadcastChannelEventMap>(type: K,listener: (this: BroadcastChannel,ev: BroadcastChannelEventMap[K],) => any,options?: boolean | EventListenerOptions,): void #removeEventListener(): void variable BroadcastChannel
The constructor object for BroadcastChannel.
Construct a channel with new BroadcastChannel(name) to join the channel
identified by name; messages posted on it are delivered to every other
BroadcastChannel connected to the same name.
Properties #
#prototype: BroadcastChannel readonly