import { type ChatDeliveryState, type ChatDeliveryEvent } from './Lifecycle.js'; import type { RuntimeTransport } from './types.js'; export interface ChatMessage { id: string; userId: string; text: string; channel: string; sentAt: number; raw?: unknown; } type ChatHistory = { from: ChatDeliveryState; event: ChatDeliveryEvent; to: ChatDeliveryState; }[]; /** Room-scoped realtime chat. Messages never cross rooms or games. */ export declare class ChatClient { private readonly transport; readonly roomId: string; readonly channel: string; private readonly onListenerError?; private readonly canSend; private readonly timeoutMs; private readonly retryBaseMs; private readonly canQueue; private listeners; private seen; private pending; private histories; constructor(transport: RuntimeTransport, roomId: string, channel?: string, onListenerError?: ((error: Error) => void) | undefined, canSend?: () => boolean, timeoutMs?: number, retryBaseMs?: number, canQueue?: () => boolean); onMessage(listener: (message: ChatMessage) => void): () => void; send(text: string): Promise; private attempt; private schedule; /** @internal A recovered room can resume pending delivery without waiting for backoff. */ flush(): void; private remember; private finish; /** @internal Delivery diagnostics contain only transitions, never text. */ deliveryHistory(id: string): ChatHistory; /** @internal Explicit room leave cancels queued chat immediately. */ cancelPending(error?: Error): void; /** @internal Correlates a Runtime error frame with a pending message. */ reject(id: string, error: Error): void; /** Called by RoomClient integrations to feed chat envelopes. */ receive(payload: any): void; } export {};