import type { OfficeEntryMap } from '../../shared/ooxml/archive'; import type { WordReviewDocument, WordReviewWarning, WordRevision, WordRevisionRecord } from '../word/review/types'; /** 批注范围端点在标准正文模型中的字符位置。 */ type DocxCommentPosition = { /** 正文块稳定标识。 */ blockId: string; /** 当前块中的字符偏移。 */ offset: number; }; /** comments.xml 中不依赖正文范围的批注信息。 */ type DocxCommentDefinition = { /** OOXML 批注标识。 */ id: string; /** 批注作者。 */ author?: string; /** 批注创建日期。 */ createdAt?: string; /** 批注正文纯文本。 */ text: string; /** 批注正文首段标识,用于关联回复和解决状态。 */ paragraphId?: string; /** 回复所属的父批注标识。 */ parentId?: string; /** 批注线程是否已经解决。 */ resolved?: boolean; }; /** 正文解析期间持续补全的单条批注范围。 */ type DocxCommentRange = { /** commentRangeStart 对应的位置。 */ start?: DocxCommentPosition; /** commentRangeEnd 对应的位置。 */ end?: DocxCommentPosition; /** commentReference 对应的降级位置。 */ reference?: DocxCommentPosition; }; /** DOCX 正文和审阅部件共享的可变解析状态。 */ export type DocxReviewParseState = { /** 按源顺序排列的批注定义。 */ comments: readonly DocxCommentDefinition[]; /** 按批注标识索引的定义。 */ commentById: ReadonlyMap; /** 正文扫描期间收集的批注范围。 */ commentRanges: Map; /** 当前正文位置仍处于范围内的批注标识。 */ activeCommentIds: Set; /** 按稳定标识去重的修订记录。 */ revisions: Map; /** 解析降级诊断。 */ warnings: WordReviewWarning[]; /** 文档中第一个可用正文块,供损坏范围降级定位。 */ firstBlockId?: string; }; /** 建立 DOCX 审阅解析状态,正文解析只追加范围和修订。 */ export declare function createDocxReviewParseState(entries: OfficeEntryMap): DocxReviewParseState; /** 记录当前文档首个正文块,供损坏批注范围安全降级。 */ export declare function registerDocxReviewBlock(state: DocxReviewParseState, blockId: string): void; /** 开始追踪覆盖后续行内内容的批注范围。 */ export declare function startDocxCommentRange(state: DocxReviewParseState, id: string, position: DocxCommentPosition): void; /** 结束批注范围,并阻止后续内容继续继承该批注。 */ export declare function endDocxCommentRange(state: DocxReviewParseState, id: string, position: DocxCommentPosition): void; /** 记录批注引用字符的位置,供缺失范围标记时降级定位。 */ export declare function recordDocxCommentReference(state: DocxReviewParseState, id: string, position: DocxCommentPosition): void; /** 把当前范围内的批注标识复制到行内模型,避免泄露可变 Set。 */ export declare function getActiveDocxCommentIds(state: DocxReviewParseState): string[] | undefined; /** 按稳定标识登记修订,重复引用不会重复增加摘要数量。 */ export declare function recordDocxRevision(state: DocxReviewParseState, revision: WordRevision): Readonly<{ id: string; kind: import("../word/review/types").WordRevisionKind; author?: string | undefined; createdAt?: string | undefined; }>; /** 将正文范围与 comments.xml 定义合并为共享审阅模型。 */ export declare function buildDocxReviewDocument(state: DocxReviewParseState, noteCount?: number, revisionRecords?: readonly WordRevisionRecord[]): WordReviewDocument | undefined; export {};