@stll/folio-core 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (449) hide show
  1. package/dist/ai-edits/apply.d.ts +2 -2
  2. package/dist/ai-edits/blockRange.d.ts +3 -17
  3. package/dist/ai-edits/clean-text.d.ts +0 -1
  4. package/dist/ai-edits/headless.d.ts +23 -19
  5. package/dist/ai-edits/read.d.ts +8 -5
  6. package/dist/ai-edits/scoped-reading.d.ts +0 -1
  7. package/dist/ai-edits/snapshot.d.ts +1 -7
  8. package/dist/ai-edits/table-cell-mutations.d.ts +4 -31
  9. package/dist/ai-edits/table-row-column-mutations.d.ts +9 -39
  10. package/dist/ai-edits/table-targets.d.ts +0 -1
  11. package/dist/ai-edits/types.d.ts +32 -17
  12. package/dist/ai-suggestions/apply.d.ts +0 -1
  13. package/dist/ai-suggestions/conflict.d.ts +0 -1
  14. package/dist/ai-suggestions/text-positions.d.ts +2 -2
  15. package/dist/ai-suggestions/types.d.ts +27 -13
  16. package/dist/content-controls/errors.d.ts +0 -1
  17. package/dist/content-controls/findContentControls.d.ts +6 -4
  18. package/dist/content-controls/mutateContentControls.d.ts +0 -1
  19. package/dist/controller/activeEditorStory.d.ts +1 -6
  20. package/dist/controller/collaborationModules.d.ts +0 -1
  21. package/dist/controller/contentControlWidgetController.d.ts +0 -1
  22. package/dist/controller/folioEditor.d.ts +2 -2
  23. package/dist/controller/folioEditorEvents.d.ts +5 -3
  24. package/dist/controller/fontReadiness.d.ts +0 -1
  25. package/dist/controller/headerFooterEditorManager.d.ts +1 -5
  26. package/dist/controller/hiddenEditorApi.d.ts +35 -18
  27. package/dist/controller/hiddenEditorManager.d.ts +5 -3
  28. package/dist/controller/latestRequestGate.d.ts +3 -1
  29. package/dist/controller/layoutPipeline.d.ts +1 -1
  30. package/dist/controller/layoutScheduler.d.ts +8 -5
  31. package/dist/controller/layoutSession.d.ts +0 -1
  32. package/dist/controller/noteEditorManager.d.ts +0 -1
  33. package/dist/document-operations.d.ts +5 -12
  34. package/dist/document-stories.d.ts +0 -1
  35. package/dist/docx/blockContentParser.d.ts +0 -1
  36. package/dist/docx/blockContentParser.js +1 -0
  37. package/dist/docx/bookmarkParser.d.ts +5 -3
  38. package/dist/docx/bookmarkPlacement.d.ts +0 -1
  39. package/dist/docx/commentParser.d.ts +0 -1
  40. package/dist/docx/commentParser.js +30 -2
  41. package/dist/docx/commentRangeIntegrity.d.ts +0 -1
  42. package/dist/docx/commentReferenceNormalization.d.ts +1 -9
  43. package/dist/docx/commentReplyMarkers.d.ts +0 -1
  44. package/dist/docx/compatibility.d.ts +0 -1
  45. package/dist/docx/conformance.d.ts +0 -1
  46. package/dist/docx/corePropertiesParser.d.ts +0 -1
  47. package/dist/docx/documentParser.d.ts +0 -1
  48. package/dist/docx/documentParser.js +3 -1
  49. package/dist/docx/drawingIdNormalization.d.ts +5 -0
  50. package/dist/docx/drawingIdNormalization.js +35 -0
  51. package/dist/docx/drawingUtils.d.ts +24 -3
  52. package/dist/docx/drawingUtils.js +134 -28
  53. package/dist/docx/encryption/agileDecryption.d.ts +0 -1
  54. package/dist/docx/encryption/cryptoBytes.js +4 -1
  55. package/dist/docx/encryption/openEncryptedDocx.d.ts +5 -2
  56. package/dist/docx/ensureParaIds.d.ts +7 -3
  57. package/dist/docx/fieldParser.d.ts +23 -11
  58. package/dist/docx/fontTableParser.d.ts +0 -1
  59. package/dist/docx/footnoteParser.d.ts +26 -13
  60. package/dist/docx/footnoteParser.js +4 -2
  61. package/dist/docx/groupDrawingParser.d.ts +0 -1
  62. package/dist/docx/headerFooterParser.d.ts +9 -5
  63. package/dist/docx/headerFooterRefParser.d.ts +0 -1
  64. package/dist/docx/headerFooterReferenceNormalization.d.ts +1 -6
  65. package/dist/docx/headerFooterVerbatim.d.ts +4 -3
  66. package/dist/docx/headerFooterVerbatim.js +6 -1
  67. package/dist/docx/hyperlinkParser.d.ts +0 -1
  68. package/dist/docx/hyperlinkParser.js +1 -9
  69. package/dist/docx/imageParser.d.ts +0 -1
  70. package/dist/docx/imageParser.js +15 -7
  71. package/dist/docx/mathToMathml.d.ts +0 -1
  72. package/dist/docx/metadataPrivacy.d.ts +1 -3
  73. package/dist/docx/modelValidation.d.ts +0 -1
  74. package/dist/docx/newImage.d.ts +11 -0
  75. package/dist/docx/newImage.js +11 -0
  76. package/dist/docx/normalizeBaseDirection.d.ts +0 -1
  77. package/dist/docx/notePropertiesParser.d.ts +0 -1
  78. package/dist/docx/numberingParser.d.ts +10 -6
  79. package/dist/docx/numberingParser.js +4 -2
  80. package/dist/docx/numberingReferenceNormalization.d.ts +1 -9
  81. package/dist/docx/paragraphParser.d.ts +0 -1
  82. package/dist/docx/paragraphParser.js +31 -15
  83. package/dist/docx/paragraphTextBoxEnrichment.d.ts +0 -1
  84. package/dist/docx/paragraphTextBoxEnrichment.js +2 -1
  85. package/dist/docx/paragraphTraversal.d.ts +5 -10
  86. package/dist/docx/paragraphTraversal.js +20 -13
  87. package/dist/docx/parser.d.ts +15 -8
  88. package/dist/docx/parser.js +22 -1
  89. package/dist/docx/parserEnums.d.ts +5 -2
  90. package/dist/docx/parserEnums.js +6 -2
  91. package/dist/docx/relsParser.d.ts +1 -0
  92. package/dist/docx/renderedPageBreakNormalization.d.ts +12 -0
  93. package/dist/docx/renderedPageBreakNormalization.js +59 -0
  94. package/dist/docx/replyToComment.d.ts +2 -2
  95. package/dist/docx/rezip.d.ts +6 -7
  96. package/dist/docx/rezip.js +136 -102
  97. package/dist/docx/runConsolidator.d.ts +0 -1
  98. package/dist/docx/runConsolidator.js +0 -1
  99. package/dist/docx/runParser.d.ts +0 -1
  100. package/dist/docx/runParser.js +25 -12
  101. package/dist/docx/sdtProperties.d.ts +0 -1
  102. package/dist/docx/sdtPropertiesPatch.d.ts +0 -1
  103. package/dist/docx/sectionParser.d.ts +0 -1
  104. package/dist/docx/selectiveSave.d.ts +5 -3
  105. package/dist/docx/selectiveSave.js +2 -2
  106. package/dist/docx/selectiveSaveFlags.d.ts +4 -2
  107. package/dist/docx/selectiveXmlPatch.js +20 -8
  108. package/dist/docx/serializer/blockSdtSerializer.d.ts +0 -1
  109. package/dist/docx/serializer/blockSdtSerializer.js +2 -1
  110. package/dist/docx/serializer/borderSerializer.d.ts +0 -1
  111. package/dist/docx/serializer/commentSerializer.d.ts +0 -1
  112. package/dist/docx/serializer/commentSerializer.js +19 -40
  113. package/dist/docx/serializer/documentSerializer.d.ts +0 -1
  114. package/dist/docx/serializer/documentSerializer.js +1 -1
  115. package/dist/docx/serializer/fontTableSerializer.d.ts +0 -1
  116. package/dist/docx/serializer/headerFooterSerializer.d.ts +0 -1
  117. package/dist/docx/serializer/headerFooterSerializer.js +1 -1
  118. package/dist/docx/serializer/noteSerializer.d.ts +0 -1
  119. package/dist/docx/serializer/noteSerializer.js +1 -1
  120. package/dist/docx/serializer/numberingSerializer.d.ts +0 -1
  121. package/dist/docx/serializer/paragraphSerializer.d.ts +0 -1
  122. package/dist/docx/serializer/paragraphSerializer.js +10 -23
  123. package/dist/docx/serializer/runSerializer.d.ts +0 -1
  124. package/dist/docx/serializer/runSerializer.js +53 -32
  125. package/dist/docx/serializer/sectionPropertiesSerializer.d.ts +0 -1
  126. package/dist/docx/serializer/sectionPropertiesSerializer.js +7 -5
  127. package/dist/docx/serializer/settingsSerializer.d.ts +0 -1
  128. package/dist/docx/serializer/stylesSerializer.d.ts +0 -1
  129. package/dist/docx/serializer/tableSerializer.d.ts +0 -1
  130. package/dist/docx/serializer/tableSerializer.js +2 -0
  131. package/dist/docx/serializer/themeSerializer.d.ts +0 -1
  132. package/dist/docx/serializer/xmlUtils.js +10 -1
  133. package/dist/docx/server/applyDocxXmlPatchProposal.d.ts +3 -10
  134. package/dist/docx/server/docxToMarkdown.d.ts +0 -1
  135. package/dist/docx/server/evaluateDocxXmlPatchProposal.d.ts +3 -9
  136. package/dist/docx/server/inspectDocxPackage.d.ts +3 -8
  137. package/dist/docx/server/validateDocxConformance.d.ts +0 -1
  138. package/dist/docx/settingsParser.d.ts +2 -2
  139. package/dist/docx/shapeParser.d.ts +0 -1
  140. package/dist/docx/shapeParser.js +16 -123
  141. package/dist/docx/streamingXmlParser.d.ts +16 -0
  142. package/dist/docx/streamingXmlParser.js +248 -0
  143. package/dist/docx/styleParser.d.ts +0 -1
  144. package/dist/docx/styleParser.js +6 -4
  145. package/dist/docx/tableParser.d.ts +1 -2
  146. package/dist/docx/tableParser.js +11 -12
  147. package/dist/docx/textBoxParser.d.ts +1 -2
  148. package/dist/docx/textBoxParser.js +5 -2
  149. package/dist/docx/textWhitespace.d.ts +4 -0
  150. package/dist/docx/textWhitespace.js +4 -0
  151. package/dist/docx/themeParser.d.ts +0 -1
  152. package/dist/docx/trackedMoveRangeNormalization.d.ts +1 -8
  153. package/dist/docx/unzip.d.ts +6 -3
  154. package/dist/docx/unzip.js +96 -40
  155. package/dist/docx/vmlImageParser.d.ts +0 -1
  156. package/dist/docx/vmlImageParser.js +3 -1
  157. package/dist/docx/watermarkParser.d.ts +0 -1
  158. package/dist/docx/xmlParser.d.ts +21 -8
  159. package/dist/docx/xmlParser.js +126 -43
  160. package/dist/fields/bookmarkPages.d.ts +0 -1
  161. package/dist/fields/bookmarkText.d.ts +0 -1
  162. package/dist/fields/evaluateField.d.ts +5 -3
  163. package/dist/fields/fieldContext.d.ts +11 -5
  164. package/dist/fields/resolveFieldValues.d.ts +4 -3
  165. package/dist/fields/sectionPageCounts.d.ts +0 -1
  166. package/dist/fields/seqValues.d.ts +0 -1
  167. package/dist/fonts/embeddedFontTable.d.ts +5 -2
  168. package/dist/fonts/embeddedFonts.d.ts +15 -7
  169. package/dist/index.d.ts +1 -0
  170. package/dist/layout-bridge/cellSelectionHighlight.d.ts +0 -1
  171. package/dist/layout-bridge/convert/footnoteLayout.d.ts +5 -3
  172. package/dist/layout-bridge/convert/headerFooterLayout.d.ts +2 -2
  173. package/dist/layout-bridge/convert/paragraphFrames.d.ts +0 -1
  174. package/dist/layout-bridge/convert/templatePreviewFlow.d.ts +8 -8
  175. package/dist/layout-bridge/convert/toFlowBlocks.d.ts +25 -13
  176. package/dist/layout-bridge/convert/wrapEditorViewAsSurface.d.ts +3 -2
  177. package/dist/layout-bridge/dom/findHfPmSpans.d.ts +2 -1
  178. package/dist/layout-bridge/dom/noteStoryDom.d.ts +0 -1
  179. package/dist/layout-bridge/engine/clickToPosition.d.ts +5 -3
  180. package/dist/layout-bridge/engine/hitTest.d.ts +40 -19
  181. package/dist/layout-bridge/engine/selectionRects.d.ts +16 -8
  182. package/dist/layout-bridge/engine/tableWidthUtils.d.ts +0 -1
  183. package/dist/layout-bridge/headerFooterLayout.d.ts +0 -1
  184. package/dist/layout-bridge/sectionColumns.d.ts +0 -1
  185. package/dist/layout-bridge/tableInsertHover.d.ts +8 -4
  186. package/dist/layout-engine/headerFooterRefs.d.ts +0 -1
  187. package/dist/layout-engine/index.d.ts +0 -1
  188. package/dist/layout-engine/justificationCompatibility.d.ts +0 -1
  189. package/dist/layout-engine/keep-together.d.ts +7 -4
  190. package/dist/layout-engine/layoutInstrumentation.d.ts +0 -1
  191. package/dist/layout-engine/lineFlow.d.ts +0 -1
  192. package/dist/layout-engine/measure/cache.d.ts +0 -1
  193. package/dist/layout-engine/measure/effectiveLineBreakPolicy.d.ts +6 -7
  194. package/dist/layout-engine/measure/floatingTablePosition.d.ts +0 -1
  195. package/dist/layout-engine/measure/floatingZones.d.ts +14 -6
  196. package/dist/layout-engine/measure/font-metrics.worker.d.ts +0 -1
  197. package/dist/layout-engine/measure/lineBreakProvider.d.ts +20 -9
  198. package/dist/layout-engine/measure/lineBreaks.d.ts +0 -1
  199. package/dist/layout-engine/measure/listMarkerWidth.d.ts +0 -1
  200. package/dist/layout-engine/measure/measureBlocks.d.ts +1 -0
  201. package/dist/layout-engine/measure/measureContainer.d.ts +0 -1
  202. package/dist/layout-engine/measure/measureHelpers.d.ts +0 -1
  203. package/dist/layout-engine/measure/measureParagraph.d.ts +3 -2
  204. package/dist/layout-engine/measure/measureParagraph.js +23 -3
  205. package/dist/layout-engine/measure/measureProvider.d.ts +0 -1
  206. package/dist/layout-engine/measure/measureTypes.d.ts +4 -2
  207. package/dist/layout-engine/measure/measureWorker.d.ts +0 -1
  208. package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +0 -1
  209. package/dist/layout-engine/measure/tableCellFloating.d.ts +0 -1
  210. package/dist/layout-engine/measure/tableCellFlow.d.ts +0 -1
  211. package/dist/layout-engine/measure/tableCellGrid.d.ts +0 -1
  212. package/dist/layout-engine/measure/textBoxParagraphLayout.d.ts +0 -1
  213. package/dist/layout-engine/measure/textMeasurementPolicy.d.ts +0 -1
  214. package/dist/layout-engine/paginator.d.ts +66 -33
  215. package/dist/layout-engine/paragraphFragmentRange.d.ts +0 -1
  216. package/dist/layout-engine/paragraphFrame.d.ts +0 -1
  217. package/dist/layout-engine/paragraphSequence.d.ts +0 -1
  218. package/dist/layout-engine/paragraphSpacing.d.ts +1 -5
  219. package/dist/layout-engine/pmPageIndex.d.ts +0 -1
  220. package/dist/layout-engine/renderedBreakReconciliation.d.ts +2 -17
  221. package/dist/layout-engine/section-breaks.d.ts +34 -17
  222. package/dist/layout-engine/tableRowBreak.d.ts +4 -3
  223. package/dist/layout-engine/textBoxFlow.d.ts +0 -1
  224. package/dist/layout-engine/textBoxGroup.d.ts +0 -1
  225. package/dist/layout-engine/types.d.ts +382 -189
  226. package/dist/layout-painter/anchoredImagePosition.d.ts +0 -1
  227. package/dist/layout-painter/borderStroke.d.ts +0 -1
  228. package/dist/layout-painter/imageLayout.d.ts +14 -7
  229. package/dist/layout-painter/index.d.ts +9 -5
  230. package/dist/layout-painter/registry/modules/image.d.ts +0 -1
  231. package/dist/layout-painter/registry/modules/paragraph.d.ts +0 -1
  232. package/dist/layout-painter/registry/modules/table.d.ts +0 -1
  233. package/dist/layout-painter/registry/modules/textBox.d.ts +0 -1
  234. package/dist/layout-painter/registry/modules.d.ts +0 -1
  235. package/dist/layout-painter/registry/registry.d.ts +0 -1
  236. package/dist/layout-painter/registry/types.d.ts +0 -1
  237. package/dist/layout-painter/renderFragment.d.ts +2 -2
  238. package/dist/layout-painter/renderImage.d.ts +0 -1
  239. package/dist/layout-painter/renderPage.d.ts +71 -42
  240. package/dist/layout-painter/renderParagraph.d.ts +28 -14
  241. package/dist/layout-painter/renderParagraph.js +6 -2
  242. package/dist/layout-painter/renderTable.d.ts +0 -1
  243. package/dist/layout-painter/renderTextBox.d.ts +0 -1
  244. package/dist/layout-painter/renderUtils.d.ts +17 -9
  245. package/dist/layout-painter/renderWatermark.d.ts +2 -2
  246. package/dist/layout-painter/sdtBoundary.d.ts +0 -1
  247. package/dist/managers/AutoSaveManager.d.ts +22 -11
  248. package/dist/managers/ClipboardManager.d.ts +0 -1
  249. package/dist/managers/ContextMenuManager.d.ts +5 -8
  250. package/dist/managers/DocumentLoaderManager.d.ts +12 -6
  251. package/dist/managers/EditorModeManager.d.ts +3 -2
  252. package/dist/managers/ErrorManager.d.ts +0 -1
  253. package/dist/managers/FindReplaceManager.d.ts +0 -1
  254. package/dist/managers/HistoryManager.d.ts +19 -9
  255. package/dist/managers/TableSelectionManager.d.ts +0 -1
  256. package/dist/managers/editorShortcuts.d.ts +4 -6
  257. package/dist/markdown/annotations.d.ts +0 -1
  258. package/dist/markdown/fromMarkdown.d.ts +0 -1
  259. package/dist/markdown/images.d.ts +0 -1
  260. package/dist/markdown/index.d.ts +0 -1
  261. package/dist/markdown/internals.d.ts +0 -1
  262. package/dist/markdown/renderBlock.d.ts +0 -1
  263. package/dist/markdown/renderParagraph.d.ts +0 -1
  264. package/dist/markdown/renderRuns.d.ts +0 -1
  265. package/dist/markdown/renderTable.d.ts +0 -1
  266. package/dist/markdown/trailers.d.ts +0 -1
  267. package/dist/markdown/types.d.ts +39 -18
  268. package/dist/model.d.ts +3 -5
  269. package/dist/model.js +2 -2
  270. package/dist/paged-layout/incrementalMeasure.d.ts +1 -10
  271. package/dist/paged-layout/pageText.d.ts +1 -1
  272. package/dist/paged-layout/paragraphFlash.d.ts +0 -1
  273. package/dist/paged-layout/paragraphFlashTypes.d.ts +5 -2
  274. package/dist/paged-layout/rangeProjection.d.ts +10 -5
  275. package/dist/paged-layout/scrollNavigation.d.ts +0 -1
  276. package/dist/paged-layout/scrollPageInfo.d.ts +12 -13
  277. package/dist/paged-layout/scrollToPmPosition.d.ts +0 -1
  278. package/dist/paged-layout/sectionBlockWidths.d.ts +2 -11
  279. package/dist/paged-layout/sectionGeometry.d.ts +0 -1
  280. package/dist/paged-layout/selectionViewportRect.d.ts +0 -1
  281. package/dist/paged-layout/transactionDirtyRange.d.ts +0 -1
  282. package/dist/paged-layout/zoomScrollAnchor.d.ts +2 -12
  283. package/dist/prosemirror/attrs/index.d.ts +6 -4
  284. package/dist/prosemirror/attrs/index.js +22 -2
  285. package/dist/prosemirror/autospacingBase.d.ts +0 -1
  286. package/dist/prosemirror/cellDragSelection.d.ts +6 -4
  287. package/dist/prosemirror/commands/comments.d.ts +6 -4
  288. package/dist/prosemirror/commands/contentControls.d.ts +5 -3
  289. package/dist/prosemirror/commands/contentControlsBlockFill.d.ts +1 -1
  290. package/dist/prosemirror/commands/formatPainter.d.ts +0 -1
  291. package/dist/prosemirror/commands/formatting.d.ts +1 -1
  292. package/dist/prosemirror/commands/hyperlink.d.ts +4 -9
  293. package/dist/prosemirror/commands/image.d.ts +0 -1
  294. package/dist/prosemirror/commands/pageBreak.d.ts +0 -1
  295. package/dist/prosemirror/commands/paragraph.d.ts +0 -1
  296. package/dist/prosemirror/commands/pastePlainText.d.ts +0 -1
  297. package/dist/prosemirror/commands/propertyChangeScope.d.ts +0 -1
  298. package/dist/prosemirror/commands/sectionBreak.d.ts +0 -1
  299. package/dist/prosemirror/commands/table.d.ts +0 -1
  300. package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +0 -1
  301. package/dist/prosemirror/commentIdAllocator.d.ts +2 -2
  302. package/dist/prosemirror/commentOps.d.ts +0 -1
  303. package/dist/prosemirror/conversion/effectiveTableCellFormatting.d.ts +1 -10
  304. package/dist/prosemirror/conversion/fromProseDoc.d.ts +0 -1
  305. package/dist/prosemirror/conversion/fromProseDoc.js +17 -10
  306. package/dist/prosemirror/conversion/runShadingMark.d.ts +0 -1
  307. package/dist/prosemirror/conversion/sdtAttrs.d.ts +0 -1
  308. package/dist/prosemirror/conversion/toProseDoc.d.ts +3 -2
  309. package/dist/prosemirror/conversion/toProseDoc.js +17 -3
  310. package/dist/prosemirror/extensions/ExtensionManager.d.ts +0 -1
  311. package/dist/prosemirror/extensions/StarterKit.d.ts +7 -4
  312. package/dist/prosemirror/extensions/core/DocExtension.d.ts +0 -1
  313. package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +0 -1
  314. package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +0 -1
  315. package/dist/prosemirror/extensions/core/TextExtension.d.ts +0 -1
  316. package/dist/prosemirror/extensions/create.d.ts +0 -1
  317. package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +0 -1
  318. package/dist/prosemirror/extensions/features/BaseKeymapExtension.d.ts +0 -1
  319. package/dist/prosemirror/extensions/features/BidiShortcutExtension.d.ts +0 -1
  320. package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts +0 -1
  321. package/dist/prosemirror/extensions/features/DropCursorExtension.d.ts +0 -1
  322. package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts +0 -1
  323. package/dist/prosemirror/extensions/features/GapCursorExtension.d.ts +0 -1
  324. package/dist/prosemirror/extensions/features/ImageDragExtension.d.ts +0 -1
  325. package/dist/prosemirror/extensions/features/ImagePasteExtension.d.ts +0 -1
  326. package/dist/prosemirror/extensions/features/ListExtension.d.ts +0 -1
  327. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +0 -1
  328. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +7 -4
  329. package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +0 -1
  330. package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.d.ts +0 -1
  331. package/dist/prosemirror/extensions/features/SelectionTrackerExtension.d.ts +0 -1
  332. package/dist/prosemirror/extensions/features/bidiShortcutController.d.ts +3 -1
  333. package/dist/prosemirror/extensions/marks/AllCapsExtension.d.ts +0 -1
  334. package/dist/prosemirror/extensions/marks/BoldExtension.d.ts +0 -1
  335. package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.d.ts +0 -1
  336. package/dist/prosemirror/extensions/marks/CharacterStyleExtension.d.ts +0 -1
  337. package/dist/prosemirror/extensions/marks/CommentExtension.d.ts +0 -1
  338. package/dist/prosemirror/extensions/marks/FontFamilyExtension.d.ts +0 -1
  339. package/dist/prosemirror/extensions/marks/FontFamilyExtension.js +1 -0
  340. package/dist/prosemirror/extensions/marks/FontSizeExtension.d.ts +0 -1
  341. package/dist/prosemirror/extensions/marks/FootnoteRefExtension.d.ts +0 -1
  342. package/dist/prosemirror/extensions/marks/HiddenTextExtension.d.ts +0 -1
  343. package/dist/prosemirror/extensions/marks/HighlightExtension.d.ts +0 -1
  344. package/dist/prosemirror/extensions/marks/HyperlinkExtension.d.ts +0 -1
  345. package/dist/prosemirror/extensions/marks/ItalicExtension.d.ts +0 -1
  346. package/dist/prosemirror/extensions/marks/LanguageExtension.d.ts +0 -1
  347. package/dist/prosemirror/extensions/marks/RtlExtension.d.ts +0 -1
  348. package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.d.ts +0 -1
  349. package/dist/prosemirror/extensions/marks/RunShadingExtension.d.ts +0 -1
  350. package/dist/prosemirror/extensions/marks/SmallCapsExtension.d.ts +0 -1
  351. package/dist/prosemirror/extensions/marks/StrikeExtension.d.ts +0 -1
  352. package/dist/prosemirror/extensions/marks/SubscriptExtension.d.ts +0 -1
  353. package/dist/prosemirror/extensions/marks/SuperscriptExtension.d.ts +0 -1
  354. package/dist/prosemirror/extensions/marks/TextColorExtension.d.ts +0 -1
  355. package/dist/prosemirror/extensions/marks/TextEffectExtension.d.ts +0 -1
  356. package/dist/prosemirror/extensions/marks/TextEffectsExtensions.d.ts +0 -1
  357. package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +0 -1
  358. package/dist/prosemirror/extensions/marks/UnderlineExtension.d.ts +0 -1
  359. package/dist/prosemirror/extensions/marks/markUtils.d.ts +0 -1
  360. package/dist/prosemirror/extensions/marks/markUtils.js +4 -1
  361. package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +0 -1
  362. package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +0 -1
  363. package/dist/prosemirror/extensions/nodes/HardBreakExtension.d.ts +0 -1
  364. package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.d.ts +0 -1
  365. package/dist/prosemirror/extensions/nodes/ImageExtension.d.ts +0 -1
  366. package/dist/prosemirror/extensions/nodes/ImageExtension.js +2 -0
  367. package/dist/prosemirror/extensions/nodes/MathExtension.d.ts +0 -1
  368. package/dist/prosemirror/extensions/nodes/PageBreakExtension.d.ts +0 -1
  369. package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.d.ts +0 -1
  370. package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +0 -1
  371. package/dist/prosemirror/extensions/nodes/ShapeExtension.d.ts +0 -1
  372. package/dist/prosemirror/extensions/nodes/ShapeExtension.js +2 -0
  373. package/dist/prosemirror/extensions/nodes/TabExtension.d.ts +0 -1
  374. package/dist/prosemirror/extensions/nodes/TabExtension.js +32 -9
  375. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +4 -3
  376. package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.d.ts +0 -1
  377. package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +53 -27
  378. package/dist/prosemirror/extensions/types.d.ts +0 -1
  379. package/dist/prosemirror/findReplaceSelection.d.ts +5 -3
  380. package/dist/prosemirror/imageCommit.d.ts +0 -1
  381. package/dist/prosemirror/index.d.ts +4 -0
  382. package/dist/prosemirror/insertOperations.d.ts +0 -1
  383. package/dist/prosemirror/paraText.d.ts +0 -1
  384. package/dist/prosemirror/plugins/aiCitationDecorations.d.ts +2 -2
  385. package/dist/prosemirror/plugins/aiSuggestionDecorations.d.ts +0 -1
  386. package/dist/prosemirror/plugins/anonymizationDecorations.d.ts +9 -7
  387. package/dist/prosemirror/plugins/autocompleteSuggestion.d.ts +2 -2
  388. package/dist/prosemirror/plugins/contentControlWidgets.d.ts +4 -7
  389. package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +3 -8
  390. package/dist/prosemirror/plugins/documentStyles.d.ts +0 -1
  391. package/dist/prosemirror/plugins/pmTextScan.d.ts +2 -2
  392. package/dist/prosemirror/plugins/revisionIds.d.ts +0 -1
  393. package/dist/prosemirror/plugins/selectionTracker.d.ts +23 -12
  394. package/dist/prosemirror/plugins/suggestionMode.d.ts +0 -1
  395. package/dist/prosemirror/plugins/templateDirectives.d.ts +10 -8
  396. package/dist/prosemirror/plugins/templatePreviewValues.d.ts +10 -5
  397. package/dist/prosemirror/plugins/templateSlashMenu.d.ts +2 -2
  398. package/dist/prosemirror/queries.d.ts +0 -1
  399. package/dist/prosemirror/schema/index.d.ts +2 -3
  400. package/dist/prosemirror/schema/marks.d.ts +8 -5
  401. package/dist/prosemirror/schema/nodes.d.ts +344 -164
  402. package/dist/prosemirror/selectionState.d.ts +13 -7
  403. package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +0 -1
  404. package/dist/prosemirror/styles/styleResolver.d.ts +3 -2
  405. package/dist/prosemirror/tableCellMergeRevision.d.ts +0 -1
  406. package/dist/prosemirror/tableResize.d.ts +0 -1
  407. package/dist/prosemirror/textBoxAnchorAttrs.d.ts +0 -1
  408. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +8 -5
  409. package/dist/prosemirror/utils/findParagraphByParaId.d.ts +0 -1
  410. package/dist/prosemirror/utils/tabCalculator.d.ts +18 -7
  411. package/dist/prosemirror/utils/visualLineNavigation.d.ts +0 -1
  412. package/dist/prosemirror/validation.d.ts +0 -1
  413. package/dist/prosemirror/validation.js +5 -3
  414. package/dist/redline.d.ts +16 -8
  415. package/dist/render-dom/BodySelectionOverlay.d.ts +1 -9
  416. package/dist/render-dom/HeaderFooterSelectionOverlay.d.ts +0 -1
  417. package/dist/render-dom/RemoteSelectionOverlay.d.ts +1 -8
  418. package/dist/render-dom/resolveSidebarItemPositions.d.ts +1 -9
  419. package/dist/style-engine/styleEngine.d.ts +21 -11
  420. package/dist/style-sets/extract.d.ts +4 -3
  421. package/dist/style-sets/stellaStyle.d.ts +0 -1
  422. package/dist/style-sets/types.d.ts +0 -1
  423. package/dist/symbols.d.ts +6 -2
  424. package/dist/types/block-id.d.ts +3 -6
  425. package/dist/types/content.d.ts +2 -2
  426. package/dist/types/document.d.ts +0 -3
  427. package/dist/types/documentEnumValues.d.ts +5 -1
  428. package/dist/types/documentEnumValues.js +19 -1
  429. package/dist/types/index.d.ts +2 -1
  430. package/dist/utils/clipboard.d.ts +17 -8
  431. package/dist/utils/colorResolver.d.ts +9 -5
  432. package/dist/utils/createDocument.d.ts +19 -10
  433. package/dist/utils/documentLoaderBehavior.d.ts +1 -5
  434. package/dist/utils/docxInput.js +1 -0
  435. package/dist/utils/findReplace.d.ts +0 -1
  436. package/dist/utils/fontFamilyMerge.d.ts +0 -1
  437. package/dist/utils/fontResolver.d.ts +10 -4
  438. package/dist/utils/formatToStyle.d.ts +0 -1
  439. package/dist/utils/headerFooter.d.ts +8 -16
  440. package/dist/utils/headingCollector.d.ts +7 -4
  441. package/dist/utils/mergeDocumentContent.d.ts +0 -1
  442. package/dist/utils/paragraphFormattingMerge.d.ts +0 -1
  443. package/dist/utils/replaceText.d.ts +0 -1
  444. package/dist/utils/rotationBoundingBox.d.ts +0 -1
  445. package/dist/utils/tableOperations.d.ts +0 -1
  446. package/dist/utils/textFormattingMerge.d.ts +0 -1
  447. package/dist/version-comparison.d.ts +12 -6
  448. package/dist/watermark/index.d.ts +0 -1
  449. package/package.json +3 -3
