Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/websocket_broadcastchannel/src/types.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/src/types.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; }