/** * Relay Service Types * Real-time collaboration, WebSocket, OT, presence */ export interface WebSocketMessage { type: string; data: unknown; timestamp?: number; clientId?: string; userId?: string; } export interface UseWebSocketOptions { autoConnect?: boolean; reconnectInterval?: number; maxReconnectAttempts?: number; onMessage?: (message: WebSocketMessage) => void; onConnected?: () => void; onDisconnected?: () => void; onError?: (error: Error) => void; } export interface UseOTOptions { initialContent?: string; userId?: string; clientId?: string; } export interface UseOTReturn { content: string; version: number; applyChange: (changes: unknown) => boolean; insertText: (index: number, text: string) => boolean; deleteText: (index: number, length: number) => boolean; undo: () => boolean; redo: () => boolean; reset: (content: string) => void; } export interface UseOTSyncOptions extends UseOTOptions { wsUrl?: string; syncInterval?: number; maxRetries?: number; onSyncComplete?: () => void; onSyncError?: (error: Error) => void; } export interface UseOTSyncReturn extends UseOTReturn { isSyncing: boolean; isConnected: boolean; syncError: Error | null; syncNow: () => Promise; } export interface UserPresence { userId: string; clientId: string; name?: string; cursor?: { line: number; column: number; }; selection?: { start: number; end: number; }; color?: string; } export interface UsePresenceOptions { documentId?: string; onError?: (error: Error) => void; } export interface UsePresenceReturn { collaborators: UserPresence[]; localPresence: UserPresence | null; updatePresence: (presence: Partial) => Promise; } export interface UseCollaborationOptions { documentId: string; userId: string; wsUrl?: string; onError?: (error: Error) => void; } //# sourceMappingURL=types.d.ts.map