import { ReactNode } from 'react'; import { TextMessageAuthorType } from './types/message-types'; /** * Explicit view states for the threaded annotations panel. * Replaces the ambiguous `isExpanded` boolean with named states * so impossible combinations (e.g. editor open while replies disabled) * are unrepresentable. */ export declare enum ThreadViewState { /** Default — root + last reply visible, no editor. */ Collapsed = "collapsed", /** All replies visible, editor hidden (resolved / reply-disabled threads). */ RepliesOnly = "repliesOnly", /** All replies visible + editor open. */ Composing = "composing" } export type ThreadEvent = { type: 'EXPAND'; } | { type: 'REPLY'; author: TextMessageAuthorType; } /** No-op when `isEditDisabled` is true. */ | { type: 'EDIT'; id: string; } | { type: 'CLEAR_EDIT'; } | { type: 'COLLAPSE'; } | { type: 'CLEAR_MENTION'; }; export interface ThreadedAnnotationsContextValue { viewState: ThreadViewState; replyMention: TextMessageAuthorType | null; /** * Id of the message currently being edited, or null. Cleared on CLEAR_EDIT/COLLAPSE, when * `isEditDisabled` or `collapsed` flip true, or when the id disappears from the messages list. */ editingMessageId: string | null; /** Whether the component is rendered in annotation mode (scrollable, fixed-height) vs comments mode. */ isAnnotations: boolean; /** When true, globally disables replies (hides reply buttons and blocks editor opening on click). */ isReplyDisabled: boolean; /** When true, globally disables edits (hides the Edit menu item and blocks EDIT dispatch). */ isEditDisabled: boolean; dispatch: (event: ThreadEvent) => void; } export interface ThreadedAnnotationsProviderProps { children: ReactNode; defaultExpanded?: boolean; /** When true, globally disables replies (hides reply buttons and blocks editor opening on click). */ isReplyDisabled?: boolean; /** When true, globally disables edits (hides the Edit menu item and blocks EDIT dispatch). */ isEditDisabled?: boolean; /** When true, forces the panel to the Collapsed state. */ collapsed?: boolean; /** Whether the component is rendered in annotation mode (scrollable, fixed-height) vs comments mode. */ isAnnotations?: boolean; } export declare const ThreadedAnnotationsProvider: ({ children, defaultExpanded, isReplyDisabled, isEditDisabled, collapsed, isAnnotations, }: ThreadedAnnotationsProviderProps) => import("react/jsx-runtime").JSX.Element; export declare const useThreadedAnnotationsContext: () => ThreadedAnnotationsContextValue;