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.