/** * Document transforms on suggestions — pure functions over a transaction. * * Every transform marks its transaction as internal (never tracked, never locked) and keeps it out * of the undo history: undoing a commit, an accept or a reject would leave Velt and the document * disagreeing about the suggestion. * * Marks are removed by INSTANCE (the suggestion's own wrapper), so an overlapping suggestion on the * same text is left alone. */ import type { Node as PMNode } from '@tiptap/pm/model'; import type { EditorState, Transaction } from '@tiptap/pm/state'; import type { SuggestionAuthor } from './types'; /** Gives a pending cluster its Velt target id. False when the cluster is gone. */ export declare const promoteCluster: (tr: Transaction, state: EditorState, pendingId: string, targetId: string) => boolean; /** Accepted in Velt → apply the change. False when this document has no such suggestion. */ export declare const applyAccepted: (tr: Transaction, state: EditorState, targetId: string) => boolean; /** Rejected or stale in Velt → drop the change. False when this document has no such suggestion. */ export declare const applyRejected: (tr: Transaction, state: EditorState, targetId: string) => boolean; /** Drops a pending cluster (e.g. Velt refused it as no change). */ export declare const revertPendingCluster: (tr: Transaction, state: EditorState, pendingId: string) => boolean; /** * Marks `[from, to)` as replaced by `text` (a pending cluster; `text` may be empty for a deletion, * `from === to` for an insertion). Returns the cluster id, or null when there is nothing to suggest. */ export declare const markReplacement: (tr: Transaction, state: EditorState, range: { from: number; to: number; }, text: string, author: SuggestionAuthor) => string | null; /** * The document as it would read with every PENDING suggestion dropped (pending insertions removed, * pending deletions and format changes undone); committed suggestions are kept, marks and all. * Use it to save content while edits are still pending. */ export declare const withoutPendingSuggestions: (state: EditorState) => PMNode;