/**
 * `@platform-modules/realtime` — isomorphic wire contract for the realtime substrate.
 *
 * This barrel is TYPE-ONLY and browser-safe: it carries no runtime code and no
 * Workers globals, so a browser/SSR consumer (e.g. `@platform-modules/realtime-react`) can import
 * it without dragging `Queue`/`DurableObjectState` into a DOM compile.
 *
 * The Workers-locked server helpers (Durable Object accept/broadcast, Queue
 * publish/consume, constant-time secret verify) live behind the `/server`
 * subpath (`@platform-modules/realtime/server`) — never imported here, so this
 * barrel stays free of Workers globals.
 */
/**
 * Producer→queue→DO transport event. The module owns the envelope (idempotency id,
 * timestamp, scope, the security-critical targetUserId); the HOST owns `type` + `payload`.
 * Generic so the host's event-type union and payload map are the contract, not `unknown`.
 */
interface RealtimeEvent<TType extends string = string, TPayload = unknown> {
    id: string;
    type: TType;
    scope: string;
    targetUserId?: string;
    payload: TPayload;
    timestamp: string;
}
/**
 * DO→client wire frame convention. `v` is the wire-compat version — the one boundary a
 * connected browser pins against; bump on a breaking frame change. The host extends with
 * its own `type` union + fields. (One prior app already versions its frames `v:1`; another did not
 * — versioning here adopts the more forward-compatible convention as the seam default.)
 */
interface ServerFrame<TType extends string = string> {
    v: number;
    type: TType;
}

export type { RealtimeEvent, ServerFrame };
