UNPKG

@veltdev/tiptap-velt-comments

Version:

Tiptap Extension to add Google Docs-style overlay comments to your Tiptap editor. Works with the Velt Collaboration SDK.

40 lines (39 loc) 1.37 kB
import { Editor } from '@tiptap/core'; import type { CommentAnnotation } from '@veltdev/types'; import type { Plugin } from './plugin'; import type { AnnotationData, PluginReference } from './types'; type GlobalStore = { editor?: Editor | null; comments?: CommentAnnotation[]; filteredComments?: CommentAnnotation[]; selectedCommentsMap?: Map<string, boolean>; }; /** * Interface for annotation store entry */ interface AnnotationStoreEntry { annotation: AnnotationData; pluginReference: PluginReference; } export declare class StoreService { static storeInstanceMap: Map<string, StoreService>; plugin: Plugin; isSubscribed: boolean; globalStore: GlobalStore; globalAnnotationStore: Map<string, AnnotationStoreEntry>; /** * Helper to get and set annotations with debug messages */ annotationStore: { get: (id: string) => AnnotationStoreEntry | undefined; set: (id: string, data: AnnotationStoreEntry) => void; getAll: () => Map<string, AnnotationStoreEntry>; clear: () => void; remove: (id: string) => void; hasAnnotationTextChanged: (annotationId: string, currentAnnotation: AnnotationData) => boolean; }; constructor(plugin: Plugin); updateGlobalStore: (store: GlobalStore) => void; highlightCommentsFromGlobalStore: () => void; } export {};