Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/websocket_broadcastchannel/mod.ts>GlobalThisWithBroadcastChannel

Host-wide BroadcastChannel for Deno CLI, backed by WebSockets.
Latest
type alias GlobalThisWithBroadcastChannel
import { type GlobalThisWithBroadcastChannel } from "https://deno.land/x/websocket_broadcastchannel@0.8.0/mod.ts";

What globalThis looks like when it has BroadcastChannel.

We use this to convince TypeScript that globalThis.BroadcastChannel exists, so typechecking passes. Then we use runtime checks to ensure that it actually exists.

definition: globalThis & { BroadcastChannel: BroadcastChannelConstructor; }