import type { PresenceSnapshot, RealtimeEvent, RealtimeTopic } from "./events.js"; export type RealtimeSubscriber = (event: RealtimeEvent) => void | Promise; export type Unsubscribe = () => void; export interface PresenceConnection { readonly connectionId: string; readonly userId: string; } /** * Transport-neutral ephemeral fanout. A Redis adapter can implement the same * contract without changing route code. No implementation may treat it as the * source of truth for sync state. */ export interface PubSub { publish(topic: RealtimeTopic, event: RealtimeEvent): Promise; subscribe(topic: RealtimeTopic, subscriber: RealtimeSubscriber): Unsubscribe; connectPresence(connection: PresenceConnection): Promise; recordPresenceActivity(connectionId: string, occurredAt?: number): Promise; disconnectPresence(connectionId: string, occurredAt?: number): Promise; getPresenceSnapshot(userIds?: readonly string[]): Promise; close(): Promise; } export declare class PubSubClosedError extends Error { constructor(); } //# sourceMappingURL=pubsub.d.ts.map