@@ -1,7 +1,5 @@
1
1
  import { OutlineStyleAttr } from "../types/documentEnumValues.js";
2
2
  import { ImagePosition, ImageWrap, SdtProperties, SdtType, ShapeTextBody, TableCellFormatting, TableWidthType } from "@stll/docx-core/model";
3
-
4
- //#region src/layout-engine/types.d.ts
5
3
  declare namespace types_d_exports {
6
4
  export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, tableColumnsArePinned };
7
5
  }
@@ -38,7 +36,8 @@ type RunFormatting = {
38
36
  * `segmentByScript`) so wrapping stays correct. Absent means CJK falls back
39
37
  * to `fontFamily`.
40
38
  */
41
- eastAsiaFontFamily?: string; /** Run language metadata resolved from `w:lang`. */
39
+ eastAsiaFontFamily?: string;
40
+ /** Run language metadata resolved from `w:lang`. */
42
41
  language?: {
43
42
  val?: string;
44
43
  eastAsia?: string;
@@ -47,11 +46,16 @@ type RunFormatting = {
47
46
  fontSize?: number;
48
47
  letterSpacing?: number;
49
48
  superscript?: boolean;
50
- subscript?: boolean; /** Render glyphs as uppercase regardless of source case. */
51
- allCaps?: boolean; /** Render lowercase glyphs as small uppercase. */
52
- smallCaps?: boolean; /** Vertical baseline shift in CSS pixels. */
53
- positionPx?: number; /** Horizontal text scale as a percentage. */
54
- horizontalScale?: number; /** Minimum font size in points at which kerning is enabled. */
49
+ subscript?: boolean;
50
+ /** Render glyphs as uppercase regardless of source case. */
51
+ allCaps?: boolean;
52
+ /** Render lowercase glyphs as small uppercase. */
53
+ smallCaps?: boolean;
54
+ /** Vertical baseline shift in CSS pixels. */
55
+ positionPx?: number;
56
+ /** Horizontal text scale as a percentage. */
57
+ horizontalScale?: number;
58
+ /** Minimum font size in points at which kerning is enabled. */
55
59
  kerningMinPt?: number;
56
60
  imprint?: boolean;
57
61
  emboss?: boolean;
@@ -77,15 +81,24 @@ type RunFormatting = {
77
81
  * but the painter emits `docx-text-effect-<name>` plus `data-effect` so
78
82
  * host CSS can opt in.
79
83
  */
80
- textEffect?: "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle"; /** Hyperlink info if this run is a link */
81
- hyperlink?: HyperlinkInfo; /** Footnote reference ID (if this run contains a footnote reference) */
82
- footnoteRefId?: number; /** Endnote reference ID (if this run contains an endnote reference) */
83
- endnoteRefId?: number; /** Comment IDs if this run is within a comment range */
84
- commentIds?: number[]; /** Whether this run is a tracked insertion */
85
- isInsertion?: boolean; /** Whether this run is a tracked deletion */
86
- isDeletion?: boolean; /** Author of the tracked change */
87
- changeAuthor?: string; /** Date of the tracked change */
88
- changeDate?: string; /** Revision ID of the tracked change (for sidebar matching) */
84
+ textEffect?: "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle";
85
+ /** Hyperlink info if this run is a link */
86
+ hyperlink?: HyperlinkInfo;
87
+ /** Footnote reference ID (if this run contains a footnote reference) */
88
+ footnoteRefId?: number;
89
+ /** Endnote reference ID (if this run contains an endnote reference) */
90
+ endnoteRefId?: number;
91
+ /** Comment IDs if this run is within a comment range */
92
+ commentIds?: number[];
93
+ /** Whether this run is a tracked insertion */
94
+ isInsertion?: boolean;
95
+ /** Whether this run is a tracked deletion */
96
+ isDeletion?: boolean;
97
+ /** Author of the tracked change */
98
+ changeAuthor?: string;
99
+ /** Date of the tracked change */
100
+ changeDate?: string;
101
+ /** Revision ID of the tracked change (for sidebar matching) */
89
102
  changeRevisionId?: number;
90
103
  /**
91
104
  * Whether this tracked insertion/deletion is an AI-proposed *suggestion*
@@ -93,7 +106,8 @@ type RunFormatting = {
93
106
  * dotted stroke and a dedicated hue; they are stripped from serialized DOCX
94
107
  * until accepted.
95
108
  */
96
- isSuggestion?: boolean; /** Groups a suggestion's runs for accept/reject and scroll-to. */
109
+ isSuggestion?: boolean;
110
+ /** Groups a suggestion's runs for accept/reject and scroll-to. */
97
111
  suggestionId?: string;
98
112
  };
99
113
  /**
@@ -116,9 +130,12 @@ type HyperlinkInfo = {
116
130
  */
117
131
  type TextRun = RunFormatting & {
118
132
  kind: "text";
119
- text: string; /** Hyperlink information if this run is a link. */
120
- hyperlink?: HyperlinkInfo; /** Absolute ProseMirror position (inclusive) of first character. */
121
- pmStart?: number; /** Absolute ProseMirror position (exclusive) after last character. */
133
+ text: string;
134
+ /** Hyperlink information if this run is a link. */
135
+ hyperlink?: HyperlinkInfo;
136
+ /** Absolute ProseMirror position (inclusive) of first character. */
137
+ pmStart?: number;
138
+ /** Absolute ProseMirror position (exclusive) after last character. */
122
139
  pmEnd?: number;
123
140
  /**
124
141
  * Set when this run is a template fill-preview substitution: the text is
@@ -162,23 +179,31 @@ type ImageRun = {
162
179
  src: string;
163
180
  width: number;
164
181
  height: number;
165
- alt?: string; /** CSS transform string (rotation, flip) */
182
+ alt?: string;
183
+ /** CSS transform string (rotation, flip) */
166
184
  transform?: string;
167
185
  /**
168
186
  * Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
169
187
  * fully opaque; the painter emits no CSS `opacity` in that case.
170
188
  * eigenpal #424 (opacity render pipeline).
171
189
  */
172
- opacity?: number; /** Position for floating/anchored images */
173
- position?: ImageRunPosition; /** Whether a table-cell anchor uses the cell as its positioning scope. Undefined defaults true. */
174
- layoutInCell?: boolean; /** Wrap type from DOCX (inline, square, tight, through, topAndBottom, etc.) */
175
- wrapType?: ImageWrap["type"]; /** Display mode for CSS rendering */
176
- displayMode?: "inline" | "block" | "float"; /** CSS float direction */
177
- cssFloat?: "left" | "right" | "none"; /** Wrap distances in pixels */
190
+ opacity?: number;
191
+ /** Position for floating/anchored images */
192
+ position?: ImageRunPosition;
193
+ /** Whether a table-cell anchor uses the cell as its positioning scope. Undefined defaults true. */
194
+ layoutInCell?: boolean;
195
+ /** Wrap type from DOCX (inline, square, tight, through, topAndBottom, etc.) */
196
+ wrapType?: ImageWrap["type"];
197
+ /** Display mode for CSS rendering */
198
+ displayMode?: "inline" | "block" | "float";
199
+ /** CSS float direction */
200
+ cssFloat?: "left" | "right" | "none";
201
+ /** Wrap distances in pixels */
178
202
  distTop?: number;
179
203
  distBottom?: number;
180
204
  distLeft?: number;
181
- distRight?: number; /** Use the image box as the exact line height for an embedded-object preview. */
205
+ distRight?: number;
206
+ /** Use the image box as the exact line height for an embedded-object preview. */
182
207
  exactLineHeight?: boolean;
183
208
  /**
184
209
  * wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`
@@ -187,14 +212,22 @@ type ImageRun = {
187
212
  cropTop?: number;
188
213
  cropRight?: number;
189
214
  cropBottom?: number;
190
- cropLeft?: number; /** CSS border width in pixels. eigenpal #1096. */
191
- borderWidth?: number; /** CSS border color. eigenpal #1096. */
192
- borderColor?: string; /** CSS border style. eigenpal #1096. */
193
- borderStyle?: string; /** Whether this picture is itself a tracked insertion (`<w:ins>`). eigenpal #641. */
194
- isInsertion?: boolean; /** Whether this picture is itself a tracked deletion (`<w:del>`). eigenpal #641. */
195
- isDeletion?: boolean; /** Author of the tracked change wrapping the picture. eigenpal #641. */
196
- changeAuthor?: string; /** Date of the tracked change wrapping the picture. eigenpal #641. */
197
- changeDate?: string; /** Revision id of the tracked change wrapping the picture. eigenpal #641. */
215
+ cropLeft?: number;
216
+ /** CSS border width in pixels. eigenpal #1096. */
217
+ borderWidth?: number;
218
+ /** CSS border color. eigenpal #1096. */
219
+ borderColor?: string;
220
+ /** CSS border style. eigenpal #1096. */
221
+ borderStyle?: string;
222
+ /** Whether this picture is itself a tracked insertion (`<w:ins>`). eigenpal #641. */
223
+ isInsertion?: boolean;
224
+ /** Whether this picture is itself a tracked deletion (`<w:del>`). eigenpal #641. */
225
+ isDeletion?: boolean;
226
+ /** Author of the tracked change wrapping the picture. eigenpal #641. */
227
+ changeAuthor?: string;
228
+ /** Date of the tracked change wrapping the picture. eigenpal #641. */
229
+ changeDate?: string;
230
+ /** Revision id of the tracked change wrapping the picture. eigenpal #641. */
198
231
  changeRevisionId?: number;
199
232
  pmStart?: number;
200
233
  pmEnd?: number;
@@ -217,12 +250,15 @@ type RenderedPageBreakRun = RunFormatting & {
217
250
  * A field run (PAGE, NUMPAGES, etc.) that gets substituted at render time.
218
251
  */
219
252
  type FieldRun = RunFormatting & {
220
- kind: "field"; /** Coarse render category, kept for cache keys and caret-width fast paths. */
253
+ kind: "field";
254
+ /** Coarse render category, kept for cache keys and caret-width fast paths. */
221
255
  fieldType: "PAGE" | "NUMPAGES" | "DATE" | "TIME" | "OTHER";
222
256
  /** Full OOXML field instruction (e.g. `PAGE \* ROMAN`, `PAGEREF _Ref1 \h`)
223
257
  * for live evaluation; falls back to `fieldType` when absent. */
224
- instruction?: string; /** Fallback text if field can't be resolved */
225
- fallback?: string; /** Whether OOXML marked this field as locked (`w:fldLock`). */
258
+ instruction?: string;
259
+ /** Fallback text if field can't be resolved */
260
+ fallback?: string;
261
+ /** Whether OOXML marked this field as locked (`w:fldLock`). */
226
262
  fldLock?: boolean;
227
263
  pmStart?: number;
228
264
  pmEnd?: number;
@@ -237,9 +273,12 @@ type FieldRun = RunFormatting & {
237
273
  * the document model, not the layout layer).
238
274
  */
239
275
  type MathRun = RunFormatting & {
240
- kind: "math"; /** `inline` = `<m:oMath>`, `block` = `<m:oMathPara>`. */
241
- display: "inline" | "block"; /** Raw OMML XML for conversion + round-trip. */
242
- ommlXml: string; /** Plain-text fallback used when MathML rendering is unavailable. */
276
+ kind: "math";
277
+ /** `inline` = `<m:oMath>`, `block` = `<m:oMathPara>`. */
278
+ display: "inline" | "block";
279
+ /** Raw OMML XML for conversion + round-trip. */
280
+ ommlXml: string;
281
+ /** Plain-text fallback used when MathML rendering is unavailable. */
243
282
  plainText: string;
244
283
  pmStart?: number;
245
284
  pmEnd?: number;
@@ -275,8 +314,11 @@ type TabAlignment = "start" | "end" | "center" | "decimal" | "bar" | "clear";
275
314
  * Tab stop definition
276
315
  */
277
316
  type TabStop = {
278
- /** Tab alignment mode */val: TabAlignment; /** Position in twips from left margin */
279
- pos: number; /** Optional leader character */
317
+ /** Tab alignment mode */
318
+ val: TabAlignment;
319
+ /** Position in twips from left margin */
320
+ pos: number;
321
+ /** Optional leader character */
280
322
  leader?: "none" | "dot" | "hyphen" | "underscore" | "heavy" | "middleDot";
281
323
  };
282
324
  /**
@@ -310,19 +352,26 @@ type ListNumPr = {
310
352
  * Paragraph block attributes.
311
353
  */
312
354
  type ParagraphAttrs = {
313
- alignment?: "left" | "center" | "right" | "justify"; /** Document-generation policy for justified line fitting. */
355
+ alignment?: "left" | "center" | "right" | "justify";
356
+ /** Document-generation policy for justified line fitting. */
314
357
  justificationCompatibility?: {
315
358
  type: "legacy";
316
- }; /** East Asian first/last-character restrictions (`w:kinsoku`). */
317
- kinsoku?: boolean; /** Hanging punctuation (`w:overflowPunct`); defaults to enabled when omitted. */
318
- overflowPunctuation?: boolean; /** Exempt this paragraph from document automatic hyphenation. */
319
- suppressAutoHyphens?: boolean; /** Document-wide automatic hyphenation controls retained for line layout. */
359
+ };
360
+ /** East Asian first/last-character restrictions (`w:kinsoku`). */
361
+ kinsoku?: boolean;
362
+ /** Hanging punctuation (`w:overflowPunct`); defaults to enabled when omitted. */
363
+ overflowPunctuation?: boolean;
364
+ /** Exempt this paragraph from document automatic hyphenation. */
365
+ suppressAutoHyphens?: boolean;
366
+ /** Document-wide automatic hyphenation controls retained for line layout. */
320
367
  automaticHyphenation?: {
321
368
  enabled: true;
322
369
  doNotHyphenateCaps?: boolean;
323
- consecutiveLineLimit?: number; /** Maximum tolerated line-end whitespace before hyphenation, in twips. */
370
+ consecutiveLineLimit?: number;
371
+ /** Maximum tolerated line-end whitespace before hyphenation, in twips. */
324
372
  hyphenationZoneTwips?: number;
325
- }; /** Document-wide custom line-edge characters and compatibility behavior. */
373
+ };
374
+ /** Document-wide custom line-edge characters and compatibility behavior. */
326
375
  lineBreakRules?: {
327
376
  noLineBreaksBefore?: {
328
377
  language?: string;
@@ -333,11 +382,15 @@ type ParagraphAttrs = {
333
382
  characters: string;
334
383
  };
335
384
  useLegacyEthiopicAmharicRules?: boolean;
336
- }; /** OOXML outline level (`w:outlineLvl`), where zero is the top level. */
385
+ };
386
+ /** OOXML outline level (`w:outlineLvl`), where zero is the top level. */
337
387
  outlineLevel?: number;
338
- spacing?: ParagraphSpacing; /** Whether this paragraph participates in the active section line grid. */
339
- snapToGrid?: boolean; /** Active section line pitch in pixels; present only on top-level body paragraphs. */
340
- documentGridLinePitch?: number; /** Spacing sides resolved from OOXML automatic paragraph spacing. */
388
+ spacing?: ParagraphSpacing;
389
+ /** Whether this paragraph participates in the active section line grid. */
390
+ snapToGrid?: boolean;
391
+ /** Active section line pitch in pixels; present only on top-level body paragraphs. */
392
+ documentGridLinePitch?: number;
393
+ /** Spacing sides resolved from OOXML automatic paragraph spacing. */
341
394
  automaticSpacing?: {
342
395
  before?: boolean;
343
396
  after?: boolean;
@@ -359,13 +412,15 @@ type ParagraphAttrs = {
359
412
  * source `w:pPr`. Word treats such a blank as authored and keeps its
360
413
  * inherited spacing; a bare empty paragraph still collapses that spacing.
361
414
  */
362
- hasDirectParagraphFormatting?: boolean; /** Whether an empty paragraph carries direct formatting on its paragraph mark. */
415
+ hasDirectParagraphFormatting?: boolean;
416
+ /** Whether an empty paragraph carries direct formatting on its paragraph mark. */
363
417
  hasDirectParagraphMarkFormatting?: boolean;
364
418
  indent?: ParagraphIndent;
365
419
  keepNext?: boolean;
366
420
  keepLines?: boolean;
367
421
  widowControl?: boolean;
368
- pageBreakBefore?: boolean; /** Cached OOXML pagination hint (`w:lastRenderedPageBreak`). */
422
+ pageBreakBefore?: boolean;
423
+ /** Cached OOXML pagination hint (`w:lastRenderedPageBreak`). */
369
424
  renderedPageBreakBefore?: boolean;
370
425
  styleId?: string;
371
426
  contextualSpacing?: boolean;
@@ -375,12 +430,15 @@ type ParagraphAttrs = {
375
430
  * stage merges the next paragraph's runs into this paragraph's
376
431
  * fragment (keeping pmStart/pmEnd intact for editing).
377
432
  */
378
- runInWithNext?: boolean; /** Right-to-left paragraph direction */
433
+ runInWithNext?: boolean;
434
+ /** Right-to-left paragraph direction */
379
435
  bidi?: boolean;
380
436
  borders?: ParagraphBorders;
381
437
  shading?: string;
382
- tabs?: TabStop[]; /** Render structural empty paragraphs as zero-height anchors. */
383
- suppressEmptyParagraphHeight?: boolean; /** Reserve the reference extra line advance for a story-leading empty level-0 outline paragraph. */
438
+ tabs?: TabStop[];
439
+ /** Render structural empty paragraphs as zero-height anchors. */
440
+ suppressEmptyParagraphHeight?: boolean;
441
+ /** Reserve the reference extra line advance for a story-leading empty level-0 outline paragraph. */
384
442
  reserveEmptyOutlineHeight?: boolean;
385
443
  numPr?: ListNumPr;
386
444
  listMarker?: string;
@@ -394,7 +452,8 @@ type ParagraphAttrs = {
394
452
  * that line box without enlarging the marker or Western text glyphs.
395
453
  */
396
454
  listParagraphMarkFontSize?: number;
397
- listMarkerBold?: boolean; /** Horizontal alignment of the marker around the paragraph's list anchor. */
455
+ listMarkerBold?: boolean;
456
+ /** Horizontal alignment of the marker around the paragraph's list anchor. */
398
457
  listMarkerAlignment?: "left" | "center" | "right";
399
458
  /**
400
459
  * `w:suff` (§17.9.25) — what follows the marker before body text.
@@ -437,14 +496,17 @@ type ParagraphAttrs = {
437
496
  */
438
497
  type ParagraphBlock = {
439
498
  kind: "paragraph";
440
- id: BlockId; /** Stable Word `w14:paraId` / PM `paraId`, when available. */
499
+ id: BlockId;
500
+ /** Stable Word `w14:paraId` / PM `paraId`, when available. */
441
501
  paraId?: string;
442
502
  runs: Run[];
443
503
  attrs?: ParagraphAttrs;
444
504
  /** Names of bookmarks anchored to this paragraph; used to map a bookmark to
445
505
  * the page it lands on for PAGEREF/REF resolution. */
446
- bookmarks?: string[]; /** ProseMirror start position for this block. */
447
- pmStart?: number; /** ProseMirror end position for this block. */
506
+ bookmarks?: string[];
507
+ /** ProseMirror start position for this block. */
508
+ pmStart?: number;
509
+ /** ProseMirror end position for this block. */
448
510
  pmEnd?: number;
449
511
  /**
450
512
  * Outer→inner SDT wrappers enclosing this block. Empty / undefined when
@@ -484,7 +546,8 @@ type TableCell = {
484
546
  verticalAlign?: "top" | "center" | "bottom";
485
547
  textDirection?: NonNullable<TableCellFormatting["textDirection"]>;
486
548
  background?: string;
487
- borders?: CellBorders; /** Per-cell padding in pixels (from w:tcMar or table-level w:tblCellMar) */
549
+ borders?: CellBorders;
550
+ /** Per-cell padding in pixels (from w:tcMar or table-level w:tblCellMar) */
488
551
  padding?: {
489
552
  top: number;
490
553
  right: number;
@@ -508,7 +571,8 @@ type TableRow = {
508
571
  gridAfter?: number;
509
572
  height?: number;
510
573
  heightRule?: "auto" | "atLeast" | "exact";
511
- isHeader?: boolean; /** `w:cantSplit`: keep this row in one flow region. */
574
+ isHeader?: boolean;
575
+ /** `w:cantSplit`: keep this row in one flow region. */
512
576
  cantSplit?: boolean;
513
577
  hidden?: boolean;
514
578
  };
@@ -534,8 +598,10 @@ type TableBlock = {
534
598
  kind: "table";
535
599
  id: BlockId;
536
600
  rows: TableRow[];
537
- columnWidths?: number[]; /** Table width value (twips for dxa, 50ths of percent for pct). */
538
- width?: number; /** Table width type ('auto', 'pct', 'dxa', 'nil'). */
601
+ columnWidths?: number[];
602
+ /** Table width value (twips for dxa, 50ths of percent for pct). */
603
+ width?: number;
604
+ /** Table width type ('auto', 'pct', 'dxa', 'nil'). */
539
605
  widthType?: TableWidthType;
540
606
  /**
541
607
  * Table layout algorithm (`w:tblLayout`). "fixed" pins columns to their grid
@@ -543,13 +609,18 @@ type TableBlock = {
543
609
  * content. Consulted alongside `widthType` to decide whether `w:noWrap` cells
544
610
  * can be honored (see `tableColumnsArePinned`).
545
611
  */
546
- layout?: "fixed" | "autofit"; /** Table horizontal alignment */
547
- justification?: "left" | "center" | "right"; /** Table indent from left margin (in pixels, from w:tblInd) */
548
- indent?: number; /** Right-to-left column order (w:bidiVisual): logical column 0 paints on the right. */
549
- bidi?: boolean; /** Floating table properties (pixel values). */
612
+ layout?: "fixed" | "autofit";
613
+ /** Table horizontal alignment */
614
+ justification?: "left" | "center" | "right";
615
+ /** Table indent from left margin (in pixels, from w:tblInd) */
616
+ indent?: number;
617
+ /** Right-to-left column order (w:bidiVisual): logical column 0 paints on the right. */
618
+ bidi?: boolean;
619
+ /** Floating table properties (pixel values). */
550
620
  floating?: FloatingTablePosition;
551
621
  pmStart?: number;
552
- pmEnd?: number; /** Outer→inner SDT wrappers enclosing this table (see ParagraphBlock). */
622
+ pmEnd?: number;
623
+ /** Outer→inner SDT wrappers enclosing this table (see ParagraphBlock). */
553
624
  sdtGroups?: SdtGroup[];
554
625
  };
555
626
  /**
@@ -561,7 +632,8 @@ type ImageBlock = {
561
632
  src: string;
562
633
  width: number;
563
634
  height: number;
564
- alt?: string; /** CSS transform string (rotation, flip) */
635
+ alt?: string;
636
+ /** CSS transform string (rotation, flip) */
565
637
  transform?: string;
566
638
  /**
567
639
  * Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
@@ -574,7 +646,8 @@ type ImageBlock = {
574
646
  offsetH?: number;
575
647
  offsetV?: number;
576
648
  behindDoc?: boolean;
577
- }; /** Hyperlink URL for clickable image */
649
+ };
650
+ /** Hyperlink URL for clickable image */
578
651
  hlinkHref?: string;
579
652
  /**
580
653
  * wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`.
@@ -583,9 +656,12 @@ type ImageBlock = {
583
656
  cropTop?: number;
584
657
  cropRight?: number;
585
658
  cropBottom?: number;
586
- cropLeft?: number; /** CSS border width in pixels. eigenpal #1096. */
587
- borderWidth?: number; /** CSS border color. eigenpal #1096. */
588
- borderColor?: string; /** CSS border style. eigenpal #1096. */
659
+ cropLeft?: number;
660
+ /** CSS border width in pixels. eigenpal #1096. */
661
+ borderWidth?: number;
662
+ /** CSS border color. eigenpal #1096. */
663
+ borderColor?: string;
664
+ /** CSS border style. eigenpal #1096. */
589
665
  borderStyle?: string;
590
666
  pmStart?: number;
591
667
  pmEnd?: number;
@@ -603,7 +679,8 @@ type SectionBreakBlock = {
603
679
  };
604
680
  orientation?: "portrait" | "landscape";
605
681
  margins?: PageMargins;
606
- columns?: ColumnLayout; /** Line pitch authored by the section properties that end at this boundary, in twips. */
682
+ columns?: ColumnLayout;
683
+ /** Line pitch authored by the section properties that end at this boundary, in twips. */
607
684
  documentGridLinePitchTwips?: number;
608
685
  };
609
686
  type PageHeaderFooterRefs = {
@@ -648,26 +725,41 @@ declare const DEFAULT_TEXTBOX_WIDTH = 200;
648
725
  */
649
726
  type TextBoxBlock = {
650
727
  kind: "textBox";
651
- id: BlockId; /** Width in pixels */
652
- width: number; /** Height in pixels (may be auto-calculated) */
653
- height?: number; /** Text fitting behavior */
654
- autoFit?: ShapeTextBody["autoFit"]; /** Fill/background color */
655
- fillColor?: string; /** Border width in pixels */
656
- outlineWidth?: number; /** Border color */
657
- outlineColor?: string; /** Outline dash style, or `"none"` for an explicit no-outline. */
658
- outlineStyle?: OutlineStyleAttr; /** Internal padding */
728
+ id: BlockId;
729
+ /** Width in pixels */
730
+ width: number;
731
+ /** Height in pixels (may be auto-calculated) */
732
+ height?: number;
733
+ /** Text fitting behavior */
734
+ autoFit?: ShapeTextBody["autoFit"];
735
+ /** Fill/background color */
736
+ fillColor?: string;
737
+ /** Border width in pixels */
738
+ outlineWidth?: number;
739
+ /** Border color */
740
+ outlineColor?: string;
741
+ /** Outline dash style, or `"none"` for an explicit no-outline. */
742
+ outlineStyle?: OutlineStyleAttr;
743
+ /** Internal padding */
659
744
  margins?: {
660
745
  top: number;
661
746
  bottom: number;
662
747
  left: number;
663
748
  right: number;
664
- }; /** Flow blocks inside the text box */
665
- content: (ParagraphBlock | TableBlock)[]; /** Display mode copied from the ProseMirror text box node. */
666
- displayMode?: "inline" | "float" | "block"; /** CSS float direction copied from the ProseMirror text box node. */
667
- cssFloat?: "left" | "right" | "none"; /** OOXML wrap type for anchored text boxes. */
668
- wrapType?: ImageWrap["type"]; /** OOXML wrapText direction for anchored text boxes. */
669
- wrapText?: "bothSides" | "left" | "right" | "largest"; /** Position for floating/anchored text boxes (OOXML EMU offsets). */
670
- position?: ImageRunPosition; /** Wrap distances in pixels. */
749
+ };
750
+ /** Flow blocks inside the text box */
751
+ content: (ParagraphBlock | TableBlock)[];
752
+ /** Display mode copied from the ProseMirror text box node. */
753
+ displayMode?: "inline" | "float" | "block";
754
+ /** CSS float direction copied from the ProseMirror text box node. */
755
+ cssFloat?: "left" | "right" | "none";
756
+ /** OOXML wrap type for anchored text boxes. */
757
+ wrapType?: ImageWrap["type"];
758
+ /** OOXML wrapText direction for anchored text boxes. */
759
+ wrapText?: "bothSides" | "left" | "right" | "largest";
760
+ /** Position for floating/anchored text boxes (OOXML EMU offsets). */
761
+ position?: ImageRunPosition;
762
+ /** Wrap distances in pixels. */
671
763
  distTop?: number;
672
764
  distBottom?: number;
673
765
  distLeft?: number;
@@ -684,21 +776,30 @@ type TextBoxBlock = {
684
776
  * stay disambiguated even when alias/tag/sdtId collide.
685
777
  */
686
778
  type SdtGroup = {
687
- /** Folio-local identifier (stable within one toFlowBlocks call). */id: string;
779
+ /** Folio-local identifier (stable within one toFlowBlocks call). */
780
+ id: string;
688
781
  /**
689
782
  * ProseMirror position of the blockSdt's open token in the source doc.
690
783
  * Stable across renders for the same control and unique per instance —
691
784
  * the addressing API uses this to disambiguate SDTs that share a tag.
692
785
  */
693
786
  pmPos: number;
694
- sdtType: SdtType; /** OOXML `w:alias` (friendly display name). */
695
- alias?: string; /** OOXML `w:tag` (developer identifier — anchor for addressing API). */
696
- tag?: string; /** OOXML numeric `w:id`. */
697
- sdtId?: number; /** OOXML `w:lock` setting. */
698
- lock?: NonNullable<SdtProperties["lock"]>; /** True if `w:showingPlcHdr` is set. */
699
- showingPlaceholder?: boolean; /** Modeled checkbox state, when the control is `w14:checkbox`. */
700
- checked?: boolean; /** Modeled `w:date/w:dateFormat`. */
701
- dateFormat?: string; /** Modeled `w:dropDownList`/`w:comboBox` items (JSON-encoded). */
787
+ sdtType: SdtType;
788
+ /** OOXML `w:alias` (friendly display name). */
789
+ alias?: string;
790
+ /** OOXML `w:tag` (developer identifier — anchor for addressing API). */
791
+ tag?: string;
792
+ /** OOXML numeric `w:id`. */
793
+ sdtId?: number;
794
+ /** OOXML `w:lock` setting. */
795
+ lock?: NonNullable<SdtProperties["lock"]>;
796
+ /** True if `w:showingPlcHdr` is set. */
797
+ showingPlaceholder?: boolean;
798
+ /** Modeled checkbox state, when the control is `w14:checkbox`. */
799
+ checked?: boolean;
800
+ /** Modeled `w:date/w:dateFormat`. */
801
+ dateFormat?: string;
802
+ /** Modeled `w:dropDownList`/`w:comboBox` items (JSON-encoded). */
702
803
  listItemsJson?: string;
703
804
  /**
704
805
  * Position of the carrying block within its SDT group (`first`/`middle`/
@@ -718,25 +819,37 @@ type FlowBlock = ParagraphBlock | TableBlock | ImageBlock | TextBoxBlock | Secti
718
819
  * A measured line within a paragraph.
719
820
  */
720
821
  type MeasuredLine = {
721
- /** Starting run index (inclusive). */fromRun: number; /** Starting character index within fromRun. */
722
- fromChar: number; /** Ending run index (inclusive). */
723
- toRun: number; /** Ending character index within toRun (exclusive). */
724
- toChar: number; /** Total width of the line in pixels. */
725
- width: number; /** Ascent (height above baseline) in pixels. */
726
- ascent: number; /** Descent (height below baseline) in pixels. */
727
- descent: number; /** Total line height in pixels. */
728
- lineHeight: number; /** Left offset from floating images (pixels from content left edge). */
729
- leftOffset?: number; /** Right offset from floating images (pixels from content right edge). */
822
+ /** Starting run index (inclusive). */
823
+ fromRun: number;
824
+ /** Starting character index within fromRun. */
825
+ fromChar: number;
826
+ /** Ending run index (inclusive). */
827
+ toRun: number;
828
+ /** Ending character index within toRun (exclusive). */
829
+ toChar: number;
830
+ /** Total width of the line in pixels. */
831
+ width: number;
832
+ /** Ascent (height above baseline) in pixels. */
833
+ ascent: number;
834
+ /** Descent (height below baseline) in pixels. */
835
+ descent: number;
836
+ /** Total line height in pixels. */
837
+ lineHeight: number;
838
+ /** Left offset from floating images (pixels from content left edge). */
839
+ leftOffset?: number;
840
+ /** Right offset from floating images (pixels from content right edge). */
730
841
  rightOffset?: number;
731
842
  /**
732
843
  * Vertical space inserted before this line to skip past floats that leave
733
844
  * no usable horizontal room at the natural line Y. Painters render this
734
845
  * as marginTop on the line element; measurement adds it to totalHeight.
735
846
  */
736
- floatSkipBefore?: number; /** Decorative hyphen inserted at a dictionary break without changing source text. */
847
+ floatSkipBefore?: number;
848
+ /** Decorative hyphen inserted at a dictionary break without changing source text. */
737
849
  discretionaryHyphen?: {
738
850
  runIndex: number;
739
- }; /** A cached pagination boundary occurs immediately before this line. */
851
+ };
852
+ /** A cached pagination boundary occurs immediately before this line. */
740
853
  renderedPageBreakBefore?: boolean;
741
854
  };
742
855
  /**
@@ -815,7 +928,8 @@ type ColumnBreakMeasure = {
815
928
  type TextBoxMeasure = {
816
929
  kind: "textBox";
817
930
  width: number;
818
- height: number; /** Pre-measured inner content (avoids re-measuring during render) */
931
+ height: number;
932
+ /** Pre-measured inner content (avoids re-measuring during render) */
819
933
  innerMeasures: (ParagraphMeasure | TableMeasure)[];
820
934
  };
821
935
  /**
@@ -826,11 +940,17 @@ type Measure = ParagraphMeasure | ImageMeasure | TableMeasure | TextBoxMeasure |
826
940
  * Base fragment properties common to all fragment types.
827
941
  */
828
942
  type FragmentBase = {
829
- /** Block ID this fragment belongs to. */blockId: BlockId; /** X position on page (relative to page left). */
830
- x: number; /** Y position on page (relative to page top). */
831
- y: number; /** Width of the fragment. */
832
- width: number; /** ProseMirror start position (for click mapping). */
833
- pmStart?: number; /** ProseMirror end position (for click mapping). */
943
+ /** Block ID this fragment belongs to. */
944
+ blockId: BlockId;
945
+ /** X position on page (relative to page left). */
946
+ x: number;
947
+ /** Y position on page (relative to page top). */
948
+ y: number;
949
+ /** Width of the fragment. */
950
+ width: number;
951
+ /** ProseMirror start position (for click mapping). */
952
+ pmStart?: number;
953
+ /** ProseMirror end position (for click mapping). */
834
954
  pmEnd?: number;
835
955
  /**
836
956
  * Outer→inner SDT wrappers enclosing the originating block. Copied
@@ -844,11 +964,16 @@ type FragmentBase = {
844
964
  * May span only part of the paragraph's lines if split across pages.
845
965
  */
846
966
  type ParagraphFragment = FragmentBase & {
847
- kind: "paragraph"; /** First line index (inclusive) from the measure. */
848
- fromLine: number; /** Last line index (exclusive) from the measure. */
849
- toLine: number; /** Height of this fragment. */
850
- height: number; /** True if this continues from a previous page. */
851
- continuesFromPrev?: boolean; /** True if this continues onto the next page. */
967
+ kind: "paragraph";
968
+ /** First line index (inclusive) from the measure. */
969
+ fromLine: number;
970
+ /** Last line index (exclusive) from the measure. */
971
+ toLine: number;
972
+ /** Height of this fragment. */
973
+ height: number;
974
+ /** True if this continues from a previous page. */
975
+ continuesFromPrev?: boolean;
976
+ /** True if this continues onto the next page. */
852
977
  continuesOnNext?: boolean;
853
978
  };
854
979
  /**
@@ -856,13 +981,20 @@ type ParagraphFragment = FragmentBase & {
856
981
  * May span only part of the table's rows if split across pages.
857
982
  */
858
983
  type TableFragment = FragmentBase & {
859
- kind: "table"; /** First row index (inclusive). */
860
- fromRow: number; /** Last row index (exclusive). */
861
- toRow: number; /** Height of this fragment. */
862
- height: number; /** True if this is a floating table. */
863
- isFloating?: boolean; /** True if this continues from a previous page. */
864
- continuesFromPrev?: boolean; /** True if this continues onto the next page. */
865
- continuesOnNext?: boolean; /** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
984
+ kind: "table";
985
+ /** First row index (inclusive). */
986
+ fromRow: number;
987
+ /** Last row index (exclusive). */
988
+ toRow: number;
989
+ /** Height of this fragment. */
990
+ height: number;
991
+ /** True if this is a floating table. */
992
+ isFloating?: boolean;
993
+ /** True if this continues from a previous page. */
994
+ continuesFromPrev?: boolean;
995
+ /** True if this continues onto the next page. */
996
+ continuesOnNext?: boolean;
997
+ /** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
866
998
  headerRowCount?: number;
867
999
  /**
868
1000
  * Mid-content row break (eigenpal #698): when a single row is taller than a
@@ -879,16 +1011,20 @@ type TableFragment = FragmentBase & {
879
1011
  * An image fragment positioned on a page.
880
1012
  */
881
1013
  type ImageFragment = FragmentBase & {
882
- kind: "image"; /** Height of the image. */
883
- height: number; /** True if this is an anchored/floating image. */
884
- isAnchored?: boolean; /** Z-index for layering. */
1014
+ kind: "image";
1015
+ /** Height of the image. */
1016
+ height: number;
1017
+ /** True if this is an anchored/floating image. */
1018
+ isAnchored?: boolean;
1019
+ /** Z-index for layering. */
885
1020
  zIndex?: number;
886
1021
  };
887
1022
  /**
888
1023
  * A text box fragment positioned on a page.
889
1024
  */
890
1025
  type TextBoxFragment = FragmentBase & {
891
- kind: "textBox"; /** Height of the text box. */
1026
+ kind: "textBox";
1027
+ /** Height of the text box. */
892
1028
  height: number;
893
1029
  };
894
1030
  /**
@@ -902,27 +1038,40 @@ type PageMargins = {
902
1038
  top: number;
903
1039
  right: number;
904
1040
  bottom: number;
905
- left: number; /** Distance from page top to header content. */
906
- header?: number; /** Distance from page bottom to footer content. */
1041
+ left: number;
1042
+ /** Distance from page top to header content. */
1043
+ header?: number;
1044
+ /** Distance from page bottom to footer content. */
907
1045
  footer?: number;
908
1046
  };
909
1047
  /**
910
1048
  * A rendered page containing positioned fragments.
911
1049
  */
912
1050
  type Page = {
913
- /** Page number (1-indexed). */number: number; /** Fragments positioned on this page. */
914
- fragments: Fragment[]; /** Page margins. */
915
- margins: PageMargins; /** Page size (width, height). */
1051
+ /** Page number (1-indexed). */
1052
+ number: number;
1053
+ /** Fragments positioned on this page. */
1054
+ fragments: Fragment[];
1055
+ /** Page margins. */
1056
+ margins: PageMargins;
1057
+ /** Page size (width, height). */
916
1058
  size: {
917
1059
  w: number;
918
1060
  h: number;
919
- }; /** Page orientation. */
920
- orientation?: "portrait" | "landscape"; /** Section index this page belongs to. */
921
- sectionIndex?: number; /** 1-based page number within the active section. */
922
- sectionPageNumber?: number; /** Header/footer references for this page. */
923
- headerFooterRefs?: PageHeaderFooterRefs; /** Footnote IDs that appear on this page (for rendering). */
924
- footnoteIds?: number[]; /** Height reserved for the footnote area at page bottom (pixels). */
925
- footnoteReservedHeight?: number; /** Column layout for this page (if multi-column). */
1061
+ };
1062
+ /** Page orientation. */
1063
+ orientation?: "portrait" | "landscape";
1064
+ /** Section index this page belongs to. */
1065
+ sectionIndex?: number;
1066
+ /** 1-based page number within the active section. */
1067
+ sectionPageNumber?: number;
1068
+ /** Header/footer references for this page. */
1069
+ headerFooterRefs?: PageHeaderFooterRefs;
1070
+ /** Footnote IDs that appear on this page (for rendering). */
1071
+ footnoteIds?: number[];
1072
+ /** Height reserved for the footnote area at page bottom (pixels). */
1073
+ footnoteReservedHeight?: number;
1074
+ /** Column layout for this page (if multi-column). */
926
1075
  columns?: ColumnLayout;
927
1076
  };
928
1077
  /**
@@ -931,9 +1080,12 @@ type Page = {
931
1080
  type ColumnLayout = {
932
1081
  count: number;
933
1082
  gap: number;
934
- equalWidth?: boolean; /** Authored widths for unequal-width section columns. */
935
- widths?: number[]; /** Authored space after each column except the last. */
936
- gaps?: number[]; /** Draw vertical separator line between columns (w:sep). */
1083
+ equalWidth?: boolean;
1084
+ /** Authored widths for unequal-width section columns. */
1085
+ widths?: number[];
1086
+ /** Authored space after each column except the last. */
1087
+ gaps?: number[];
1088
+ /** Draw vertical separator line between columns (w:sep). */
937
1089
  separator?: boolean;
938
1090
  };
939
1091
  /**
@@ -947,14 +1099,20 @@ type HeaderFooterLayout = {
947
1099
  * Final layout output ready for rendering/painting.
948
1100
  */
949
1101
  type Layout = {
950
- /** Default page size for the document. */pageSize: {
1102
+ /** Default page size for the document. */
1103
+ pageSize: {
951
1104
  w: number;
952
1105
  h: number;
953
- }; /** All rendered pages with positioned fragments. */
954
- pages: Page[]; /** Column configuration (if multi-column). */
955
- columns?: ColumnLayout; /** Header layouts by type (default, first, even). */
956
- headers?: Record<string, HeaderFooterLayout>; /** Footer layouts by type (default, first, even). */
957
- footers?: Record<string, HeaderFooterLayout>; /** Gap between pages in pixels (for rendering). */
1106
+ };
1107
+ /** All rendered pages with positioned fragments. */
1108
+ pages: Page[];
1109
+ /** Column configuration (if multi-column). */
1110
+ columns?: ColumnLayout;
1111
+ /** Header layouts by type (default, first, even). */
1112
+ headers?: Record<string, HeaderFooterLayout>;
1113
+ /** Footer layouts by type (default, first, even). */
1114
+ footers?: Record<string, HeaderFooterLayout>;
1115
+ /** Gap between pages in pixels (for rendering). */
958
1116
  pageGap?: number;
959
1117
  };
960
1118
  /**
@@ -965,20 +1123,27 @@ type HeaderFooterContentHeights = Partial<Record<"default" | "first" | "even" |
965
1123
  * Pre-calculated footnote content for layout and rendering.
966
1124
  */
967
1125
  type FootnoteContent = {
968
- /** Footnote ID. */id: number; /** Display number (e.g. 1, 2, 3). */
969
- displayNumber: number; /** FlowBlocks for rendering the footnote content. */
970
- blocks: FlowBlock[]; /** Measurements for the blocks. */
971
- measures: Measure[]; /** Total height in pixels. */
1126
+ /** Footnote ID. */
1127
+ id: number;
1128
+ /** Display number (e.g. 1, 2, 3). */
1129
+ displayNumber: number;
1130
+ /** FlowBlocks for rendering the footnote content. */
1131
+ blocks: FlowBlock[];
1132
+ /** Measurements for the blocks. */
1133
+ measures: Measure[];
1134
+ /** Total height in pixels. */
972
1135
  height: number;
973
1136
  };
974
1137
  /**
975
1138
  * Options for the layout engine.
976
1139
  */
977
1140
  type LayoutOptions = {
978
- /** Initial page size. */pageSize: {
1141
+ /** Initial page size. */
1142
+ pageSize: {
979
1143
  w: number;
980
1144
  h: number;
981
- }; /** Initial page margins. */
1145
+ };
1146
+ /** Initial page margins. */
982
1147
  margins: PageMargins;
983
1148
  /**
984
1149
  * Margins applied only to page 1 (the title page) when the first
@@ -986,22 +1151,35 @@ type LayoutOptions = {
986
1151
  * overflowing first-page header without forcing pages 2+ to inherit the
987
1152
  * same extension.
988
1153
  */
989
- firstPageMargins?: PageMargins; /** Per-section body margins used on even section pages. */
990
- sectionEvenPageMargins?: (PageMargins | undefined)[]; /** Body-level final section page size. */
1154
+ firstPageMargins?: PageMargins;
1155
+ /** Per-section body margins used on even section pages. */
1156
+ sectionEvenPageMargins?: (PageMargins | undefined)[];
1157
+ /** Body-level final section page size. */
991
1158
  finalPageSize?: {
992
1159
  w: number;
993
1160
  h: number;
994
- }; /** Body-level final section margins. */
995
- finalMargins?: PageMargins; /** Body-level final section column configuration. */
996
- finalColumns?: ColumnLayout; /** Column configuration. */
997
- columns?: ColumnLayout; /** Gap between rendered pages (for UI). */
998
- pageGap?: number; /** Default line height multiplier. */
999
- defaultLineHeight?: number; /** Header content heights by variant. */
1000
- headerContentHeights?: HeaderFooterContentHeights; /** Footer content heights by variant. */
1001
- footerContentHeights?: HeaderFooterContentHeights; /** Whether section has different first page header/footer. */
1002
- titlePage?: boolean; /** Whether section has different even/odd headers/footers. */
1003
- evenAndOddHeaders?: boolean; /** Swap left/right margins on even physical pages. */
1004
- mirrorMargins?: boolean; /** Per-page footnote reserved heights (pageNumber → height in pixels). */
1161
+ };
1162
+ /** Body-level final section margins. */
1163
+ finalMargins?: PageMargins;
1164
+ /** Body-level final section column configuration. */
1165
+ finalColumns?: ColumnLayout;
1166
+ /** Column configuration. */
1167
+ columns?: ColumnLayout;
1168
+ /** Gap between rendered pages (for UI). */
1169
+ pageGap?: number;
1170
+ /** Default line height multiplier. */
1171
+ defaultLineHeight?: number;
1172
+ /** Header content heights by variant. */
1173
+ headerContentHeights?: HeaderFooterContentHeights;
1174
+ /** Footer content heights by variant. */
1175
+ footerContentHeights?: HeaderFooterContentHeights;
1176
+ /** Whether section has different first page header/footer. */
1177
+ titlePage?: boolean;
1178
+ /** Whether section has different even/odd headers/footers. */
1179
+ evenAndOddHeaders?: boolean;
1180
+ /** Swap left/right margins on even physical pages. */
1181
+ mirrorMargins?: boolean;
1182
+ /** Per-page footnote reserved heights (pageNumber → height in pixels). */
1005
1183
  footnoteReservedHeights?: Map<number, number>;
1006
1184
  /**
1007
1185
  * Footnote content heights keyed by internal footnote id (the OOXML
@@ -1014,26 +1192,36 @@ type LayoutOptions = {
1014
1192
  * above the fn area) on documents with multiple long footnotes per
1015
1193
  * page.
1016
1194
  */
1017
- footnoteHeightById?: Map<number, number>; /** Section break type for the body-level (final) section (for section transition logic). */
1018
- bodyBreakType?: "continuous" | "nextPage" | "evenPage" | "oddPage"; /** Header/footer references for each document section, by section index. */
1195
+ footnoteHeightById?: Map<number, number>;
1196
+ /** Section break type for the body-level (final) section (for section transition logic). */
1197
+ bodyBreakType?: "continuous" | "nextPage" | "evenPage" | "oddPage";
1198
+ /** Header/footer references for each document section, by section index. */
1019
1199
  sectionHeaderFooterRefs?: PageHeaderFooterRefs[];
1020
1200
  };
1021
1201
  /**
1022
1202
  * Result of hit-testing a click position.
1023
1203
  */
1024
1204
  type HitTestResult = {
1025
- /** Page index (0-based). */pageIndex: number; /** Fragment that was hit, if any. */
1026
- fragment?: Fragment; /** Local X coordinate within the fragment. */
1027
- localX?: number; /** Local Y coordinate within the fragment. */
1205
+ /** Page index (0-based). */
1206
+ pageIndex: number;
1207
+ /** Fragment that was hit, if any. */
1208
+ fragment?: Fragment;
1209
+ /** Local X coordinate within the fragment. */
1210
+ localX?: number;
1211
+ /** Local Y coordinate within the fragment. */
1028
1212
  localY?: number;
1029
1213
  };
1030
1214
  /**
1031
1215
  * Position within the document model.
1032
1216
  */
1033
1217
  type DocumentPosition = {
1034
- /** Block index. */blockIndex: number; /** Run index within the block (for paragraphs). */
1035
- runIndex?: number; /** Character offset within the run. */
1036
- charOffset?: number; /** ProseMirror position. */
1218
+ /** Block index. */
1219
+ blockIndex: number;
1220
+ /** Run index within the block (for paragraphs). */
1221
+ runIndex?: number;
1222
+ /** Character offset within the run. */
1223
+ charOffset?: number;
1224
+ /** ProseMirror position. */
1037
1225
  pmPos?: number;
1038
1226
  };
1039
1227
  /**
@@ -1062,10 +1250,15 @@ declare const FOOTNOTE_FALLBACK_LINE_HEIGHT = 13;
1062
1250
  * the bridge and the bridge must not import it from the painter.
1063
1251
  */
1064
1252
  type HeaderFooterContent = {
1065
- /** Flow blocks for the header/footer content. */blocks: FlowBlock[]; /** Measurements for the blocks. */
1066
- measures: Measure[]; /** Total height of the content. */
1067
- height: number; /** Top-most visual extent relative to the nominal flow origin. */
1068
- visualTop?: number; /** Bottom-most visual extent relative to the nominal flow origin. */
1253
+ /** Flow blocks for the header/footer content. */
1254
+ blocks: FlowBlock[];
1255
+ /** Measurements for the blocks. */
1256
+ measures: Measure[];
1257
+ /** Total height of the content. */
1258
+ height: number;
1259
+ /** Top-most visual extent relative to the nominal flow origin. */
1260
+ visualTop?: number;
1261
+ /** Bottom-most visual extent relative to the nominal flow origin. */
1069
1262
  visualBottom?: number;
1070
1263
  /**
1071
1264
  * Flow-only bounds for consumers that need to distinguish normal