superdoc 2.2.1 → 2.3.0

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 (687) hide show
  1. package/AGENTS.md +337 -0
  2. package/LICENSE +661 -0
  3. package/NOTICE +8 -0
  4. package/README.md +107 -0
  5. package/dist/chunks/FindReplaceSurface-BEW-1NhM.es.js +344 -0
  6. package/dist/chunks/FindReplaceSurface-DLxnCQOB.cjs +346 -0
  7. package/dist/chunks/PasswordPromptSurface-BA6HHqEa.es.js +111 -0
  8. package/dist/chunks/PasswordPromptSurface-DMbfDvpQ.cjs +113 -0
  9. package/dist/chunks/PdfViewer-CNOtyS-I.es.js +531 -0
  10. package/dist/chunks/PdfViewer-CoFiGAhm.cjs +535 -0
  11. package/dist/chunks/_plugin-vue_export-helper-BTwbGDKw.cjs +11 -0
  12. package/dist/chunks/_plugin-vue_export-helper-CInC0bKI.es.js +6 -0
  13. package/dist/chunks/blank-docx-CJAXnJKp.es.js +2 -0
  14. package/dist/chunks/blank-docx-DA-G-3VB.cjs +7 -0
  15. package/dist/chunks/constants-CY3R3_kF.es.js +3 -0
  16. package/dist/chunks/constants-sbCZ2O_A.cjs +14 -0
  17. package/dist/chunks/create-super-doc-ui-CXCqHc2m.cjs +9451 -0
  18. package/dist/chunks/create-super-doc-ui-fxF2Q8Ib.es.js +9188 -0
  19. package/dist/chunks/eventemitter3-B60Fsz-a.es.js +131 -0
  20. package/dist/chunks/eventemitter3-DCfwFVNn.cjs +137 -0
  21. package/dist/chunks/jszip-BdUBlUeG.cjs +4679 -0
  22. package/dist/chunks/jszip-DzmwAHr3.es.js +4650 -0
  23. package/dist/chunks/rolldown-runtime-BJVcqBbz.es.js +43 -0
  24. package/dist/chunks/rolldown-runtime-_dR15c8t.cjs +68 -0
  25. package/dist/chunks/uuid-B2Sqk-3p.es.js +32 -0
  26. package/dist/chunks/uuid-CFp0WGVU.cjs +38 -0
  27. package/dist/collaboration-upgrade-engine.cjs +37 -0
  28. package/dist/collaboration-upgrade-engine.es.js +30 -0
  29. package/dist/document-api/src/authorities/authorities.d.ts +29 -0
  30. package/dist/document-api/src/authorities/authorities.types.d.ts +113 -0
  31. package/dist/document-api/src/blocks/blocks.d.ts +29 -0
  32. package/dist/document-api/src/bookmarks/bookmarks.d.ts +15 -0
  33. package/dist/document-api/src/bookmarks/bookmarks.types.d.ts +82 -0
  34. package/dist/document-api/src/capabilities/capabilities.d.ts +82 -0
  35. package/dist/document-api/src/captions/captions.d.ts +17 -0
  36. package/dist/document-api/src/captions/captions.types.d.ts +61 -0
  37. package/dist/document-api/src/citations/citations.d.ts +39 -0
  38. package/dist/document-api/src/citations/citations.types.d.ts +151 -0
  39. package/dist/document-api/src/clear-content/clear-content.d.ts +25 -0
  40. package/dist/document-api/src/clipboard/clipboard.d.ts +11 -0
  41. package/dist/document-api/src/comments/comments.d.ts +222 -0
  42. package/dist/document-api/src/comments/comments.types.d.ts +227 -0
  43. package/dist/document-api/src/content-controls/content-controls.d.ts +136 -0
  44. package/dist/document-api/src/content-controls/content-controls.types.d.ts +453 -0
  45. package/dist/document-api/src/contract/command-catalog.d.ts +17 -0
  46. package/dist/document-api/src/contract/index.d.ts +9 -0
  47. package/dist/document-api/src/contract/metadata-types.d.ts +30 -0
  48. package/dist/document-api/src/contract/operation-definitions.d.ts +3645 -0
  49. package/dist/document-api/src/contract/operation-map.d.ts +5 -0
  50. package/dist/document-api/src/contract/operation-registry.d.ts +2002 -0
  51. package/dist/document-api/src/contract/reference-aliases.d.ts +19 -0
  52. package/dist/document-api/src/contract/reference-doc-map.d.ts +12 -0
  53. package/dist/document-api/src/contract/schemas.d.ts +35 -0
  54. package/dist/document-api/src/contract/step-op-catalog.d.ts +26 -0
  55. package/dist/document-api/src/contract/types.d.ts +31 -0
  56. package/dist/document-api/src/create/create.d.ts +27 -0
  57. package/dist/document-api/src/cross-refs/cross-refs.d.ts +15 -0
  58. package/dist/document-api/src/cross-refs/cross-refs.types.d.ts +68 -0
  59. package/dist/document-api/src/customXml/customXml.d.ts +19 -0
  60. package/dist/document-api/src/customXml/customXml.types.d.ts +148 -0
  61. package/dist/document-api/src/delete/delete.d.ts +20 -0
  62. package/dist/document-api/src/diff/diff.d.ts +14 -0
  63. package/dist/document-api/src/diff/diff.types.d.ts +83 -0
  64. package/dist/document-api/src/diff/index.d.ts +3 -0
  65. package/dist/document-api/src/errors.d.ts +11 -0
  66. package/dist/document-api/src/export/export.d.ts +10 -0
  67. package/dist/document-api/src/export/export.types.d.ts +40 -0
  68. package/dist/document-api/src/extract/extract.d.ts +15 -0
  69. package/dist/document-api/src/fields/fields.d.ts +15 -0
  70. package/dist/document-api/src/fields/fields.types.d.ts +90 -0
  71. package/dist/document-api/src/find/find.d.ts +52 -0
  72. package/dist/document-api/src/footnotes/footnotes.d.ts +17 -0
  73. package/dist/document-api/src/footnotes/footnotes.types.d.ts +104 -0
  74. package/dist/document-api/src/format/format.d.ts +92 -0
  75. package/dist/document-api/src/format/inline-run-patch.d.ts +138 -0
  76. package/dist/document-api/src/get/get.d.ts +19 -0
  77. package/dist/document-api/src/get-html/get-html.d.ts +27 -0
  78. package/dist/document-api/src/get-markdown/get-markdown.d.ts +22 -0
  79. package/dist/document-api/src/get-node/get-node.d.ts +46 -0
  80. package/dist/document-api/src/get-text/get-text.d.ts +22 -0
  81. package/dist/document-api/src/header-footers/header-footers.d.ts +37 -0
  82. package/dist/document-api/src/header-footers/header-footers.types.d.ts +116 -0
  83. package/dist/document-api/src/history/history.d.ts +38 -0
  84. package/dist/document-api/src/history/history.types.d.ts +100 -0
  85. package/dist/document-api/src/hyperlinks/hyperlinks.d.ts +17 -0
  86. package/dist/document-api/src/hyperlinks/hyperlinks.types.d.ts +112 -0
  87. package/dist/document-api/src/images/images.d.ts +63 -0
  88. package/dist/document-api/src/images/images.types.d.ts +209 -0
  89. package/dist/document-api/src/images/z-order.d.ts +10 -0
  90. package/dist/document-api/src/index/index.d.ts +29 -0
  91. package/dist/document-api/src/index/index.types.d.ts +125 -0
  92. package/dist/document-api/src/index.d.ts +560 -0
  93. package/dist/document-api/src/info/info.d.ts +19 -0
  94. package/dist/document-api/src/inline-semantics/directives.d.ts +95 -0
  95. package/dist/document-api/src/inline-semantics/error-types.d.ts +68 -0
  96. package/dist/document-api/src/inline-semantics/index.d.ts +20 -0
  97. package/dist/document-api/src/inline-semantics/property-ids.d.ts +24 -0
  98. package/dist/document-api/src/inline-semantics/token-parsers.d.ts +59 -0
  99. package/dist/document-api/src/inline-semantics/token-sets.d.ts +34 -0
  100. package/dist/document-api/src/insert/insert.d.ts +65 -0
  101. package/dist/document-api/src/invoke/invoke.d.ts +17 -0
  102. package/dist/document-api/src/lists/lists.d.ts +100 -0
  103. package/dist/document-api/src/lists/lists.types.d.ts +499 -0
  104. package/dist/document-api/src/markdown-to-fragment/markdown-to-fragment.d.ts +15 -0
  105. package/dist/document-api/src/metadata/anchored-metadata.d.ts +33 -0
  106. package/dist/document-api/src/metadata/anchored-metadata.types.d.ts +175 -0
  107. package/dist/document-api/src/paragraphs/paragraphs.d.ts +84 -0
  108. package/dist/document-api/src/paragraphs/paragraphs.types.d.ts +214 -0
  109. package/dist/document-api/src/permission-ranges/permission-ranges.d.ts +15 -0
  110. package/dist/document-api/src/permission-ranges/permission-ranges.types.d.ts +49 -0
  111. package/dist/document-api/src/plan/plan.d.ts +73 -0
  112. package/dist/document-api/src/protection/protection.d.ts +11 -0
  113. package/dist/document-api/src/protection/protection.types.d.ts +47 -0
  114. package/dist/document-api/src/ranges/index.d.ts +2 -0
  115. package/dist/document-api/src/ranges/ranges.types.d.ts +121 -0
  116. package/dist/document-api/src/ranges/resolve.d.ts +2 -0
  117. package/dist/document-api/src/receipt-bridge.d.ts +30 -0
  118. package/dist/document-api/src/replace/replace.d.ts +24 -0
  119. package/dist/document-api/src/sections/sections.d.ts +42 -0
  120. package/dist/document-api/src/sections/sections.types.d.ts +236 -0
  121. package/dist/document-api/src/selection/selection.d.ts +23 -0
  122. package/dist/document-api/src/selection/selection.types.d.ts +85 -0
  123. package/dist/document-api/src/selection-mutation.d.ts +46 -0
  124. package/dist/document-api/src/styles/apply.d.ts +142 -0
  125. package/dist/document-api/src/styles/catalog.d.ts +154 -0
  126. package/dist/document-api/src/styles/index.d.ts +14 -0
  127. package/dist/document-api/src/styles/registry.d.ts +43 -0
  128. package/dist/document-api/src/styles/schema.d.ts +9 -0
  129. package/dist/document-api/src/styles/validation.d.ts +38 -0
  130. package/dist/document-api/src/tables/color-formats.d.ts +12 -0
  131. package/dist/document-api/src/tables/tables.d.ts +83 -0
  132. package/dist/document-api/src/templates/apply.d.ts +160 -0
  133. package/dist/document-api/src/templates/index.d.ts +7 -0
  134. package/dist/document-api/src/toc/toc.d.ts +25 -0
  135. package/dist/document-api/src/toc/toc.types.d.ts +247 -0
  136. package/dist/document-api/src/track-changes/track-changes.d.ts +177 -0
  137. package/dist/document-api/src/types/adapter-result.d.ts +10 -0
  138. package/dist/document-api/src/types/address.d.ts +169 -0
  139. package/dist/document-api/src/types/base.d.ts +89 -0
  140. package/dist/document-api/src/types/blocks.types.d.ts +190 -0
  141. package/dist/document-api/src/types/clipboard.d.ts +216 -0
  142. package/dist/document-api/src/types/comments.types.d.ts +17 -0
  143. package/dist/document-api/src/types/create.types.d.ts +56 -0
  144. package/dist/document-api/src/types/discovery.d.ts +99 -0
  145. package/dist/document-api/src/types/extract.types.d.ts +163 -0
  146. package/dist/document-api/src/types/fragment.d.ts +29 -0
  147. package/dist/document-api/src/types/index.d.ts +30 -0
  148. package/dist/document-api/src/types/info.types.d.ts +109 -0
  149. package/dist/document-api/src/types/inline.types.d.ts +28 -0
  150. package/dist/document-api/src/types/media.types.d.ts +72 -0
  151. package/dist/document-api/src/types/mutation-plan.types.d.ts +264 -0
  152. package/dist/document-api/src/types/node.d.ts +9 -0
  153. package/dist/document-api/src/types/paragraph.types.d.ts +61 -0
  154. package/dist/document-api/src/types/placement.d.ts +24 -0
  155. package/dist/document-api/src/types/query-match.types.d.ts +212 -0
  156. package/dist/document-api/src/types/query.d.ts +133 -0
  157. package/dist/document-api/src/types/receipt.d.ts +191 -0
  158. package/dist/document-api/src/types/references.types.d.ts +9 -0
  159. package/dist/document-api/src/types/sd-contract.d.ts +54 -0
  160. package/dist/document-api/src/types/sd-envelope.d.ts +59 -0
  161. package/dist/document-api/src/types/sd-nodes.d.ts +375 -0
  162. package/dist/document-api/src/types/sd-objects.d.ts +144 -0
  163. package/dist/document-api/src/types/sd-props.d.ts +240 -0
  164. package/dist/document-api/src/types/sd-sections.d.ts +126 -0
  165. package/dist/document-api/src/types/sd-styles.d.ts +36 -0
  166. package/dist/document-api/src/types/step-manifest.types.d.ts +30 -0
  167. package/dist/document-api/src/types/story.types.d.ts +123 -0
  168. package/dist/document-api/src/types/structural-input.d.ts +40 -0
  169. package/dist/document-api/src/types/structured.types.d.ts +21 -0
  170. package/dist/document-api/src/types/style-policy.types.d.ts +49 -0
  171. package/dist/document-api/src/types/table-operations.types.d.ts +618 -0
  172. package/dist/document-api/src/types/tables.types.d.ts +43 -0
  173. package/dist/document-api/src/types/toc.types.d.ts +1 -0
  174. package/dist/document-api/src/types/track-changes.types.d.ts +703 -0
  175. package/dist/document-api/src/validation/create-location-validator.d.ts +2 -0
  176. package/dist/document-api/src/validation/fragment-validator.d.ts +13 -0
  177. package/dist/document-api/src/validation/selection-target-validator.d.ts +7 -0
  178. package/dist/document-api/src/validation/story-validator.d.ts +12 -0
  179. package/dist/document-api/src/validation-primitives.d.ts +29 -0
  180. package/dist/document-api/src/write/locator.d.ts +24 -0
  181. package/dist/document-api/src/write/write.d.ts +73 -0
  182. package/dist/images/altText_add.svg +3 -0
  183. package/dist/images/altText_disclaimer.svg +3 -0
  184. package/dist/images/altText_done.svg +3 -0
  185. package/dist/images/altText_spinner.svg +30 -0
  186. package/dist/images/altText_warning.svg +3 -0
  187. package/dist/images/annotation-check.svg +11 -0
  188. package/dist/images/annotation-comment.svg +16 -0
  189. package/dist/images/annotation-help.svg +26 -0
  190. package/dist/images/annotation-insert.svg +10 -0
  191. package/dist/images/annotation-key.svg +11 -0
  192. package/dist/images/annotation-newparagraph.svg +11 -0
  193. package/dist/images/annotation-noicon.svg +7 -0
  194. package/dist/images/annotation-note.svg +42 -0
  195. package/dist/images/annotation-paperclip.svg +6 -0
  196. package/dist/images/annotation-paragraph.svg +16 -0
  197. package/dist/images/annotation-pushpin.svg +7 -0
  198. package/dist/images/checkmark.svg +5 -0
  199. package/dist/images/comment-actionsButton.svg +3 -0
  200. package/dist/images/comment-closeButton.svg +3 -0
  201. package/dist/images/comment-editButton.svg +8 -0
  202. package/dist/images/comment-popup-editButton.svg +5 -0
  203. package/dist/images/cursor-editorFreeHighlight.svg +6 -0
  204. package/dist/images/cursor-editorFreeText.svg +3 -0
  205. package/dist/images/cursor-editorInk.svg +4 -0
  206. package/dist/images/cursor-editorTextHighlight.svg +8 -0
  207. package/dist/images/editor-toolbar-delete.svg +5 -0
  208. package/dist/images/editor-toolbar-edit.svg +3 -0
  209. package/dist/images/findbarButton-next.svg +3 -0
  210. package/dist/images/findbarButton-previous.svg +3 -0
  211. package/dist/images/gv-toolbarButton-download.svg +3 -0
  212. package/dist/images/loading-icon.gif +0 -0
  213. package/dist/images/loading.svg +1 -0
  214. package/dist/images/messageBar_closingButton.svg +3 -0
  215. package/dist/images/messageBar_info.svg +3 -0
  216. package/dist/images/messageBar_warning.svg +3 -0
  217. package/dist/images/pages_closeButton.svg +3 -0
  218. package/dist/images/pages_selected.svg +7 -0
  219. package/dist/images/pages_viewArrow.svg +3 -0
  220. package/dist/images/pages_viewButton.svg +3 -0
  221. package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
  222. package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
  223. package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
  224. package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
  225. package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  226. package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
  227. package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  228. package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
  229. package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  230. package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  231. package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
  232. package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
  233. package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
  234. package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  235. package/dist/images/toolbarButton-bookmark.svg +3 -0
  236. package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
  237. package/dist/images/toolbarButton-download.svg +4 -0
  238. package/dist/images/toolbarButton-editorFreeText.svg +5 -0
  239. package/dist/images/toolbarButton-editorHighlight.svg +6 -0
  240. package/dist/images/toolbarButton-editorInk.svg +4 -0
  241. package/dist/images/toolbarButton-editorSignature.svg +6 -0
  242. package/dist/images/toolbarButton-editorStamp.svg +8 -0
  243. package/dist/images/toolbarButton-menuArrow.svg +3 -0
  244. package/dist/images/toolbarButton-openFile.svg +3 -0
  245. package/dist/images/toolbarButton-pageDown.svg +3 -0
  246. package/dist/images/toolbarButton-pageUp.svg +3 -0
  247. package/dist/images/toolbarButton-presentationMode.svg +3 -0
  248. package/dist/images/toolbarButton-print.svg +3 -0
  249. package/dist/images/toolbarButton-search.svg +3 -0
  250. package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  251. package/dist/images/toolbarButton-viewAttachments.svg +3 -0
  252. package/dist/images/toolbarButton-viewLayers.svg +3 -0
  253. package/dist/images/toolbarButton-viewOutline.svg +3 -0
  254. package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
  255. package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
  256. package/dist/images/toolbarButton-zoomIn.svg +3 -0
  257. package/dist/images/toolbarButton-zoomOut.svg +3 -0
  258. package/dist/images/treeitem-collapsed.svg +1 -0
  259. package/dist/images/treeitem-expanded.svg +1 -0
  260. package/dist/layout-engine/contracts/src/author-colors.d.ts +56 -0
  261. package/dist/layout-engine/contracts/src/cell-spacing.d.ts +12 -0
  262. package/dist/layout-engine/contracts/src/clip-path-inset.d.ts +27 -0
  263. package/dist/layout-engine/contracts/src/column-layout.d.ts +79 -0
  264. package/dist/layout-engine/contracts/src/direction-context.d.ts +219 -0
  265. package/dist/layout-engine/contracts/src/drawing-taxonomy.d.ts +126 -0
  266. package/dist/layout-engine/contracts/src/engines/image-wrap.d.ts +54 -0
  267. package/dist/layout-engine/contracts/src/engines/index.d.ts +17 -0
  268. package/dist/layout-engine/contracts/src/engines/lists.d.ts +57 -0
  269. package/dist/layout-engine/contracts/src/engines/paragraph.d.ts +59 -0
  270. package/dist/layout-engine/contracts/src/engines/tables.d.ts +89 -0
  271. package/dist/layout-engine/contracts/src/engines/tabs.d.ts +117 -0
  272. package/dist/layout-engine/contracts/src/graphic-placement.d.ts +76 -0
  273. package/dist/layout-engine/contracts/src/header-footer-inheritance.d.ts +22 -0
  274. package/dist/layout-engine/contracts/src/header-footer-resolution.d.ts +28 -0
  275. package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +10 -0
  276. package/dist/layout-engine/contracts/src/index.d.ts +2459 -0
  277. package/dist/layout-engine/contracts/src/justify-utils.d.ts +98 -0
  278. package/dist/layout-engine/contracts/src/layout-identity.d.ts +136 -0
  279. package/dist/layout-engine/contracts/src/ooxml-z-index.d.ts +46 -0
  280. package/dist/layout-engine/contracts/src/page-number-formatting.d.ts +26 -0
  281. package/dist/layout-engine/contracts/src/page-ref-anchor.d.ts +2 -0
  282. package/dist/layout-engine/contracts/src/pm-range.d.ts +45 -0
  283. package/dist/layout-engine/contracts/src/resolved-layout.d.ts +541 -0
  284. package/dist/layout-engine/contracts/src/run-helpers.d.ts +23 -0
  285. package/dist/layout-engine/contracts/src/sdt-container.d.ts +13 -0
  286. package/dist/layout-engine/contracts/src/segment-geometry.d.ts +192 -0
  287. package/dist/layout-engine/contracts/src/semantic-colors.d.ts +150 -0
  288. package/dist/layout-engine/contracts/src/table-cell-spacing.d.ts +12 -0
  289. package/dist/layout-engine/contracts/src/table-column-rescale.d.ts +13 -0
  290. package/dist/layout-engine/contracts/src/vertical-text.d.ts +43 -0
  291. package/dist/layout-engine/dom-contract/src/class-names.d.ts +62 -0
  292. package/dist/layout-engine/dom-contract/src/data-attrs.d.ts +103 -0
  293. package/dist/layout-engine/dom-contract/src/index.d.ts +18 -0
  294. package/dist/layout-engine/dom-contract/src/selectors.d.ts +47 -0
  295. package/dist/layout-engine/layout-bridge/src/cache-warmer.d.ts +73 -0
  296. package/dist/layout-engine/layout-bridge/src/cache.d.ts +143 -0
  297. package/dist/layout-engine/layout-bridge/src/cacheInvalidation.d.ts +117 -0
  298. package/dist/layout-engine/layout-bridge/src/cursor-renderer.d.ts +201 -0
  299. package/dist/layout-engine/layout-bridge/src/debounced-passes.d.ts +130 -0
  300. package/dist/layout-engine/layout-bridge/src/diff.d.ts +36 -0
  301. package/dist/layout-engine/layout-bridge/src/dirty-tracker.d.ts +128 -0
  302. package/dist/layout-engine/layout-bridge/src/dom-mapping.d.ts +80 -0
  303. package/dist/layout-engine/layout-bridge/src/featureFlags.d.ts +95 -0
  304. package/dist/layout-engine/layout-bridge/src/field-annotation-key.d.ts +2 -0
  305. package/dist/layout-engine/layout-bridge/src/focus-watchdog.d.ts +170 -0
  306. package/dist/layout-engine/layout-bridge/src/font-metrics-cache.d.ts +164 -0
  307. package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +63 -0
  308. package/dist/layout-engine/layout-bridge/src/headerFooterUtils.d.ts +218 -0
  309. package/dist/layout-engine/layout-bridge/src/ime-handler.d.ts +81 -0
  310. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +390 -0
  311. package/dist/layout-engine/layout-bridge/src/index.d.ts +211 -0
  312. package/dist/layout-engine/layout-bridge/src/instrumentation.d.ts +245 -0
  313. package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +123 -0
  314. package/dist/layout-engine/layout-bridge/src/list-indent-utils.d.ts +205 -0
  315. package/dist/layout-engine/layout-bridge/src/local-paragraph-layout.d.ts +93 -0
  316. package/dist/layout-engine/layout-bridge/src/neutral-hit.d.ts +142 -0
  317. package/dist/layout-engine/layout-bridge/src/neutral-segment-geometry.d.ts +32 -0
  318. package/dist/layout-engine/layout-bridge/src/page-geometry-helper.d.ts +197 -0
  319. package/dist/layout-engine/layout-bridge/src/paragraph-hash-utils.d.ts +126 -0
  320. package/dist/layout-engine/layout-bridge/src/paragraph-line-cache.d.ts +152 -0
  321. package/dist/layout-engine/layout-bridge/src/performance-metrics.d.ts +249 -0
  322. package/dist/layout-engine/layout-bridge/src/pm-dom-fallback.d.ts +188 -0
  323. package/dist/layout-engine/layout-bridge/src/pm-position-validator.d.ts +100 -0
  324. package/dist/layout-engine/layout-bridge/src/position-hit.d.ts +167 -0
  325. package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +75 -0
  326. package/dist/layout-engine/layout-bridge/src/resolveHeaderFooterTokens.d.ts +76 -0
  327. package/dist/layout-engine/layout-bridge/src/rtl-text-geometry.d.ts +34 -0
  328. package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +12 -0
  329. package/dist/layout-engine/layout-bridge/src/safety-net.d.ts +234 -0
  330. package/dist/layout-engine/layout-bridge/src/sectionAwareHeaderFooter.d.ts +15 -0
  331. package/dist/layout-engine/layout-bridge/src/table-handler.d.ts +86 -0
  332. package/dist/layout-engine/layout-bridge/src/text-boundaries.d.ts +17 -0
  333. package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +69 -0
  334. package/dist/layout-engine/layout-bridge/src/track-changes-handler.d.ts +90 -0
  335. package/dist/layout-engine/layout-bridge/src/tracked-changes-utils.d.ts +41 -0
  336. package/dist/layout-engine/layout-engine/src/anchors.d.ts +52 -0
  337. package/dist/layout-engine/layout-engine/src/column-balancing.d.ts +255 -0
  338. package/dist/layout-engine/layout-engine/src/column-utils.d.ts +1 -0
  339. package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +60 -0
  340. package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +21 -0
  341. package/dist/layout-engine/layout-engine/src/index.d.ts +349 -0
  342. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +60 -0
  343. package/dist/layout-engine/layout-engine/src/layout-image.d.ts +16 -0
  344. package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +101 -0
  345. package/dist/layout-engine/layout-engine/src/layout-table.d.ts +71 -0
  346. package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +4 -0
  347. package/dist/layout-engine/layout-engine/src/layout-utils.d.ts +104 -0
  348. package/dist/layout-engine/layout-engine/src/normalize-header-footer-fragments.d.ts +45 -0
  349. package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +73 -0
  350. package/dist/layout-engine/layout-engine/src/paginator.d.ts +131 -0
  351. package/dist/layout-engine/layout-engine/src/paragraph-layout-eligibility.d.ts +1 -0
  352. package/dist/layout-engine/layout-engine/src/resolvePageRefs.d.ts +31 -0
  353. package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +82 -0
  354. package/dist/layout-engine/layout-engine/src/section-breaks.d.ts +98 -0
  355. package/dist/layout-engine/layout-engine/src/section-props.d.ts +65 -0
  356. package/dist/layout-engine/layout-engine/src/table-cell-slice.d.ts +98 -0
  357. package/dist/layout-engine/painters/dom/src/_test-utils.d.ts +21 -0
  358. package/dist/layout-engine/painters/dom/src/chart-renderer.d.ts +13 -0
  359. package/dist/layout-engine/painters/dom/src/constants.d.ts +10 -0
  360. package/dist/layout-engine/painters/dom/src/css-token.d.ts +10 -0
  361. package/dist/layout-engine/painters/dom/src/features/feature-registry.d.ts +41 -0
  362. package/dist/layout-engine/painters/dom/src/features/inline-direction/index.d.ts +22 -0
  363. package/dist/layout-engine/painters/dom/src/features/inline-direction/rtl-styles.d.ts +27 -0
  364. package/dist/layout-engine/painters/dom/src/features/inline-direction/run-direction.d.ts +75 -0
  365. package/dist/layout-engine/painters/dom/src/features/math/converters/accent.d.ts +25 -0
  366. package/dist/layout-engine/painters/dom/src/features/math/converters/bar.d.ts +16 -0
  367. package/dist/layout-engine/painters/dom/src/features/math/converters/box.d.ts +38 -0
  368. package/dist/layout-engine/painters/dom/src/features/math/converters/delimiter.d.ts +13 -0
  369. package/dist/layout-engine/painters/dom/src/features/math/converters/equation-array.d.ts +19 -0
  370. package/dist/layout-engine/painters/dom/src/features/math/converters/fraction.d.ts +13 -0
  371. package/dist/layout-engine/painters/dom/src/features/math/converters/function.d.ts +16 -0
  372. package/dist/layout-engine/painters/dom/src/features/math/converters/group-character.d.ts +26 -0
  373. package/dist/layout-engine/painters/dom/src/features/math/converters/index.d.ts +27 -0
  374. package/dist/layout-engine/painters/dom/src/features/math/converters/lower-limit.d.ts +13 -0
  375. package/dist/layout-engine/painters/dom/src/features/math/converters/math-run.d.ts +47 -0
  376. package/dist/layout-engine/painters/dom/src/features/math/converters/matrix.d.ts +23 -0
  377. package/dist/layout-engine/painters/dom/src/features/math/converters/nary.d.ts +23 -0
  378. package/dist/layout-engine/painters/dom/src/features/math/converters/phantom.d.ts +17 -0
  379. package/dist/layout-engine/painters/dom/src/features/math/converters/pre-sub-superscript.d.ts +25 -0
  380. package/dist/layout-engine/painters/dom/src/features/math/converters/radical.d.ts +14 -0
  381. package/dist/layout-engine/painters/dom/src/features/math/converters/sub-superscript.d.ts +13 -0
  382. package/dist/layout-engine/painters/dom/src/features/math/converters/subscript.d.ts +13 -0
  383. package/dist/layout-engine/painters/dom/src/features/math/converters/superscript.d.ts +13 -0
  384. package/dist/layout-engine/painters/dom/src/features/math/converters/upper-limit.d.ts +13 -0
  385. package/dist/layout-engine/painters/dom/src/features/math/index.d.ts +14 -0
  386. package/dist/layout-engine/painters/dom/src/features/math/omml-to-mathml.d.ts +18 -0
  387. package/dist/layout-engine/painters/dom/src/features/math/types.d.ts +41 -0
  388. package/dist/layout-engine/painters/dom/src/images/drawing-image.d.ts +5 -0
  389. package/dist/layout-engine/painters/dom/src/images/hyperlink.d.ts +2 -0
  390. package/dist/layout-engine/painters/dom/src/images/image-block.d.ts +15 -0
  391. package/dist/layout-engine/painters/dom/src/images/image-clip-path.d.ts +17 -0
  392. package/dist/layout-engine/painters/dom/src/images/image-fragment.d.ts +34 -0
  393. package/dist/layout-engine/painters/dom/src/images/image-selectors.d.ts +9 -0
  394. package/dist/layout-engine/painters/dom/src/images/types.d.ts +2 -0
  395. package/dist/layout-engine/painters/dom/src/index.d.ts +125 -0
  396. package/dist/layout-engine/painters/dom/src/page-content.d.ts +209 -0
  397. package/dist/layout-engine/painters/dom/src/paragraph/block-version.d.ts +8 -0
  398. package/dist/layout-engine/painters/dom/src/paragraph/borders/border-layer.d.ts +59 -0
  399. package/dist/layout-engine/painters/dom/src/paragraph/borders/group-analysis.d.ts +38 -0
  400. package/dist/layout-engine/painters/dom/src/paragraph/borders/index.d.ts +18 -0
  401. package/dist/layout-engine/painters/dom/src/paragraph/frame.d.ts +3 -0
  402. package/dist/layout-engine/painters/dom/src/paragraph/indentation.d.ts +25 -0
  403. package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +51 -0
  404. package/dist/layout-engine/painters/dom/src/paragraph/marker-tracked-change.d.ts +34 -0
  405. package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphContent.d.ts +87 -0
  406. package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphFragment.d.ts +33 -0
  407. package/dist/layout-engine/painters/dom/src/paragraph/styles.d.ts +3 -0
  408. package/dist/layout-engine/painters/dom/src/paragraph-hash-utils.d.ts +13 -0
  409. package/dist/layout-engine/painters/dom/src/pm-position-validation.d.ts +149 -0
  410. package/dist/layout-engine/painters/dom/src/renderer.d.ts +681 -0
  411. package/dist/layout-engine/painters/dom/src/ruler/index.d.ts +41 -0
  412. package/dist/layout-engine/painters/dom/src/ruler/ruler-core.d.ts +195 -0
  413. package/dist/layout-engine/painters/dom/src/ruler/ruler-renderer.d.ts +97 -0
  414. package/dist/layout-engine/painters/dom/src/ruler/ruler-styles.d.ts +31 -0
  415. package/dist/layout-engine/painters/dom/src/runs/field-annotation-run.d.ts +14 -0
  416. package/dist/layout-engine/painters/dom/src/runs/font-synthesis.d.ts +1 -0
  417. package/dist/layout-engine/painters/dom/src/runs/formatting-marks.d.ts +3 -0
  418. package/dist/layout-engine/painters/dom/src/runs/hash.d.ts +82 -0
  419. package/dist/layout-engine/painters/dom/src/runs/image-run.d.ts +37 -0
  420. package/dist/layout-engine/painters/dom/src/runs/index.d.ts +13 -0
  421. package/dist/layout-engine/painters/dom/src/runs/links.d.ts +58 -0
  422. package/dist/layout-engine/painters/dom/src/runs/math-run.d.ts +7 -0
  423. package/dist/layout-engine/painters/dom/src/runs/render-line.d.ts +2 -0
  424. package/dist/layout-engine/painters/dom/src/runs/render-run.d.ts +12 -0
  425. package/dist/layout-engine/painters/dom/src/runs/tab-run.d.ts +66 -0
  426. package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +35 -0
  427. package/dist/layout-engine/painters/dom/src/runs/tracked-changes.d.ts +90 -0
  428. package/dist/layout-engine/painters/dom/src/runs/types.d.ts +67 -0
  429. package/dist/layout-engine/painters/dom/src/sdt/boundaries.d.ts +16 -0
  430. package/dist/layout-engine/painters/dom/src/sdt/container.d.ts +32 -0
  431. package/dist/layout-engine/painters/dom/src/sdt/dataset.d.ts +7 -0
  432. package/dist/layout-engine/painters/dom/src/sdt/inline.d.ts +9 -0
  433. package/dist/layout-engine/painters/dom/src/sdt/snapshot.d.ts +29 -0
  434. package/dist/layout-engine/painters/dom/src/styles.d.ts +71 -0
  435. package/dist/layout-engine/painters/dom/src/svg-utils.d.ts +101 -0
  436. package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +185 -0
  437. package/dist/layout-engine/painters/dom/src/table/grid-geometry.d.ts +69 -0
  438. package/dist/layout-engine/painters/dom/src/table/renderTableCell.d.ts +170 -0
  439. package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +132 -0
  440. package/dist/layout-engine/painters/dom/src/table/renderTableRow.d.ts +146 -0
  441. package/dist/layout-engine/painters/dom/src/test-utils/normalize-line.d.ts +39 -0
  442. package/dist/layout-engine/painters/dom/src/utils/anchor-helpers.d.ts +3 -0
  443. package/dist/layout-engine/painters/dom/src/utils/apply-styles.d.ts +1 -0
  444. package/dist/layout-engine/painters/dom/src/utils/layout-identity.d.ts +9 -0
  445. package/dist/layout-engine/painters/dom/src/utils/source-anchor.d.ts +2 -0
  446. package/dist/layout-engine/style-engine/src/bench/resolveSdtMetadata.bench.d.ts +1 -0
  447. package/dist/layout-engine/style-engine/src/cascade.d.ts +43 -0
  448. package/dist/layout-engine/style-engine/src/index.d.ts +121 -0
  449. package/dist/layout-engine/style-engine/src/normalize/colors.d.ts +13 -0
  450. package/dist/layout-engine/style-engine/src/normalize/index.d.ts +13 -0
  451. package/dist/layout-engine/style-engine/src/normalize/paragraph-attrs.d.ts +3 -0
  452. package/dist/layout-engine/style-engine/src/normalize/run-attrs.d.ts +17 -0
  453. package/dist/layout-engine/style-engine/src/normalize/types.d.ts +36 -0
  454. package/dist/layout-engine/style-engine/src/normalize/units.d.ts +13 -0
  455. package/dist/layout-engine/style-engine/src/ooxml/index.d.ts +64 -0
  456. package/dist/layout-engine/style-engine/src/ooxml/numbering-types.d.ts +126 -0
  457. package/dist/layout-engine/style-engine/src/ooxml/styles-types.d.ts +363 -0
  458. package/dist/layout-engine/style-engine/src/ooxml/table-style-selection.d.ts +86 -0
  459. package/dist/layout-engine/style-engine/src/ooxml/types.d.ts +459 -0
  460. package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +33 -0
  461. package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-xml.d.ts +29 -0
  462. package/dist/public/ui-react.cjs +175 -0
  463. package/dist/public/ui-react.es.js +159 -0
  464. package/dist/public/ui.cjs +5 -0
  465. package/dist/public/ui.es.js +2 -0
  466. package/dist/shared/common/comments-types.d.ts +102 -0
  467. package/dist/shared/common/layout-constants.d.ts +7 -0
  468. package/dist/shared/common/list-marker-utils.d.ts +186 -0
  469. package/dist/shared/common/list-numbering/index.d.ts +16 -0
  470. package/dist/shared/font-system/src/activation.d.ts +64 -0
  471. package/dist/shared/font-system/src/bundled-manifest.d.ts +32 -0
  472. package/dist/shared/font-system/src/bundled.d.ts +41 -0
  473. package/dist/shared/font-system/src/document-font-options.d.ts +53 -0
  474. package/dist/shared/font-system/src/epoch.d.ts +6 -0
  475. package/dist/shared/font-system/src/font-offerings.d.ts +120 -0
  476. package/dist/shared/font-system/src/index.d.ts +35 -0
  477. package/dist/shared/font-system/src/os2.d.ts +30 -0
  478. package/dist/shared/font-system/src/registry.d.ts +188 -0
  479. package/dist/shared/font-system/src/report.d.ts +98 -0
  480. package/dist/shared/font-system/src/resolver.d.ts +215 -0
  481. package/dist/shared/font-system/src/substitution-evidence.d.ts +103 -0
  482. package/dist/shared/font-system/src/types.d.ts +128 -0
  483. package/dist/style.css +3316 -0
  484. package/dist/style.layered.css +3316 -0
  485. package/dist/superdoc/src/SuperDoc.vue.d.ts +88 -0
  486. package/dist/superdoc/src/cdn-entry.d.ts +2 -0
  487. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +62 -0
  488. package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +26 -0
  489. package/dist/superdoc/src/components/CommentsLayer/CommentInput.vue.d.ts +19 -0
  490. package/dist/superdoc/src/components/CommentsLayer/CommentsDropdown.vue.d.ts +30 -0
  491. package/dist/superdoc/src/components/CommentsLayer/InternalDropdown.vue.d.ts +10 -0
  492. package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +1 -0
  493. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +6 -0
  494. package/dist/superdoc/src/components/CommentsLayer/comment-schemas.d.ts +18 -0
  495. package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +9 -0
  496. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +21 -0
  497. package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +28 -0
  498. package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +7 -0
  499. package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +2 -0
  500. package/dist/superdoc/src/components/CommentsLayer/types.d.ts +3 -0
  501. package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +8 -0
  502. package/dist/superdoc/src/components/CommentsLayer/use-conversation.d.ts +22 -0
  503. package/dist/superdoc/src/components/CommentsLayer/use-floating-comment.d.ts +11 -0
  504. package/dist/superdoc/src/components/HtmlViewer/HtmlViewer.vue.d.ts +10 -0
  505. package/dist/superdoc/src/components/PdfViewer/PdfViewer.vue.d.ts +61 -0
  506. package/dist/superdoc/src/components/PdfViewer/PdfViewerDocument.vue.d.ts +21 -0
  507. package/dist/superdoc/src/components/PdfViewer/PdfViewerPage.vue.d.ts +24 -0
  508. package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +19 -0
  509. package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +17 -0
  510. package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +18 -0
  511. package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +19 -0
  512. package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +17 -0
  513. package/dist/superdoc/src/components/surfaces/SurfaceDialog.vue.d.ts +12 -0
  514. package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +19 -0
  515. package/dist/superdoc/src/components/surfaces/SurfaceFloating.vue.d.ts +10 -0
  516. package/dist/superdoc/src/components/surfaces/SurfaceHost.vue.d.ts +31 -0
  517. package/dist/superdoc/src/components/surfaces/focusable-selector.d.ts +5 -0
  518. package/dist/superdoc/src/composables/find-shortcut-owner.d.ts +32 -0
  519. package/dist/superdoc/src/composables/replace-continuation.d.ts +37 -0
  520. package/dist/superdoc/src/composables/use-ai.d.ts +10 -0
  521. package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +10 -0
  522. package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +21 -0
  523. package/dist/superdoc/src/composables/use-document.d.ts +34 -0
  524. package/dist/superdoc/src/composables/use-field.d.ts +33 -0
  525. package/dist/superdoc/src/composables/use-find-replace.d.ts +83 -0
  526. package/dist/superdoc/src/composables/use-high-contrast-mode.d.ts +4 -0
  527. package/dist/superdoc/src/composables/use-link-popover.d.ts +221 -0
  528. package/dist/superdoc/src/composables/use-password-prompt.d.ts +33 -0
  529. package/dist/superdoc/src/composables/use-selected-text.d.ts +16 -0
  530. package/dist/superdoc/src/composables/use-viewport-fit.d.ts +50 -0
  531. package/dist/superdoc/src/composables/useUiFontFamily.d.ts +24 -0
  532. package/dist/superdoc/src/core/EventEmitter.d.ts +55 -0
  533. package/dist/superdoc/src/core/SuperDoc.d.ts +775 -0
  534. package/dist/superdoc/src/core/collaboration/collaboration-comments.d.ts +4 -0
  535. package/dist/superdoc/src/core/collaboration/collaboration.d.ts +28 -0
  536. package/dist/superdoc/src/core/collaboration/helpers.d.ts +8 -0
  537. package/dist/superdoc/src/core/collaboration/permissions.d.ts +19 -0
  538. package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +99 -0
  539. package/dist/superdoc/src/core/collaboration/room-overwrite.d.ts +22 -0
  540. package/dist/superdoc/src/core/collaboration/v2-awareness-bridge.d.ts +57 -0
  541. package/dist/superdoc/src/core/config/merge-defined.d.ts +35 -0
  542. package/dist/superdoc/src/core/config/normalize-interaction-config.d.ts +15 -0
  543. package/dist/superdoc/src/core/config/normalize-surfaces-config.d.ts +23 -0
  544. package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +62 -0
  545. package/dist/superdoc/src/core/create-app.d.ts +32 -0
  546. package/dist/superdoc/src/core/editor-runtime/conformance/fake-v2-runtime.d.ts +9 -0
  547. package/dist/superdoc/src/core/editor-runtime/editor-runtime-registry.d.ts +117 -0
  548. package/dist/superdoc/src/core/editor-runtime/index.d.ts +1 -0
  549. package/dist/superdoc/src/core/editor-runtime/root-marker.d.ts +33 -0
  550. package/dist/superdoc/src/core/editor-runtime/types.d.ts +405 -0
  551. package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +185 -0
  552. package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +47 -0
  553. package/dist/superdoc/src/core/extensions/define.d.ts +56 -0
  554. package/dist/superdoc/src/core/extensions/index.d.ts +2 -0
  555. package/dist/superdoc/src/core/extensions/types.d.ts +519 -0
  556. package/dist/superdoc/src/core/helpers/export.d.ts +2 -0
  557. package/dist/superdoc/src/core/helpers/file.d.ts +43 -0
  558. package/dist/superdoc/src/core/helpers/normalize-track-changes-config.d.ts +60 -0
  559. package/dist/superdoc/src/core/helpers/normalize-user.d.ts +13 -0
  560. package/dist/superdoc/src/core/index.d.ts +1 -0
  561. package/dist/superdoc/src/core/pdf/helpers/constants.d.ts +2 -0
  562. package/dist/superdoc/src/core/pdf/helpers/floor.d.ts +1 -0
  563. package/dist/superdoc/src/core/pdf/helpers/range.d.ts +1 -0
  564. package/dist/superdoc/src/core/pdf/helpers/read-file.d.ts +1 -0
  565. package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +66 -0
  566. package/dist/superdoc/src/core/surface-manager.d.ts +90 -0
  567. package/dist/superdoc/src/core/theme/create-theme.d.ts +82 -0
  568. package/dist/superdoc/src/core/types/index.d.ts +3006 -0
  569. package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +3 -0
  570. package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +16 -0
  571. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +97 -0
  572. package/dist/superdoc/src/core/whiteboard/Whiteboard.d.ts +247 -0
  573. package/dist/superdoc/src/core/whiteboard/WhiteboardPage.d.ts +251 -0
  574. package/dist/superdoc/src/core/whiteboard/WhiteboardRenderer.d.ts +2 -0
  575. package/dist/superdoc/src/core/whiteboard/helpers/createTextarea.d.ts +1 -0
  576. package/dist/superdoc/src/core/whiteboard/helpers/flattenPoints.d.ts +1 -0
  577. package/dist/superdoc/src/core/whiteboard/helpers/getRandomId.d.ts +1 -0
  578. package/dist/superdoc/src/helpers/collect-touched-tracked-change-ids.d.ts +11 -0
  579. package/dist/superdoc/src/helpers/comment-focus.d.ts +4 -0
  580. package/dist/superdoc/src/helpers/comment-small-screen.d.ts +14 -0
  581. package/dist/superdoc/src/helpers/deprecation.d.ts +26 -0
  582. package/dist/superdoc/src/helpers/floor.d.ts +1 -0
  583. package/dist/superdoc/src/helpers/group-changes.d.ts +1 -0
  584. package/dist/superdoc/src/helpers/interaction-trace.d.ts +26 -0
  585. package/dist/superdoc/src/helpers/selection-source.d.ts +1 -0
  586. package/dist/superdoc/src/helpers/transaction-touches-structural-change.d.ts +19 -0
  587. package/dist/superdoc/src/helpers/use-selection.d.ts +17 -0
  588. package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +22 -0
  589. package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +12 -0
  590. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +15 -0
  591. package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +19 -0
  592. package/dist/superdoc/src/helpers/v2-review-target.d.ts +7 -0
  593. package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +12 -0
  594. package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +5 -0
  595. package/dist/superdoc/src/icons.d.ts +11 -0
  596. package/dist/superdoc/src/index.d.cts +13 -0
  597. package/dist/superdoc/src/index.d.ts +11 -0
  598. package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +21 -0
  599. package/dist/superdoc/src/internal/toolbar/built-in/AlignmentButtons.vue.d.ts +6 -0
  600. package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +10 -0
  601. package/dist/superdoc/src/internal/toolbar/built-in/DocumentMode.vue.d.ts +10 -0
  602. package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +10 -0
  603. package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +10 -0
  604. package/dist/superdoc/src/internal/toolbar/built-in/IconGrid.vue.d.ts +14 -0
  605. package/dist/superdoc/src/internal/toolbar/built-in/IconGridRow.vue.d.ts +13 -0
  606. package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +37 -0
  607. package/dist/superdoc/src/internal/toolbar/built-in/LinkedStyle.vue.d.ts +12 -0
  608. package/dist/superdoc/src/internal/toolbar/built-in/OverflowMenu.vue.d.ts +10 -0
  609. package/dist/superdoc/src/internal/toolbar/built-in/SdTooltip.vue.d.ts +34 -0
  610. package/dist/superdoc/src/internal/toolbar/built-in/StyleButtonsList.vue.d.ts +14 -0
  611. package/dist/superdoc/src/internal/toolbar/built-in/TableActions.vue.d.ts +8 -0
  612. package/dist/superdoc/src/internal/toolbar/built-in/TableGrid.vue.d.ts +6 -0
  613. package/dist/superdoc/src/internal/toolbar/built-in/Toolbar.vue.d.ts +4 -0
  614. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +24 -0
  615. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButtonIcon.vue.d.ts +11 -0
  616. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +18 -0
  617. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +38 -0
  618. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarSeparator.vue.d.ts +8 -0
  619. package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +24 -0
  620. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +102 -0
  621. package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +17 -0
  622. package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +1 -0
  623. package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +11 -0
  624. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +5 -0
  625. package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +1 -0
  626. package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +5 -0
  627. package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +10 -0
  628. package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +4 -0
  629. package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +1 -0
  630. package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +76 -0
  631. package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +58 -0
  632. package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +8 -0
  633. package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +48 -0
  634. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +237 -0
  635. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +59 -0
  636. package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +63 -0
  637. package/dist/superdoc/src/internal/toolbar/index.d.ts +10 -0
  638. package/dist/superdoc/src/main.d.ts +1 -0
  639. package/dist/superdoc/src/public/browser-document-api.d.ts +53 -0
  640. package/dist/superdoc/src/public/collaboration-upgrade-engine.d.cts +26 -0
  641. package/dist/superdoc/src/public/collaboration-upgrade-engine.d.ts +130 -0
  642. package/dist/superdoc/src/public/index.d.cts +359 -0
  643. package/dist/superdoc/src/public/index.d.ts +179 -0
  644. package/dist/superdoc/src/public/ui/commands.d.ts +249 -0
  645. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +18 -0
  646. package/dist/superdoc/src/public/ui/entity-at.d.ts +29 -0
  647. package/dist/superdoc/src/public/ui/equality.d.ts +10 -0
  648. package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +36 -0
  649. package/dist/superdoc/src/public/ui/react.d.ts +81 -0
  650. package/dist/superdoc/src/public/ui/reasons.d.ts +99 -0
  651. package/dist/superdoc/src/public/ui/types.d.ts +1425 -0
  652. package/dist/superdoc/src/public/ui-react.d.cts +20 -0
  653. package/dist/superdoc/src/public/ui-react.d.ts +20 -0
  654. package/dist/superdoc/src/public/ui.d.cts +194 -0
  655. package/dist/superdoc/src/public/ui.d.ts +29 -0
  656. package/dist/superdoc/src/stores/comments-store.d.ts +676 -0
  657. package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +14 -0
  658. package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +14 -0
  659. package/dist/superdoc/src/stores/hrbr-fields-store.d.ts +43 -0
  660. package/dist/superdoc/src/stores/superdoc-store.d.ts +2182 -0
  661. package/dist/superdoc.cjs +36521 -0
  662. package/dist/superdoc.es.js +36449 -0
  663. package/dist/word-layout/src/index.d.ts +64 -0
  664. package/dist/word-layout/src/list-marker.d.ts +68 -0
  665. package/dist/word-layout/src/marker-utils.d.ts +20 -0
  666. package/dist/word-layout/src/numbering-manager.d.ts +85 -0
  667. package/dist/word-layout/src/tab-layout.d.ts +193 -0
  668. package/dist/word-layout/src/types.d.ts +106 -0
  669. package/dist/word-layout/src/unit-conversions.d.ts +120 -0
  670. package/dist-cdn/style.layered.css +2 -0
  671. package/dist-cdn/superdoc.min.css +2 -0
  672. package/dist-cdn/superdoc.min.js +108 -0
  673. package/package.json +137 -24
  674. package/.npmignore +0 -4
  675. package/data.json +0 -17
  676. package/index.js +0 -2
  677. package/lib/Augmenter.js +0 -27
  678. package/lib/Runner.js +0 -80
  679. package/lib/Stopper.js +0 -71
  680. package/test/superdoc.js +0 -126
  681. package/utils/app.js +0 -18
  682. package/utils/server.js +0 -2
  683. package/web/index.js +0 -54
  684. package/web/public/style.css +0 -76
  685. package/web/views/index.ejs +0 -53
  686. package/web/views/layout.ejs +0 -13
  687. package/web/views/method.ejs +0 -59
