/** * Debug channel — the order-independent handshake between the SDK core and the * optional `@colyseus/sdk/debug` overlay. * * Publishers (a joined room in {@link Client}, a `Predict` instance) call * {@link publishDebug} whenever there's something the overlay could surface. If * the overlay is already loaded it renders immediately; if it loads LATER — the * usual dev-only `import("@colyseus/sdk/debug")` races the first room join — * {@link setDebugReceiver} REPLAYS what was buffered. No app-side ordering * (awaiting the import) is required, and a publisher that fires before the * overlay loads is never dropped. * * Module-private on purpose: rooms are reachable only by importing the overlay. * Nothing here may read or write a global — a page script could then read a * buffered room, or plant its own receiver and be handed every join. * * Production (overlay never imported) stays effectively free: the buffer holds * WeakRefs so nothing is pinned, and is bounded — an app that never loads the * overlay leaks neither memory nor room references. * * The script-tag builds share no module graph, so rollup swaps this file for * `debug-channel.umd.ts` there. */ export type DebugReceiver = (channel: string, handle: object) => void; /** * Publish a `handle` to the overlay `channel` (`"room"` | `"predict"` | …). * Prod fast path: a live call (overlay loaded) or a bounded WeakRef append * (buffered for replay on install). */ export declare function publishDebug(channel: string, handle: object): void; /** * Connect the overlay and replay everything buffered before it loaded. `undefined` * disconnects it again. */ export declare function setDebugReceiver(next: DebugReceiver | undefined): void; /** * True only when the overlay is connected. Diagnostics that must stay free in * production (reconciler drift bookkeeping) gate on this. */ export declare function debugOverlayActive(): boolean;