import { type Node as PMNode, type Schema } from 'prosemirror-model'; import type { Diff } from './types'; import { type SuggestionSubtype } from '../plugins/suggestions/plugin-suggestions'; export interface DiffSuggestionRef { id: string; type: SuggestionSubtype; } /** * Builds a single ProseMirror document from a diff: inserted content is kept * and marked with the suggestion mark's "insert" subtype (or, for a whole * inserted node, a `suggestions` attr entry of type "insert"), deleted content * is kept in place and marked "delete" (or a `suggestions` attr entry of type * "delete") - a track-changes style merged view of both documents, using the * same mark/attr as the live suggestion-mode plugin (see * src/lib/plugins/suggestions), so the result can be shown in an editable * editor with that plugin attached and reviewed (accepted/rejected) exactly * like a live-typed suggestion. Must use the same Schema instance the diff * was computed with. * * No author is embedded (the schema no longer carries one - see * marks.suggestion in schema.ts) - the returned `suggestions` list lets the * caller attribute the whole batch and seed the suggestions plugin's cache, * e.g. via seedSuggestionSource(view, suggestions.map(s => ({...s, author}))). */ export declare function buildDiffDoc(diffs: Diff[], schema: Schema): { doc: PMNode; suggestions: DiffSuggestionRef[]; };