import { default as React } from 'react'; import { Editor } from '@tiptap/core'; import { IComment } from '../extensions/comment'; import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin'; import { CommentMutationMeta, SerializedCommentAnchor } from '../types'; import { createCommentStore } from './comment-store'; import * as Y from 'yjs'; export interface CommentStoreProviderProps { children: React.ReactNode; editor: Editor | null; ydoc: Y.Doc; isFocusMode?: boolean; setActiveCommentId: (id: string | null) => void; focusCommentWithActiveId: (id: string) => void; setInitialComments?: React.Dispatch>; onNewComment?: (comment: IComment, meta?: CommentMutationMeta) => void; onEditComment?: (commentId: string, meta?: CommentMutationMeta) => void; onEditReply?: (commentId: string, replyId: string, meta?: CommentMutationMeta) => void; onCommentReply?: (activeCommentId: string, reply: IComment) => void; onResolveComment?: (commentId: string, meta?: CommentMutationMeta) => void; onUnresolveComment?: (commentId: string, meta?: CommentMutationMeta) => void; onDeleteComment?: (commentId: string, meta?: CommentMutationMeta) => void; onDeleteReply?: (commentId: string, replyId: string) => void; onInlineComment?: () => void; onComment?: () => void; setCommentDrawerOpen?: (open: boolean) => void; connectViaWallet?: () => Promise; connectViaUsername?: (username: string) => Promise; ensResolutionUrl: string; commentAnchorsRef?: React.MutableRefObject; draftAnchorsRef?: React.MutableRefObject; /** * Ref populated by the provider with the Zustand store instance. * SuggestionTrackingExtension reads this inside event handlers to route * keystrokes into draft actions without rebuilding the editor. */ storeApiRef?: React.MutableRefObject | null>; initialCommentAnchors?: SerializedCommentAnchor[]; initialComments: IComment[]; username: string | null; activeCommentId: string | null; activeTabId: string; isConnected?: boolean; isLoading?: boolean; isDDocOwner?: boolean; /** Inline comments usable — see ddoc-editor.tsx's derivation. */ isInlineCommentAvailable?: boolean; setUsername?: React.Dispatch>; } export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onDeleteReply, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, draftAnchorsRef, storeApiRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, isInlineCommentAvailable, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element; interface CommentRefsContextType { commentsSectionRef: React.RefObject; replySectionRef: React.RefObject; portalRef: React.RefObject; buttonRef: React.RefObject; dropdownRef: React.RefObject; mobileDraftRef: React.RefObject; } export declare const useCommentRefs: () => CommentRefsContextType; interface CommentAnchorsContextType { activeCommentAnchorIds: Set; activeCommentAnchorIdsTabId: string | null; hasRenderedCommentAnchor: (commentId: string) => boolean; } export declare const useCommentAnchors: () => CommentAnchorsContextType; export {};