From d632cce129cb7025a34cf0aa7262a38fb12f47c4 Mon Sep 17 00:00:00 2001 From: ud2 Date: Tue, 4 Jul 2023 02:36:55 +0800 Subject: 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. --- ext/broadcast_channel/lib.deno_broadcast_channel.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/broadcast_channel/lib.deno_broadcast_channel.d.ts') 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 @@ /// /** @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; }; -- cgit v1.2.3