/** * useComments Hook * TASKSET 9 Phase 8: Real-time comment updates via MessageRouter * * Provides: * - Real-time comment creation/update/deletion * - Comment reactions * - Comment replies * - Thread updates */ export interface Comment { id: string; documentId: string; userId: string; content: string; position?: number; parentId?: string; resolved?: boolean; resolvedBy?: string; reactions?: Array<{ userId: string; emoji: string; }>; replies?: Comment[]; createdAt: Date; updatedAt: Date; } export interface UseCommentsOptions { 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; onCommentCreated?: (comment: Comment) => void; onCommentUpdated?: (comment: Comment) => void; onCommentDeleted?: (commentId: string) => void; onCommentResolved?: (commentId: string, resolvedBy: string) => void; onError?: (error: Error) => void; } export interface UseCommentsReturn { comments: Comment[]; isConnected: boolean; error: Error | null; addComment: (comment: Omit) => Promise; updateComment: (commentId: string, content: string) => Promise; deleteComment: (commentId: string) => Promise; resolveComment: (commentId: string) => Promise; addReaction: (commentId: string, emoji: string) => Promise; removeReaction: (commentId: string, emoji: string) => Promise; } /** * Real-time comment management hook */ export declare const useComments: (options: UseCommentsOptions) => UseCommentsReturn; //# sourceMappingURL=useComments.d.ts.map