import type { DocxBlock, DocxNote, DocxPageContent, DocxParagraphBlock } from './types'; /** 单个 DOCX 测量批次允许包含的普通内容块上限。 */ export declare const DOCX_MEASURE_BLOCK_LIMIT = 100; /** 单个 DOCX 测量批次允许包含的表格行上限。 */ export declare const DOCX_MEASURE_TABLE_ROW_LIMIT = 200; /** DOCX 分页测量过程需要保留的上下文。 */ export type DocxMeasurementContext = { /** 当前内容块之前的相邻内容块。 */ previousBlock?: DocxBlock; /** 文档节的零基索引。 */ sectionIndex: number; /** 当前批次是否延续上一页的表格。 */ continuedTable?: { /** 分页拆分前源内容块的稳定标识。 */ sourceBlockId: string; /** 当前批次已经消费的表格行数。 */ consumedRowCount: number; }; }; /** 一次提交到隐藏容器测量的 DOCX 内容批次。 */ export type DocxMeasurementBatch = { /** 在所属集合中的唯一标识。 */ id: string; /** 数据源变更时递增的修订号。 */ revision: number; /** 分页处理前所属的源页面。 */ sourcePage: DocxPageContent; /** 按源文档顺序排列的内容块。 */ blocks: readonly DocxBlock[]; /** 当前批次开始前保留的分页上下文。 */ contextBefore?: DocxMeasurementContext; /** 各表格行相对表格顶部的偏移。 */ rowOffsets: Readonly>; /** 各源表格在拆分前包含的行数。 */ originalTableRowCounts: Readonly>; /** 当前批次是否到达源页面末尾。 */ endOfSourcePage: boolean; }; /** 完成高度测量的 DOCX 内容块。 */ export type DocxMeasuredBlock = { /** 当前负责处理或渲染的内容块。 */ block: DocxBlock; /** 高度,单位为标准化渲染像素。 */ height: number; /** 内容块成为页首时需要额外占用的上边距。 */ leadingSpacing: number; /** 内容块位于页尾时最后一个可见字形占用的高度。 */ pageEndHeight?: number; /** 多行段落最后一行补足下半行距后的行盒底边。 */ paragraphLineBoxEndHeight?: number; /** 各表格行的测量高度。 */ rowHeights?: readonly number[]; /** 各表格行可在不裁切可见内容时使用的纵向拆分位置。 */ rowBreakOffsets?: readonly (readonly number[])[]; /** 当前表格行相对表格顶部的偏移。 */ rowOffset?: number; /** 当前表格在拆分前包含的总行数。 */ originalTableRowCount?: number; /** 纯文本段落在浏览器排版后的各行 UTF-16 结束偏移。 */ paragraphLineEndOffsets?: readonly number[]; /** 段落元素不含外边距的完整行盒高度。 */ paragraphBoxHeight?: number; /** 纯文本段落在浏览器排版后的实际行数。 */ paragraphLineCount?: number; /** 与 paragraphLineEndOffsets 一一对应的行级流式高度。 */ paragraphLineHeights?: readonly number[]; /** 当前正文块首次引用的脚注正文实测高度。 */ footnoteReserveHeight?: number; /** 当前正文块首次引用的脚注分页片段。 */ measuredFootnotes?: readonly DocxMeasuredFootnote[]; }; /** 已按页面容量拆分的单条脚注。 */ export type DocxMeasuredFootnote = Readonly<{ /** 源脚注标识。 */ noteId: string; /** 首段显示在引用页,其余片段按顺序进入脚注续页。 */ fragments: readonly Readonly<{ /** 当前页使用的脚注块片段。 */ note: DocxNote; /** 当前片段实测高度。 */ height: number; }>[]; }>; /** 判断段落是否可在不破坏复杂行内对象的前提下按浏览器实测行拆分。 */ export declare function canSplitMeasuredParagraph(block: DocxParagraphBlock): boolean; /** 按 UTF-16 偏移裁剪纯文本段落,同时保留跨行的文字样式。 */ export declare function sliceMeasuredParagraph(block: DocxParagraphBlock, startOffset: number, endOffset: number): { id: string; sourceBlockId: string; inlines: { text: string; type: "text"; preserveSpace?: boolean | undefined; style?: import("./types").DocxTextStyle | undefined; hyperlink?: import("../../..").OfficeHyperlink | undefined; advanceWidth?: number | undefined; review?: import("./types").DocxInlineReview | undefined; }[]; text: string; outlineLevel: number | undefined; keepNext: boolean | undefined; spacingBefore: number | undefined; spacingAfter: number | undefined; firstLineIndent: number | undefined; type: "paragraph"; review?: import("./types").DocxInlineReview | undefined; revisionHidden?: boolean | undefined; isTableOfContents?: boolean | undefined; keepLines?: boolean | undefined; widowControl?: boolean | undefined; paragraphStyleId?: string | undefined; contextualSpacing?: boolean | undefined; autoSpaceLatin?: boolean | undefined; autoSpaceNumber?: boolean | undefined; tabStops?: import("./types").DocxTabStop[] | undefined; align?: "center" | "left" | "right" | "justify" | undefined; lineHeight?: number | undefined; inferredHeadingLineHeight?: boolean | undefined; minimumHeight?: number | undefined; style?: import("./types").DocxTextStyle | undefined; indentLeft?: number | undefined; indentRight?: number | undefined; backgroundColor?: string | undefined; borderTop?: string | undefined; borderRight?: string | undefined; borderBottom?: string | undefined; borderLeft?: string | undefined; hasBorderTop?: boolean | undefined; hasBorderRight?: boolean | undefined; hasBorderBottom?: boolean | undefined; hasBorderLeft?: boolean | undefined; paddingTop?: number | undefined; paddingRight?: number | undefined; paddingBottom?: number | undefined; paddingLeft?: number | undefined; position?: import("./types").DocxPosition | undefined; }; /** 按正文块和表格行双阈值切分隐藏测量批次。 */ export declare function createDocxMeasurementBatches(sourcePage: DocxPageContent, firstRevision: number): DocxMeasurementBatch[]; /** 使用浏览器测得的块和行高,复用现有 DOCX 溢出分页规则。 */ export declare function paginateMeasuredDocxPage(sourcePage: DocxPageContent, measuredBlocks: readonly DocxMeasuredBlock[]): DocxPageContent[];