import { Plugin, PluginKey } from "prosemirror-state"; import type { EditorView } from "prosemirror-view"; export interface RemoteCursorUser { name: string; color: string; picture?: string; } export interface RemoteCursor { clientId: string; from: number; to: number; user: RemoteCursorUser; } export interface CursorsPluginConfig { onLocalCursorChange: (cursor: { from: number; to: number; } | null) => void; debounceMs?: number; } export interface CursorsPluginState { cursors: RemoteCursor[]; } export declare const cursorsPluginKey: PluginKey; /** * Renders other user's cursors as decorations (caret + tinted selection range + tooltip on hovering) * and, reports the current user's own selection changes to the host app via `onLocalCursorChange` */ export default function cursorsPlugin(config: CursorsPluginConfig): Plugin; export declare function setRemoteCursors(view: EditorView, cursors: RemoteCursor[]): void;