import type { Block, TextRun } from './model.js'; import { type CommentContinuation } from './comment-spans.js'; import { type XmlDocument, type XmlElement } from './xml.js'; /** How this paragraph's comment and move ranges continue across paragraphs, plus new range ids. */ export interface ParagraphRanges extends CommentContinuation { /** `w:id`s for move ranges that have none yet (new moves), by range key. */ rangeIds: ReadonlyMap; } /** Comment range continuations in the blocks being written and in the part as loaded. */ export interface CommentSpans { next: Map; original: Map; /** Fresh `w:id`s for move ranges created in the editor (their runs carry no range id yet). */ rangeIds: Map; /** Allocates `w:id`s for new annotations such as bookmarks. */ nextId: () => string; } /** * Hands out annotation `w:id`s (bookmarks, move ranges) after the largest id already in the part * or among the model's revisions, so new markers never collide with existing ones. */ export declare function annotationIdAllocator(doc: XmlDocument, blocks: Block[]): () => string; /** `w:id`s for move ranges created in the editor, whose runs carry no range id yet. */ export declare function newMoveRangeIds(blocks: Block[], nextId: () => string): Map; /** A range marker to emit around a run: a comment anchor or a move range. */ export type RangeEdge = { kind: 'comment'; id: string; } | { kind: 'moveFrom' | 'moveTo'; name: string; rangeId: string; revision: TextRun['revision']; }; export declare function rangeStartNodes(doc: XmlDocument, edge: RangeEdge): XmlElement[]; export declare function rangeEndNodes(doc: XmlDocument, edge: RangeEdge): XmlElement[]; /** Range edges per run index: where each comment or move range opens and closes in this paragraph. */ export declare function rangeEdges(runs: TextRun[], ranges: ParagraphRanges | undefined): { opens: Map; closes: Map; }; //# sourceMappingURL=write-ranges.d.ts.map