summaryrefslogtreecommitdiff
path: root/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts
diff options
context:
space:
mode:
authorud2 <sjx233@qq.com>2023-07-04 02:36:55 +0800
committerGitHub <noreply@github.com>2023-07-03 14:36:55 -0400
commitd632cce129cb7025a34cf0aa7262a38fb12f47c4 (patch)
tree6fe672badbe6ea0fb8a30ecc88b74c613aaa7370 /ext/broadcast_channel/lib.deno_broadcast_channel.d.ts
parente8a866ca8a682b552722926161a7816c5cf94124 (diff)
fix(dts): make globals available on globalThis (#19438)
This PR changes Web IDL interfaces to be declared with `var` instead of `class`, so that accessing them via `globalThis` does not raise type errors. Closes #13390.
Diffstat (limited to 'ext/broadcast_channel/lib.deno_broadcast_channel.d.ts')
-rw-r--r--ext/broadcast_channel/lib.deno_broadcast_channel.d.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts b/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts
index ea01bef36..1ffd6532d 100644
--- a/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts
+++ b/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts
@@ -6,13 +6,13 @@
/// <reference lib="esnext" />
/** @category Broadcast Channel */
-interface BroadcastChannelEventMap {
+declare interface BroadcastChannelEventMap {
"message": MessageEvent;
"messageerror": MessageEvent;
}
/** @category Broadcast Channel */
-interface BroadcastChannel extends EventTarget {
+declare interface BroadcastChannel extends EventTarget {
/**
* Returns the channel name (as passed to the constructor).
*/
@@ -53,6 +53,6 @@ interface BroadcastChannel extends EventTarget {
/** @category Broadcast Channel */
declare var BroadcastChannel: {
- prototype: BroadcastChannel;
+ readonly prototype: BroadcastChannel;
new (name: string): BroadcastChannel;
};