/** * useVersionHistory Hook * TASKSET 9 Phase 8: Real-time version history updates via MessageRouter * * Provides: * - Real-time version snapshot creation * - Version restoration notifications * - Version comparison events * - Version history access tracking */ export interface Version { id: string; documentId: string; versionNumber: number; createdBy: string; snapshotSize: number; createdAt: Date; restoredBy?: string; restoredAt?: Date; newVersionNumber?: number; } export interface VersionComparison { documentId: string; versionFrom: number; versionTo: number; userId: string; diffSize: number; comparedAt: Date; diff: string; addedLines: number; removedLines: number; changedLines: number; fromTimestamp: Date; toTimestamp: Date; } export interface UseVersionHistoryOptions { documentId: string; wsUrl?: string; /** * Use shared relay connection from RelayProvider context. * When true, the hook will not create its own WebSocket connection * and will instead use the shared connection from useRelay(). * @default false */ useSharedConnection?: boolean; onVersionCreated?: (version: Version) => void; onVersionRestored?: (version: Version) => void; onVersionCompared?: (comparison: VersionComparison) => void; onError?: (error: Error) => void; } export interface UseVersionHistoryReturn { versions: Version[]; currentVersion: Version | null; comparison: VersionComparison | null; comparisons: VersionComparison[]; isConnected: boolean; error: Error | null; createSnapshot: (snapshotSize: number) => Promise; restoreVersion: (versionNumber: number) => Promise; compareVersions: (versionFrom: number, versionTo: number) => Promise; clearComparison: () => void; } /** * Real-time version history management hook */ export declare const useVersionHistory: (options: UseVersionHistoryOptions) => UseVersionHistoryReturn; //# sourceMappingURL=useVersionHistory.d.ts.map