mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 09:39:08 -05:00
a69b4646a0
Updating categories for new sitemap as documented here: https://lucid.app/lucidspark/744b0498-a133-494d-981c-76059dd18885/edit?view_items=jpvBwFdYlNdB&invitationId=inv_50c83415-2aa5-423f-b438-ea156695c08b
67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
// deno-lint-ignore-file no-explicit-any no-var
|
|
|
|
/// <reference no-default-lib="true" />
|
|
/// <reference lib="esnext" />
|
|
|
|
/**
|
|
* @category Messaging
|
|
* @tags unstable
|
|
*/
|
|
declare interface BroadcastChannelEventMap {
|
|
"message": MessageEvent;
|
|
"messageerror": MessageEvent;
|
|
}
|
|
|
|
/**
|
|
* @category Messaging
|
|
* @tags unstable
|
|
*/
|
|
declare interface BroadcastChannel extends EventTarget {
|
|
/**
|
|
* Returns the channel name (as passed to the constructor).
|
|
*/
|
|
readonly name: string;
|
|
onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
|
|
onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
|
|
/**
|
|
* Closes the BroadcastChannel object, opening it up to garbage collection.
|
|
*/
|
|
close(): 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.
|
|
*/
|
|
postMessage(message: any): void;
|
|
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(
|
|
type: string,
|
|
listener: EventListenerOrEventListenerObject,
|
|
options?: boolean | EventListenerOptions,
|
|
): void;
|
|
}
|
|
|
|
/**
|
|
* @category Messaging
|
|
* @tags unstable
|
|
*/
|
|
declare var BroadcastChannel: {
|
|
readonly prototype: BroadcastChannel;
|
|
new (name: string): BroadcastChannel;
|
|
};
|