@@ -0,0 +1,2459 @@
1
+ import { TabStop } from './engines/tabs.js';
2
+ import { PageNumberChapterSeparator, PageNumberFieldFormat, PageNumberFormat } from './page-number-formatting.js';
3
+ import { TrackedChangeSemanticColorKey } from './semantic-colors.js';
4
+ import { ParagraphDirectionContext, RunBidiContext, RunScriptContext, TableDirectionContext } from './direction-context.js';
5
+ import { LayoutSourceIdentity } from './layout-identity.js';
6
+ export { computeTabStops, layoutWithTabs, calculateTabWidth } from './engines/tabs.js';
7
+ export type { TabStop };
8
+ export type { BaseDirection, WritingMode, SectionDirectionContext, TableDirectionContext, CellDirectionContext, ParagraphDirectionContext, RunBidiContext, RunScriptContext, } from './direction-context.js';
9
+ export { getParagraphInlineDirection, getTableVisualDirection } from './direction-context.js';
10
+ export { OOXML_PCT_DIVISOR, resolveTableWidthAttr, type TableWidthAttr, type TableColumnSpec, } from './engines/tables.js';
11
+ export { effectiveTableCellSpacing } from './table-cell-spacing.js';
12
+ export { selectHeaderFooterVariantForPage, resolveEffectiveHeaderFooterRef, type HeaderFooterKind, type HeaderFooterVariant, type HeaderFooterSectionRefs, type HeaderFooterResolutionSection, type HeaderFooterVariantSelectionInput, type HeaderFooterEffectiveRefInput, type HeaderFooterEffectiveRefResult, } from './header-footer-resolution.js';
13
+ export { rescaleColumnWidths } from './table-column-rescale.js';
14
+ export { getCellSpacingPx } from './cell-spacing.js';
15
+ export { normalizeZIndex, coerceRelativeHeight, isPlainObject, OOXML_Z_INDEX_BASE, resolveFloatingZIndex, getFragmentZIndex, } from './ooxml-z-index.js';
16
+ export { shouldApplyJustify, calculateJustifySpacing, getFirstLineIndentOffset, adjustAvailableWidthForTextIndent, SPACE_CHARS, type ShouldApplyJustifyParams, type CalculateJustifySpacingParams, } from './justify-utils.js';
17
+ export { parseInsetClipPathForScale, formatInsetClipPathTransform, type InsetClipPathScale, } from './clip-path-inset.js';
18
+ export { SUBSCRIPT_SUPERSCRIPT_SCALE, normalizeBaselineShift, hasExplicitBaselineShift, isSuperscriptOrSubscript, usesDefaultScriptLayout, scaleFontSizeForVerticalText, resolveBaseFontSizeForVerticalText, type VerticalTextAlign, } from './vertical-text.js';
19
+ export { computeFragmentPmRange, computeLinePmRange, type LinePmRange } from './pm-range.js';
20
+ export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, } from './graphic-placement.js';
21
+ export { LAYOUT_BOUNDARY_SCHEMA, bodyStoryLocator, namedStoryLocator, computeLayoutFragmentId, buildLayoutSourceIdentity, buildLayoutSourceIdentityForFragment, } from './layout-identity.js';
22
+ export type { LayoutBlockRef, LayoutFragmentId, LayoutPartialRowIdentity, LayoutSourceIdentity, LayoutStoryKind, LayoutStoryLocator, } from './layout-identity.js';
23
+ export { LAYOUT_SEGMENT_GEOMETRY_SCHEMA } from './segment-geometry.js';
24
+ export type { NeutralTextDirection, NeutralSegmentGeometry, NeutralLineGeometryFlags, NeutralLineGeometry, NeutralGeometryDiagnostic, NeutralFragmentGeometry, NeutralSegmentGeometryReadback, } from './segment-geometry.js';
25
+ export { cloneColumnLayout, columnLayoutsEqual, columnRenderLayoutsEqual, getColumnAtX, getColumnGapAfter, getColumnGeometry, getColumnSeparatorPositions, getColumnWidth, getColumnX, normalizeColumnLayout, resolveColumnCount, resolveColumnLayout, resolveColumnMode, widthsEqual, } from './column-layout.js';
26
+ export type { ColumnGeometry, NormalizedColumnLayout } from './column-layout.js';
27
+ export { authorFromTrackedChangeMeta, authorIdentityKey, composeAuthorColorResolver, fallbackAuthorColor, stampTrackedChangeColors, } from './author-colors.js';
28
+ export type { AuthorColorsConfig, TrackChangeAuthorColorResolver } from './author-colors.js';
29
+ export { DEFAULT_TRACKED_CHANGE_SEMANTIC_COLORS, TRACKED_CHANGE_AFFECTED_RANGE_KEYS, TRACKED_CHANGE_CONFIGURABLE_SEMANTIC_COLOR_KEYS, TRACKED_CHANGE_SEMANTIC_COLOR_KEYS, TRACKED_CHANGE_SEMANTIC_TARGET_KINDS, composeSemanticColorResolver, defaultSemanticColor, isConfigurableSemanticColorKey, semanticColorAnchorScope, semanticColorTargetKind, stampTrackedChangeSemanticColors, structuralSemanticColorKey, trackedChangeLayersSignature, trackedChangeMetaSignature, } from './semantic-colors.js';
30
+ export type { SemanticColorsConfig, TrackChangeSemanticColorResolver, TrackedChangeConfigurableSemanticColorKey, TrackedChangeSemanticColorKey, TrackedChangeSemanticColorResolverInput, TrackedChangeSemanticTargetKind, } from './semantic-colors.js';
31
+ export { getSdtContainerKey, getSdtContainerKeyForBlock, getSdtContainerMetadata, hasExplicitSdtContainerKey, isSdtContainerMetadata, } from './sdt-container.js';
32
+ export { resolveInheritedHeaderFooterRef, resolveInheritedHeaderFooterRefWithType, type HeaderFooterRefIdentifier, type HeaderFooterRefMap, type ResolvedInheritedHeaderFooterRef, type ResolveInheritedHeaderFooterRefInput, } from './header-footer-inheritance.js';
33
+ export { formatChapterPageNumberText, formatIntegerWithNumericPicture, formatPageNumber, formatPageNumberFieldValue, formatSectionPageNumberText, type PageNumberFieldFormat, type PageNumberChapterSeparator, type PageNumberFormat, } from './page-number-formatting.js';
34
+ export { buildPageRefAnchorMap } from './page-ref-anchor.js';
35
+ export { DRAWING_DIAGNOSTIC_CODES, DRAWING_DIAGNOSTIC_CODE_ALIASES, DRAWING_SUPPORT_TAXONOMY, DRAWING_FAMILIES, canonicalDrawingDiagnosticCode, getDrawingFamilySpec, isSupportedDrawingFamily, type DrawingContractTarget, type DrawingDiagnosticCode, type DrawingFamily, type DrawingFamilySpec, type DrawingSupportLevel, type DrawingTaxonomyDrawingKind, } from './drawing-taxonomy.js';
36
+ /** Inline field annotation metadata extracted from w:sdt nodes. */
37
+ export type FieldAnnotationMetadata = {
38
+ type: 'fieldAnnotation';
39
+ variant?: 'text' | 'image' | 'signature' | 'checkbox' | 'html' | 'link';
40
+ fieldId: string;
41
+ fieldType?: string;
42
+ displayLabel?: string;
43
+ defaultDisplayLabel?: string;
44
+ alias?: string;
45
+ fieldColor?: string;
46
+ borderColor?: string;
47
+ highlighted?: boolean;
48
+ fontFamily?: string | null;
49
+ fontSize?: string | number | null;
50
+ textColor?: string | null;
51
+ textHighlight?: string | null;
52
+ linkUrl?: string | null;
53
+ imageSrc?: string | null;
54
+ rawHtml?: unknown;
55
+ size?: {
56
+ width?: number;
57
+ height?: number;
58
+ } | null;
59
+ extras?: Record<string, unknown> | null;
60
+ multipleImage?: boolean;
61
+ hash?: string | null;
62
+ generatorIndex?: number | null;
63
+ sdtId?: string | null;
64
+ hidden?: boolean;
65
+ visibility?: 'visible' | 'hidden';
66
+ isLocked?: boolean;
67
+ formatting?: {
68
+ bold?: boolean;
69
+ italic?: boolean;
70
+ underline?: boolean;
71
+ };
72
+ marks?: Record<string, unknown>;
73
+ };
74
+ export type StructuredContentLockMode = 'unlocked' | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked';
75
+ /**
76
+ * Visual chrome / labelling behavior of an SDT, mirroring
77
+ * `<w15:appearance w15:val="…">` (ECMA-376 §17.5.2.6 / OOXML 2010+).
78
+ *
79
+ * - `'boundingBox'` (default): visible chrome around the SDT content.
80
+ * - `'tags'`: tags-only mode (start/end markers).
81
+ * - `'hidden'`: no chrome at all; the SDT exists in the document but is
82
+ * visually transparent. The alias label MUST NOT leak into the rendered
83
+ * DOM textContent (a11y / copy-paste behavior).
84
+ */
85
+ export type StructuredContentAppearance = 'boundingBox' | 'tags' | 'hidden';
86
+ export type StructuredContentMetadata = {
87
+ type: 'structuredContent';
88
+ scope: 'inline' | 'block';
89
+ id?: string | null;
90
+ tag?: string | null;
91
+ alias?: string | null;
92
+ lockMode?: StructuredContentLockMode;
93
+ /** Appearance from the SDT's `<w15:appearance>` element, when present. */
94
+ appearance?: StructuredContentAppearance;
95
+ sdtPr?: unknown;
96
+ };
97
+ export type DocumentSectionMetadata = {
98
+ type: 'documentSection';
99
+ id?: string | null;
100
+ title?: string | null;
101
+ description?: string | null;
102
+ sectionType?: string | null;
103
+ isLocked?: boolean;
104
+ sdBlockId?: string | null;
105
+ };
106
+ export type DocPartMetadata = {
107
+ type: 'docPartObject';
108
+ gallery?: string | null;
109
+ uniqueId?: string | null;
110
+ alias?: string | null;
111
+ instruction?: string | null;
112
+ };
113
+ /**
114
+ * Union of all SDT (Structured Document Tag) metadata variants.
115
+ *
116
+ * Word SDTs are flexible containers that can represent:
117
+ * - Field annotations: inline placeholders for user input
118
+ * - Structured content: containers with semantic tags (inline or block-level)
119
+ * - Document sections: locked or conditional regions with titles
120
+ * - Doc parts: special objects like tables of contents
121
+ */
122
+ export type SdtMetadata = FieldAnnotationMetadata | StructuredContentMetadata | DocumentSectionMetadata | DocPartMetadata;
123
+ export declare const CONTRACTS_VERSION = "1.1.0";
124
+ /** Unique identifier for a block in the document. Format: `${pos}-${type}`. */
125
+ export type BlockId = string;
126
+ /**
127
+ * Optional DOCX source evidence carried through the render pipeline.
128
+ *
129
+ * Phase 3 keeps this deliberately optional and payload-shaped so existing
130
+ * layout snapshots remain valid while source-linked intelligence consumers can
131
+ * preserve exact DOCX/source-tree anchors where available.
132
+ */
133
+ export type SourceAnchor = {
134
+ sourceNodeId?: string;
135
+ occurrenceId?: string;
136
+ rawFactIds?: string[];
137
+ schemaQNames?: Array<{
138
+ qName: string;
139
+ namespaceUri?: string;
140
+ prefix?: string;
141
+ localName?: string;
142
+ ownerElementQName?: string;
143
+ }>;
144
+ featureKey?: string;
145
+ conceptKey?: string;
146
+ sourceRef?: {
147
+ partUri: string;
148
+ xpathLikePath: string;
149
+ rawFactId?: string;
150
+ occurrenceId?: string;
151
+ };
152
+ anchorConfidence?: 'high' | 'medium' | 'low';
153
+ pmNodeId?: string;
154
+ pmRange?: {
155
+ from: number;
156
+ to: number;
157
+ };
158
+ flowBlockId?: string;
159
+ layoutFragmentId?: string;
160
+ paintItemId?: string;
161
+ };
162
+ /** Tab leader type for filling space before tab stops. */
163
+ export type LeaderType = 'dot' | 'heavy' | 'hyphen' | 'middleDot' | 'underscore';
164
+ export type TrackedChangeKind = 'insert' | 'delete' | 'format';
165
+ export type TrackedChangesMode = 'review' | 'original' | 'final' | 'off';
166
+ /**
167
+ * Identity of a tracked-change author, used to resolve a per-author color.
168
+ *
169
+ * Mirrors the author metadata carried on {@link TrackedChangeMeta}
170
+ * (`author` → `name`, `authorEmail` → `email`, `authorImage` → `image`).
171
+ * Hosts configure per-author colors through this shape (see the
172
+ * `modules.trackChanges.authorColors` config on the `superdoc` package).
173
+ */
174
+ export type TrackChangeAuthor = {
175
+ name?: string;
176
+ email?: string;
177
+ image?: string;
178
+ };
179
+ /** Formatting mark for track-format metadata. */
180
+ export type RunMark = {
181
+ type: string;
182
+ attrs?: Record<string, unknown> | null;
183
+ };
184
+ export type TrackedChangeMeta = {
185
+ kind: TrackedChangeKind;
186
+ id: string;
187
+ overlapParentId?: string;
188
+ relationship?: 'parent' | 'child' | 'standalone';
189
+ /**
190
+ * Internal story key identifying which content story owns this tracked
191
+ * change (`'body'`, `'hf:part:…'`, `'fn:…'`, `'en:…'`).
192
+ *
193
+ * Set by the PM adapter during conversion and stamped on the rendered DOM
194
+ * as `data-story-key` so downstream code can distinguish anchors across
195
+ * stories without re-resolving the story runtime.
196
+ */
197
+ storyKey?: string;
198
+ author?: string;
199
+ authorEmail?: string;
200
+ authorImage?: string;
201
+ /**
202
+ * Paint-ready per-author color, resolved upstream (in/around the
203
+ * pm-adapter data-preparation pass) from the author identity. DomPainter
204
+ * reads only this field and stamps the element-scoped tracked-change CSS
205
+ * variables from it — it never invokes resolvers or touches app config.
206
+ * Undefined when per-author colors are disabled or unconfigured, in which
207
+ * case the static default tracked-change palette applies.
208
+ */
209
+ color?: string;
210
+ /**
211
+ * Semantic visual color category for this change, e.g. `insertion`,
212
+ * `deletion`, `move-from`, `table-cell-insertion`, `cell-merge`.
213
+ * Independent of the author identity, so the same author can receive
214
+ * different colors for different review roles.
215
+ */
216
+ semanticColorKey?: TrackedChangeSemanticColorKey;
217
+ /**
218
+ * Paint-ready semantic color, resolved upstream from
219
+ * {@link semanticColorKey}. Additive to and independent of the per-author
220
+ * `color`. DomPainter uses author color for plain insertion/deletion
221
+ * highlights when present, while side/structural semantic categories
222
+ * (`move-from`, `table-cell-insertion`, `cell-merge`, etc.) keep semantic
223
+ * visual precedence. Undefined when semantic colors are disabled or this layer
224
+ * carries no semantic category.
225
+ */
226
+ semanticColor?: string;
227
+ /** Raw tracked-change type carried for semantic resolution/projection. */
228
+ type?: string;
229
+ /** Logical subtype carried for semantic resolution/projection. */
230
+ subtype?: string;
231
+ /** Target kind (e.g. text/cell/row/table) for semantic resolution. */
232
+ targetKind?: string;
233
+ /**
234
+ * Scope of the semantic paint anchor when paint applies to an affected range
235
+ * rather than a single direct marker (e.g. `'affected-range'` for a derived
236
+ * cell split).
237
+ */
238
+ semanticAnchorScope?: string;
239
+ date?: string;
240
+ before?: RunMark[];
241
+ after?: RunMark[];
242
+ };
243
+ /**
244
+ * Tracked-change review metadata attached to a list marker glyph (Plan 5).
245
+ *
246
+ * A list marker is generated chrome, not a text run, so run-level tracked-change
247
+ * decorations never reach it automatically. When a paragraph's visible marker is
248
+ * affected by a guide-relevant tracked change (list add/remove, numbering/level
249
+ * change, list item insert/delete, paragraph-mark insert/delete, or a moved list
250
+ * item), the projection attaches this metadata so the painter can stamp the same
251
+ * review identity/classes/CSS variables the run path uses and paint Word-like
252
+ * marker glyph color + underline.
253
+ *
254
+ * It reuses the canonical {@link TrackedChangeMeta} so marker and run review
255
+ * metadata never drift, plus an optional `groupedIds` for the
256
+ * `data-track-change-ids` attribute when more than one change affects one marker.
257
+ */
258
+ export type MarkerTrackedChange = TrackedChangeMeta & {
259
+ /** All tracked-change ids affecting this marker, for `data-track-change-ids`. */
260
+ groupedIds?: readonly string[];
261
+ };
262
+ /**
263
+ * HTML anchor target. DOCX `w:tgtFrame` may be one of the reserved browsing
264
+ * context names (`_blank`, `_self`, `_parent`, `_top`) or an arbitrary named
265
+ * frame/window such as `report-frame`.
266
+ */
267
+ export type FlowRunLinkTarget = string;
268
+ export type FlowRunLink = {
269
+ version?: 1 | 2;
270
+ href?: string;
271
+ title?: string;
272
+ target?: FlowRunLinkTarget;
273
+ rel?: string;
274
+ tooltip?: string;
275
+ anchor?: string;
276
+ docLocation?: string;
277
+ rId?: string;
278
+ name?: string;
279
+ history?: boolean;
280
+ };
281
+ export declare const EMPTY_SDT_PLACEHOLDER_TEXT = "Click or tap here to enter text";
282
+ export type SdtVisualPlaceholder = 'emptyInlineSdt' | 'emptyBlockSdt';
283
+ /**
284
+ * Common formatting marks that can be applied to any run type.
285
+ * Used by TextRun, TabRun, and other run types that support inline formatting.
286
+ */
287
+ export type RunMarks = {
288
+ /** Bold text styling. */
289
+ bold?: boolean;
290
+ /** Italic text styling. */
291
+ italic?: boolean;
292
+ /** Additional letter spacing in pixels (positive for expanded, negative for condensed). */
293
+ letterSpacing?: number;
294
+ /** Horizontal glyph scale as a unitless multiplier (`1` = 100%, `0.9` = 90%). */
295
+ horizontalScale?: number;
296
+ /** Text color as hex string (e.g., "#FF0000"). */
297
+ color?: string;
298
+ /** Underline decoration with optional style and color. */
299
+ underline?: {
300
+ /** Underline style (defaults to 'single'). */
301
+ style?: 'single' | 'double' | 'dotted' | 'dashed' | 'wavy';
302
+ /** Underline color as hex string (defaults to text color). */
303
+ color?: string;
304
+ } | null;
305
+ /** Strikethrough text decoration. */
306
+ strike?: boolean;
307
+ /** Highlight (background) color as hex string. */
308
+ highlight?: string;
309
+ /** Text transformation (case modification). */
310
+ textTransform?: 'uppercase' | 'lowercase' | 'capitalize' | 'none';
311
+ /** Word hidden-text formatting (`w:vanish`): styleable runs remain addressable but do not paint or measure. */
312
+ vanish?: boolean;
313
+ /** Vertical alignment for superscript/subscript text. */
314
+ vertAlign?: 'superscript' | 'subscript' | 'baseline';
315
+ /**
316
+ * Explicit baseline shift in points (positive = raise, negative = lower).
317
+ * Rendering normalizes a shift of zero to "no explicit shift".
318
+ */
319
+ baselineShift?: number;
320
+ };
321
+ export type PageReferenceRelativePositionText = 'above' | 'below';
322
+ export type FieldResultFormat = 'charformat' | 'mergeformat';
323
+ export type NumericPictureFormat = {
324
+ /** Raw argument after the \# switch, without surrounding quotes. */
325
+ picture: string;
326
+ };
327
+ export interface PageRefLocation {
328
+ physicalPage: number;
329
+ displayNumber: number;
330
+ displayText: string;
331
+ pageFormat?: PageNumberFormat;
332
+ chapterNumberText?: string;
333
+ chapterSeparator?: PageNumberChapterSeparator;
334
+ sectionIndex?: number;
335
+ pmPosition?: number;
336
+ }
337
+ export type TextRun = RunMarks & {
338
+ kind?: 'text';
339
+ text: string;
340
+ fontFamily: string;
341
+ fontSize: number;
342
+ /** Comment annotations applied to this run (supports overlapping comments). */
343
+ comments?: Array<{
344
+ commentId: string;
345
+ importedId?: string;
346
+ internal?: boolean;
347
+ trackedChange?: boolean;
348
+ trackedChangeThreadParentId?: string;
349
+ }>;
350
+ /**
351
+ * Custom data attributes propagated from ProseMirror marks (keys must be data-*).
352
+ */
353
+ dataAttrs?: Record<string, string>;
354
+ sdt?: SdtMetadata;
355
+ /** Layout-only placeholder for visual affordances that do not represent document text. */
356
+ visualPlaceholder?: SdtVisualPlaceholder;
357
+ link?: FlowRunLink;
358
+ /** Token annotations for dynamic content (page numbers, etc.). */
359
+ token?: 'pageNumber' | 'totalPageCount' | 'pageReference' | 'sectionPageCount' | 'seq';
360
+ /** Explicit formatting requested by PAGE/NUMPAGES/SECTIONPAGES field switches. */
361
+ pageNumberFieldFormat?: PageNumberFieldFormat;
362
+ /** Absolute ProseMirror position (inclusive) of first character in this run. */
363
+ pmStart?: number;
364
+ /** Absolute ProseMirror position (exclusive) after the last character. */
365
+ pmEnd?: number;
366
+ /** Metadata for page reference tokens (only when token === 'pageReference'). */
367
+ pageRefMetadata?: {
368
+ bookmarkId: string;
369
+ instruction: string;
370
+ /** True when the instruction has \p. */
371
+ relativePosition?: boolean;
372
+ /** General numeric formatting switch for the PAGEREF page value. */
373
+ pageNumberFieldFormat?: PageNumberFieldFormat;
374
+ /** Raw numeric picture from \#. */
375
+ numericPictureFormat?: NumericPictureFormat;
376
+ /** CHARFORMAT / MERGEFORMAT, if present. */
377
+ fieldResultFormat?: FieldResultFormat;
378
+ };
379
+ /** Metadata for SEQ tokens (resolved by the document runtime before layout measurement). */
380
+ seqMetadata?: {
381
+ identifier: string;
382
+ instruction?: string;
383
+ fieldArgument?: string;
384
+ sequenceMode?: 'next' | 'current';
385
+ hideResult?: boolean;
386
+ restartNumber?: number | null;
387
+ restartLevel?: number | null;
388
+ format?: string;
389
+ hasGeneralFormat?: boolean;
390
+ pageNumberFieldFormat?: PageNumberFieldFormat | null;
391
+ numericPictureFormat?: NumericPictureFormat | null;
392
+ cachedText?: string;
393
+ };
394
+ /** Tracked-change metadata from ProseMirror marks. */
395
+ trackedChange?: TrackedChangeMeta;
396
+ /** All tracked-change layers on this run, preserving overlap order. */
397
+ trackedChanges?: TrackedChangeMeta[];
398
+ /**
399
+ * Run-level bidi signals preserved from the source DOCX (run rtl flag,
400
+ * embedding/override directions). Direction-only - script formatting lives
401
+ * on `script`. Populated by pm-adapter from raw run properties; not yet
402
+ * rendered (Wave 1c consumes embedding/override).
403
+ */
404
+ bidi?: RunBidiContext;
405
+ /**
406
+ * Run-level script context preserved from the source DOCX (complex-script
407
+ * flag, per-script language metadata). Wave 1b uses `complexScript` to gate
408
+ * the formatting-stack selection (Latin variants vs CS variants).
409
+ */
410
+ script?: RunScriptContext;
411
+ };
412
+ export type TabRun = RunMarks & {
413
+ kind: 'tab';
414
+ text: '\t';
415
+ /**
416
+ * Font of the tab, inherited from the paragraph's resolved run properties. A tab has
417
+ * no glyphs, but its font drives the line height (so a tab-only line matches a text
418
+ * line) and the underline weight. Optional: not every producer sets it.
419
+ */
420
+ fontFamily?: string;
421
+ fontSize?: number;
422
+ /** Width in pixels (assigned by measurer/resolver). */
423
+ width?: number;
424
+ tabStops?: TabStop[];
425
+ tabIndex?: number;
426
+ leader?: LeaderType | null;
427
+ decimalChar?: string;
428
+ indent?: ParagraphIndent;
429
+ pmStart?: number;
430
+ pmEnd?: number;
431
+ /** SDT metadata if tab is inside a structured document tag. */
432
+ sdt?: SdtMetadata;
433
+ };
434
+ export type LineBreakRun = {
435
+ kind: 'lineBreak';
436
+ /**
437
+ * Optional attributes carried through from the source document.
438
+ * Mirrors OOXML <w:br> attributes (type/clear) to preserve fidelity.
439
+ */
440
+ attrs?: {
441
+ lineBreakType?: string;
442
+ clear?: string;
443
+ };
444
+ pmStart?: number;
445
+ pmEnd?: number;
446
+ };
447
+ export type ImageLuminanceAdjustment = {
448
+ /** OOXML a:lum/@bright in raw units (-100000..100000). */
449
+ bright?: number;
450
+ /** OOXML a:lum/@contrast in raw units (-100000..100000). */
451
+ contrast?: number;
452
+ };
453
+ export type ImageAlphaModFix = {
454
+ /** OOXML a:alphaModFix/@amt in raw fixed-percentage units (0..100000). */
455
+ amt: number;
456
+ };
457
+ /** Hyperlink metadata from OOXML a:hlinkClick on a DrawingML image. */
458
+ export type ImageHyperlink = {
459
+ url: string;
460
+ tooltip?: string;
461
+ };
462
+ /**
463
+ * Vertical alignment mode for an inline {@link ImageRun}.
464
+ *
465
+ * - `'top'`: the image box top aligns to the top of the line box. This is the
466
+ * legacy default and the behavior for inline images that are taller than the
467
+ * text-derived line height (they expand the line).
468
+ * - `'bottom'`: legacy baseline-ish alignment preserved for existing callers.
469
+ * - `'baseline'`: the image box bottom aligns to the text baseline. Intended for
470
+ * small, glyph-like inline images (for example tiny PNG section numbers used
471
+ * as text) that fit inside the text-derived line box and should sit on the
472
+ * baseline next to the surrounding text instead of floating above it.
473
+ */
474
+ export type ImageRunVerticalAlign = 'top' | 'bottom' | 'baseline';
475
+ /**
476
+ * Inline image run for images that flow with text on the same line.
477
+ * Unlike ImageBlock (anchored/floating images), ImageRun is part of the paragraph's run array
478
+ * and participates in line breaking alongside text.
479
+ *
480
+ * Corresponds to Microsoft Word's inline images (<wp:inline> in DOCX).
481
+ *
482
+ * @example
483
+ * // A paragraph with text and inline image:
484
+ * {
485
+ * kind: 'paragraph',
486
+ * runs: [
487
+ * { kind: 'text', text: 'Here is an image: ', ... },
488
+ * { kind: 'image', src: 'data:...', width: 100, height: 50, ... },
489
+ * { kind: 'text', text: ' within text.', ... }
490
+ * ]
491
+ * }
492
+ */
493
+ export type ImageRun = {
494
+ kind: 'image';
495
+ /** Image source URL (data URI or external URL). */
496
+ src: string;
497
+ /** Image width in pixels. */
498
+ width: number;
499
+ /** Image height in pixels. */
500
+ height: number;
501
+ /** Alternative text for accessibility. */
502
+ alt?: string;
503
+ /** Image title (tooltip). */
504
+ title?: string;
505
+ /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
506
+ imageId?: string;
507
+ /** Clip-path value for cropped images. */
508
+ clipPath?: string;
509
+ /**
510
+ * Spacing around the image (from DOCX distT/distB/distL/distR attributes).
511
+ * Applied as CSS margins in the DOM painter.
512
+ * All values in pixels.
513
+ */
514
+ distTop?: number;
515
+ distBottom?: number;
516
+ distLeft?: number;
517
+ distRight?: number;
518
+ /**
519
+ * Vertical alignment of image relative to the line box / text baseline.
520
+ *
521
+ * When omitted, the painter falls back to legacy `'top'`. See
522
+ * {@link ImageRunVerticalAlign} for the semantics of each mode. An authored
523
+ * value here is treated as the source of truth and always wins over the
524
+ * measured per-line alignment in {@link Line.inlineImageAlignments}.
525
+ */
526
+ verticalAlign?: ImageRunVerticalAlign;
527
+ /** Absolute ProseMirror position (inclusive) of this image run. */
528
+ pmStart?: number;
529
+ /** Absolute ProseMirror position (exclusive) after this image run. */
530
+ pmEnd?: number;
531
+ /** SDT metadata if image is wrapped in a structured document tag. */
532
+ sdt?: SdtMetadata;
533
+ /** Tracked-change metadata from OOXML wrappers that own this inline image. */
534
+ trackedChange?: TrackedChangeMeta;
535
+ /** All tracked-change layers on this inline image, preserving overlap order. */
536
+ trackedChanges?: TrackedChangeMeta[];
537
+ /**
538
+ * Custom data attributes propagated from ProseMirror marks (keys must be data-*).
539
+ */
540
+ dataAttrs?: Record<string, string>;
541
+ rotation?: number;
542
+ flipH?: boolean;
543
+ flipV?: boolean;
544
+ gain?: string | number;
545
+ blacklevel?: string | number;
546
+ grayscale?: boolean;
547
+ lum?: ImageLuminanceAdjustment;
548
+ alphaModFix?: ImageAlphaModFix;
549
+ /** Image hyperlink from OOXML a:hlinkClick. When set, clicking the image opens the URL. */
550
+ hyperlink?: ImageHyperlink;
551
+ };
552
+ export type BreakRun = RunMarks & {
553
+ kind: 'break';
554
+ /** Optional break type (e.g., 'line', 'page', 'column') */
555
+ breakType?: 'line' | 'page' | 'column' | string;
556
+ /**
557
+ * Font metrics inherited from the run carrying the break.
558
+ *
559
+ * Block-level break runs do not paint text directly, but the v2 exact
560
+ * composition path may split a break-only paragraph into a page/column break
561
+ * plus a synthetic empty paragraph. That synthetic paragraph must keep the
562
+ * source paragraph mark's metrics so blank-line height matches Word/V1.
563
+ */
564
+ fontFamily?: string;
565
+ fontSize?: number;
566
+ pmStart?: number;
567
+ pmEnd?: number;
568
+ sdt?: SdtMetadata;
569
+ trackedChange?: TrackedChangeMeta;
570
+ trackedChanges?: TrackedChangeMeta[];
571
+ };
572
+ /**
573
+ * Inline field annotation run for interactive form fields displayed as styled "pills".
574
+ * Renders as a bordered, rounded inline element with displayLabel or type-specific content.
575
+ *
576
+ * Corresponds to a field-annotation document node rendered as a styled inline element.
577
+ *
578
+ * @example
579
+ * // A paragraph with text and field annotation:
580
+ * {
581
+ * kind: 'paragraph',
582
+ * runs: [
583
+ * { kind: 'text', text: 'Enter name: ', ... },
584
+ * { kind: 'fieldAnnotation', variant: 'text', displayLabel: 'Full Name', fieldColor: '#980043', ... },
585
+ * ]
586
+ * }
587
+ */
588
+ export type FieldAnnotationRun = {
589
+ kind: 'fieldAnnotation';
590
+ /** The variant/type of field annotation. */
591
+ variant: 'text' | 'image' | 'signature' | 'checkbox' | 'html' | 'link';
592
+ /** Display text shown inside the pill (fallback for all types). */
593
+ displayLabel: string;
594
+ /** Unique field identifier. */
595
+ fieldId?: string;
596
+ /** Field type identifier (e.g., 'TEXTINPUT', 'SIGNATURE'). */
597
+ fieldType?: string;
598
+ /** Background color as hex string (e.g., "#980043"). Applied with alpha. */
599
+ fieldColor?: string;
600
+ /** Border color as hex string (e.g., "#b015b3"). */
601
+ borderColor?: string;
602
+ /** Whether to show the pill styling (border, background). Defaults to true. */
603
+ highlighted?: boolean;
604
+ /** Whether the field is hidden (display: none). */
605
+ hidden?: boolean;
606
+ /** CSS visibility value. */
607
+ visibility?: 'visible' | 'hidden';
608
+ /** Image source URL for image/signature variants. */
609
+ imageSrc?: string | null;
610
+ /** Link URL for link variant. */
611
+ linkUrl?: string | null;
612
+ /** Raw HTML content for html variant. */
613
+ rawHtml?: string | null;
614
+ /** Explicit size for the annotation (used for images). */
615
+ size?: {
616
+ width?: number;
617
+ height?: number;
618
+ } | null;
619
+ /** Font family for the label text. */
620
+ fontFamily?: string | null;
621
+ /** Font size in points or pixels (e.g., "12pt", 14). */
622
+ fontSize?: string | number | null;
623
+ /** Text color as hex string. */
624
+ textColor?: string | null;
625
+ /** Text highlight/background color (overrides fieldColor). */
626
+ textHighlight?: string | null;
627
+ /** Bold text styling. */
628
+ bold?: boolean;
629
+ /** Italic text styling. */
630
+ italic?: boolean;
631
+ /** Underline text styling. */
632
+ underline?: boolean;
633
+ /** Absolute ProseMirror position (inclusive) of this run. */
634
+ pmStart?: number;
635
+ /** Absolute ProseMirror position (exclusive) after this run. */
636
+ pmEnd?: number;
637
+ /** Full SDT metadata if available. */
638
+ sdt?: SdtMetadata;
639
+ };
640
+ export type MathRun = {
641
+ kind: 'math';
642
+ /** OMML XML as JSON (xml2json format) for the renderer to convert to MathML. */
643
+ ommlJson: unknown;
644
+ /** Plain text content for measurement fallback and accessibility. */
645
+ textContent: string;
646
+ /** Estimated width in pixels. */
647
+ width: number;
648
+ /** Estimated height in pixels. */
649
+ height: number;
650
+ /** Absolute ProseMirror position (inclusive) of this math run. */
651
+ pmStart?: number;
652
+ /** Absolute ProseMirror position (exclusive) after this math run. */
653
+ pmEnd?: number;
654
+ /** SDT metadata if math is wrapped in a structured document tag. */
655
+ sdt?: SdtMetadata;
656
+ };
657
+ export type Run = TextRun | TabRun | ImageRun | LineBreakRun | BreakRun | FieldAnnotationRun | MathRun;
658
+ export type ParagraphBlock = {
659
+ kind: 'paragraph';
660
+ id: BlockId;
661
+ runs: Run[];
662
+ attrs?: ParagraphAttrs;
663
+ sourceAnchor?: SourceAnchor;
664
+ };
665
+ /** Border style (subset of OOXML ST_Border). */
666
+ export type BorderStyle = 'none' | 'single' | 'double' | 'dashed' | 'dotted' | 'thick' | 'triple' | 'dotDash' | 'dotDotDash' | 'wave' | 'doubleWave';
667
+ /** Border specification for table and cell borders. */
668
+ export type BorderSpec = {
669
+ style?: BorderStyle;
670
+ width?: number;
671
+ color?: string;
672
+ space?: number;
673
+ };
674
+ /**
675
+ * Three-state border value for table borders.
676
+ * - `null`: inherit from table style
677
+ * - `{ none: true }`: explicit "no border"
678
+ * - `BorderSpec`: explicit border
679
+ */
680
+ export type TableBorderValue = null | {
681
+ none: true;
682
+ } | BorderSpec;
683
+ /** Table-level border configuration (outer + inner borders). */
684
+ export type TableBorders = {
685
+ top?: TableBorderValue;
686
+ right?: TableBorderValue;
687
+ bottom?: TableBorderValue;
688
+ left?: TableBorderValue;
689
+ insideH?: TableBorderValue;
690
+ insideV?: TableBorderValue;
691
+ };
692
+ /** Cell-level border configuration (overrides table-level borders). */
693
+ export type CellBorders = {
694
+ top?: BorderSpec;
695
+ right?: BorderSpec;
696
+ bottom?: BorderSpec;
697
+ left?: BorderSpec;
698
+ };
699
+ export type TableCellAttrs = {
700
+ borders?: CellBorders;
701
+ padding?: BoxSpacing;
702
+ verticalAlign?: 'top' | 'middle' | 'center' | 'bottom';
703
+ background?: string;
704
+ tableCellProperties?: Record<string, unknown>;
705
+ /**
706
+ * Cell-level structural tracked change (SD-3481), e.g. a cell insertion,
707
+ * deletion, merge, or split. Reuses the shared {@link TrackedChangeMeta}
708
+ * shape, mirroring {@link TableRowAttrs.trackedChange} at row level, so one
709
+ * painter + color-stamping system handles inline, row-level, and cell-level
710
+ * tracked changes. This is paint-ready metadata: `semanticColor` is stamped
711
+ * downstream by {@link stampTrackedChangeSemanticColors}.
712
+ */
713
+ trackedChange?: TrackedChangeMeta;
714
+ };
715
+ export type TablePropertiesAttrs = {
716
+ rightToLeft?: boolean;
717
+ [key: string]: unknown;
718
+ };
719
+ export type TableAttrs = {
720
+ borders?: TableBorders;
721
+ borderCollapse?: 'collapse' | 'separate';
722
+ cellSpacing?: CellSpacing;
723
+ tableProperties?: TablePropertiesAttrs;
724
+ /**
725
+ * Resolved table direction context (SD-3138). Populated by pm-adapter from
726
+ * cascade-resolved table properties via `resolveTableDirection`. Consumers
727
+ * should call `getTableVisualDirection(attrs)` instead of reading
728
+ * `tableProperties.rightToLeft` directly — the helper prefers this field
729
+ * and falls back to the legacy raw read for compatibility.
730
+ *
731
+ * Per ECMA-376 §17.4.1, `w:bidiVisual` affects cell ordering and
732
+ * table-visual properties only; it does NOT propagate to cell paragraphs
733
+ * as inline direction.
734
+ */
735
+ tableDirectionContext?: TableDirectionContext;
736
+ sdt?: SdtMetadata;
737
+ containerSdt?: SdtMetadata;
738
+ [key: string]: unknown;
739
+ };
740
+ export type TableCell = {
741
+ id: BlockId;
742
+ /** Multi-block cell content (new feature) */
743
+ blocks?: (ParagraphBlock | ImageBlock | DrawingBlock | TableBlock | SectionBreakBlock | PageBreakBlock | ColumnBreakBlock)[];
744
+ /** Single paragraph (backward compatibility) */
745
+ paragraph?: ParagraphBlock;
746
+ rowSpan?: number;
747
+ colSpan?: number;
748
+ attrs?: TableCellAttrs;
749
+ sourceAnchor?: SourceAnchor;
750
+ };
751
+ export type TableRowProperties = {
752
+ repeatHeader?: boolean;
753
+ cantSplit?: boolean;
754
+ [key: string]: unknown;
755
+ };
756
+ export type TableRowAttrs = {
757
+ tableRowProperties?: TableRowProperties;
758
+ rowHeight?: {
759
+ value: number;
760
+ rule?: 'auto' | 'atLeast' | 'exact' | string;
761
+ };
762
+ /**
763
+ * Structural tracked change on the whole row (inserted/deleted row), imported
764
+ * from `<w:ins>`/`<w:del>` inside `<w:trPr>`. Reuses the same shared
765
+ * {@link TrackedChangeMeta} shape that inline runs carry, so one painter +
766
+ * color-stamping system handles both inline and structural tracked changes.
767
+ * `kind` is `'insert'` for an inserted row and `'delete'` for a deleted row.
768
+ * `color` is stamped downstream by {@link stampTrackedChangeColors}.
769
+ */
770
+ trackedChange?: TrackedChangeMeta;
771
+ /**
772
+ * Row-level border override from OOXML `w:tblPrEx/w:tblBorders` (§17.4.61).
773
+ * Table property exceptions override the table-level borders for this row
774
+ * only. Rows without a `tblPrEx` border block leave this undefined and fall
775
+ * through to the table's borders. Resolved (eighth-points → px) by the v1
776
+ * layout-adapter; the painter merges it over the table borders per edge.
777
+ */
778
+ borders?: TableBorders;
779
+ };
780
+ export type TableRow = {
781
+ id: BlockId;
782
+ cells: TableCell[];
783
+ attrs?: TableRowAttrs;
784
+ sourceAnchor?: SourceAnchor;
785
+ };
786
+ export type TableBlock = {
787
+ kind: 'table';
788
+ id: BlockId;
789
+ rows: TableRow[];
790
+ attrs?: TableAttrs;
791
+ /** Column widths in pixels from OOXML w:tblGrid. */
792
+ columnWidths?: number[];
793
+ /** Anchor positioning for floating tables (from w:tblpPr). */
794
+ anchor?: TableAnchor;
795
+ /** Text wrapping for floating tables (from w:tblpPr distances). */
796
+ wrap?: TableWrap;
797
+ sourceAnchor?: SourceAnchor;
798
+ };
799
+ export type BoxSpacing = {
800
+ top?: number;
801
+ right?: number;
802
+ bottom?: number;
803
+ left?: number;
804
+ };
805
+ export type PageMargins = {
806
+ top?: number;
807
+ right?: number;
808
+ bottom?: number;
809
+ left?: number;
810
+ header?: number;
811
+ footer?: number;
812
+ gutter?: number;
813
+ };
814
+ export type DocumentBackground = {
815
+ /** Solid page background color as a CSS hex value. */
816
+ color: string;
817
+ };
818
+ export type ImageBlockAttrs = {
819
+ sdt?: SdtMetadata;
820
+ containerSdt?: SdtMetadata;
821
+ [key: string]: unknown;
822
+ };
823
+ export type ImageBlock = {
824
+ kind: 'image';
825
+ id: BlockId;
826
+ src: string;
827
+ width?: number;
828
+ height?: number;
829
+ alt?: string;
830
+ title?: string;
831
+ /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
832
+ imageId?: string;
833
+ objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down';
834
+ display?: 'inline' | 'block';
835
+ padding?: BoxSpacing;
836
+ margin?: BoxSpacing;
837
+ anchor?: ImageAnchor;
838
+ wrap?: ImageWrap;
839
+ /** Stacking order from OOXML relativeHeight (same formula as editor: Math.max(0, relativeHeight - OOXML_Z_INDEX_BASE)) */
840
+ zIndex?: number;
841
+ /** Tracked-change metadata from OOXML wrappers that own this block image. */
842
+ trackedChange?: TrackedChangeMeta;
843
+ /** All tracked-change layers on this block image, preserving overlap order. */
844
+ trackedChanges?: TrackedChangeMeta[];
845
+ attrs?: ImageBlockAttrs;
846
+ gain?: string | number;
847
+ blacklevel?: string | number;
848
+ grayscale?: boolean;
849
+ lum?: ImageLuminanceAdjustment;
850
+ alphaModFix?: ImageAlphaModFix;
851
+ rotation?: number;
852
+ flipH?: boolean;
853
+ flipV?: boolean;
854
+ /** Image hyperlink from OOXML a:hlinkClick. When set, clicking the image opens the URL. */
855
+ hyperlink?: ImageHyperlink;
856
+ sourceAnchor?: SourceAnchor;
857
+ };
858
+ export type DrawingKind = 'image' | 'vectorShape' | 'textboxShape' | 'shapeGroup' | 'chart';
859
+ export type DrawingContentSnapshot = {
860
+ name: string;
861
+ attributes?: Record<string, unknown>;
862
+ elements?: unknown[];
863
+ };
864
+ export type DrawingGeometry = {
865
+ width: number;
866
+ height: number;
867
+ rotation?: number;
868
+ flipH?: boolean;
869
+ flipV?: boolean;
870
+ };
871
+ export type PositionedDrawingGeometry = DrawingGeometry & {
872
+ x?: number;
873
+ y?: number;
874
+ };
875
+ /** Gradient stop for gradient fills. Defines a color at a specific position along the gradient. */
876
+ export type GradientStop = {
877
+ /** Position along the gradient (0-1 range, where 0 is start and 1 is end). */
878
+ position: number;
879
+ /** Hex color code (e.g., "#FF0000"). */
880
+ color: string;
881
+ /** Optional alpha/opacity value (0-1 range). */
882
+ alpha?: number;
883
+ };
884
+ /** Gradient fill configuration for linear or radial gradients. */
885
+ export type GradientFill = {
886
+ type: 'gradient';
887
+ /** Type of gradient: linear (directional) or radial (circular). */
888
+ gradientType: 'linear' | 'radial';
889
+ /** Array of color stops defining the gradient. */
890
+ stops: GradientStop[];
891
+ /** Angle in degrees for linear gradients (0 = left to right, 90 = bottom to top). */
892
+ angle: number;
893
+ /** Path descriptor for radial gradients (e.g., 'circle'). */
894
+ path?: string;
895
+ };
896
+ /** Solid fill with alpha transparency. */
897
+ export type SolidFillWithAlpha = {
898
+ type: 'solidWithAlpha';
899
+ /** Hex color code. */
900
+ color: string;
901
+ /** Alpha/opacity value (0-1 range, where 0 is fully transparent and 1 is fully opaque). */
902
+ alpha: number;
903
+ };
904
+ /**
905
+ * Fill color for shapes. Can be:
906
+ * - string: Simple hex color (e.g., "#FF0000") for backward compatibility
907
+ * - GradientFill: Linear or radial gradient
908
+ * - SolidFillWithAlpha: Solid color with transparency
909
+ * - null: No fill
910
+ */
911
+ export type FillColor = string | GradientFill | SolidFillWithAlpha | null;
912
+ /**
913
+ * Stroke color for shapes. Can be:
914
+ * - string: Hex color (e.g., "#000000")
915
+ * - null: Explicitly no border/stroke
916
+ */
917
+ export type StrokeColor = string | null;
918
+ /** Text formatting options for shape text content. */
919
+ export type TextFormatting = {
920
+ bold?: boolean;
921
+ italic?: boolean;
922
+ color?: string;
923
+ fontSize?: number;
924
+ fontFamily?: string;
925
+ letterSpacing?: number;
926
+ };
927
+ /** A single text part with optional formatting. */
928
+ export type TextPart = {
929
+ text: string;
930
+ formatting?: TextFormatting;
931
+ /** Optional field token (e.g., PAGE/NUMPAGES/SECTIONPAGES) resolved at render time. */
932
+ fieldType?: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES';
933
+ /** PAGE/SECTIONPAGES field-local value formatting override. */
934
+ pageNumberFormat?: PageNumberFormat;
935
+ /** Indicates this part represents a line break between paragraphs. */
936
+ isLineBreak?: boolean;
937
+ /** Indicates this line break follows an empty paragraph (creates extra spacing). */
938
+ isEmptyParagraph?: boolean;
939
+ /**
940
+ * SD-2804: ECMA-376 §20.4.2.38 lets a textbox hold full body-level
941
+ * content, including paragraphs whose runs carry inline w:drawing
942
+ * images. When the importer encounters such a drawing it appends a
943
+ * part with `kind: 'image'` carrying the raw media path; pm-adapter's
944
+ * hydrateImageBlocks resolves it to a data URI alongside ImageRuns so
945
+ * binary (Y.js) and string (zip) media files share the same path
946
+ * candidates and Uint8Array decoding.
947
+ */
948
+ kind?: 'image';
949
+ src?: string;
950
+ extension?: string;
951
+ rId?: string;
952
+ width?: number;
953
+ height?: number;
954
+ alt?: string;
955
+ };
956
+ /** Text content configuration for shapes. */
957
+ export type ShapeTextContent = {
958
+ /** Array of text parts with individual formatting. */
959
+ parts: TextPart[];
960
+ /** Horizontal text alignment within the shape. */
961
+ horizontalAlign?: 'left' | 'center' | 'right';
962
+ };
963
+ export type LineEnd = {
964
+ type?: string;
965
+ width?: string;
966
+ length?: string;
967
+ };
968
+ export type LineEnds = {
969
+ head?: LineEnd;
970
+ tail?: LineEnd;
971
+ };
972
+ export type EffectExtent = {
973
+ left: number;
974
+ top: number;
975
+ right: number;
976
+ bottom: number;
977
+ };
978
+ export type VectorShapeStyle = {
979
+ fillColor?: FillColor;
980
+ strokeColor?: StrokeColor;
981
+ strokeWidth?: number;
982
+ lineEnds?: LineEnds;
983
+ textContent?: ShapeTextContent;
984
+ textAlign?: string;
985
+ textVerticalAlign?: 'top' | 'center' | 'bottom';
986
+ textInsets?: {
987
+ top: number;
988
+ right: number;
989
+ bottom: number;
990
+ left: number;
991
+ };
992
+ };
993
+ export type ShapeGroupTransform = {
994
+ x?: number;
995
+ y?: number;
996
+ width?: number;
997
+ height?: number;
998
+ childX?: number;
999
+ childY?: number;
1000
+ childWidth?: number;
1001
+ childHeight?: number;
1002
+ childOriginXEmu?: number;
1003
+ childOriginYEmu?: number;
1004
+ };
1005
+ export type ShapeGroupVectorChild = {
1006
+ shapeType: 'vectorShape';
1007
+ attrs: PositionedDrawingGeometry & VectorShapeStyle & {
1008
+ kind?: string;
1009
+ customGeometry?: CustomGeometryData;
1010
+ shapeId?: string;
1011
+ shapeName?: string;
1012
+ };
1013
+ };
1014
+ export type ShapeGroupImageChild = {
1015
+ shapeType: 'image';
1016
+ attrs: PositionedDrawingGeometry & {
1017
+ src: string;
1018
+ alt?: string;
1019
+ clipPath?: string;
1020
+ alphaModFix?: ImageAlphaModFix;
1021
+ imageId?: string;
1022
+ imageName?: string;
1023
+ };
1024
+ };
1025
+ export type ShapeGroupUnknownChild = {
1026
+ shapeType: string;
1027
+ attrs: Record<string, unknown>;
1028
+ };
1029
+ export type ShapeGroupChild = ShapeGroupVectorChild | ShapeGroupImageChild | ShapeGroupUnknownChild;
1030
+ export type DrawingBlockBase = {
1031
+ kind: 'drawing';
1032
+ id: BlockId;
1033
+ drawingKind: DrawingKind;
1034
+ margin?: BoxSpacing;
1035
+ padding?: BoxSpacing;
1036
+ anchor?: ImageAnchor;
1037
+ wrap?: ImageWrap;
1038
+ zIndex?: number;
1039
+ drawingContentId?: string;
1040
+ drawingContent?: DrawingContentSnapshot;
1041
+ attrs?: Record<string, unknown>;
1042
+ sourceAnchor?: SourceAnchor;
1043
+ };
1044
+ /**
1045
+ * Custom geometry path data extracted from a:custGeom/a:pathLst.
1046
+ * Each path has an SVG `d` attribute and its own coordinate space (w × h).
1047
+ */
1048
+ export type CustomGeometryData = {
1049
+ paths: Array<{
1050
+ /** SVG path d attribute (M, L, C, Q, Z commands) */
1051
+ d: string;
1052
+ /** Coordinate space width for this path */
1053
+ w: number;
1054
+ /** Coordinate space height for this path */
1055
+ h: number;
1056
+ }>;
1057
+ };
1058
+ export type VectorShapeDrawing = DrawingBlockBase & {
1059
+ drawingKind: 'vectorShape';
1060
+ geometry: DrawingGeometry;
1061
+ shapeKind?: string;
1062
+ customGeometry?: CustomGeometryData;
1063
+ fillColor?: FillColor;
1064
+ strokeColor?: StrokeColor;
1065
+ strokeWidth?: number;
1066
+ lineEnds?: LineEnds;
1067
+ effectExtent?: EffectExtent;
1068
+ textContent?: ShapeTextContent;
1069
+ textAlign?: string;
1070
+ textVerticalAlign?: 'top' | 'center' | 'bottom';
1071
+ textInsets?: {
1072
+ top: number;
1073
+ right: number;
1074
+ bottom: number;
1075
+ left: number;
1076
+ };
1077
+ };
1078
+ export type TextboxDrawing = DrawingBlockBase & {
1079
+ drawingKind: 'textboxShape';
1080
+ geometry: DrawingGeometry;
1081
+ shapeKind?: string;
1082
+ customGeometry?: CustomGeometryData;
1083
+ fillColor?: FillColor;
1084
+ strokeColor?: StrokeColor;
1085
+ strokeWidth?: number;
1086
+ lineEnds?: LineEnds;
1087
+ effectExtent?: EffectExtent;
1088
+ textContent?: ShapeTextContent;
1089
+ textAlign?: string;
1090
+ textVerticalAlign?: 'top' | 'center' | 'bottom';
1091
+ textInsets?: {
1092
+ top: number;
1093
+ right: number;
1094
+ bottom: number;
1095
+ left: number;
1096
+ };
1097
+ contentBlocks: ParagraphBlock[];
1098
+ /** Paragraph layout results for table-cell textboxes; populated by the layout bridge, read by the painter. */
1099
+ contentMeasures?: ParagraphMeasure[];
1100
+ };
1101
+ export type ShapeGroupDrawing = DrawingBlockBase & {
1102
+ drawingKind: 'shapeGroup';
1103
+ geometry: DrawingGeometry;
1104
+ groupTransform?: ShapeGroupTransform;
1105
+ shapes: ShapeGroupChild[];
1106
+ size?: {
1107
+ width?: number;
1108
+ height?: number;
1109
+ };
1110
+ };
1111
+ export type ImageDrawing = DrawingBlockBase & Omit<ImageBlock, 'kind' | 'id' | 'margin' | 'padding' | 'anchor' | 'wrap'> & {
1112
+ drawingKind: 'image';
1113
+ };
1114
+ /** A single data series in a chart (e.g., one set of bars in a bar chart). */
1115
+ export type ChartSeriesData = {
1116
+ /** Display name for the series (from c:tx). */
1117
+ name: string;
1118
+ /** Category labels (from c:cat / c:strCache). */
1119
+ categories: string[];
1120
+ /** Numeric values (from c:val / c:numCache). */
1121
+ values: number[];
1122
+ /** Optional X-axis values for XY charts (scatter/bubble). */
1123
+ xValues?: number[];
1124
+ /** Optional bubble radius/size values for bubble charts. */
1125
+ bubbleSizes?: number[];
1126
+ };
1127
+ /** Axis configuration extracted from c:catAx / c:valAx. */
1128
+ export type ChartAxisConfig = {
1129
+ title?: string;
1130
+ orientation?: 'minMax' | 'maxMin';
1131
+ };
1132
+ /** Normalized chart data model parsed from OOXML chart XML. */
1133
+ export type ChartModel = {
1134
+ /** OOXML chart element name (e.g., 'barChart', 'lineChart', 'pieChart'). */
1135
+ chartType: string;
1136
+ /** Sub-type qualifier (e.g., 'clustered', 'stacked', 'percentStacked'). */
1137
+ subType?: string;
1138
+ /** Bar direction — 'col' for vertical columns, 'bar' for horizontal bars. */
1139
+ barDirection?: 'col' | 'bar';
1140
+ /** Data series in the chart. */
1141
+ series: ChartSeriesData[];
1142
+ /** Category axis config. */
1143
+ categoryAxis?: ChartAxisConfig;
1144
+ /** Value axis config. */
1145
+ valueAxis?: ChartAxisConfig;
1146
+ /** Legend position (e.g., 'r', 'b', 't', 'l'). */
1147
+ legendPosition?: string;
1148
+ /** OOXML chart style ID. */
1149
+ styleId?: number;
1150
+ };
1151
+ /** Chart drawing block. */
1152
+ export type ChartDrawing = DrawingBlockBase & {
1153
+ drawingKind: 'chart';
1154
+ geometry: DrawingGeometry;
1155
+ /** Parsed chart data for rendering. */
1156
+ chartData: ChartModel;
1157
+ /** Relationship ID for the chart part in the docx package. */
1158
+ chartRelId?: string;
1159
+ /** Path to the chart XML part (e.g., 'word/charts/chart1.xml'). */
1160
+ chartPartPath?: string;
1161
+ };
1162
+ export type DrawingBlock = VectorShapeDrawing | TextboxDrawing | ShapeGroupDrawing | ImageDrawing | ChartDrawing;
1163
+ /**
1164
+ * Vertical alignment of content within a section/page.
1165
+ * Maps to OOXML w:vAlign values in sectPr.
1166
+ */
1167
+ export type SectionVerticalAlign = 'top' | 'center' | 'bottom' | 'both';
1168
+ export type SectionBreakBlock = {
1169
+ kind: 'sectionBreak';
1170
+ id: BlockId;
1171
+ type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
1172
+ pageSize?: {
1173
+ w: number;
1174
+ h: number;
1175
+ };
1176
+ orientation?: 'portrait' | 'landscape';
1177
+ margins: {
1178
+ /** Header margin (distance from top of page to header content) */
1179
+ header?: number;
1180
+ /** Footer margin (distance from bottom of page to footer content) */
1181
+ footer?: number;
1182
+ /** Top page margin (distance from top of page to body content) */
1183
+ top?: number;
1184
+ /** Right page margin */
1185
+ right?: number;
1186
+ /** Bottom page margin */
1187
+ bottom?: number;
1188
+ /** Left page margin */
1189
+ left?: number;
1190
+ };
1191
+ numbering?: SectionNumbering;
1192
+ headerRefs?: {
1193
+ default?: string;
1194
+ first?: string;
1195
+ even?: string;
1196
+ odd?: string;
1197
+ };
1198
+ footerRefs?: {
1199
+ default?: string;
1200
+ first?: string;
1201
+ even?: string;
1202
+ odd?: string;
1203
+ };
1204
+ columns?: ColumnLayout & {
1205
+ equalWidth?: boolean;
1206
+ };
1207
+ /**
1208
+ * Vertical alignment of content within the section's pages.
1209
+ * - 'top': Content starts at top margin (default behavior)
1210
+ * - 'center': Content is vertically centered between margins
1211
+ * - 'bottom': Content is aligned to bottom margin
1212
+ * - 'both': Content is vertically justified (distributed)
1213
+ */
1214
+ vAlign?: SectionVerticalAlign;
1215
+ attrs?: {
1216
+ source?: string;
1217
+ requirePageBoundary?: boolean;
1218
+ [key: string]: unknown;
1219
+ };
1220
+ };
1221
+ export type SectionRefType = 'default' | 'first' | 'even' | 'odd';
1222
+ export type SectionRefs = {
1223
+ headerRefs?: Partial<Record<SectionRefType, string>>;
1224
+ footerRefs?: Partial<Record<SectionRefType, string>>;
1225
+ };
1226
+ export type SectionNumbering = {
1227
+ format?: PageNumberFormat;
1228
+ start?: number;
1229
+ chapterStyle?: number;
1230
+ chapterSeparator?: PageNumberChapterSeparator;
1231
+ };
1232
+ export type SectionMetadata = {
1233
+ sectionIndex: number;
1234
+ headerRefs?: Partial<Record<SectionRefType, string>>;
1235
+ footerRefs?: Partial<Record<SectionRefType, string>>;
1236
+ numbering?: SectionNumbering;
1237
+ /** Whether first page has a different header/footer (w:titlePg in OOXML) */
1238
+ titlePg?: boolean;
1239
+ /** Vertical alignment of content within this section's pages */
1240
+ vAlign?: SectionVerticalAlign;
1241
+ /** Section page margins in CSS px */
1242
+ margins?: {
1243
+ top?: number;
1244
+ right?: number;
1245
+ bottom?: number;
1246
+ left?: number;
1247
+ header?: number;
1248
+ footer?: number;
1249
+ } | null;
1250
+ /** Section page size in CSS px */
1251
+ pageSize?: {
1252
+ w: number;
1253
+ h: number;
1254
+ } | null;
1255
+ };
1256
+ export type PageBreakBlock = {
1257
+ kind: 'pageBreak';
1258
+ id: BlockId;
1259
+ attrs?: Record<string, unknown>;
1260
+ };
1261
+ export type ColumnBreakBlock = {
1262
+ kind: 'columnBreak';
1263
+ id: BlockId;
1264
+ attrs?: Record<string, unknown>;
1265
+ };
1266
+ /** Positioning for anchored images (offsets in CSS px). */
1267
+ export type ImageAnchor = {
1268
+ isAnchored?: boolean;
1269
+ hRelativeFrom?: 'column' | 'page' | 'margin';
1270
+ vRelativeFrom?: 'paragraph' | 'page' | 'margin';
1271
+ alignH?: 'left' | 'center' | 'right';
1272
+ alignV?: 'top' | 'center' | 'bottom';
1273
+ offsetH?: number;
1274
+ offsetV?: number;
1275
+ behindDoc?: boolean;
1276
+ padding?: BoxSpacing | undefined;
1277
+ margin?: BoxSpacing | undefined;
1278
+ };
1279
+ /**
1280
+ * Shared vertical page-relative anchor predicate.
1281
+ *
1282
+ * Layout-engine uses this to decide which floating drawing anchors must be
1283
+ * pre-registered before body flow. Host dependency scanning uses the same
1284
+ * predicate so retained-layout admission cannot drift from engine semantics.
1285
+ */
1286
+ export declare function isPageRelativeAnchor(input: {
1287
+ anchor?: {
1288
+ vRelativeFrom?: unknown;
1289
+ } | null;
1290
+ } | null | undefined): boolean;
1291
+ /** Sub-pixel tolerance under which explicit column widths count as equal (SD-2324). */
1292
+ export declare const COLUMN_WIDTH_EQUALITY_TOLERANCE_PX = 0.5;
1293
+ /** True when every explicit column width is equal within the shared sub-pixel tolerance. */
1294
+ export declare function allExplicitColumnWidthsEqual(widths: readonly number[]): boolean;
1295
+ /**
1296
+ * Shared "genuinely unequal explicit column widths" predicate (SD-2324).
1297
+ *
1298
+ * The layout engine skips end-of-section column balancing exactly when this
1299
+ * is true: Word fills genuinely-unequal explicit columns column-by-column
1300
+ * rather than rebalancing them. Host retained-layout dependency scanning
1301
+ * (SD-3772) consumes the same predicate so checkpoint admission can never
1302
+ * drift from the engine's balancing semantics. Explicit widths that are all
1303
+ * EQUAL (`equalWidth="0"` with every `<w:col w:w>` equal) still balance like
1304
+ * implicit equal columns and are NOT genuinely unequal.
1305
+ */
1306
+ export declare function hasGenuinelyUnequalExplicitColumnWidths(columns: {
1307
+ equalWidth?: boolean | undefined;
1308
+ widths?: readonly number[] | undefined;
1309
+ } | null | undefined): boolean;
1310
+ /** Text wrapping for floating images (distances in px). */
1311
+ export type ImageWrap = {
1312
+ type: 'None' | 'Square' | 'Tight' | 'Through' | 'TopAndBottom' | 'Inline';
1313
+ wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
1314
+ distTop?: number;
1315
+ distBottom?: number;
1316
+ distLeft?: number;
1317
+ distRight?: number;
1318
+ polygon?: number[][];
1319
+ behindDoc?: boolean;
1320
+ };
1321
+ /**
1322
+ * Positioning for anchored/floating tables (offsets in CSS px).
1323
+ * Corresponds to OOXML w:tblpPr attributes.
1324
+ */
1325
+ export type TableAnchor = {
1326
+ isAnchored?: boolean;
1327
+ /** Horizontal anchor reference: column, page, or margin. Maps from w:horzAnchor. */
1328
+ hRelativeFrom?: 'column' | 'page' | 'margin';
1329
+ /** Vertical anchor reference: paragraph (text), page, or margin. Maps from w:vertAnchor. */
1330
+ vRelativeFrom?: 'paragraph' | 'page' | 'margin';
1331
+ /** Horizontal alignment relative to anchor. Maps from w:tblpXSpec. */
1332
+ alignH?: 'left' | 'center' | 'right' | 'inside' | 'outside';
1333
+ /** Vertical alignment relative to anchor. Maps from w:tblpYSpec. */
1334
+ alignV?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
1335
+ /** Absolute horizontal offset in px. Maps from w:tblpX (twips converted to px). */
1336
+ offsetH?: number;
1337
+ /** Absolute vertical offset in px. Maps from w:tblpY (twips converted to px). */
1338
+ offsetV?: number;
1339
+ };
1340
+ /**
1341
+ * Text wrapping for floating tables (distances in px).
1342
+ * Tables only support Square or None wrapping (not Tight/Through like images).
1343
+ */
1344
+ export type TableWrap = {
1345
+ /** Wrap type: Square for text wrapping, None for absolute positioning. */
1346
+ type: 'Square' | 'None';
1347
+ /** Which side(s) text flows on. */
1348
+ wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
1349
+ /** Distance from text above table (px). Maps from w:topFromText. */
1350
+ distTop?: number;
1351
+ /** Distance from text below table (px). Maps from w:bottomFromText. */
1352
+ distBottom?: number;
1353
+ /** Distance from text to left of table (px). Maps from w:leftFromText. */
1354
+ distLeft?: number;
1355
+ /** Distance from text to right of table (px). Maps from w:rightFromText. */
1356
+ distRight?: number;
1357
+ };
1358
+ /** Exclusion zone for text wrapping around anchored images. */
1359
+ export type ExclusionZone = {
1360
+ imageBlockId: BlockId;
1361
+ pageNumber: number;
1362
+ columnIndex: number;
1363
+ bounds: {
1364
+ x: number;
1365
+ y: number;
1366
+ width: number;
1367
+ height: number;
1368
+ };
1369
+ distances: {
1370
+ top: number;
1371
+ bottom: number;
1372
+ left: number;
1373
+ right: number;
1374
+ };
1375
+ wrapMode: 'left' | 'right' | 'both' | 'none' | 'largest';
1376
+ polygon?: number[][];
1377
+ };
1378
+ export type ParagraphSpacing = {
1379
+ before?: number;
1380
+ after?: number;
1381
+ line?: number;
1382
+ lineUnit?: 'px' | 'multiplier';
1383
+ lineRule?: 'auto' | 'exact' | 'atLeast';
1384
+ beforeAutospacing?: boolean;
1385
+ afterAutospacing?: boolean;
1386
+ };
1387
+ export type ParagraphIndent = {
1388
+ left?: number;
1389
+ right?: number;
1390
+ firstLine?: number;
1391
+ hanging?: number;
1392
+ };
1393
+ export type ParagraphBorder = {
1394
+ style?: 'none' | 'solid' | 'dashed' | 'dotted' | 'double';
1395
+ width?: number;
1396
+ color?: string;
1397
+ space?: number;
1398
+ };
1399
+ export type ParagraphBorders = {
1400
+ top?: ParagraphBorder;
1401
+ right?: ParagraphBorder;
1402
+ bottom?: ParagraphBorder;
1403
+ left?: ParagraphBorder;
1404
+ between?: ParagraphBorder;
1405
+ };
1406
+ export type ParagraphShading = {
1407
+ fill?: string;
1408
+ color?: string;
1409
+ val?: string;
1410
+ themeColor?: string;
1411
+ themeFill?: string;
1412
+ themeFillShade?: string;
1413
+ themeFillTint?: string;
1414
+ themeShade?: string;
1415
+ themeTint?: string;
1416
+ };
1417
+ /**
1418
+ * Run styling for drop cap letter.
1419
+ * Contains the text and font properties of the drop cap character(s).
1420
+ */
1421
+ export type DropCapRun = {
1422
+ /** The drop cap text (usually a single capital letter). */
1423
+ text: string;
1424
+ /** Font family for the drop cap. */
1425
+ fontFamily: string;
1426
+ /** Font size in pixels (typically much larger than body text, e.g., 117pt). */
1427
+ fontSize: number;
1428
+ /** Bold styling. */
1429
+ bold?: boolean;
1430
+ /** Italic styling. */
1431
+ italic?: boolean;
1432
+ /** Text color. */
1433
+ color?: string;
1434
+ /** Vertical position offset in pixels (from w:position, e.g., -10). */
1435
+ position?: number;
1436
+ };
1437
+ /**
1438
+ * Structured drop cap descriptor for layout engine.
1439
+ *
1440
+ * Drop caps are enlarged initial letters that span multiple lines of text.
1441
+ * OOXML encodes drop caps via w:framePr with @w:dropCap attribute on a separate
1442
+ * paragraph containing just the drop cap letter, followed by the text paragraph.
1443
+ *
1444
+ * Layout engine merges these into a single paragraph with this descriptor
1445
+ * to enable proper measurement and rendering.
1446
+ */
1447
+ export type DropCapDescriptor = {
1448
+ /**
1449
+ * Drop cap mode:
1450
+ * - 'drop': Letter drops into the text area (most common)
1451
+ * - 'margin': Letter sits in the left margin
1452
+ */
1453
+ mode: 'drop' | 'margin';
1454
+ /**
1455
+ * Number of lines the drop cap spans (from w:lines attribute, typically 2-5).
1456
+ * Determines the height of the drop cap box.
1457
+ */
1458
+ lines: number;
1459
+ /**
1460
+ * The drop cap run containing text and styling.
1461
+ */
1462
+ run: DropCapRun;
1463
+ /**
1464
+ * Text wrapping mode (from w:wrap attribute on framePr).
1465
+ * - 'around': Text wraps around the drop cap (default)
1466
+ * - 'notBeside': Text does not wrap beside drop cap
1467
+ * - 'none': No special wrapping
1468
+ * - 'tight': Tight wrapping
1469
+ */
1470
+ wrap?: 'around' | 'notBeside' | 'none' | 'tight';
1471
+ /**
1472
+ * Measured width of the drop cap in pixels (populated during measurement).
1473
+ */
1474
+ measuredWidth?: number;
1475
+ /**
1476
+ * Measured height of the drop cap in pixels (populated during measurement).
1477
+ */
1478
+ measuredHeight?: number;
1479
+ };
1480
+ /**
1481
+ * Marker metadata for word-layout lists.
1482
+ * Contains styling and positioning information for list markers.
1483
+ */
1484
+ export type WordLayoutMarker = {
1485
+ /** The text content of the marker (e.g., "1.", "a)", "•"). */
1486
+ markerText?: string;
1487
+ /** Horizontal alignment of the marker within its allocated space. */
1488
+ justification?: 'left' | 'right' | 'center';
1489
+ /** Spacing between marker text and paragraph content in pixels. */
1490
+ gutterWidthPx?: number;
1491
+ /** Total width allocated for the marker box in pixels. */
1492
+ markerBoxWidthPx?: number;
1493
+ /** Type of separator between marker and text (tab, space, or nothing). */
1494
+ suffix?: 'tab' | 'space' | 'nothing';
1495
+ /** Pre-calculated X position where the marker should be placed (used in firstLineIndentMode). */
1496
+ markerX?: number;
1497
+ /** Pre-calculated X position where paragraph text should begin after the marker (used in firstLineIndentMode). */
1498
+ textStartX?: number;
1499
+ /** Style properties for the marker text. */
1500
+ run: {
1501
+ fontFamily: string;
1502
+ fontSize: number;
1503
+ bold?: boolean;
1504
+ italic?: boolean;
1505
+ color?: string;
1506
+ letterSpacing?: number;
1507
+ vanish?: boolean;
1508
+ };
1509
+ /**
1510
+ * Optional tracked-change review metadata for the marker glyph (Plan 5).
1511
+ * Projected onto the marker when the paragraph's visible marker is affected
1512
+ * by a guide-relevant tracked change; absent for normal markers.
1513
+ */
1514
+ trackedChange?: MarkerTrackedChange;
1515
+ };
1516
+ /**
1517
+ * Word layout configuration for list items created via input rules.
1518
+ *
1519
+ * This type represents the structure of wordLayout data produced by @superdoc/word-layout
1520
+ * for paragraphs with list markers. It contains metadata about marker positioning and
1521
+ * text alignment that differs from standard hanging-indent lists.
1522
+ *
1523
+ * Two distinct list rendering modes exist:
1524
+ * 1. **Standard hanging indent**: Marker sits in hanging indent area, text starts at paraIndentLeft
1525
+ * 2. **First-line indent mode**: Marker is at paraIndentLeft + firstLine, text starts at textStartPx
1526
+ *
1527
+ * This type enables type-safe access to word-layout-specific properties without unsafe casts.
1528
+ *
1529
+ * @example
1530
+ * ```typescript
1531
+ * // Standard hanging indent list (marker in hanging indent area)
1532
+ * const standardListConfig: WordLayoutConfig = {
1533
+ * marker: {
1534
+ * markerText: "1.",
1535
+ * justification: "right",
1536
+ * gutterWidthPx: 18
1537
+ * }
1538
+ * };
1539
+ * // Text starts at paraIndentLeft, marker is placed in hanging indent area
1540
+ * ```
1541
+ *
1542
+ * @example
1543
+ * ```typescript
1544
+ * // First-line indent mode list (input-rule created, e.g., typing "1. ")
1545
+ * const firstLineIndentConfig: WordLayoutConfig = {
1546
+ * firstLineIndentMode: true,
1547
+ * textStartPx: 56, // Pre-calculated: paraIndentLeft + firstLine + markerWidth + tabWidth
1548
+ * marker: {
1549
+ * markerText: "1.",
1550
+ * markerX: 36, // Position where marker renders
1551
+ * textStartX: 56 // Where text starts after marker
1552
+ * }
1553
+ * };
1554
+ * // Text starts at textStartPx (56px), marker is at markerX (36px)
1555
+ * ```
1556
+ *
1557
+ * @example
1558
+ * ```typescript
1559
+ * // Checking for first-line indent mode in layout code
1560
+ * const wordLayout = block.attrs?.wordLayout;
1561
+ * if (wordLayout?.firstLineIndentMode) {
1562
+ * const textStart = wordLayout.textStartPx ?? 0;
1563
+ * // Use textStart for positioning text on first line
1564
+ * } else {
1565
+ * // Use standard hanging indent calculations
1566
+ * }
1567
+ * ```
1568
+ *
1569
+ * @example
1570
+ * ```typescript
1571
+ * // Non-list paragraph (no word layout config)
1572
+ * const regularParagraph = {
1573
+ * kind: 'paragraph',
1574
+ * attrs: {
1575
+ * indent: { left: 36, firstLine: 18 }
1576
+ * // No wordLayout property
1577
+ * }
1578
+ * };
1579
+ * // Text positioning uses standard paragraph indent logic
1580
+ * ```
1581
+ */
1582
+ export type WordLayoutConfig = {
1583
+ /**
1584
+ * Whether this list uses first-line indent mode (true for input-rule-created lists).
1585
+ * When true, text positioning uses textStartPx instead of standard hanging indent calculations.
1586
+ */
1587
+ firstLineIndentMode?: boolean;
1588
+ /**
1589
+ * Absolute X position in pixels where text content starts on the first line.
1590
+ * Includes marker width, tab width, and any additional spacing.
1591
+ * Only meaningful when firstLineIndentMode is true.
1592
+ */
1593
+ textStartPx?: number;
1594
+ /**
1595
+ * Marker metadata for word-layout lists.
1596
+ * Present when the paragraph is part of a list structure.
1597
+ */
1598
+ marker?: WordLayoutMarker;
1599
+ /**
1600
+ * Additional word-layout properties may be present but are not yet typed.
1601
+ */
1602
+ [key: string]: unknown;
1603
+ };
1604
+ export type ParagraphAttrs = {
1605
+ styleId?: string;
1606
+ alignment?: 'left' | 'center' | 'right' | 'justify';
1607
+ spacing?: ParagraphSpacing;
1608
+ /**
1609
+ * Indicates which spacing properties were explicitly set on the paragraph.
1610
+ * Used to preserve Word behavior for empty paragraphs when spacing only comes
1611
+ * from docDefaults or styles.
1612
+ */
1613
+ spacingExplicit?: {
1614
+ before?: boolean;
1615
+ after?: boolean;
1616
+ line?: boolean;
1617
+ };
1618
+ contextualSpacing?: boolean;
1619
+ indent?: ParagraphIndent;
1620
+ /** Word quirk: justified paragraphs ignore first-line indent. Set by pm-adapter. */
1621
+ suppressFirstLineIndent?: boolean;
1622
+ /**
1623
+ * Legacy drop cap flag from w:framePr/@w:dropCap.
1624
+ * @deprecated Use dropCapDescriptor for full drop cap support.
1625
+ */
1626
+ dropCap?: string | number | boolean;
1627
+ /**
1628
+ * Structured drop cap descriptor with full metadata.
1629
+ * When present, layout engine will render the drop cap with proper geometry.
1630
+ */
1631
+ dropCapDescriptor?: DropCapDescriptor;
1632
+ frame?: ParagraphFrame;
1633
+ numberingProperties?: {
1634
+ ilvl?: number;
1635
+ numId?: number;
1636
+ } | null;
1637
+ /** Built-in heading level resolved from style metadata, where 1 means Heading 1. */
1638
+ headingLevel?: number;
1639
+ /** Current list level ordinal from structured numbering metadata. */
1640
+ listLevelOrdinal?: number;
1641
+ borders?: ParagraphBorders;
1642
+ shading?: ParagraphShading;
1643
+ tabs?: TabStop[];
1644
+ decimalSeparator?: string;
1645
+ tabIntervalTwips?: number;
1646
+ keepNext?: boolean;
1647
+ keepLines?: boolean;
1648
+ pageBreakBefore?: boolean;
1649
+ trackedChangesMode?: TrackedChangesMode;
1650
+ trackedChangesEnabled?: boolean;
1651
+ /**
1652
+ * Review anchor for a paragraph-mark tracked change when there is no list
1653
+ * marker glyph to carry the review identity. The DOM painter stamps this on
1654
+ * the paragraph frame so geometry/focus/sidebar paths can resolve normal and
1655
+ * empty paragraph splits.
1656
+ */
1657
+ paragraphMarkTrackedChange?: MarkerTrackedChange;
1658
+ /**
1659
+ * Review anchor for a paragraph-property formatting revision such as
1660
+ * `w:pPrChange` alignment. Used when the change has no inline text or list
1661
+ * marker glyph that can carry review geometry.
1662
+ */
1663
+ paragraphPropertyTrackedChange?: MarkerTrackedChange;
1664
+ /** Marks an empty paragraph that only exists to carry section properties. */
1665
+ sectPrMarker?: boolean;
1666
+ /**
1667
+ * The paragraph break should not produce a visible line break: the next
1668
+ * paragraph's runs fuse into this block during pm-adapter post-processing
1669
+ * and the successor's auto-generated list marker disappears with it.
1670
+ * Numbering counters on subsequent paragraphs still advance per OOXML
1671
+ * paragraph, matching Word.
1672
+ *
1673
+ * Triggered by `w:vanish` on the paragraph-mark rPr (`w:pPr/w:rPr`).
1674
+ * ECMA-376 §17.3.2.36 reads as if `w:specVanish` is the trigger ("a
1675
+ * paragraph mark shall never be used to break the end of a paragraph for
1676
+ * display"), but Word 16.0 fuses on `w:vanish` and leaves `w:specVanish`
1677
+ * standalone as a no-op for the paragraph break (SD-3269 fixture matrix).
1678
+ * Matching Word, not the literal spec, is the rendering goal.
1679
+ */
1680
+ suppressParagraphBreak?: boolean;
1681
+ /**
1682
+ * Resolved direction context for the paragraph (inline direction + writing mode).
1683
+ * Single source of truth for paragraph direction-aware rendering decisions.
1684
+ *
1685
+ * Read via `getParagraphInlineDirection(attrs)` rather than inspecting this
1686
+ * field directly so the helper can normalize `null` vs `undefined` and fall
1687
+ * back to `paragraphProperties.rightToLeft` for PM-node / editor paths.
1688
+ *
1689
+ * See `@superdoc/contracts/direction-context` for axis semantics.
1690
+ */
1691
+ directionContext?: ParagraphDirectionContext;
1692
+ isTocEntry?: boolean;
1693
+ tocInstruction?: string;
1694
+ /** Stable id shared by every paragraph in the same TOC (docPartObj uniqueId or parent sdBlockId). */
1695
+ tocId?: string;
1696
+ /** Floating alignment for positioned paragraphs (from w:framePr/@w:xAlign). */
1697
+ floatAlignment?: 'left' | 'right' | 'center';
1698
+ /**
1699
+ * Identity of the editable textbox story (`w:txbxContent`) this paragraph
1700
+ * was projected from, part-global per host part (e.g. `tb0`, `header1-tb0`).
1701
+ * Stamped by the projection adapter; the DOM painter forwards it so hosts
1702
+ * can bind textbox content elements back to their story.
1703
+ */
1704
+ textboxId?: string;
1705
+ /**
1706
+ * Word paragraph layout output from @superdoc/word-layout.
1707
+ * Contains metadata about list marker positioning and text alignment for word-layout lists.
1708
+ * Use WordLayoutConfig type for type-safe access to known properties.
1709
+ */
1710
+ wordLayout?: WordLayoutConfig;
1711
+ sdt?: SdtMetadata;
1712
+ /** Container SDT for blocks with both primary and container metadata. */
1713
+ containerSdt?: SdtMetadata;
1714
+ };
1715
+ export type ParagraphFrame = {
1716
+ wrap?: string;
1717
+ x?: number;
1718
+ y?: number;
1719
+ xAlign?: 'left' | 'right' | 'center';
1720
+ yAlign?: 'top' | 'center' | 'bottom';
1721
+ hAnchor?: string;
1722
+ vAnchor?: string;
1723
+ };
1724
+ export type ListMarker = {
1725
+ kind: 'bullet' | 'number';
1726
+ text: string;
1727
+ level: number;
1728
+ order?: number;
1729
+ style?: string;
1730
+ numId?: string;
1731
+ levels?: number[];
1732
+ numberingType?: string;
1733
+ lvlText?: string;
1734
+ customFormat?: string;
1735
+ align?: 'left' | 'center' | 'right';
1736
+ sourceAnchor?: SourceAnchor;
1737
+ };
1738
+ export type ListItem = {
1739
+ id: BlockId;
1740
+ marker: ListMarker;
1741
+ paragraph: ParagraphBlock;
1742
+ sourceAnchor?: SourceAnchor;
1743
+ };
1744
+ export type ListBlock = {
1745
+ kind: 'list';
1746
+ id: BlockId;
1747
+ listType: 'bullet' | 'number';
1748
+ items: ListItem[];
1749
+ sourceAnchor?: SourceAnchor;
1750
+ };
1751
+ export type FlowBlock = ParagraphBlock | ImageBlock | DrawingBlock | ListBlock | TableBlock | SectionBreakBlock | PageBreakBlock | ColumnBreakBlock;
1752
+ export declare const isReviewableSectionBoundaryMarkerBlock: (block: FlowBlock | null | undefined) => boolean;
1753
+ export declare const isInvisibleSectionBoundaryMarkerBlock: (block: FlowBlock | null | undefined) => boolean;
1754
+ export declare const isForcedSectPrSectionBreak: (block: FlowBlock | undefined) => block is SectionBreakBlock;
1755
+ /**
1756
+ * Collect blocks the paginator deliberately collapses before a forcing sectPr.
1757
+ *
1758
+ * The paragraph-only rule is source-complete and shared with consumers that
1759
+ * need to prove whether a source child owns a layout fragment. The layout
1760
+ * engine may additionally identify measured, tiny inline drawings; those are
1761
+ * accepted only when their source/anchor proves they belong to the same filler
1762
+ * run.
1763
+ */
1764
+ export declare const collectSectionBoundaryFillerBlockIds: (blocks: readonly FlowBlock[], options?: {
1765
+ isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
1766
+ }) => ReadonlySet<string>;
1767
+ /** Shared eligibility for paragraphs the layout loop deliberately omits. */
1768
+ export declare const shouldSkipParagraphDuringLayout: (blocks: FlowBlock[], index: number) => boolean;
1769
+ /** True only for block kinds that produce an addressable layout fragment. */
1770
+ export declare const doesFlowBlockProduceLayoutFragment: (blocks: FlowBlock[], index: number, suppressedBlockIds?: ReadonlySet<string>) => boolean;
1771
+ export type ColumnLayout = {
1772
+ count: number;
1773
+ gap: number;
1774
+ withSeparator?: boolean;
1775
+ widths?: number[];
1776
+ equalWidth?: boolean;
1777
+ /**
1778
+ * Per-column inter-column gaps in px, length `count - 1`: the gap after each column except the
1779
+ * last. Explicit mode (`equalWidth === false`) only, derived from each `<w:col w:space>`; equal
1780
+ * mode uses the scalar `gap`. When absent, consumers fall back to the uniform `gap`. (SD-2629)
1781
+ */
1782
+ gaps?: number[];
1783
+ };
1784
+ /**
1785
+ * A vertical region of a page that shares a single column configuration.
1786
+ *
1787
+ * Continuous section breaks can introduce multiple column configurations on the
1788
+ * same page (see ECMA-376 §17.6.22 and §17.18.77). A page may therefore carry
1789
+ * multiple regions stacked vertically. Consumers (e.g. DomPainter) use
1790
+ * `yStart`/`yEnd` to bound any per-region overlays such as column separators.
1791
+ */
1792
+ export type ColumnRegion = {
1793
+ /** Inclusive top of the region, in pixels from the page top. */
1794
+ yStart: number;
1795
+ /** Exclusive bottom of the region, in pixels from the page top. */
1796
+ yEnd: number;
1797
+ /** Column configuration active within this region. */
1798
+ columns: ColumnLayout;
1799
+ };
1800
+ /** A measured line within a block, output by the measurer. */
1801
+ /**
1802
+ * Measured vertical alignment for one inline image run on a {@link Line}.
1803
+ *
1804
+ * Measurement owns this decision because only it knows the composed line's
1805
+ * text-derived metrics and whether the image fits inside the line box (glyph)
1806
+ * or expands it. The painter consumes it as paint-ready data and never
1807
+ * re-derives alignment by measuring the DOM.
1808
+ *
1809
+ * `runIndex` indexes into the owning block's `runs` array (the same space as
1810
+ * {@link Line.fromRun}/{@link LineSegment.runIndex}).
1811
+ */
1812
+ export type LineInlineImageAlignment = {
1813
+ runIndex: number;
1814
+ verticalAlign: ImageRunVerticalAlign;
1815
+ };
1816
+ export type Line = {
1817
+ fromRun: number;
1818
+ fromChar: number;
1819
+ toRun: number;
1820
+ toChar: number;
1821
+ width: number;
1822
+ ascent: number;
1823
+ descent: number;
1824
+ lineHeight: number;
1825
+ /** Maximum available width for this line (used during measurement). */
1826
+ maxWidth?: number;
1827
+ /** Content width before justify compression (used for negative word-spacing calculation). */
1828
+ naturalWidth?: number;
1829
+ /** Number of spaces in the line (pre-computed for efficiency in justify calculations). */
1830
+ spaceCount?: number;
1831
+ /** True when this line used author-defined OOXML tab stops, not synthesized default stops. */
1832
+ hasExplicitTabStops?: boolean;
1833
+ segments?: LineSegment[];
1834
+ leaders?: LeaderDecoration[];
1835
+ bars?: BarDecoration[];
1836
+ /**
1837
+ * Measured per-image vertical alignment for inline images on this line.
1838
+ *
1839
+ * Measurement only emits an entry for an image it resolved to a non-default
1840
+ * alignment (currently `'baseline'` for glyph-like images that fit inside the
1841
+ * text-derived line box). Images absent from this list keep the legacy `'top'`
1842
+ * default in the painter. An authored {@link ImageRun.verticalAlign} always
1843
+ * wins over the entry here.
1844
+ */
1845
+ inlineImageAlignments?: LineInlineImageAlignment[];
1846
+ /**
1847
+ * Measured tab widths keyed by tab run `pmStart`, stored alongside the
1848
+ * `ParagraphMeasure` so the painter can read them even after FlowBlock
1849
+ * re-projection where the measuring cache returns a hit and `run.width` is
1850
+ * never re-assigned on the fresh run objects.
1851
+ */
1852
+ tabWidths?: Record<number, number>;
1853
+ };
1854
+ export type LineSegment = {
1855
+ runIndex: number;
1856
+ fromChar: number;
1857
+ toChar: number;
1858
+ width: number;
1859
+ /**
1860
+ * Explicit line-content-relative x override (px), set by the measurer only for
1861
+ * tab-aligned segments. When omitted, the segment flows immediately after the
1862
+ * previous one (cumulative measured widths from the line content start).
1863
+ *
1864
+ * This stays optional on the producer type on purpose: it is an override
1865
+ * channel, not a resolved coordinate. The editor-neutral substrate resolves it
1866
+ * (together with indent + alignment) into a load-bearing absolute
1867
+ * {@link NeutralSegmentGeometry.x}, so hosts consume the resolved value and
1868
+ * never need fallback positioning logic. See `segment-geometry.ts`.
1869
+ */
1870
+ x?: number;
1871
+ /** End x for an immediately preceding tab when it differs from this segment's paint x. */
1872
+ precedingTabEndX?: number;
1873
+ };
1874
+ export type LeaderDecoration = {
1875
+ from: number;
1876
+ to: number;
1877
+ style: 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
1878
+ };
1879
+ export type BarDecoration = {
1880
+ x: number;
1881
+ };
1882
+ export type ParagraphMeasure = {
1883
+ kind: 'paragraph';
1884
+ lines: Line[];
1885
+ totalHeight: number;
1886
+ /**
1887
+ * The `maxWidth` constraint (pre-indent, in pixels) this measure was produced for.
1888
+ *
1889
+ * Layout uses this to decide whether a paragraph must be remeasured for a
1890
+ * narrower region (e.g. a multi-column section). Per-line `maxWidth` cannot
1891
+ * serve that purpose: the first line's available width legitimately differs
1892
+ * from the constraint under hanging/negative first-line indents, which made
1893
+ * width-change detection based on `lines[0].maxWidth` fire spuriously.
1894
+ * Optional so producer-independent measures (and fixtures) stay valid; when
1895
+ * absent, layout falls back to the legacy first-line width heuristic.
1896
+ */
1897
+ measuredAtMaxWidth?: number;
1898
+ marker?: {
1899
+ markerWidth: number;
1900
+ /**
1901
+ * The actual rendered text width of the marker glyphs in pixels (e.g., "1." text width).
1902
+ * This represents the precise width of the marker text content, as opposed to markerWidth
1903
+ * which includes padding and represents the full marker box width.
1904
+ *
1905
+ * Used by the renderer for tab positioning calculations to match Word's behavior, where
1906
+ * tabs extend from the end of the actual marker text (not the marker box edge) to the
1907
+ * next tab stop. This ensures proper alignment between the marker and paragraph content.
1908
+ *
1909
+ * When undefined or null, the renderer falls back to using markerWidth for compatibility.
1910
+ *
1911
+ * @see markerWidth - The full marker box width including padding
1912
+ * @see ParagraphFragment.markerTextWidth - The corresponding property in layout fragments
1913
+ */
1914
+ markerTextWidth: number;
1915
+ indentLeft: number;
1916
+ /**
1917
+ * The gutter (spacing) width between the marker text and the paragraph content, in pixels.
1918
+ * Used by the renderer for calculating tab stops in word-layout lists.
1919
+ * When present, this value comes from Word's gutterWidthPx and is used to match Word's
1920
+ * list marker tab alignment behavior.
1921
+ */
1922
+ gutterWidth?: number;
1923
+ };
1924
+ /**
1925
+ * Measured drop cap information, populated when the paragraph has a drop cap.
1926
+ * Used by the renderer to position the drop cap element.
1927
+ */
1928
+ dropCap?: {
1929
+ /** Measured width of the drop cap box (including padding). */
1930
+ width: number;
1931
+ /** Measured height of the drop cap (based on lines * lineHeight). */
1932
+ height: number;
1933
+ /** Number of lines the drop cap spans. */
1934
+ lines: number;
1935
+ /** Drop cap mode: 'drop' inside text area, 'margin' in the margin. */
1936
+ mode: 'drop' | 'margin';
1937
+ };
1938
+ };
1939
+ export type ImageMeasure = {
1940
+ kind: 'image';
1941
+ width: number;
1942
+ height: number;
1943
+ };
1944
+ export type DrawingMeasure = {
1945
+ kind: 'drawing';
1946
+ drawingKind: DrawingKind;
1947
+ width: number;
1948
+ height: number;
1949
+ scale: number;
1950
+ naturalWidth: number;
1951
+ naturalHeight: number;
1952
+ geometry: DrawingGeometry;
1953
+ groupTransform?: ShapeGroupTransform;
1954
+ /** Canonical paragraph measurements for textbox content, when the drawing owns text. */
1955
+ contentMeasures?: ParagraphMeasure[];
1956
+ };
1957
+ export type TableCellMeasure = {
1958
+ /** Multi-block cell measurements (new feature) */
1959
+ blocks?: Measure[];
1960
+ /** Single paragraph measure (backward compatibility) */
1961
+ paragraph?: ParagraphMeasure;
1962
+ width: number;
1963
+ height: number;
1964
+ /** Starting grid column index (0-based) */
1965
+ gridColumnStart?: number;
1966
+ /** Number of grid columns this cell spans */
1967
+ colSpan?: number;
1968
+ /** Number of rows this cell spans */
1969
+ rowSpan?: number;
1970
+ };
1971
+ export type TableRowMeasure = {
1972
+ cells: TableCellMeasure[];
1973
+ height: number;
1974
+ };
1975
+ /** Outer table border widths in pixels (top, right, bottom, left). Used for total dimensions and content offset. */
1976
+ export type TableBorderWidths = {
1977
+ top: number;
1978
+ right: number;
1979
+ bottom: number;
1980
+ left: number;
1981
+ };
1982
+ export type TableMeasure = {
1983
+ kind: 'table';
1984
+ rows: TableRowMeasure[];
1985
+ columnWidths: number[];
1986
+ totalWidth: number;
1987
+ totalHeight: number;
1988
+ /**
1989
+ * Cell spacing in pixels (border-spacing between cells).
1990
+ * Used for total table dimensions and cell x/y positioning when border-collapse is 'separate'.
1991
+ */
1992
+ cellSpacingPx?: number;
1993
+ /**
1994
+ * Outer table border widths in pixels. Included in totalWidth/totalHeight; content is offset by (left, top).
1995
+ */
1996
+ tableBorderWidths?: TableBorderWidths;
1997
+ };
1998
+ export type CellSpacing = {
1999
+ type: 'dxa' | 'px';
2000
+ value: number;
2001
+ };
2002
+ export type SectionBreakMeasure = {
2003
+ kind: 'sectionBreak';
2004
+ };
2005
+ export type PageBreakMeasure = {
2006
+ kind: 'pageBreak';
2007
+ };
2008
+ export type ColumnBreakMeasure = {
2009
+ kind: 'columnBreak';
2010
+ };
2011
+ export type ListItemMeasure = {
2012
+ itemId: BlockId;
2013
+ markerWidth: number;
2014
+ markerTextWidth: number;
2015
+ indentLeft: number;
2016
+ paragraph: ParagraphMeasure;
2017
+ };
2018
+ export type ListMeasure = {
2019
+ kind: 'list';
2020
+ items: ListItemMeasure[];
2021
+ totalHeight: number;
2022
+ };
2023
+ export type Measure = ParagraphMeasure | ImageMeasure | DrawingMeasure | TableMeasure | ListMeasure | SectionBreakMeasure | PageBreakMeasure | ColumnBreakMeasure;
2024
+ /** A rendered page containing positioned fragments. Page numbers are 1-indexed. */
2025
+ /**
2026
+ * SD-2656: per-page footnote planning ledger.
2027
+ *
2028
+ * The single source of truth that body pagination, footnote placement, and
2029
+ * continuation carry must all agree on. Without it the three subsystems read
2030
+ * different numbers (body reserves X, planner paints Y, carry-forward thinks
2031
+ * Z) and the resulting drift compounds across the document.
2032
+ *
2033
+ * Mandatory invariants checked by `tools/sd-2656-footnote-analyzer`:
2034
+ * 1. `actualBandHeight <= appliedBodyReserve` (band fits)
2035
+ * 2. `mandatorySlices` always equals `full(non-last) + firstLine(last)` of
2036
+ * the page's anchored cluster (rule).
2037
+ * 3. `continuationIn[P]` matches `continuationOut[P-1]` (carry parity).
2038
+ * 4. `deadReserve = appliedBodyReserve - actualBandHeight` is small (drift
2039
+ * fuel above ~30 px is a planning bug).
2040
+ */
2041
+ export type FootnoteContinuationEntry = {
2042
+ /** Footnote id (OOXML id, not the Word visible number). */
2043
+ id: string;
2044
+ /** How many ranges remain to render. */
2045
+ remainingRangeCount: number;
2046
+ /** Total height of the remaining ranges. */
2047
+ remainingHeightPx: number;
2048
+ };
2049
+ export type FootnotePageLedger = {
2050
+ pageIndex: number;
2051
+ /** Ordered footnote ids whose body refs are anchored on this page. */
2052
+ anchorIds: string[];
2053
+ /** Slices required by the rule: full of non-last + firstLine of last. */
2054
+ mandatorySliceIds: string[];
2055
+ /** Slices for content drained from prior pages. */
2056
+ continuationSliceIds: string[];
2057
+ /** Slices for last-anchor content beyond firstLine (rendered only if there
2058
+ * is leftover space after mandatory + continuation). */
2059
+ extendedSliceIds: string[];
2060
+ /** Continuations arriving from page-1. */
2061
+ continuationIn: FootnoteContinuationEntry[];
2062
+ /** Continuations deferred to page+1. */
2063
+ continuationOut: FootnoteContinuationEntry[];
2064
+ /** Mandatory-reserve px: mandatorySlices height + overhead. */
2065
+ mandatoryReservePx: number;
2066
+ /** SD-2656 Phase 7: Word-like "preferred" reserve px. Body slicer is allowed
2067
+ * to reserve this much when doing so does not cause cluster spill or
2068
+ * continuation overflow. = full(non-last) + asMuchAsFits(last) + overhead. */
2069
+ preferredReservePx: number;
2070
+ /** Total painted band height in px, including separator + gaps. */
2071
+ actualBandHeightPx: number;
2072
+ /** Body's applied reserve (i.e. `page.footnoteReserved`) for this page. */
2073
+ appliedBodyReservePx: number;
2074
+ /** appliedBodyReservePx - actualBandHeightPx — wasted body area. */
2075
+ deadReservePx: number;
2076
+ /** Number of measured lines actually rendered for the LAST anchor on this
2077
+ * page (0 if there is no cluster anchor). Used to flag "mandatory-only"
2078
+ * pages where Word would have rendered more. */
2079
+ lastAnchorRenderedLines: number;
2080
+ };
2081
+ export type Page = {
2082
+ number: number;
2083
+ fragments: Fragment[];
2084
+ margins?: PageMargins;
2085
+ /**
2086
+ * Extra bottom space reserved on this page for footnotes (in px).
2087
+ * Used by consumers (e.g. editors/painters) to keep footer hit regions and
2088
+ * decoration boxes anchored to the real bottom margin while the body shrinks.
2089
+ */
2090
+ footnoteReserved?: number;
2091
+ /**
2092
+ * SD-2656: page-level footnote planning ledger. Populated by the layout
2093
+ * bridge when footnotes are present. Read by the diagnostic toolkit and
2094
+ * (in later phases) by body pagination itself.
2095
+ */
2096
+ footnoteLedger?: FootnotePageLedger;
2097
+ /** Numeric page number after section numbering restart/offset. Used for OOXML odd/even parity. */
2098
+ displayNumber?: number;
2099
+ numberText?: string;
2100
+ /** Numeric page number after section page numbering settings are applied. */
2101
+ effectivePageNumber?: number;
2102
+ /** One-based physical position within the owning section. */
2103
+ sectionPageNumber?: number;
2104
+ /** Section PAGE number format before any run-local PAGE switch is applied. */
2105
+ pageNumberFormat?: PageNumberFormat;
2106
+ /** MVP chapter prefix text derived from the nearest numbered Heading N marker. */
2107
+ pageNumberChapterText?: string;
2108
+ /** Separator between chapter prefix and page number component. */
2109
+ pageNumberChapterSeparator?: PageNumberChapterSeparator;
2110
+ size?: {
2111
+ w: number;
2112
+ h: number;
2113
+ };
2114
+ orientation?: 'portrait' | 'landscape';
2115
+ sectionRefs?: {
2116
+ headerRefs?: {
2117
+ default?: string;
2118
+ first?: string;
2119
+ even?: string;
2120
+ odd?: string;
2121
+ };
2122
+ footerRefs?: {
2123
+ default?: string;
2124
+ first?: string;
2125
+ even?: string;
2126
+ odd?: string;
2127
+ };
2128
+ };
2129
+ /**
2130
+ * Vertical alignment of content within this page.
2131
+ * Used for post-layout adjustment of fragment Y positions.
2132
+ */
2133
+ vAlign?: SectionVerticalAlign;
2134
+ /**
2135
+ * Base section margins before header/footer inflation.
2136
+ * Used for vAlign centering and page-relative decoration positioning to match
2137
+ * Word's behavior without inheriting effective header/footer margin inflation.
2138
+ */
2139
+ baseMargins?: {
2140
+ top: number;
2141
+ bottom: number;
2142
+ };
2143
+ /**
2144
+ * Index of the section this page belongs to.
2145
+ * Used for section-aware page numbering and header/footer selection.
2146
+ * Sections are 0-indexed, matching the sectionIndex in SectionMetadata.
2147
+ */
2148
+ sectionIndex?: number;
2149
+ /**
2150
+ * Column layout configuration for this page.
2151
+ *
2152
+ * Reflects the column configuration at page start. For pages with continuous
2153
+ * section breaks that change column layout mid-page, use `columnRegions` for
2154
+ * accurate per-region information.
2155
+ *
2156
+ * Used by the renderer to draw column separator lines when `withSeparator`
2157
+ * is set to true.
2158
+ */
2159
+ columns?: ColumnLayout;
2160
+ /**
2161
+ * Vertical column regions on this page, ordered top to bottom.
2162
+ *
2163
+ * Populated when continuous section breaks change column layout mid-page. Each
2164
+ * region pairs a `{yStart, yEnd}` span with the column config active inside it
2165
+ * (see ECMA-376 §17.6.22). Renderers should prefer this field over
2166
+ * `columns` when drawing per-region overlays (e.g. column separators).
2167
+ *
2168
+ * If omitted, the page has a single column region and consumers can fall back
2169
+ * to `columns`.
2170
+ */
2171
+ columnRegions?: ColumnRegion[];
2172
+ };
2173
+ /** A paragraph fragment positioned on a page. */
2174
+ export type ParaFragment = {
2175
+ kind: 'para';
2176
+ blockId: BlockId;
2177
+ /** Flow column that owns this fragment (e.g. a footnote body placed in a
2178
+ * specific column's note band), distinct from visual x. */
2179
+ columnIndex?: number;
2180
+ fromLine: number;
2181
+ toLine: number;
2182
+ x: number;
2183
+ y: number;
2184
+ width: number;
2185
+ continuesFromPrev?: boolean;
2186
+ continuesOnNext?: boolean;
2187
+ /** The marker box width in pixels (includes padding). Used for visual sizing. */
2188
+ markerWidth?: number;
2189
+ /**
2190
+ * The actual rendered text width of the marker glyphs in pixels (e.g., "1." text width).
2191
+ * Used for tab width calculation to match Word's behavior where the tab extends from
2192
+ * the end of the actual marker text to the next tab stop, not from the box edge.
2193
+ */
2194
+ markerTextWidth?: number;
2195
+ /**
2196
+ * The gutter width for word-layout list markers, in pixels.
2197
+ * This value is propagated from ParagraphMeasure.marker.gutterWidth and is used by the
2198
+ * renderer to calculate tab stop widths for right-justified or centered markers.
2199
+ * Only present for word-layout lists with marker.gutterWidth defined.
2200
+ */
2201
+ markerGutter?: number;
2202
+ /**
2203
+ * Remeasured lines for this fragment when the paragraph was re-wrapped at a different width.
2204
+ * When present, the renderer should use these lines instead of looking up lines from
2205
+ * the original measure using fromLine/toLine indices. This occurs when a paragraph
2206
+ * measured at one column width is placed in a narrower column (e.g., multi-column layouts).
2207
+ */
2208
+ lines?: Line[];
2209
+ pmStart?: number;
2210
+ pmEnd?: number;
2211
+ sourceAnchor?: SourceAnchor;
2212
+ /**
2213
+ * Optional editor-neutral identity for this fragment.
2214
+ *
2215
+ * Additive (prep-001). PM-facing `pmStart`/`pmEnd` and `blockId` remain
2216
+ * authoritative for v1 consumers; this field exists so downstream surfaces
2217
+ * can address rendered output without requiring `pmStart`/`pmEnd`. See
2218
+ * `layout-identity.ts`.
2219
+ */
2220
+ layoutSourceIdentity?: LayoutSourceIdentity;
2221
+ };
2222
+ export type TableColumnBoundary = {
2223
+ index: number;
2224
+ x: number;
2225
+ width: number;
2226
+ minWidth: number;
2227
+ resizable: boolean;
2228
+ };
2229
+ export type TableRowBoundary = {
2230
+ index: number;
2231
+ y: number;
2232
+ height: number;
2233
+ minHeight: number;
2234
+ resizable: boolean;
2235
+ };
2236
+ export type TableFragmentMetadata = {
2237
+ columnBoundaries: TableColumnBoundary[];
2238
+ rowBoundaries?: TableRowBoundary[];
2239
+ coordinateSystem: 'fragment';
2240
+ };
2241
+ export type ImageFragmentMetadata = {
2242
+ originalWidth: number;
2243
+ originalHeight: number;
2244
+ maxWidth: number;
2245
+ maxHeight: number;
2246
+ aspectRatio: number;
2247
+ minWidth: number;
2248
+ minHeight: number;
2249
+ };
2250
+ export type PartialRowInfo = {
2251
+ rowIndex: number;
2252
+ fromLineByCell: number[];
2253
+ toLineByCell: number[];
2254
+ isFirstPart: boolean;
2255
+ isLastPart: boolean;
2256
+ /** Height of this partial row portion in pixels */
2257
+ partialHeight: number;
2258
+ };
2259
+ export type TableFragment = {
2260
+ kind: 'table';
2261
+ blockId: BlockId;
2262
+ /** Flow column that owns this fragment, distinct from visual x when overflow crosses margins. */
2263
+ columnIndex?: number;
2264
+ fromRow: number;
2265
+ toRow: number;
2266
+ x: number;
2267
+ y: number;
2268
+ width: number;
2269
+ height: number;
2270
+ continuesFromPrev?: boolean;
2271
+ continuesOnNext?: boolean;
2272
+ repeatHeaderCount?: number;
2273
+ partialRow?: PartialRowInfo;
2274
+ metadata?: TableFragmentMetadata;
2275
+ pmStart?: number;
2276
+ pmEnd?: number;
2277
+ /** Per-fragment column widths, rescaled when table is clamped to section width.
2278
+ * When set, the renderer uses these instead of measure.columnWidths. */
2279
+ columnWidths?: number[];
2280
+ sourceAnchor?: SourceAnchor;
2281
+ /** Optional editor-neutral identity (prep-001). See `ParaFragment.layoutSourceIdentity`. */
2282
+ layoutSourceIdentity?: LayoutSourceIdentity;
2283
+ };
2284
+ export type ImageFragment = {
2285
+ kind: 'image';
2286
+ blockId: BlockId;
2287
+ x: number;
2288
+ y: number;
2289
+ width: number;
2290
+ height: number;
2291
+ isAnchored?: boolean;
2292
+ behindDoc?: boolean;
2293
+ zIndex?: number;
2294
+ pmStart?: number;
2295
+ pmEnd?: number;
2296
+ metadata?: ImageFragmentMetadata;
2297
+ sourceAnchor?: SourceAnchor;
2298
+ /** Optional editor-neutral identity (prep-001). See `ParaFragment.layoutSourceIdentity`. */
2299
+ layoutSourceIdentity?: LayoutSourceIdentity;
2300
+ };
2301
+ export type DrawingFragment = {
2302
+ kind: 'drawing';
2303
+ blockId: BlockId;
2304
+ drawingKind: DrawingKind;
2305
+ x: number;
2306
+ y: number;
2307
+ width: number;
2308
+ height: number;
2309
+ isAnchored?: boolean;
2310
+ behindDoc?: boolean;
2311
+ zIndex?: number;
2312
+ geometry: DrawingGeometry;
2313
+ scale: number;
2314
+ drawingContentId?: string;
2315
+ /** V2 textbox story id for DrawingML textbox content painted inside this drawing. */
2316
+ textboxId?: string;
2317
+ contentMeasures?: ParagraphMeasure[];
2318
+ pmStart?: number;
2319
+ pmEnd?: number;
2320
+ sourceAnchor?: SourceAnchor;
2321
+ /** Optional editor-neutral identity (prep-001). See `ParaFragment.layoutSourceIdentity`. */
2322
+ layoutSourceIdentity?: LayoutSourceIdentity;
2323
+ };
2324
+ export type ListItemFragment = {
2325
+ kind: 'list-item';
2326
+ blockId: BlockId;
2327
+ itemId: BlockId;
2328
+ /** Flow column that owns this fragment (e.g. a footnote body placed in a
2329
+ * specific column's note band), distinct from visual x. */
2330
+ columnIndex?: number;
2331
+ fromLine: number;
2332
+ toLine: number;
2333
+ x: number;
2334
+ y: number;
2335
+ width: number;
2336
+ markerWidth: number;
2337
+ continuesFromPrev?: boolean;
2338
+ continuesOnNext?: boolean;
2339
+ sourceAnchor?: SourceAnchor;
2340
+ /** Optional editor-neutral identity (prep-001). See `ParaFragment.layoutSourceIdentity`. */
2341
+ layoutSourceIdentity?: LayoutSourceIdentity;
2342
+ };
2343
+ export type Fragment = ParaFragment | ImageFragment | DrawingFragment | ListItemFragment | TableFragment;
2344
+ export type HeaderFooterType = 'default' | 'first' | 'even' | 'odd';
2345
+ export type HeaderFooterPage = {
2346
+ number: number;
2347
+ fragments: Fragment[];
2348
+ numberText?: string;
2349
+ /** Section-aware numeric page value before formatting. */
2350
+ displayNumber?: number;
2351
+ /** Section PAGE number format before any run-local PAGE switch is applied. */
2352
+ pageNumberFormat?: PageNumberFormat;
2353
+ /** MVP chapter prefix text derived from the nearest numbered Heading N marker. */
2354
+ pageNumberChapterText?: string;
2355
+ /** Separator between chapter prefix and page number component. */
2356
+ pageNumberChapterSeparator?: PageNumberChapterSeparator;
2357
+ /**
2358
+ * Optional page-local block clones backing this page's resolved fragments.
2359
+ * Present when header/footer tokens were laid out per page or per bucket.
2360
+ */
2361
+ blocks?: FlowBlock[];
2362
+ /**
2363
+ * Optional page-local measures aligned with `blocks`.
2364
+ * Present when header/footer tokens were laid out per page or per bucket.
2365
+ */
2366
+ measures?: Measure[];
2367
+ };
2368
+ export type HeaderFooterLayout = {
2369
+ /** Measurement height for pagination — excludes out-of-band fragments. */
2370
+ height: number;
2371
+ /** Minimum y of all rendered fragments (including out-of-band). */
2372
+ minY?: number;
2373
+ /** Maximum y + fragmentHeight of all rendered fragments. */
2374
+ maxY?: number;
2375
+ /** Full visual extent of all rendered fragments (renderMaxY - renderMinY). */
2376
+ renderHeight?: number;
2377
+ pages: HeaderFooterPage[];
2378
+ };
2379
+ /**
2380
+ * Engine-owned paginator state immediately before a top-level paragraph.
2381
+ * Incremental layout may resume from this state only after independently
2382
+ * proving that every preceding fragment on the page is stable.
2383
+ */
2384
+ export type LayoutBlockResumeCheckpoint = {
2385
+ blockId: BlockId;
2386
+ pageIndex: number;
2387
+ prefixFragmentCount: number;
2388
+ cursorY: number;
2389
+ maxCursorY: number;
2390
+ columnIndex: number;
2391
+ trailingSpacing: number;
2392
+ lastParagraphStyleId?: string;
2393
+ lastParagraphContextualSpacing: boolean;
2394
+ lastParagraphBorderHash?: string;
2395
+ constraintBoundaries: readonly {
2396
+ y: number;
2397
+ columns: ColumnLayout;
2398
+ }[];
2399
+ activeConstraintIndex: number;
2400
+ footnoteDemandThisPage: number;
2401
+ footnoteRefsThisPage: number;
2402
+ footnoteAnchorsThisPage: readonly {
2403
+ pmPos: number;
2404
+ refId: string;
2405
+ fullHeight: number;
2406
+ firstLineHeight: number;
2407
+ }[];
2408
+ };
2409
+ /** Final layout output ready for painting. */
2410
+ export type Layout = {
2411
+ pageSize: {
2412
+ w: number;
2413
+ h: number;
2414
+ };
2415
+ pages: Page[];
2416
+ /** Optional document-level page background from OOXML w:background. */
2417
+ documentBackground?: DocumentBackground;
2418
+ columns?: ColumnLayout;
2419
+ headerFooter?: Partial<Record<HeaderFooterType, HeaderFooterLayout>>;
2420
+ /**
2421
+ * Gap between pages in pixels. Used by hit testing to correctly calculate
2422
+ * which page a click lands on when pages are rendered with spacing between them.
2423
+ * Defaults to 0 if not specified (pages assumed to be stacked with no gap).
2424
+ */
2425
+ pageGap?: number;
2426
+ /**
2427
+ * Document epoch identifier for the document state used to produce this layout.
2428
+ *
2429
+ * This value is set by higher-level document orchestration and is
2430
+ * stamped into the painted DOM as `data-layout-epoch` to enable deterministic mapping
2431
+ * from DOM-derived positions back to the current ProseMirror document state.
2432
+ */
2433
+ layoutEpoch?: number;
2434
+ /** Exact paragraph-boundary resume sidecar; never inferred from painted geometry. */
2435
+ blockResumeCheckpoints?: ReadonlyMap<BlockId, LayoutBlockResumeCheckpoint>;
2436
+ };
2437
+ export type WrapTextMode = 'bothSides' | 'left' | 'right' | 'largest';
2438
+ export type WrapExclusion = {
2439
+ left: number;
2440
+ right: number;
2441
+ top: number;
2442
+ bottom: number;
2443
+ wrapText: WrapTextMode;
2444
+ };
2445
+ /**
2446
+ * Rendering flow mode.
2447
+ * - `paginated`: discrete page surfaces
2448
+ * - `semantic`: continuous flow surface
2449
+ */
2450
+ export type FlowMode = 'paginated' | 'semantic';
2451
+ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) => {
2452
+ headerSpace: number;
2453
+ footerSpace: number;
2454
+ };
2455
+ export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
2456
+ export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
2457
+ export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
2458
+ export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
2459
+ export * as Engines from './engines/index.js';