import { Step } from "prosemirror-transform"; import { Plugin, PluginKey } from "prosemirror-state"; import type { EditorView } from "prosemirror-view"; export type CollabClientID = string | number; export type CollabStepJSON = ReturnType; export interface CollabSendable { version: number; steps: CollabStepJSON[]; clientID: CollabClientID; } export interface CollabPluginConfig { version?: number; clientID?: CollabClientID; onSendable: (sendable: CollabSendable) => void; } export declare const collabPluginKey: PluginKey; /** * Wraps prosemirror-collab's `collab` plugin to support `onSendable()` callback and `receiveSteps()` method. */ export default function collabPlugin(config: CollabPluginConfig): Plugin[]; /** * Turns steps received from the server-side authority (already parsed from * JSON, in wire order, alongside the clientID that produced each one) into a * transaction and dispatches it. Must be called for every batch broadcast by * the authority, including batches made up of this client's own steps being * confirmed - prosemirror-collab uses the clientIDs to tell the two cases * apart. Called from Editor.svelte's exposed `collab.receiveSteps()`. */ export declare function receiveCollabSteps(view: EditorView, steps: CollabStepJSON[], clientIDs: CollabClientID[]): void; export declare function getCollabVersion(view: EditorView): number;