BroadcastChannel
interface BroadcastChannel extends EventTarget {
readonly name: string;
onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
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;close(): void;
postMessage(message: any): void;
removeEventListener<K extends keyof BroadcastChannelEventMap>(
type: K,
listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
}type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;var BroadcastChannel: {
prototype: BroadcastChannel;
new (name: string): BroadcastChannel;
};§Extends
§Properties
§
onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null
[src]§
onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null
[src]§Methods
§
addEventListener<K extends keyof BroadcastChannelEventMap>(
[src]type: K,
listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
postMessage(message: any): void
[src]Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.
§
removeEventListener<K extends keyof BroadcastChannelEventMap>(
[src]type: K,
listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void