import { ISocketInitConfig, SocketStatusEnum, SendUpdateResponse, HydrationResponse, SnapshotResponse, AckResponse } from './types'; import { Awareness } from 'y-protocols/awareness.js'; interface ISocketClientConfig { wsUrl: string; roomKey: string; roomId: string; ownerEdSecret?: string; contractAddress?: string; ownerAddress?: string; editLock?: string; encryptedTitle?: string; identityToken?: string; editUcan?: string; refreshEditClaim?: () => Promise<{ status: 'ok'; token: string; } | { status: 'demoted'; } | { status: 'unavailable'; }>; onRotationPrepare?: (inner: { epoch: number; gp: string; appLock?: string; }) => Promise; onEpochAvailable?: (data: { roomId: string; epoch: number; payload: string; }) => void | Promise; onCutover?: (data: { roomId: string; epoch: number; }) => void | Promise; actorHandle?: string; joinOnly?: boolean; onHandshakeData?: (response: { data: AckResponse; roomKey: string; }) => void; roomInfo?: { documentTitle: string; portalAddress: string; commentKey: string; }; } export declare class SocketClient { private _socketUrl; private _restBase; private _lastSessionToken; private _socket; private _webSocketStatus; private _isIntentionalDisconnect; get isConnected(): boolean; get status(): SocketStatusEnum; private _websocketServiceDid; private roomId; roomMembers: string[]; private _lastPresenceSignature; private _onPresenceChange?; private _pendingAwarenessUpdates; private collaborationKeyPair; private ownerKeyPair?; private contractAddress?; private ownerUcan?; private collaborationUcan?; private ownerAddress?; private editLock?; private encryptedTitle?; private identityToken?; private editUcan?; private refreshEditClaim?; private lastGoodEditUcan?; private actorHandle?; private joinOnly?; private roomKey; private roomInfo?; private awareness; private connectionAttemptErrorCount; private _onHandshakeData; private _onEpochAvailable; private _onCutover; private _rotating; constructor(config: ISocketClientConfig); registerAwareness(awareness: Awareness): void; private _stampSocketId; private _emitWithAck; private _fetchRoomMembers; private _recomputePresence; sendUpdate({ update }: { update: string; }): Promise; fetchHydrationRange(sinceSeq?: number): Promise; sendSnapshot({ data, floorSeq, publishedMarker, }: { data: string; floorSeq: number; publishedMarker?: string | null; }): Promise; sendMirrorSnapshot({ data, fileKeyEpoch, }: { data: string; fileKeyEpoch: number; }): Promise>; setDocumentMeta(): Promise; /** Owner rename mid-session: refresh the connect-frozen title artifacts (so * every later /auth re-sends current values), persist server-side, and let * the server broadcast /document/meta_update to room peers. */ updateDocumentMeta(args: { encryptedTitle: string; documentTitle: string; }): Promise; broadcastAwareness(awarenessUpdate: string): Promise; disconnect: () => void; reauth: () => void; rekey(newRoomKey: string, newAppLock?: string, newEditUcan?: string): Promise; ackEpochLoaded(documentId: string, epoch: number): Promise; terminateSession: () => Promise; flushBeacon(mergedUpdate: string): void; private getCollaborationKeyPair; private isUcanValid; private getOwnerToken; private buildSessionToken; private _authenticate; private _handleHandShake; private _handleAwarenessUpdate; connectSocket(config: ISocketInitConfig): Promise; private _onSessionTerminated; private resetSocketClient; } export {};