/** * The smallest set of ProseMirror steps that turns one document into another. * * The spike's binding replaced the whole document on every remote keystroke — * `tr.replace(0, size, …)`. That throws away the caret, every decoration, and * every node view, and its cost grows with the document rather than with the * edit. It is the second half of the ED-02 rewrite (the first being the live * cursor in `cursor.ts`). * * The recursion below is cheap because the Loro → ProseMirror projection reuses * the *same node objects* for untouched subtrees (see `LoroPmMapping`), so the * common prefix and suffix are found by reference comparison and the walk only * descends into what actually changed. */ import { type Node as PmNode } from 'prosemirror-model'; import type { Transaction } from 'prosemirror-state'; /** * Add the steps that turn `old_doc` into `new_doc` to `tr`. * * The transaction is returned for chaining; check `tr.docChanged` before * dispatching, because "nothing changed" is the common case for an event batch * that only touched containers this editor already agrees with. */ export declare function applyPmDiff(tr: Transaction, old_doc: PmNode, new_doc: PmNode): Transaction; //# sourceMappingURL=diff.d.ts.map