@arbidocs/blocks 0.5.134 → 0.5.136

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 (231) hide show
  1. package/dist/{ConnectedNativeDocxComparison-H72RQJKH.cjs → ConnectedNativeDocxComparison-W4KIGO54.cjs} +8 -8
  2. package/dist/{ConnectedNativeDocxComparison-H72RQJKH.cjs.map → ConnectedNativeDocxComparison-W4KIGO54.cjs.map} +1 -1
  3. package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs → ConnectedStreamedWordArtifact-764NSXPQ.cjs} +8 -8
  4. package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map → ConnectedStreamedWordArtifact-764NSXPQ.cjs.map} +1 -1
  5. package/dist/{DocumentReviewCard-EM2AJUF3.cjs → DocumentReviewCard-UV3DLFCB.cjs} +3 -3
  6. package/dist/{DocumentReviewCard-EM2AJUF3.cjs.map → DocumentReviewCard-UV3DLFCB.cjs.map} +1 -1
  7. package/dist/{FilesViewerDialog-PA2B7O7I.cjs → FilesViewerDialog-IFF2JR2A.cjs} +6 -6
  8. package/dist/{FilesViewerDialog-PA2B7O7I.cjs.map → FilesViewerDialog-IFF2JR2A.cjs.map} +1 -1
  9. package/dist/{NativeDocxEditor-XZAEU5QU.cjs → NativeDocxEditor-KM6U4ZLA.cjs} +6 -6
  10. package/dist/{NativeDocxEditor-XZAEU5QU.cjs.map → NativeDocxEditor-KM6U4ZLA.cjs.map} +1 -1
  11. package/dist/{chunk-T2DUNNYY.cjs → chunk-C6DF6WB2.cjs} +745 -21
  12. package/dist/chunk-C6DF6WB2.cjs.map +1 -0
  13. package/dist/{chunk-64247UHS.cjs → chunk-DBGBAD4J.cjs} +4 -4
  14. package/dist/{chunk-64247UHS.cjs.map → chunk-DBGBAD4J.cjs.map} +1 -1
  15. package/dist/{chunk-UOZ237OW.cjs → chunk-FABKMTAI.cjs} +42 -5
  16. package/dist/chunk-FABKMTAI.cjs.map +1 -0
  17. package/dist/{chunk-L4Y6UMRC.cjs → chunk-FDRZJFNV.cjs} +5 -5
  18. package/dist/{chunk-L4Y6UMRC.cjs.map → chunk-FDRZJFNV.cjs.map} +1 -1
  19. package/dist/{chunk-O5WVYUFT.cjs → chunk-IEAZX7L6.cjs} +4 -4
  20. package/dist/{chunk-O5WVYUFT.cjs.map → chunk-IEAZX7L6.cjs.map} +1 -1
  21. package/dist/{chunk-2SWS7ESM.cjs → chunk-L62EU3TQ.cjs} +3 -3
  22. package/dist/{chunk-2SWS7ESM.cjs.map → chunk-L62EU3TQ.cjs.map} +1 -1
  23. package/dist/{chunk-IN3KXI3K.cjs → chunk-LG36LSVZ.cjs} +6 -6
  24. package/dist/{chunk-IN3KXI3K.cjs.map → chunk-LG36LSVZ.cjs.map} +1 -1
  25. package/dist/{chunk-RZSBHRQL.cjs → chunk-MMKMQZ2B.cjs} +5 -5
  26. package/dist/{chunk-RZSBHRQL.cjs.map → chunk-MMKMQZ2B.cjs.map} +1 -1
  27. package/dist/chunk-MMMGOZYH.cjs +18 -0
  28. package/dist/{chunk-KWD5Q4XH.cjs.map → chunk-MMMGOZYH.cjs.map} +1 -1
  29. package/dist/{chunk-V6SFJ44C.cjs → chunk-ZN2JXV65.cjs} +50 -13
  30. package/dist/chunk-ZN2JXV65.cjs.map +1 -0
  31. package/dist/connect/docx.cjs +12 -12
  32. package/dist/connect/index.cjs +86 -86
  33. package/dist/connect/viewer.cjs +4 -4
  34. package/dist/connection/docx/ConnectedNativeDocxEditor.js +39 -2
  35. package/dist/connection/docx/ConnectedNativeDocxEditor.js.map +2 -2
  36. package/dist/connection/viewer/ConnectedDocumentViewer.js +43 -6
  37. package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
  38. package/dist/docx/NativeDocxEditor.d.ts +12 -1
  39. package/dist/docx/NativeDocxEditor.js +513 -20
  40. package/dist/docx/NativeDocxEditor.js.map +3 -3
  41. package/dist/docx/index.cjs +38 -38
  42. package/dist/docx/recoveryStore.d.ts +8 -0
  43. package/dist/docx/recoveryStore.js +208 -0
  44. package/dist/docx/recoveryStore.js.map +7 -0
  45. package/dist/docx/temporaryRecovery.d.ts +8 -0
  46. package/dist/docx/temporaryRecovery.js +37 -0
  47. package/dist/docx/temporaryRecovery.js.map +7 -0
  48. package/dist/index.cjs +72 -72
  49. package/dist/styles.css +1 -1
  50. package/dist/vite/index.cjs +11 -1
  51. package/dist/vite/index.cjs.map +1 -1
  52. package/dist/vite/index.d.ts +13 -0
  53. package/dist/vite/index.js +11 -1
  54. package/dist/vite/index.js.map +1 -1
  55. package/dist/workflow-canvas/index.cjs +10 -10
  56. package/node_modules/@arbidocs/coedit/dist/commands.cjs +18 -1
  57. package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
  58. package/node_modules/@arbidocs/coedit/dist/commands.d.cts +2 -2
  59. package/node_modules/@arbidocs/coedit/dist/commands.d.ts +2 -2
  60. package/node_modules/@arbidocs/coedit/dist/commands.js +18 -1
  61. package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
  62. package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.cts → port-DXBNxZYw.d.cts} +2 -0
  63. package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.ts → port-DXBNxZYw.d.ts} +2 -0
  64. package/node_modules/@arbidocs/coedit/dist/server.cjs +16 -0
  65. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
  66. package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
  67. package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
  68. package/node_modules/@arbidocs/coedit/dist/server.js +16 -0
  69. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
  70. package/node_modules/@arbidocs/coedit/package.json +2 -2
  71. package/node_modules/@docx-editor.dev/core/README.md +25 -1
  72. package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +1 -0
  73. package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -1
  74. package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +21 -63
  75. package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -1
  76. package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -1
  77. package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +49 -40
  78. package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -1
  79. package/node_modules/@docx-editor.dev/core/dist/{chrome-print-CAs51cpq.d.ts → chrome-print-CrPI9ZQc.d.ts} +714 -290
  80. package/node_modules/@docx-editor.dev/core/dist/chunk-23MKR33J.js +4 -0
  81. package/node_modules/@docx-editor.dev/core/dist/chunk-2CWQY27B.cjs +1 -0
  82. package/node_modules/@docx-editor.dev/core/dist/chunk-2DEY5NUC.cjs +32 -0
  83. package/node_modules/@docx-editor.dev/core/dist/chunk-2DR4TH6B.js +1 -0
  84. package/node_modules/@docx-editor.dev/core/dist/chunk-2F2UEAE2.js +2 -0
  85. package/node_modules/@docx-editor.dev/core/dist/chunk-2GPGAFOJ.cjs +5 -0
  86. package/node_modules/@docx-editor.dev/core/dist/chunk-ALD626VU.cjs +2 -0
  87. package/node_modules/@docx-editor.dev/core/dist/chunk-AU33YWEJ.js +236 -0
  88. package/node_modules/@docx-editor.dev/core/dist/chunk-AXU63LYW.cjs +1 -0
  89. package/node_modules/@docx-editor.dev/core/dist/chunk-CM5VZRBV.js +32 -0
  90. package/node_modules/@docx-editor.dev/core/dist/chunk-D7FAFFTN.js +1 -0
  91. package/node_modules/@docx-editor.dev/core/dist/chunk-DYUVJNDD.cjs +1 -0
  92. package/node_modules/@docx-editor.dev/core/dist/chunk-ESYUKD5D.js +2 -0
  93. package/node_modules/@docx-editor.dev/core/dist/chunk-F7TGQMVR.js +5 -0
  94. package/node_modules/@docx-editor.dev/core/dist/chunk-FLW7KIQX.js +30 -0
  95. package/node_modules/@docx-editor.dev/core/dist/chunk-JG4A6W6I.js +7 -0
  96. package/node_modules/@docx-editor.dev/core/dist/chunk-JNGLSBPH.js +2 -0
  97. package/node_modules/@docx-editor.dev/core/dist/chunk-KE6ZWRIY.cjs +236 -0
  98. package/node_modules/@docx-editor.dev/core/dist/chunk-L3YXJDPX.js +1 -0
  99. package/node_modules/@docx-editor.dev/core/dist/chunk-LI42N7OW.cjs +4 -0
  100. package/node_modules/@docx-editor.dev/core/dist/chunk-PLKDS4JT.js +1 -0
  101. package/node_modules/@docx-editor.dev/core/dist/chunk-PXMTQ73F.cjs +2 -0
  102. package/node_modules/@docx-editor.dev/core/dist/chunk-R4R3AAE4.js +1 -0
  103. package/node_modules/@docx-editor.dev/core/dist/chunk-RFUNFTGV.cjs +1 -0
  104. package/node_modules/@docx-editor.dev/core/dist/chunk-SVM6PGMS.js +3 -0
  105. package/node_modules/@docx-editor.dev/core/dist/chunk-SZURLHR3.cjs +3 -0
  106. package/node_modules/@docx-editor.dev/core/dist/chunk-UYCGCVZ2.cjs +1 -0
  107. package/node_modules/@docx-editor.dev/core/dist/chunk-WN7ICTA5.js +1 -0
  108. package/node_modules/@docx-editor.dev/core/dist/chunk-X34QRAUU.cjs +1 -0
  109. package/node_modules/@docx-editor.dev/core/dist/chunk-XNBYG4XJ.cjs +30 -0
  110. package/node_modules/@docx-editor.dev/core/dist/chunk-ZDFJW5XS.cjs +2 -0
  111. package/node_modules/@docx-editor.dev/core/dist/chunk-ZWO4JHNN.cjs +7 -0
  112. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -1
  113. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +29 -5
  114. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -1
  115. package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -1
  116. package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +5 -6
  117. package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -1
  118. package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +3 -3
  119. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +13 -10
  120. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +2 -2
  121. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +15 -13
  122. package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +135 -2
  123. package/node_modules/@docx-editor.dev/core/dist/{custom-node-writes-Bn6uciLb.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
  124. package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
  125. package/node_modules/@docx-editor.dev/core/dist/{diagnostic-hints-BeVjfNOv.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +14 -7
  126. package/node_modules/@docx-editor.dev/core/dist/{document-protection-CUb55pl_.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
  127. package/node_modules/@docx-editor.dev/core/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
  128. package/node_modules/@docx-editor.dev/core/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
  129. package/node_modules/@docx-editor.dev/core/dist/{editor-CZQZmTIU.d.ts → editor-B7OOAAie.d.ts} +536 -283
  130. package/node_modules/@docx-editor.dev/core/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
  131. package/node_modules/@docx-editor.dev/core/dist/editor-scope-CA6egMaK.d.ts +141 -0
  132. package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -1
  133. package/node_modules/@docx-editor.dev/core/dist/editor.css +6 -4
  134. package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +834 -34
  135. package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -1
  136. package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -2
  137. package/node_modules/@docx-editor.dev/core/dist/export.d.ts +52 -21
  138. package/node_modules/@docx-editor.dev/core/dist/export.js +2 -2
  139. package/node_modules/@docx-editor.dev/core/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
  140. package/node_modules/@docx-editor.dev/core/dist/{font-resolver-lSBLirLR.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
  141. package/node_modules/@docx-editor.dev/core/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
  142. package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -1
  143. package/node_modules/@docx-editor.dev/core/dist/index.d.ts +44 -27
  144. package/node_modules/@docx-editor.dev/core/dist/index.js +1 -1
  145. package/node_modules/@docx-editor.dev/core/dist/{layout-shaping-BD-dF_rn.d.ts → layout-shaping-Ci_BTnSU.d.ts} +3 -2
  146. package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -1
  147. package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +276 -126
  148. package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -1
  149. package/node_modules/@docx-editor.dev/core/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
  150. package/node_modules/@docx-editor.dev/core/dist/{note-properties-qQUjO1GQ.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
  151. package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -1
  152. package/node_modules/@docx-editor.dev/core/dist/output.d.ts +24 -10
  153. package/node_modules/@docx-editor.dev/core/dist/output.js +1 -1
  154. package/node_modules/@docx-editor.dev/core/dist/{protocol-DYzzz2ej.d.ts → protocol-Cp_QzVxS.d.ts} +167 -5
  155. package/node_modules/@docx-editor.dev/core/dist/{review-paragraph-order-CN_0l2Cb.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
  156. package/node_modules/@docx-editor.dev/core/dist/revision-projection-OVusTS77.d.ts +258 -0
  157. package/node_modules/@docx-editor.dev/core/dist/{semantic-cell-selection-eYag3P47.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
  158. package/node_modules/@docx-editor.dev/core/dist/{semantic-interaction-kR_QB845.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
  159. package/node_modules/@docx-editor.dev/core/dist/{semantic-paint-ZayFF3tD.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
  160. package/node_modules/@docx-editor.dev/core/dist/{semantic-record-queries-Bsgth6lv.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
  161. package/node_modules/@docx-editor.dev/core/dist/{semantic-records-DQmumPgL.d.ts → semantic-records-DoK0lNjS.d.ts} +697 -608
  162. package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -1
  163. package/node_modules/@docx-editor.dev/core/dist/store.d.ts +527 -123
  164. package/node_modules/@docx-editor.dev/core/dist/store.js +1 -1
  165. package/node_modules/@docx-editor.dev/core/dist/{types-barrel-DuC5QBNC.d.ts → tree-op-types-Df4oY2u4.d.ts} +1723 -765
  166. package/node_modules/@docx-editor.dev/core/dist/{tree-package-store-CovjNARF.d.ts → tree-package-store-DXhX1PE-.d.ts} +617 -428
  167. package/node_modules/@docx-editor.dev/core/dist/{tree-session-contract-CZVAGl51.d.ts → tree-session-contract-CF2625mv.d.ts} +28 -13
  168. package/node_modules/@docx-editor.dev/core/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
  169. package/node_modules/@docx-editor.dev/core/docs/accept-reject-without-scrolling.md +95 -0
  170. package/node_modules/@docx-editor.dev/core/docs/comment-on-found-text.md +72 -0
  171. package/node_modules/@docx-editor.dev/core/docs/custom-review-cards.md +178 -0
  172. package/node_modules/@docx-editor.dev/core/docs/highlight-ranges.md +48 -0
  173. package/node_modules/@docx-editor.dev/core/docs/index.md +36 -0
  174. package/node_modules/@docx-editor.dev/core/docs/propose-rewrite.md +247 -0
  175. package/node_modules/@docx-editor.dev/core/docs/tracked-replacement.md +68 -0
  176. package/node_modules/@docx-editor.dev/core/licenses/ECMA-376.md +29 -0
  177. package/node_modules/@docx-editor.dev/core/package.json +3 -2
  178. package/node_modules/@docx-editor.dev/react/README.md +71 -0
  179. package/node_modules/@docx-editor.dev/react/dist/index.d.mts +936 -86
  180. package/node_modules/@docx-editor.dev/react/dist/index.d.ts +936 -86
  181. package/node_modules/@docx-editor.dev/react/dist/index.js +3 -3
  182. package/node_modules/@docx-editor.dev/react/dist/index.mjs +3 -3
  183. package/node_modules/@docx-editor.dev/react/docs/accept-reject-without-scrolling.md +72 -0
  184. package/node_modules/@docx-editor.dev/react/docs/comment-on-found-text.md +47 -0
  185. package/node_modules/@docx-editor.dev/react/docs/custom-review-cards.md +105 -0
  186. package/node_modules/@docx-editor.dev/react/docs/highlight-ranges.md +25 -0
  187. package/node_modules/@docx-editor.dev/react/docs/index.md +36 -0
  188. package/node_modules/@docx-editor.dev/react/docs/propose-rewrite.md +247 -0
  189. package/node_modules/@docx-editor.dev/react/docs/tracked-replacement.md +45 -0
  190. package/node_modules/@docx-editor.dev/react/package.json +4 -3
  191. package/package.json +8 -8
  192. package/src/docx/styles.css +37 -7
  193. package/dist/chunk-KWD5Q4XH.cjs +0 -18
  194. package/dist/chunk-T2DUNNYY.cjs.map +0 -1
  195. package/dist/chunk-UOZ237OW.cjs.map +0 -1
  196. package/dist/chunk-V6SFJ44C.cjs.map +0 -1
  197. package/node_modules/@docx-editor.dev/core/dist/chunk-236O4YQW.js +0 -2
  198. package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +0 -1
  199. package/node_modules/@docx-editor.dev/core/dist/chunk-6JPL6ZAS.cjs +0 -5
  200. package/node_modules/@docx-editor.dev/core/dist/chunk-6ZQP4HQ7.js +0 -3
  201. package/node_modules/@docx-editor.dev/core/dist/chunk-7WQ7AAHW.cjs +0 -2
  202. package/node_modules/@docx-editor.dev/core/dist/chunk-BCXH4BXB.js +0 -5
  203. package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +0 -1
  204. package/node_modules/@docx-editor.dev/core/dist/chunk-BY2ACZZ6.cjs +0 -1
  205. package/node_modules/@docx-editor.dev/core/dist/chunk-CAJEXXVG.cjs +0 -4
  206. package/node_modules/@docx-editor.dev/core/dist/chunk-CPWLFPWC.js +0 -30
  207. package/node_modules/@docx-editor.dev/core/dist/chunk-D7ZMDMPX.cjs +0 -3
  208. package/node_modules/@docx-editor.dev/core/dist/chunk-DOHF6FA7.cjs +0 -30
  209. package/node_modules/@docx-editor.dev/core/dist/chunk-DVX32P2P.js +0 -27
  210. package/node_modules/@docx-editor.dev/core/dist/chunk-E4LOMDNL.js +0 -1
  211. package/node_modules/@docx-editor.dev/core/dist/chunk-EKLM7NWB.cjs +0 -7
  212. package/node_modules/@docx-editor.dev/core/dist/chunk-G3K63G7P.cjs +0 -27
  213. package/node_modules/@docx-editor.dev/core/dist/chunk-G4HOFIKJ.js +0 -1
  214. package/node_modules/@docx-editor.dev/core/dist/chunk-JLVBDYVQ.cjs +0 -2
  215. package/node_modules/@docx-editor.dev/core/dist/chunk-LQX36Z5P.js +0 -7
  216. package/node_modules/@docx-editor.dev/core/dist/chunk-LSZ6KPKK.js +0 -1
  217. package/node_modules/@docx-editor.dev/core/dist/chunk-MM5QBMTE.cjs +0 -1
  218. package/node_modules/@docx-editor.dev/core/dist/chunk-OMCG63ZF.js +0 -1
  219. package/node_modules/@docx-editor.dev/core/dist/chunk-OSFOJTHU.cjs +0 -18
  220. package/node_modules/@docx-editor.dev/core/dist/chunk-RCLZXP3B.js +0 -2
  221. package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +0 -2
  222. package/node_modules/@docx-editor.dev/core/dist/chunk-TRGAVV2Y.js +0 -4
  223. package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +0 -2
  224. package/node_modules/@docx-editor.dev/core/dist/chunk-UHHYFIDT.cjs +0 -1
  225. package/node_modules/@docx-editor.dev/core/dist/chunk-W35WTWAO.cjs +0 -1
  226. package/node_modules/@docx-editor.dev/core/dist/chunk-YQ5G6LC7.js +0 -18
  227. package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-B8M79cfK.d.ts +0 -30
  228. package/node_modules/@docx-editor.dev/core/dist/editor-scope-7o9xweiJ.d.ts +0 -84
  229. package/node_modules/@docx-editor.dev/core/dist/headless-document-view-pp3q7wIh.d.ts +0 -143
  230. package/node_modules/@docx-editor.dev/core/dist/image-resources-tXLQShoC.d.ts +0 -211
  231. package/node_modules/@docx-editor.dev/core/dist/omml-equation-BUbU0utM.d.ts +0 -85
@@ -1,27 +1,54 @@
1
- import { c as HistoryGroupOutcome } from './editor-scope-7o9xweiJ.js';
1
+ import { H as HistoryGroupOutcome } from './editor-scope-CA6egMaK.js';
2
2
 
3
3
  /**
4
- * How a tracked change is addressed: `@w:id`, `@w:author` and `@w:date` together, within a
5
- * part.
4
+ * Why a zip was refused at the trust boundary.
6
5
  *
7
- * All of them, always. `@w:id` is unique only within a part, so an id alone names two
8
- * revisions in any package with a header or a comments part — and it is not author-scoped
9
- * either, so `(part, id)` would merge two authors' distinct revisions. One logical revision is
10
- * also deliberately many elements sharing an id, as a tracked row insertion is, which no
11
- * uniqueness rule could express.
6
+ * `too-large` and `too-many-entries` are the zip-bomb guards; `bad-name` catches path traversal —
7
+ * an entry with `..` or a leading `/` is rejected rather than normalized.
12
8
  */
13
- interface RevisionAddress {
14
- readonly id: string;
15
- readonly author: string;
16
- /** Absent when the file wrote no `@w:date`; part of the identity either way. */
17
- readonly date?: string;
18
- }
19
- /** The author and timestamp a tracked edit is recorded under. */
20
- interface RevisionAttributionInput {
21
- readonly author: string;
22
- /** ISO-8601. Omitted writes no `@w:date`. */
23
- readonly date?: string;
9
+ type ZipRejection = 'too-many-entries' | 'too-large' | 'bad-name' | 'inflate-error';
10
+ /** Archive caps: entry count, total decompressed bytes, and the decompression ratio. */
11
+ interface ZipLimits {
12
+ readonly maxEntries: number;
13
+ /** Max total UNCOMPRESSED bytes across the archive. */
14
+ readonly maxTotalBytes: number;
15
+ /**
16
+ * Max ratio of the archive's total declared uncompressed bytes to the archive's own byte
17
+ * length (zip-bomb guard). Applies once that total exceeds 8 MiB, so a small archive is
18
+ * never refused for compressing well.
19
+ */
20
+ readonly maxRatio?: number;
24
21
  }
22
+ /** The archive caps in force when a host configures none. Conservative and finite. */
23
+ declare const DEFAULT_ZIP_LIMITS: ZipLimits;
24
+ /** The read entries, or the typed refusal. Never throws — the bytes are untrusted. */
25
+ type ZipReadResult = {
26
+ readonly ok: true;
27
+ readonly entries: ReadonlyMap<string, Uint8Array>;
28
+ } | {
29
+ readonly ok: false;
30
+ readonly reason: ZipRejection;
31
+ readonly detail?: string;
32
+ readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
33
+ };
34
+ /**
35
+ * Inflate a ZIP archive with bounds + OPC name normalization. Entry name, count, archive
36
+ * ratio, and total-uncompressed-size limits are enforced BEFORE each entry is decompressed
37
+ * (via fflate's pre-inflation filter), so a zip bomb or a traversal name is rejected without
38
+ * ever being inflated. Keys are canonical part names.
39
+ *
40
+ * The budgets count each entry's DECLARED sizes, and the declared size is also a hard cap on
41
+ * what the entry may produce: fflate inflates into a buffer of exactly `originalSize` bytes
42
+ * and never grows it, so an entry whose stream holds more than it declares is truncated (or
43
+ * refused as `inflate-error`), never expanded past its budget. A stored entry is copied at
44
+ * its compressed size, so the larger of its two declared sizes is what counts.
45
+ */
46
+ declare function readZip(bytes: Uint8Array, limits?: ZipLimits): ZipReadResult;
47
+ /** Deflate a set of canonical-part-name -> bytes into a ZIP archive. Every part name
48
+ * is re-validated through the OPC normalization profile before writing, so a
49
+ * traversal/encoded/normalized-alias name from an untrusted serialized model can
50
+ * never be smuggled into a ZIP entry (write-side path-traversal guard). */
51
+ declare function writeZip(entries: ReadonlyMap<string, Uint8Array>): Uint8Array;
25
52
 
26
53
  /**
27
54
  * One parsed XML node, preserving significant order, whitespace and raw lexical values.
@@ -83,108 +110,332 @@ declare function textContent(node: Extract<XmlNode, {
83
110
  type: 'element';
84
111
  }>): string;
85
112
 
86
- /** The WordprocessingML main namespace — the `w:` prefix in every `word/document.xml`. */
87
- declare const WML_NAMESPACE_URI = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
88
- /** The reserved `xml:` namespace, which carries `xml:space`. */
89
- declare const XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
90
- /** The reserved `xmlns:` namespace that namespace declarations themselves live in. */
91
- declare const XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
92
- /** The `w14` wordml-2010 extension namespace — `w14:paraId`/`w14:textId` live here. */
93
- declare const W14_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2010/wordml";
94
- declare const DRAWINGML_MAIN_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/main";
95
- declare const WP_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
96
- declare const PIC_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/picture";
97
- /** The four content-position revision wrappers, which nest and carry runs. */
98
- declare function isContentRevisionKind(kind: OoxmlNode['kind']): kind is 'revisionInsert' | 'revisionDelete' | 'revisionMoveFrom' | 'revisionMoveTo';
99
- /** Move-range and comment-range boundary markers, which are empty and sit between runs. */
100
- declare function isRangeMarkerKind(kind: OoxmlNode['kind']): kind is 'moveFromRangeStart' | 'moveFromRangeEnd' | 'moveToRangeStart' | 'moveToRangeEnd' | 'commentRangeStart' | 'commentRangeEnd';
101
113
  /**
102
- * OOXML on/off toggle: on only when a same-namespace child is present and its `w:val`
103
- * (same namespace as the child) does not explicitly disable. Foreign-namespace siblings
104
- * with the same local name cannot turn the flag on.
114
+ * Why a part or relationship name was refused.
115
+ *
116
+ * Path traversal is the reason this exists: a name with `..` or a leading `/` is refused rather
117
+ * than normalized, because normalizing is how a crafted package reaches outside itself.
105
118
  */
106
- declare function readOnOffChild(parent: OoxmlNode, localName: string, namespaceUri?: string): boolean;
119
+ type NameRejection = 'empty' | 'control-char' | 'backslash' | 'drive-or-unc' | 'encoded-separator' | 'encoded-dot' | 'bad-encoding' | 'empty-segment' | 'dot-segment' | 'unsafe-key' | 'segment-trailing-dot' | 'traversal-escape' | 'not-absolute-uri' | 'unsafe-scheme';
120
+ /** A validated OPC name, or the typed reason it was refused. */
121
+ type NameResult = {
122
+ readonly ok: true;
123
+ readonly partName: string;
124
+ } | {
125
+ readonly ok: false;
126
+ readonly reason: NameRejection;
127
+ };
128
+ /**
129
+ * Normalize a ZIP entry name or OPC part name into a canonical part name
130
+ * (`/word/document.xml`). Accepts leading-slash and no-leading-slash inputs;
131
+ * rejects traversal, dot segments, and the attack surface. Duplicate detection
132
+ * folds ASCII case (OPC part-name equivalence).
133
+ */
134
+ declare function normalizePartName(raw: string): NameResult;
135
+ /**
136
+ * ASCII-only lowercase fold. OPC part-name/extension equivalence is US-ASCII
137
+ * case-insensitive; a locale `toLowerCase()` mis-folds e.g. Turkish `I`/`İ` and
138
+ * could let two "equivalent" part names evade duplicate detection.
139
+ */
140
+ declare function asciiFold(s: string): string;
141
+ /** Case-folded key for OPC part-name equivalence / duplicate detection. */
142
+ declare function partNameKey(partName: string): string;
143
+ /**
144
+ * Detect archive entries that collide after normalization (before inflation).
145
+ * Returns the case-folded keys that more than one raw name maps to.
146
+ */
147
+ declare function detectDuplicateNames(rawNames: readonly string[]): {
148
+ readonly duplicates: readonly string[];
149
+ readonly rejected: readonly {
150
+ raw: string;
151
+ reason: NameRejection;
152
+ }[];
153
+ };
154
+ /**
155
+ * Resolve an internal relationship target against its owner part, without
156
+ * escaping the package root. `ownerPartName` is a canonical part name; the base
157
+ * is its containing folder. A leading "/" target is package-absolute. `.`/`..`
158
+ * segments resolve on a stack; popping above root is `traversal-escape`.
159
+ */
160
+ declare function resolveInternalTarget(ownerPartName: string, rawTarget: string): NameResult;
161
+ /**
162
+ * Validate an external-mode relationship target. It MUST be an absolute URI, is
163
+ * retained verbatim by the caller, and is NEVER owner-resolved or fetched here.
164
+ * Unsafe schemes (javascript/vbscript/data/file) are rejected for runtime sinks;
165
+ * the raw lexical form is still preserved separately by the authored record.
166
+ */
167
+ declare function validateExternalTarget(raw: string): NameResult;
107
168
 
169
+ /** OOXML image relationship type for embedded or linked media parts. */
170
+ declare const IMAGE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
108
171
  /**
109
- * A node's stable identity within its part.
172
+ * Whether a relationship points inside the package or out of it.
110
173
  *
111
- * Minted deterministically from the structural path at parse, then RETAINED through structural
112
- * sharing — the same bytes always produce the same ids, and an edit elsewhere in the document
113
- * does not renumber untouched nodes. Every tree op addresses nodes by these.
174
+ * The security-relevant distinction: an `External` target is retained VERBATIM and never
175
+ * owner-resolved or fetched, because auto-loading a file-supplied remote target is a zero-click
176
+ * external fetch.
114
177
  */
115
- type OoxmlNodeId = string;
178
+ type TargetMode = 'Internal' | 'External';
116
179
  /**
117
- * One `xmlns:` declaration carried on a node.
118
- *
119
- * Preserved rather than normalized away: a document that binds `w14` at the root and a document
120
- * that binds it on a paragraph are different bytes, and re-emitting the wrong one is a fidelity
121
- * loss even though the semantics match.
180
+ * One authored relationship, with nothing materialized away: owner part, id, type, raw target
181
+ * lexical form, mode, and position.
122
182
  */
123
- interface OoxmlNamespaceBinding {
124
- readonly prefix: string;
125
- readonly namespaceUri: string;
126
- }
127
- interface OoxmlAttributeBase {
128
- readonly namespaceUri: string;
129
- readonly localName: string;
130
- readonly prefix?: string;
131
- readonly value: string;
132
- }
133
- /** `xml:space`, which decides whether a run's leading and trailing whitespace survives. */
134
- interface OoxmlXmlSpaceAttribute extends OoxmlAttributeBase {
135
- readonly kind: 'xmlSpace';
136
- readonly namespaceUri: typeof XML_NAMESPACE_URI;
137
- readonly localName: 'space';
138
- readonly prefix: 'xml';
139
- readonly value: 'default' | 'preserve';
140
- }
141
- /** `w:val` — the attribute nearly every WordprocessingML property carries its value in. */
142
- interface OoxmlWmlValAttribute extends OoxmlAttributeBase {
143
- readonly kind: 'wmlVal';
144
- readonly namespaceUri: typeof WML_NAMESPACE_URI;
145
- readonly localName: 'val';
183
+ interface RelationshipRecord {
184
+ readonly ownerPart: string;
185
+ readonly id: string;
186
+ readonly type: string;
187
+ readonly rawTarget: string;
188
+ readonly targetMode: TargetMode;
189
+ readonly order: number;
146
190
  }
191
+ /** Why a relationship set is invalid. Duplicate ids within one owner fail closed. */
192
+ type RelationshipError = {
193
+ readonly code: 'duplicate-id';
194
+ readonly ownerPart: string;
195
+ readonly id: string;
196
+ };
197
+ /** The validated relationship set, or the conflict that rejected it. */
198
+ type RelationshipSetResult = {
199
+ readonly ok: true;
200
+ readonly byOwner: ReadonlyMap<string, readonly RelationshipRecord[]>;
201
+ } | {
202
+ readonly ok: false;
203
+ readonly error: RelationshipError;
204
+ };
205
+ /** Group relationships by owner in authored order; reject duplicate ids per owner. */
206
+ declare function buildRelationshipSet(records: readonly RelationshipRecord[]): RelationshipSetResult;
147
207
  /**
148
- * Any attribute outside the typed vocabulary, carried verbatim.
208
+ * A relationship resolved to a part, or the reason it could not be.
149
209
  *
150
- * Where losslessness actually happens: an attribute this engine has no model for is preserved
151
- * exactly rather than dropped, so a save re-emits what the file said.
210
+ * External targets resolve to a refusal by design: they are never followed from a file.
152
211
  */
153
- interface OoxmlGenericExtensionAttribute extends OoxmlAttributeBase {
154
- readonly kind: 'genericExtension';
155
- }
156
- /** Any attribute on any node: the two typed ones, plus the verbatim catch-all. */
157
- type OoxmlAttribute = OoxmlXmlSpaceAttribute | OoxmlWmlValAttribute | OoxmlGenericExtensionAttribute;
212
+ type ResolvedRelationship = {
213
+ readonly mode: 'Internal';
214
+ readonly target: NameResult;
215
+ readonly raw: string;
216
+ } | {
217
+ readonly mode: 'External';
218
+ readonly sinkSafe: NameResult;
219
+ readonly raw: string;
220
+ };
158
221
  /**
159
- * Attributes a TYPED node may carry.
222
+ * Resolve a relationship to a runtime projection while the raw target stays
223
+ * authored. Internal -> owner-relative part name; External -> sink-safe
224
+ * validation only (never owner-resolved, never fetched). `raw` is always the
225
+ * verbatim authored target.
226
+ */
227
+ declare function resolveRelationship(rec: RelationshipRecord): ResolvedRelationship;
228
+ /**
229
+ * An image relationship resolved to package bytes, or why it was refused.
160
230
  *
161
- * Excludes `w:val` on purpose: a node the engine models keeps its value in typed fields, and
162
- * allowing a stray `w:val` alongside them would create two sources of truth for one property.
231
+ * External-mode image rels are refused rather than fetched — the no-zero-click-external-fetch
232
+ * rule applies to images exactly as it does to links.
163
233
  */
164
- type OoxmlKnownNodeAttribute = OoxmlXmlSpaceAttribute | OoxmlGenericExtensionAttribute;
165
- interface OoxmlElementBase<Children extends readonly OoxmlNode[] = readonly OoxmlNode[], Attributes extends readonly OoxmlAttribute[] = readonly OoxmlAttribute[]> {
166
- readonly id: OoxmlNodeId;
167
- readonly namespaceUri: string;
168
- readonly localName: string;
169
- /** Authored prefix retained as non-authoritative fidelity evidence. */
170
- readonly prefix?: string;
171
- /** Namespace declarations authored directly on this element, in source order. */
172
- readonly namespaceBindings: readonly OoxmlNamespaceBinding[];
173
- readonly attributes: Attributes;
174
- readonly children: Children;
175
- }
176
- /** `w:document` — the root of a main document part. */
177
- interface OoxmlDocumentNode extends OoxmlElementBase<readonly (OoxmlBodyNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
178
- readonly kind: 'document';
179
- readonly namespaceUri: typeof WML_NAMESPACE_URI;
180
- readonly localName: 'document';
181
- }
182
- /** `w:body` — the main story's block content. */
183
- interface OoxmlBodyNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
184
- readonly kind: 'body';
185
- readonly namespaceUri: typeof WML_NAMESPACE_URI;
186
- readonly localName: 'body';
187
- }
234
+ type ImageRelationshipResolution = {
235
+ readonly mode: 'internal';
236
+ readonly partName: string;
237
+ readonly raw: string;
238
+ } | {
239
+ readonly mode: 'external';
240
+ readonly sinkSafe: boolean;
241
+ readonly raw: string;
242
+ } | {
243
+ readonly mode: 'missing';
244
+ };
245
+ /**
246
+ * Resolve an image relationship id from an owner part. Internal targets resolve
247
+ * owner-relative; external targets are never fetched; a missing id is `missing`.
248
+ */
249
+ declare function resolveImageRelationship(records: readonly RelationshipRecord[] | undefined, ownerPart: string, relationshipId: string): ImageRelationshipResolution;
250
+
251
+ /** One `<Default>`: a file extension mapped to a content type. */
252
+ interface DefaultRecord {
253
+ readonly extension: string;
254
+ readonly contentType: string;
255
+ readonly order: number;
256
+ }
257
+ /** One `<Override>`: a specific part name mapped to a content type. Beats any Default. */
258
+ interface OverrideRecord {
259
+ readonly partName: string;
260
+ readonly contentType: string;
261
+ readonly order: number;
262
+ }
263
+ /**
264
+ * The authored `[Content_Types].xml` records, in significant order.
265
+ *
266
+ * Retained rather than collapsed into a lookup, because the file's lexical form and ordering are
267
+ * part of what a lossless save re-emits.
268
+ */
269
+ interface ContentTypeRecords {
270
+ readonly defaults: readonly DefaultRecord[];
271
+ readonly overrides: readonly OverrideRecord[];
272
+ }
273
+ /**
274
+ * Why content-type records could not be indexed.
275
+ *
276
+ * All fail CLOSED: conflicting Defaults on one extension, duplicate normalized Override names, or
277
+ * invalid MIME syntax are refused rather than resolved by picking one.
278
+ */
279
+ type ContentTypeError = {
280
+ readonly code: 'invalid-mime';
281
+ readonly value: string;
282
+ } | {
283
+ readonly code: 'conflicting-default';
284
+ readonly extension: string;
285
+ } | {
286
+ readonly code: 'duplicate-override';
287
+ readonly partName: string;
288
+ } | {
289
+ readonly code: 'invalid-override-name';
290
+ readonly partName: string;
291
+ } | {
292
+ readonly code: 'too-many-records';
293
+ readonly limit: number;
294
+ };
295
+ /** Whether a string is syntactically a MIME type. Syntax only — no registry lookup. */
296
+ declare function isValidMime(value: string): boolean;
297
+ /** ASCII-case-insensitive extension key (leading dot removed; ASCII-only fold). */
298
+ declare function extensionKey(extension: string): string;
299
+ /** The resolved lookup: Override by case-folded part name, Default by case-insensitive extension. */
300
+ interface ContentTypeIndex {
301
+ /** ext key -> single MIME (identical duplicates collapsed). */
302
+ readonly defaults: ReadonlyMap<string, string>;
303
+ /** case-folded part name -> MIME. */
304
+ readonly overrides: ReadonlyMap<string, string>;
305
+ }
306
+ /** The built index, or the conflict that made it impossible. */
307
+ type IndexResult = {
308
+ readonly ok: true;
309
+ readonly index: ContentTypeIndex;
310
+ } | {
311
+ readonly ok: false;
312
+ readonly error: ContentTypeError;
313
+ };
314
+ /**
315
+ * Build a resolved content-type index, failing closed on conflict/duplicate/MIME
316
+ * errors. `maxRecords` bounds the combined record count (N/N+1 gate).
317
+ */
318
+ declare function buildContentTypeIndex(records: ContentTypeRecords, maxRecords?: number): IndexResult;
319
+ /**
320
+ * A part's content type, or why it has none.
321
+ *
322
+ * An orphan record never determines a part's type — a Default with no matching part is preserved
323
+ * inertly rather than applied.
324
+ */
325
+ type ResolveResult = {
326
+ readonly ok: true;
327
+ readonly contentType: string;
328
+ readonly source: 'override' | 'default';
329
+ } | {
330
+ readonly ok: false;
331
+ readonly reason: 'unknown';
332
+ };
333
+ /** Resolve a part's content type: Override wins over Default; else unknown. */
334
+ declare function resolveContentType(index: ContentTypeIndex, partName: string): ResolveResult;
335
+
336
+ /** The WordprocessingML main namespace — the `w:` prefix in every `word/document.xml`. */
337
+ declare const WML_NAMESPACE_URI = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
338
+ /** The reserved `xml:` namespace, which carries `xml:space`. */
339
+ declare const XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
340
+ /** The reserved `xmlns:` namespace that namespace declarations themselves live in. */
341
+ declare const XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
342
+ /** The `w14` wordml-2010 extension namespace — `w14:paraId`/`w14:textId` live here. */
343
+ declare const W14_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2010/wordml";
344
+ /** @internal */
345
+ declare const DRAWINGML_MAIN_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/main";
346
+ declare const WP_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
347
+ declare const PIC_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/picture";
348
+ /** The four content-position revision wrappers, which nest and carry runs. */
349
+ declare function isContentRevisionKind(kind: OoxmlNode['kind']): kind is 'revisionInsert' | 'revisionDelete' | 'revisionMoveFrom' | 'revisionMoveTo';
350
+ /** Move-range and comment-range boundary markers, which are empty and sit between runs. */
351
+ declare function isRangeMarkerKind(kind: OoxmlNode['kind']): kind is 'moveFromRangeStart' | 'moveFromRangeEnd' | 'moveToRangeStart' | 'moveToRangeEnd' | 'commentRangeStart' | 'commentRangeEnd';
352
+ /**
353
+ * OOXML on/off toggle: on only when a same-namespace child is present and its `w:val`
354
+ * (same namespace as the child) does not explicitly disable. Foreign-namespace siblings
355
+ * with the same local name cannot turn the flag on.
356
+ */
357
+ declare function readOnOffChild(parent: OoxmlNode, localName: string, namespaceUri?: string): boolean;
358
+
359
+ /**
360
+ * A node's stable identity within its part.
361
+ *
362
+ * Minted deterministically from the structural path at parse, then RETAINED through structural
363
+ * sharing — the same bytes always produce the same ids, and an edit elsewhere in the document
364
+ * does not renumber untouched nodes. Every tree op addresses nodes by these.
365
+ */
366
+ type OoxmlNodeId = string;
367
+ /**
368
+ * One `xmlns:` declaration carried on a node.
369
+ *
370
+ * Preserved rather than normalized away: a document that binds `w14` at the root and a document
371
+ * that binds it on a paragraph are different bytes, and re-emitting the wrong one is a fidelity
372
+ * loss even though the semantics match.
373
+ */
374
+ interface OoxmlNamespaceBinding {
375
+ readonly prefix: string;
376
+ readonly namespaceUri: string;
377
+ }
378
+ interface OoxmlAttributeBase {
379
+ readonly namespaceUri: string;
380
+ readonly localName: string;
381
+ readonly prefix?: string;
382
+ readonly value: string;
383
+ }
384
+ /** `xml:space`, which decides whether a run's leading and trailing whitespace survives. */
385
+ interface OoxmlXmlSpaceAttribute extends OoxmlAttributeBase {
386
+ readonly kind: 'xmlSpace';
387
+ readonly namespaceUri: typeof XML_NAMESPACE_URI;
388
+ readonly localName: 'space';
389
+ readonly prefix: 'xml';
390
+ readonly value: 'default' | 'preserve';
391
+ }
392
+ /** `w:val` — the attribute nearly every WordprocessingML property carries its value in. */
393
+ interface OoxmlWmlValAttribute extends OoxmlAttributeBase {
394
+ readonly kind: 'wmlVal';
395
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
396
+ readonly localName: 'val';
397
+ }
398
+ /**
399
+ * Any attribute outside the typed vocabulary, carried verbatim.
400
+ *
401
+ * Where losslessness actually happens: an attribute this engine has no model for is preserved
402
+ * exactly rather than dropped, so a save re-emits what the file said.
403
+ */
404
+ interface OoxmlGenericExtensionAttribute extends OoxmlAttributeBase {
405
+ readonly kind: 'genericExtension';
406
+ }
407
+ /** Any attribute on any node: the two typed ones, plus the verbatim catch-all. */
408
+ type OoxmlAttribute = OoxmlXmlSpaceAttribute | OoxmlWmlValAttribute | OoxmlGenericExtensionAttribute;
409
+ /**
410
+ * Attributes a TYPED node may carry.
411
+ *
412
+ * Excludes `w:val` on purpose: a node the engine models keeps its value in typed fields, and
413
+ * allowing a stray `w:val` alongside them would create two sources of truth for one property.
414
+ */
415
+ type OoxmlKnownNodeAttribute = OoxmlXmlSpaceAttribute | OoxmlGenericExtensionAttribute;
416
+ interface OoxmlElementBase<Children extends readonly OoxmlNode[] = readonly OoxmlNode[], Attributes extends readonly OoxmlAttribute[] = readonly OoxmlAttribute[]> {
417
+ readonly id: OoxmlNodeId;
418
+ readonly namespaceUri: string;
419
+ readonly localName: string;
420
+ /** Authored prefix retained as non-authoritative fidelity evidence. */
421
+ readonly prefix?: string;
422
+ /** Namespace declarations authored directly on this element, in source order. */
423
+ readonly namespaceBindings: readonly OoxmlNamespaceBinding[];
424
+ readonly attributes: Attributes;
425
+ readonly children: Children;
426
+ }
427
+ /** `w:document` — the root of a main document part. */
428
+ interface OoxmlDocumentNode extends OoxmlElementBase<readonly (OoxmlBodyNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
429
+ readonly kind: 'document';
430
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
431
+ readonly localName: 'document';
432
+ }
433
+ /** `w:body` — the main story's block content. */
434
+ interface OoxmlBodyNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
435
+ readonly kind: 'body';
436
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
437
+ readonly localName: 'body';
438
+ }
188
439
  interface OoxmlTableNode extends OoxmlElementBase<readonly (OoxmlTablePropertiesNode | OoxmlTableGridNode | OoxmlTableRowNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
189
440
  readonly kind: 'table';
190
441
  readonly namespaceUri: typeof WML_NAMESPACE_URI;
@@ -894,323 +1145,100 @@ type OoxmlInvariantResult = {
894
1145
  */
895
1146
  declare function readOoxmlPart(xml: string, metadata: OoxmlPartMetadata, limits?: XmlLimits): OoxmlReadResult;
896
1147
 
897
- type AutomationTableMutation = {
898
- readonly kind: 'insertRows';
899
- readonly rowId: string;
900
- readonly location: 'before' | 'after';
901
- readonly count: number;
902
- readonly values?: readonly (readonly string[])[];
903
- } | {
904
- readonly kind: 'values';
905
- readonly values: readonly (readonly string[])[];
906
- } | {
907
- readonly kind: 'addRows' | 'addColumns';
908
- readonly location: 'start' | 'end';
909
- readonly count: number;
910
- readonly values?: readonly (readonly string[])[];
911
- } | {
912
- readonly kind: 'deleteRows' | 'deleteColumns';
913
- readonly index: number;
914
- readonly count: number;
915
- } | {
916
- readonly kind: 'delete';
917
- } | {
918
- readonly kind: 'properties';
919
- readonly styleId?: string;
920
- readonly headerRowCount?: number;
921
- } | {
922
- readonly kind: 'cell';
923
- readonly cellId: string;
924
- readonly value?: string;
925
- readonly columnWidth?: number;
926
- readonly shadingColor?: string;
927
- readonly verticalAlignment?: 'Top' | 'Center' | 'Bottom';
1148
+ /** @internal */
1149
+ type ShapeSchemeColorResolver = (scheme: string) => string | null;
1150
+ /** A resolved shape colour. @public */
1151
+ interface ShapeColor {
1152
+ /** Validated six-character sRGB hex, without `#`. */
1153
+ readonly hex: string;
1154
+ /** Opacity, 0..1. */
1155
+ readonly alpha: number;
1156
+ }
1157
+ /** @internal */
1158
+ declare function resolveColorNode(color: OoxmlNode, resolveSchemeColor?: ShapeSchemeColorResolver, placeholder?: ShapeColor): ShapeColor | null;
1159
+ /** @internal */
1160
+ declare function directFill(parent: OoxmlElement, resolveSchemeColor?: ShapeSchemeColorResolver, placeholder?: ShapeColor): {
1161
+ readonly present: boolean;
1162
+ readonly color: ShapeColor | null;
928
1163
  };
929
1164
 
930
- /** Select one declared entry of a legacy Word dropdown form field. */
931
- interface SetLegacyDropdownOp {
932
- readonly op: 'setLegacyDropdown';
933
- readonly paragraphId: string;
934
- readonly fieldNodeId: string;
935
- readonly selectedIndex: number;
1165
+ /** A pattern fill: the tile's foreground rows and the two colours. @public */
1166
+ interface VectorPattern {
1167
+ /** Eight rows of foreground cells from the top; the leftmost cell is the high bit. */
1168
+ readonly rows: readonly number[];
1169
+ readonly foreground: ShapeColor;
1170
+ readonly background: ShapeColor;
936
1171
  }
937
1172
 
938
- interface SetFieldCodeOp {
939
- readonly op: 'setFieldCode';
940
- readonly paragraphId: string;
941
- readonly fieldNodeId: string;
942
- readonly code: string;
1173
+ /** An affine map `[a, b, c, d, e, f]`: x' = a x + c y + e, y' = b x + d y + f. */
1174
+ type AffineMatrix = readonly [number, number, number, number, number, number];
1175
+ /** One colour stop of a gradient. @public */
1176
+ interface GradientStop {
1177
+ /** Position along the gradient, 0..1. */
1178
+ readonly offset: number;
1179
+ /** Validated six-character sRGB hex, without `#`. */
1180
+ readonly hex: string;
1181
+ /** Opacity, 0..1. */
1182
+ readonly alpha: number;
1183
+ }
1184
+ /**
1185
+ * A gradient ready to paint. `linear` runs from (x1, y1) to (x2, y2); `radial` grows from
1186
+ * its centre (cx, cy) at offset 0 to radius r at offset 1. Both are in gradient space, which
1187
+ * `matrix` maps onto the component's point space.
1188
+ */
1189
+ interface VectorGradient {
1190
+ readonly kind: 'linear' | 'radial';
1191
+ /** Stops in offset order; at least two. */
1192
+ readonly stops: readonly GradientStop[];
1193
+ /** `[x1, y1, x2, y2]` for a linear gradient, `[cx, cy, r]` for a radial one. */
1194
+ readonly coords: readonly number[];
1195
+ /** Gradient space onto the component's point space. */
1196
+ readonly matrix: AffineMatrix;
943
1197
  }
944
1198
 
945
- type InsertTextOp = {
946
- readonly op: 'insertText';
947
- readonly paragraphId: string;
948
- /** Legacy text form identity for protected filling; never an inline wrapper owner. */
949
- readonly textFormFieldId?: string;
950
- readonly offset: number;
951
- readonly text: string;
952
- /**
953
- * Write this as a TRACKED insertion, attributed here.
954
- *
955
- * On the op rather than on the store, so suggesting stays a decision the surface makes
956
- * per edit and the write vocabulary stays explicit — a global "everything is tracked
957
- * now" flag is exactly what `DocEdits` refuses, because it makes the meaning of an op
958
- * depend on state the op does not carry.
959
- */
960
- readonly revision?: RevisionAttributionInput;
961
- /**
962
- * When set, the text belongs INSIDE this content control, whatever sits at the offset.
963
- *
964
- * A boundary offset is owned by the run that starts there, which at a control's trailing
965
- * edge is the run after the control — so an offset alone cannot say "append to this field",
966
- * the way it cannot say which run of a field result to format (see `targetRunIds`). A
967
- * caller that names the control gets the text in the control; one that does not gets the
968
- * plain offset rule, which is what a keystroke beside a field means.
969
- */
970
- readonly inside?: string;
971
- /**
972
- * Which side of a run BOUNDARY the text joins. Default `'left'` — Word's typing rule:
973
- * the next character takes the formatting of the character before the caret.
974
- *
975
- * `'right'` is for a caller that is not typing but placing text inside the run that
976
- * STARTS at the offset — the hyperlink editor rewriting a link's display text, where
977
- * landing left of the boundary would put the new text outside the link. Ignored when
978
- * the offset falls strictly inside a run, which has no boundary to choose.
979
- */
980
- readonly bias?: 'left' | 'right';
981
- };
982
- type DeleteTextOp = {
983
- readonly op: 'deleteText';
984
- readonly paragraphId: string;
985
- /** Legacy text form identity for protected filling; never an inline wrapper owner. */
986
- readonly textFormFieldId?: string;
987
- readonly start: number;
988
- readonly end: number;
989
- /** Write this as a TRACKED deletion — the characters stay, wrapped in `w:del`. */
990
- readonly revision?: RevisionAttributionInput;
991
- };
992
-
993
- /** Editable legacy text input types. Other authored types remain inert. */
994
- type TextFormFieldType = 'regular' | 'number' | 'date';
995
- /** Options stored in the legacy field definition. Zero means unlimited length. */
996
- interface TextFormFieldOptions {
997
- readonly type: TextFormFieldType;
998
- readonly maxLength: number;
999
- readonly format: string;
1000
- readonly enabled: boolean;
1001
- }
1002
- /** Supported format choices for legacy text input fields. @public */
1003
- declare const TEXT_FORM_FORMATS: {
1004
- readonly regular: readonly ['', 'Uppercase', 'Lowercase', 'First capital', 'Title case'];
1005
- readonly number: readonly ['', '0', '0.00', '#,##0', '#,##0.00', '0%', '0.00%'];
1006
- readonly date: readonly ['', 'M/d/yyyy', 'MM/dd/yyyy', 'd/M/yyyy', 'dd/MM/yyyy', 'yyyy-MM-dd', 'd MMMM yyyy', 'MMMM d, yyyy'];
1007
- };
1008
-
1009
- /** A legacy text input in the shared paragraph offset space. */
1010
- interface TextFormFieldRange {
1011
- readonly fieldNodeId: string;
1012
- readonly start: number;
1013
- readonly end: number;
1014
- readonly enabled: boolean;
1015
- readonly defaultText: string;
1016
- readonly type: string;
1017
- readonly maxLength: number;
1018
- readonly format: string;
1019
- readonly chromeIds: readonly string[];
1020
- }
1021
- /** Uses the field parser and offset index; never introduces another inline walk. */
1022
- declare function textFormFieldsOf(paragraph: OoxmlParagraphNode): readonly TextFormFieldRange[];
1023
- /** Options edit for an existing legacy text form. */
1024
- interface SetTextFormFieldDefaultOp {
1025
- readonly op: 'setTextFormFieldDefault';
1026
- /** Regional conventions for new date input; defaults to en-US. */
1027
- readonly locale?: string;
1028
- readonly paragraphId: string;
1029
- readonly fieldNodeId: string;
1030
- readonly text: string;
1031
- readonly options?: TextFormFieldOptions;
1032
- }
1033
- /** Validate and format the existing result when a user finishes filling a field. */
1034
- interface CommitTextFormFieldOp {
1035
- readonly op: 'commitTextFormField';
1036
- /** Regional conventions for new date input; defaults to en-US. */
1037
- readonly locale?: string;
1038
- readonly paragraphId: string;
1039
- readonly fieldNodeId: string;
1040
- }
1041
-
1042
- /** One FORMCHECKBOX in the shared paragraph offset space. */
1043
- interface LegacyCheckboxFieldRange {
1044
- /** The begin `w:fldChar` node: what the op addresses. */
1045
- readonly fieldNodeId: string;
1046
- readonly start: number;
1047
- readonly end: number;
1048
- readonly checked: boolean;
1049
- /** `w:enabled` under `w:ffData`; a disabled field renders but refuses the toggle. */
1050
- readonly enabled: boolean;
1051
- }
1052
- /** Flip a FORMCHECKBOX's state; the only write into `w:ffData` a checkbox permits. */
1053
- interface SetLegacyCheckboxOp {
1054
- readonly op: 'setLegacyCheckbox';
1055
- readonly paragraphId: string;
1056
- readonly fieldNodeId: string;
1057
- readonly checked: boolean;
1058
- }
1059
- /** Every FORMCHECKBOX in a paragraph, in document order; uses the shared field parser. */
1060
- declare function legacyCheckboxFieldsOf(paragraph: OoxmlParagraphNode): readonly LegacyCheckboxFieldRange[];
1061
-
1062
- /** Replace a building block gallery control's content with one block's body. */
1063
- interface InsertBuildingBlockOp {
1064
- readonly op: 'insertBuildingBlock';
1065
- readonly controlId: string;
1066
- /** `w:docPartPr/w:name` of the picked block, for the journal and the host. */
1067
- readonly name: string;
1068
- /**
1069
- * Self-contained `w:docPartBody` children, cloned with fresh ids at apply.
1070
- * Resource, style, field, bookmark, note and revision references return `unsupported`.
1071
- */
1072
- readonly blocks: readonly OoxmlNode[];
1073
- }
1074
-
1075
- /**
1076
- * Why a part or relationship name was refused.
1077
- *
1078
- * Path traversal is the reason this exists: a name with `..` or a leading `/` is refused rather
1079
- * than normalized, because normalizing is how a crafted package reaches outside itself.
1080
- */
1081
- type NameRejection = 'empty' | 'control-char' | 'backslash' | 'drive-or-unc' | 'encoded-separator' | 'encoded-dot' | 'bad-encoding' | 'empty-segment' | 'dot-segment' | 'unsafe-key' | 'segment-trailing-dot' | 'traversal-escape' | 'not-absolute-uri' | 'unsafe-scheme';
1082
- /** A validated OPC name, or the typed reason it was refused. */
1083
- type NameResult = {
1084
- readonly ok: true;
1085
- readonly partName: string;
1086
- } | {
1087
- readonly ok: false;
1088
- readonly reason: NameRejection;
1089
- };
1090
- /**
1091
- * Normalize a ZIP entry name or OPC part name into a canonical part name
1092
- * (`/word/document.xml`). Accepts leading-slash and no-leading-slash inputs;
1093
- * rejects traversal, dot segments, and the attack surface. Duplicate detection
1094
- * folds ASCII case (OPC part-name equivalence).
1095
- */
1096
- declare function normalizePartName(raw: string): NameResult;
1097
- /**
1098
- * ASCII-only lowercase fold. OPC part-name/extension equivalence is US-ASCII
1099
- * case-insensitive; a locale `toLowerCase()` mis-folds e.g. Turkish `I`/`İ` and
1100
- * could let two "equivalent" part names evade duplicate detection.
1101
- */
1102
- declare function asciiFold(s: string): string;
1103
- /** Case-folded key for OPC part-name equivalence / duplicate detection. */
1104
- declare function partNameKey(partName: string): string;
1105
- /**
1106
- * Detect archive entries that collide after normalization (before inflation).
1107
- * Returns the case-folded keys that more than one raw name maps to.
1108
- */
1109
- declare function detectDuplicateNames(rawNames: readonly string[]): {
1110
- readonly duplicates: readonly string[];
1111
- readonly rejected: readonly {
1112
- raw: string;
1113
- reason: NameRejection;
1114
- }[];
1115
- };
1116
- /**
1117
- * Resolve an internal relationship target against its owner part, without
1118
- * escaping the package root. `ownerPartName` is a canonical part name; the base
1119
- * is its containing folder. A leading "/" target is package-absolute. `.`/`..`
1120
- * segments resolve on a stack; popping above root is `traversal-escape`.
1121
- */
1122
- declare function resolveInternalTarget(ownerPartName: string, rawTarget: string): NameResult;
1123
1199
  /**
1124
- * Validate an external-mode relationship target. It MUST be an absolute URI, is
1125
- * retained verbatim by the caller, and is NEVER owner-resolved or fetched here.
1126
- * Unsafe schemes (javascript/vbscript/data/file) are rejected for runtime sinks;
1127
- * the raw lexical form is still preserved separately by the authored record.
1200
+ * Outline geometry of a text box shape. A polygon's points are shares of the box, from 0 at
1201
+ * its top-left to 1 at its far side, so the outline stretches with a box that fits its text.
1128
1202
  */
1129
- declare function validateExternalTarget(raw: string): NameResult;
1130
-
1131
- /** OOXML image relationship type for embedded or linked media parts. */
1132
- declare const IMAGE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
1133
- /**
1134
- * Whether a relationship points inside the package or out of it.
1135
- *
1136
- * The security-relevant distinction: an `External` target is retained VERBATIM and never
1137
- * owner-resolved or fetched, because auto-loading a file-supplied remote target is a zero-click
1138
- * external fetch.
1139
- */
1140
- type TargetMode = 'Internal' | 'External';
1141
- /**
1142
- * One authored relationship, with nothing materialized away: owner part, id, type, raw target
1143
- * lexical form, mode, and position.
1144
- */
1145
- interface RelationshipRecord {
1146
- readonly ownerPart: string;
1147
- readonly id: string;
1148
- readonly type: string;
1149
- readonly rawTarget: string;
1150
- readonly targetMode: TargetMode;
1151
- readonly order: number;
1203
+ type TextboxOutlineProjection = {
1204
+ readonly kind: 'ellipse';
1152
1205
  }
1153
- /** Why a relationship set is invalid. Duplicate ids within one owner fail closed. */
1154
- type RelationshipError = {
1155
- readonly code: 'duplicate-id';
1156
- readonly ownerPart: string;
1157
- readonly id: string;
1158
- };
1159
- /** The validated relationship set, or the conflict that rejected it. */
1160
- type RelationshipSetResult = {
1161
- readonly ok: true;
1162
- readonly byOwner: ReadonlyMap<string, readonly RelationshipRecord[]>;
1163
- } | {
1164
- readonly ok: false;
1165
- readonly error: RelationshipError;
1166
- };
1167
- /** Group relationships by owner in authored order; reject duplicate ids per owner. */
1168
- declare function buildRelationshipSet(records: readonly RelationshipRecord[]): RelationshipSetResult;
1169
- /**
1170
- * A relationship resolved to a part, or the reason it could not be.
1171
- *
1172
- * External targets resolve to a refusal by design: they are never followed from a file.
1173
- */
1174
- type ResolvedRelationship = {
1175
- readonly mode: 'Internal';
1176
- readonly target: NameResult;
1177
- readonly raw: string;
1206
+ /** The corner radius is `arc` times the box's shorter side. */
1207
+ | {
1208
+ readonly kind: 'roundRect';
1209
+ readonly arc: number;
1178
1210
  } | {
1179
- readonly mode: 'External';
1180
- readonly sinkSafe: NameResult;
1181
- readonly raw: string;
1211
+ readonly kind: 'polygon';
1212
+ readonly subpaths: readonly (readonly {
1213
+ readonly x: number;
1214
+ readonly y: number;
1215
+ }[])[];
1182
1216
  };
1183
1217
  /**
1184
- * Resolve a relationship to a runtime projection while the raw target stays
1185
- * authored. Internal -> owner-relative part name; External -> sink-safe
1186
- * validation only (never owner-resolved, never fetched). `raw` is always the
1187
- * verbatim authored target.
1218
+ * The text area of a box of any size: shares of its width and height (an oval, a preset), or
1219
+ * the inscribed square of a round rectangle's corner arc on every side.
1188
1220
  */
1189
- declare function resolveRelationship(rec: RelationshipRecord): ResolvedRelationship;
1190
- /**
1191
- * An image relationship resolved to package bytes, or why it was refused.
1192
- *
1193
- * External-mode image rels are refused rather than fetched — the no-zero-click-external-fetch
1194
- * rule applies to images exactly as it does to links.
1195
- */
1196
- type ImageRelationshipResolution = {
1197
- readonly mode: 'internal';
1198
- readonly partName: string;
1199
- readonly raw: string;
1200
- } | {
1201
- readonly mode: 'external';
1202
- readonly sinkSafe: boolean;
1203
- readonly raw: string;
1221
+ type TextboxTextAreaRule = {
1222
+ readonly kind: 'share';
1223
+ readonly top: number;
1224
+ readonly right: number;
1225
+ readonly bottom: number;
1226
+ readonly left: number;
1204
1227
  } | {
1205
- readonly mode: 'missing';
1228
+ readonly kind: 'arc';
1229
+ readonly arc: number;
1206
1230
  };
1207
- /**
1208
- * Resolve an image relationship id from an owner part. Internal targets resolve
1209
- * owner-relative; external targets are never fetched; a missing id is `missing`.
1210
- */
1211
- declare function resolveImageRelationship(records: readonly RelationshipRecord[] | undefined, ownerPart: string, relationshipId: string): ImageRelationshipResolution;
1212
1231
 
1213
- type ShapeSchemeColorResolver = (scheme: string) => string | null;
1232
+ /** A text box shadow: colour, opacity and page offset. */
1233
+ interface LegacyTextboxShadow {
1234
+ readonly hex: string;
1235
+ readonly alpha: number;
1236
+ readonly offsetXEmu: number;
1237
+ readonly offsetYEmu: number;
1238
+ /** The shadow is the solid silhouette, seen only outside the shape. */
1239
+ readonly obscured: boolean;
1240
+ }
1241
+
1214
1242
  type ShapeStyleMatrixResolver = (kind: 'fill' | 'line', index: number) => OoxmlElement | null;
1215
1243
  /**
1216
1244
  * The renderable subset of a `wps:wsp` non-picture graphic, or of one bounded `wpg:wgp`
@@ -1219,6 +1247,8 @@ type ShapeStyleMatrixResolver = (kind: 'fill' | 'line', index: number) => OoxmlE
1219
1247
  * from `a:srgbClr` or from the theme, through `a:schemeClr` or a `wps:style` matrix
1220
1248
  * reference. Anything richer (gradient and picture fills, text bodies, rotation, a nested
1221
1249
  * group) projects as `null` and paints the labelled placeholder instead.
1250
+ *
1251
+ * @public
1222
1252
  */
1223
1253
  interface VectorShapeProjection {
1224
1254
  /** The drawing extent that frames the subpath coordinate space. */
@@ -1249,7 +1279,13 @@ interface VectorShapeProjection {
1249
1279
  readonly strokeWidthEmu: number;
1250
1280
  /** Independently styled paths, always non-empty. A direct shape has one component. */
1251
1281
  readonly components: readonly VectorShapeComponent[];
1282
+ /**
1283
+ * Geometry outside the extent paints too. A drawing canvas does not cut its members at
1284
+ * its frame: a member placed past an edge shows whole.
1285
+ */
1286
+ readonly overflowVisible?: true;
1252
1287
  }
1288
+ /** One painted layer of a vector shape. @public */
1253
1289
  interface VectorShapeComponent {
1254
1290
  readonly subpathsEmu: readonly (readonly Readonly<{
1255
1291
  x: number;
@@ -1267,12 +1303,50 @@ interface VectorShapeComponent {
1267
1303
  readonly strokeHex: string | null;
1268
1304
  readonly strokeAlpha: number;
1269
1305
  readonly strokeWidthEmu: number;
1306
+ /**
1307
+ * A gradient fill (`a:gradFill`), painted in place of `fillHex` where the painter can.
1308
+ * `fillHex` then holds the mean of its stops.
1309
+ */
1310
+ readonly fillGradient?: VectorGradient;
1311
+ /** A preset pattern the fill paints with; `fillHex` is its mean colour. */
1312
+ readonly fillPattern?: VectorPattern;
1313
+ /** The outer shadow the shape casts, painted under this component. */
1314
+ readonly shadow?: ShapeShadow;
1315
+ /**
1316
+ * The component only casts `shadow`: it is the silhouette of a shape with several paths,
1317
+ * placed before them, and paints no fill or outline of its own.
1318
+ */
1319
+ readonly shadowOnly?: true;
1320
+ /** Authored line ends and joins, inherited from the selected theme line when absent. */
1321
+ readonly strokeCap?: 'butt' | 'round' | 'square';
1322
+ readonly strokeJoin?: 'round' | 'bevel' | 'miter';
1323
+ /** Miter limit in line widths, for a miter join. */
1324
+ readonly strokeMiterLimit?: number;
1325
+ /** Dash and gap lengths in multiples of the stroke width; absent for a solid outline. */
1326
+ readonly strokeDash?: readonly number[];
1327
+ /** Paint clips to these closed subpaths, as an inner shadow clips to its shape. */
1328
+ readonly clipEmu?: readonly (readonly Readonly<{
1329
+ x: number;
1330
+ y: number;
1331
+ }>[])[];
1332
+ /** In a picture's frame: paints under the picture (its shadow and fill), not over it. */
1333
+ readonly belowPicture?: true;
1334
+ /**
1335
+ * How far the stroked path lies outside the geometry by design, in EMU: a picture outline
1336
+ * runs half its width outside the picture, so the whole stroke stays off the picture.
1337
+ */
1338
+ readonly strokeOutsetEmu?: number;
1270
1339
  /**
1271
1340
  * The outline sits inside the closed geometry (`a:ln algn="in"`): painters draw it at twice
1272
1341
  * its width clipped to the path, so the authored width stays inside the shape and adds no
1273
1342
  * reach past the extent. Set only for a closed outline with area.
1274
1343
  */
1275
1344
  readonly strokeInset?: boolean;
1345
+ /**
1346
+ * The subpaths fill by the nonzero winding rule rather than even-odd, so overlapping
1347
+ * subpaths of one direction stay filled where they cross.
1348
+ */
1349
+ readonly fillRule?: 'nonzero';
1276
1350
  }
1277
1351
  /**
1278
1352
  * The story carried by a `wps:wsp` text box (`wps:txbx` → `w:txbxContent`).
@@ -1280,6 +1354,8 @@ interface VectorShapeComponent {
1280
1354
  * The projection captures only the story root and the shape chrome reads; it never walks the
1281
1355
  * story content, so the per-drawing element budget is not spent on paragraphs. Layout collects
1282
1356
  * blocks from `content` under its own caps.
1357
+ *
1358
+ * @internal
1283
1359
  */
1284
1360
  interface TextboxStoryProjection {
1285
1361
  /** Canonical node id of the `w:txbxContent` element. */
@@ -1308,6 +1384,481 @@ interface TextboxStoryProjection {
1308
1384
  readonly strokeHex: string | null;
1309
1385
  /** Outline width in EMU; 0 when absent. */
1310
1386
  readonly strokeWidthEmu: number;
1387
+ /** The shape around a legacy VML story; absent for an upright rectangle. */
1388
+ readonly legacyFrame?: TextboxLegacyFrame;
1389
+ /** The outline is centred on the shape edge, half outside the extent, as VML strokes it. */
1390
+ readonly strokeCentered?: true;
1391
+ /** VML `insetpen`: the outline lies inside the box and insets the text by its full width. */
1392
+ readonly strokeInset?: true;
1393
+ /** VML `mso-fit-shape-to-text`: the box height follows its text when laid out. */
1394
+ readonly fitHeightToText?: true;
1395
+ /** Outline dash pattern in multiples of the outline width; absent for solid. */
1396
+ readonly strokeDash?: readonly number[];
1397
+ /** How outline dashes end; absent for flat ends. */
1398
+ readonly strokeCap?: 'round' | 'square';
1399
+ /** The shape painted again under itself in one colour, offset on the page. */
1400
+ readonly shadow?: LegacyTextboxShadow;
1401
+ /**
1402
+ * The story is DrawingML shape text lowered to read-only paragraphs (a diagram's text): it
1403
+ * lays out without the document's styles and with the DrawingML line rule.
1404
+ */
1405
+ readonly drawingText?: true;
1406
+ /**
1407
+ * The drawing's `vectorShape` paints the box's fill, outline and effects; the story paints
1408
+ * only its text. The fill and outline fields stay for the text insets they give.
1409
+ */
1410
+ readonly chromeByVector?: true;
1411
+ }
1412
+ /** Shape geometry, turn and text flow of a text box: a legacy VML one, or a DrawingML one. */
1413
+ interface TextboxLegacyFrame {
1414
+ /** Space between the shape box and its text area, in EMU, before the story insets. */
1415
+ readonly textAreaEmu: Readonly<{
1416
+ top: number;
1417
+ right: number;
1418
+ bottom: number;
1419
+ left: number;
1420
+ }>;
1421
+ /** Outline geometry; null for a rectangle. */
1422
+ readonly outline: TextboxOutlineProjection | null;
1423
+ /** Clockwise shape turn in degrees, in [0, 360). */
1424
+ readonly rotationDegrees: number;
1425
+ /** The text turns with the shape; otherwise it stays upright in the turned box. */
1426
+ readonly textTurnsWithShape: boolean;
1427
+ /**
1428
+ * `vertical` runs lines top to bottom, stacked right to left; `verticalBottomToTop` runs
1429
+ * them bottom to top, stacked left to right.
1430
+ */
1431
+ readonly flow: 'horizontal' | 'vertical' | 'verticalBottomToTop';
1432
+ /** The shape paints and its text does not, as a text area some shapes write hides it. */
1433
+ readonly textHidden?: true;
1434
+ /** How the text area follows the box size, for a box that fits its text. */
1435
+ readonly textAreaRule?: TextboxTextAreaRule;
1436
+ }
1437
+
1438
+ /** An outer shadow: the shape's silhouette, offset, blurred and filled in one colour. */
1439
+ interface ShapeShadow {
1440
+ /** Offset of the silhouette, in the component's point space. */
1441
+ readonly dxEmu: number;
1442
+ /** Vertical offset of the silhouette, in the same units. */
1443
+ readonly dyEmu: number;
1444
+ /** Blur radius in the same units; 0 is a crisp silhouette. */
1445
+ readonly blurEmu: number;
1446
+ /** Validated six-character sRGB hex, without `#`. */
1447
+ readonly hex: string;
1448
+ /** Opacity, 0..1. */
1449
+ readonly alpha: number;
1450
+ }
1451
+ /**
1452
+ * The effect list a shape paints with, and the colour `phClr` stands for in it.
1453
+ *
1454
+ * @internal
1455
+ */
1456
+ interface ShapeEffectList {
1457
+ /** The shape's own `a:effectLst`, or the one in the theme effect style it references. */
1458
+ readonly effectLst: OoxmlElement;
1459
+ /** True when `effectLst` comes from the theme through the shape's `effectRef`. */
1460
+ readonly fromTheme: boolean;
1461
+ /** The colour of the `effectRef`, which `phClr` in a theme effect list stands for. */
1462
+ readonly placeholder?: ShapeColor;
1463
+ }
1464
+ /**
1465
+ * A mirror image below a picture that fades out downward (`a:reflection`), as the effects
1466
+ * renderer projects it for paint.
1467
+ *
1468
+ * @public
1469
+ */
1470
+ interface ShapeReflection {
1471
+ /** Opacity where the mirror image meets the shape. */
1472
+ readonly startAlpha: number;
1473
+ /** Opacity at `endPosition`; below it the mirror image is clear. */
1474
+ readonly endAlpha: number;
1475
+ /** Where the fade ends, as a share of the shape's height. */
1476
+ readonly endPosition: number;
1477
+ /** Gap between the shape and its mirror image. */
1478
+ readonly distanceEmu: number;
1479
+ /** Blur radius of the mirror image. */
1480
+ readonly blurEmu: number;
1481
+ }
1482
+
1483
+ /** Effects that change how a picture itself paints, beyond what its frame draws. @public */
1484
+ interface PictureFrameEffects {
1485
+ /** A mirror image of the picture below it. */
1486
+ readonly reflection?: ShapeReflection;
1487
+ /** The picture's edge fades out over this distance inside it. */
1488
+ readonly softEdgeEmu?: number;
1489
+ }
1490
+
1491
+ /** The rule a layout widens to its line. */
1492
+ interface HorizontalRuleProjection {
1493
+ /** `RRGGBB` of the bar, or of its upper band when shaded. */
1494
+ readonly fillHex: string;
1495
+ /** The lower band is light grey, as a groove. */
1496
+ readonly shaded: boolean;
1497
+ /** The bar's share of its line, in (0, 1]. */
1498
+ readonly widthFraction: number;
1499
+ /** A set width in points, which the line caps; absent for a share of the line. */
1500
+ readonly widthPt?: number;
1501
+ /** Where a bar shorter than its line sits on it. */
1502
+ readonly align: 'left' | 'center' | 'right';
1503
+ }
1504
+
1505
+ /** @internal */
1506
+ declare const CHART_GRAPHIC_DATA_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
1507
+ /** @internal */
1508
+ declare const CHART_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
1509
+ /** One resolved chart part. @internal */
1510
+ interface ChartPart {
1511
+ /** The `c:chartSpace` root. */
1512
+ readonly chartSpace: OoxmlElement;
1513
+ /** Canonical part name, for story ids and diagnostics. */
1514
+ readonly partName: string;
1515
+ /** The theme's Latin heading and body faces, which chart text takes through tokens. */
1516
+ readonly themeFaces: ChartThemeFaces;
1517
+ }
1518
+ /** @internal */
1519
+ interface ChartThemeFaces {
1520
+ readonly major: string | null;
1521
+ readonly minor: string | null;
1522
+ }
1523
+ /** Resolves the chart part behind one `c:chart` element of the owner story part. @internal */
1524
+ type ChartPartResolver = (chart: OoxmlElement) => ChartPart | null;
1525
+
1526
+ /** @internal */
1527
+ declare const CHARTEX_GRAPHIC_DATA_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
1528
+ /** @internal */
1529
+ declare const CHARTEX_NAMESPACE_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
1530
+ /** The namespace of chart style and colour style parts. @internal */
1531
+ declare const CHART_STYLE_NAMESPACE_URI = "http://schemas.microsoft.com/office/drawing/2012/chartStyle";
1532
+ /** One resolved chartex part. @internal */
1533
+ interface ChartexPart {
1534
+ /** The `cx:chartSpace` root. */
1535
+ readonly chartSpace: OoxmlElement;
1536
+ /** Canonical part name, for story ids and diagnostics. */
1537
+ readonly partName: string;
1538
+ /** The `cs:chartStyle` root the chartex part names, or null. */
1539
+ readonly style: OoxmlElement | null;
1540
+ /** The `cs:colorStyle` root the chartex part names, or null. */
1541
+ readonly colors: OoxmlElement | null;
1542
+ /** The theme's Latin heading and body faces, which chart text takes through tokens. */
1543
+ readonly themeFaces: ChartThemeFaces;
1544
+ }
1545
+ /** Resolves the chartex part behind one `cx:chart` element of the owner story part. @internal */
1546
+ type ChartexPartResolver = (chart: OoxmlElement) => ChartexPart | null;
1547
+
1548
+ /** One text box member of a drawing group. @internal */
1549
+ interface GroupTextboxProjection {
1550
+ /** Canonical node id of the member `wps:wsp`; namespaces the story's line ids. */
1551
+ readonly memberNodeId: string;
1552
+ /** The member box in the group's extent space, in EMU (origin at the extent's top-left). */
1553
+ readonly frameEmu: Readonly<{
1554
+ x: number;
1555
+ y: number;
1556
+ cx: number;
1557
+ cy: number;
1558
+ }>;
1559
+ /** The member's story, projected at the scaled member size. */
1560
+ readonly story: TextboxStoryProjection;
1561
+ /**
1562
+ * Clockwise turn of the member's text about the member box center, in degrees [0, 360):
1563
+ * the member's `rot`, plus 180 for `flipV`. `flipH` never mirrors the text.
1564
+ */
1565
+ readonly rotationDegrees: number;
1566
+ }
1567
+
1568
+ /** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
1569
+ interface ValidatedImageBytesHandle {
1570
+ readonly registryId: number;
1571
+ readonly resourceKey: string;
1572
+ readonly contentId: string;
1573
+ readonly generation: number;
1574
+ }
1575
+
1576
+ /**
1577
+ * The engine's trust-boundary caps: recursion depth, element counts, and the rest.
1578
+ *
1579
+ * A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
1580
+ * zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
1581
+ * are security ceilings, not performance budgets.
1582
+ */
1583
+ interface ResourceLimits {
1584
+ /** Max nested-structure recursion (tables/shapes/SDT/groups). */
1585
+ readonly maxRecursionDepth: number;
1586
+ /** Max total parsed element count. */
1587
+ readonly maxElementCount: number;
1588
+ /** Max package part count. */
1589
+ readonly maxPartCount: number;
1590
+ /** Max total decompressed bytes (zip-bomb guard). */
1591
+ readonly maxDecompressedBytes: number;
1592
+ /** Max total compressed input bytes. */
1593
+ readonly maxCompressedBytes: number;
1594
+ /** Max decompressed:compressed ratio per entry. */
1595
+ readonly maxCompressionRatio: number;
1596
+ /** In-memory chunk budget for streaming/spooling. */
1597
+ readonly maxChunkBytes: number;
1598
+ /** Max pagination passes before non-convergence is declared. */
1599
+ readonly maxPaginationPasses: number;
1600
+ /** Max queued items in any bounded work queue. */
1601
+ readonly maxQueueDepth: number;
1602
+ }
1603
+ /** Non-disableable hard ceilings: no resolved limit may exceed these. */
1604
+ declare const HARD_CEILINGS: ResourceLimits;
1605
+ /** Finite defaults, all <= their hard ceiling. */
1606
+ declare const DEFAULT_LIMITS: ResourceLimits;
1607
+ /**
1608
+ * Resolve caller overrides into a frozen, always-finite limit set. Each value is
1609
+ * `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
1610
+ * never disable a limit — the hard ceiling always wins.
1611
+ */
1612
+ declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
1613
+ /** Bounded image decode limits (typed-drawings-and-images task 4). */
1614
+ /** Trust-boundary caps specific to image decoding and embedding. */
1615
+ interface ImageResourceLimits {
1616
+ readonly maxEncodedBytes: number;
1617
+ readonly maxDecodedBytes: number;
1618
+ readonly maxPixels: number;
1619
+ readonly maxDimension: number;
1620
+ readonly maxPolygonPoints: number;
1621
+ readonly maxExternalRedirects: number;
1622
+ }
1623
+ /** Image caps nothing can raise past. A caller's override clamps into these. */
1624
+ declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
1625
+ /** The image caps in force when a host configures none. Conservative and finite. */
1626
+ declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
1627
+ /** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
1628
+ declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
1629
+
1630
+ /**
1631
+ * Raster media the decode port measures and any authoring path may write.
1632
+ *
1633
+ * BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
1634
+ * natively, so they need a signature and a structural header and nothing else. BMP is what
1635
+ * older documents carry; WebP is what current Word writes.
1636
+ */
1637
+ type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
1638
+ /**
1639
+ * Vector media painted straight from validated bytes. An `<img>` renders SVG in the
1640
+ * browser's secure static mode — no script, no external subresource loads — so there is
1641
+ * no decode step and no raster buffer sized by a file-supplied number.
1642
+ */
1643
+ type VectorImageMime = 'image/svg+xml';
1644
+ /** Every mime the painter can hand to an `<img>`. */
1645
+ type RenderableImageMime = SupportedImageMime | VectorImageMime;
1646
+ /**
1647
+ * Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
1648
+ * A decode port may rasterize it; without one it paints as a labelled placeholder.
1649
+ */
1650
+ type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
1651
+ /** @internal */
1652
+ type MetafileImageMime = 'image/x-emf' | 'image/x-wmf';
1653
+
1654
+ /**
1655
+ * What is known about one embedded image: validated, refused, or still decoding.
1656
+ *
1657
+ * Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
1658
+ * are authoritative, and bytes that fail them never enter public state.
1659
+ */
1660
+ type ImageResourceState = {
1661
+ readonly kind: 'ready';
1662
+ readonly partName: string;
1663
+ readonly contentId: string;
1664
+ readonly resourceKey: string;
1665
+ readonly validatedHandle: ValidatedImageBytesHandle;
1666
+ readonly mime: RenderableImageMime;
1667
+ readonly pixelWidth: number;
1668
+ readonly pixelHeight: number;
1669
+ readonly dpiX: number;
1670
+ readonly dpiY: number;
1671
+ } | {
1672
+ readonly kind: 'unrenderable';
1673
+ readonly partName: string | null;
1674
+ readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
1675
+ readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
1676
+ } | {
1677
+ readonly kind: 'external';
1678
+ readonly relationshipId: string;
1679
+ readonly sinkSafe: boolean;
1680
+ } | {
1681
+ readonly kind: 'missing';
1682
+ readonly relationshipId: string;
1683
+ } | {
1684
+ readonly kind: 'pending';
1685
+ readonly resourceKey: string;
1686
+ };
1687
+ /**
1688
+ * The injected image decoder.
1689
+ *
1690
+ * A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
1691
+ * supplies its own and the engine never reaches for a browser global.
1692
+ */
1693
+ interface ImageDecodePort {
1694
+ decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits,
1695
+ /** Aborted when the owning lookup/session is disposed. */
1696
+ signal?: AbortSignal): Promise<Readonly<{
1697
+ pixelWidth: number;
1698
+ pixelHeight: number;
1699
+ dpiX: number;
1700
+ dpiY: number;
1701
+ }>>;
1702
+ /**
1703
+ * Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
1704
+ * renderable raster. The returned bytes are untrusted and re-enter the full raster
1705
+ * validation path (sniff, header, pixel caps, decode) before they can become a ready
1706
+ * resource. A null return declines the format and keeps the labelled placeholder; so does
1707
+ * a throw, as `decode-failed`.
1708
+ */
1709
+ convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
1710
+ /** Aborted when the owning lookup/session is disposed. */
1711
+ signal?: AbortSignal): Promise<Readonly<{
1712
+ bytes: Uint8Array;
1713
+ mime: SupportedImageMime;
1714
+ }> | null>;
1715
+ }
1716
+ /** Resolves a relationship id to a validated image resource, or reports why it could not. */
1717
+ interface ImageResourceLookup {
1718
+ readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
1719
+ readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
1720
+ readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
1721
+ readonly liveReferenceCount: (partName: string) => number;
1722
+ readonly dispose: () => void;
1723
+ }
1724
+ /** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
1725
+ declare const MAX_SVG_SNIFF_BYTES = 512;
1726
+ /** A raster header that passed structural validation: its real MIME type and pixel extent. */
1727
+ interface ValidatedRasterHeader {
1728
+ readonly pixelWidth: number;
1729
+ readonly pixelHeight: number;
1730
+ /** Horizontal physical density when bounded header metadata supplies it. */
1731
+ readonly dpiX?: number;
1732
+ /** Vertical physical density when bounded header metadata supplies it. */
1733
+ readonly dpiY?: number;
1734
+ }
1735
+ /** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
1736
+ declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
1737
+ /** Signature sniffing — authoritative over declared content type. */
1738
+ declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
1739
+ /** Structural PNG IHDR validation before decode. */
1740
+ declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
1741
+ /** Structural GIF logical screen descriptor validation before decode. */
1742
+ declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
1743
+ /** Bounded JPEG marker scan through the first supported SOF marker. */
1744
+ declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
1745
+ /**
1746
+ * Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
1747
+ * first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
1748
+ *
1749
+ * This is metadata for insert and reset-to-natural-size only. Layout uses the authored
1750
+ * `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
1751
+ * and an out-of-range value is clamped rather than refused.
1752
+ */
1753
+ declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
1754
+ /**
1755
+ * Validate a raster image's header structurally and report its real MIME type and extent.
1756
+ *
1757
+ * Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
1758
+ * bytes is caught here rather than at decode.
1759
+ */
1760
+ declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
1761
+ /** Package-wide live drawing references to a media part name. */
1762
+ declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
1763
+ /** How the image cache decodes, and what it will spend doing so. */
1764
+ interface CreateImageResourceCacheOptions {
1765
+ readonly limits?: Partial<ImageResourceLimits>;
1766
+ readonly decodePort: ImageDecodePort;
1767
+ }
1768
+ /**
1769
+ * Derived cache for one immutable package snapshot. Registry identity is
1770
+ * `(package snapshot, decodePort object, normalized limits)` — the first caller
1771
+ * never imposes its decoder or limits on later callers with different options.
1772
+ */
1773
+ declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
1774
+ /** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
1775
+ /** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
1776
+ declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
1777
+
1778
+ /**
1779
+ * Plain text fitted to a floating shape box, painted with one fill and an optional outline.
1780
+ *
1781
+ * @internal
1782
+ */
1783
+ interface LegacyTextArtProjection {
1784
+ readonly text: string;
1785
+ readonly fontFamily: string;
1786
+ readonly bold: boolean;
1787
+ readonly italic: boolean;
1788
+ /** `RRGGBB`, or null when the shape is not filled. */
1789
+ readonly fillHex: string | null;
1790
+ readonly fillAlpha: number;
1791
+ /** `RRGGBB`, or null when the shape is not stroked. */
1792
+ readonly strokeHex: string | null;
1793
+ readonly strokeAlpha: number;
1794
+ readonly strokeWidthPt: number;
1795
+ /** Clockwise rotation about the box centre, in [0, 360). */
1796
+ readonly rotationDegrees: number;
1797
+ /** `trim`: the ink fills the whole box, with no text inset. */
1798
+ readonly trim?: true;
1799
+ /**
1800
+ * Data an installed text art layout (`DrawingRenderers.textArtLayout`) reads: plain JSON
1801
+ * values, so equal projections stay equal. The engine never reads it.
1802
+ */
1803
+ readonly renderData?: unknown;
1804
+ }
1805
+
1806
+ /**
1807
+ * A chart plot type. A classic chart names it by its element without the `Chart` suffix:
1808
+ * column and bar charts are both `bar`, and `ofPie` is a pie-of-pie or bar-of-pie chart. A
1809
+ * chartex chart names it by its series layout: `waterfall`, `funnel`, `boxWhisker`,
1810
+ * `treemap`, `sunburst` and `regionMap` by their layout id, `histogram` for a clustered
1811
+ * column series, and `pareto` for a Pareto chart (a clustered column series with its
1812
+ * Pareto line).
1813
+ *
1814
+ * @public
1815
+ */
1816
+ type DrawingChartPlotType = 'area' | 'area3D' | 'bar' | 'bar3D' | 'bubble' | 'doughnut' | 'line' | 'line3D' | 'ofPie' | 'pie' | 'pie3D' | 'radar' | 'scatter' | 'stock' | 'surface' | 'surface3D' | 'waterfall' | 'funnel' | 'histogram' | 'pareto' | 'boxWhisker' | 'treemap' | 'sunburst' | 'regionMap';
1817
+ /**
1818
+ * How the page shows a chart: `chart` when the installed chart renderer draws it,
1819
+ * `fallback` when it shows the content saved in its `mc:AlternateContent` fallback (a
1820
+ * picture, a shape, a group or VML), and `placeholder` when it shows the labeled chart
1821
+ * placeholder.
1822
+ *
1823
+ * @public
1824
+ */
1825
+ type DrawingChartShownAs = 'chart' | 'fallback' | 'placeholder';
1826
+ /**
1827
+ * The title and plot types of a chart, as text, and how the page shows it.
1828
+ *
1829
+ * A drawing record carries it as `chart` whenever the drawing holds a chart whose chart part
1830
+ * can be read, in each of the three states that `shownAs` names. A visible drawing in a
1831
+ * skipped `mc:Choice` can retain a placeholder when its bounds are usable. Chart metadata
1832
+ * is present only when the projection resolves the chart part.
1833
+ *
1834
+ * @public
1835
+ */
1836
+ interface DrawingChartSummary {
1837
+ /**
1838
+ * The title the chart shows, as plain text: its own title, typed or from a cell, or the name
1839
+ * of its only series for an automatic title. Null when it shows none, and when a title with
1840
+ * no text of its own sits on a chart with several series. Runs of white space collapse to one
1841
+ * space, and the text is cut to at most 200 UTF-16 code units.
1842
+ *
1843
+ * A chartex chart (waterfall, funnel, histogram, Pareto, box and whisker, treemap, sunburst,
1844
+ * region map) reads only its own title text. Its title is null when the title element has
1845
+ * no text of its own and the chart shows its default caption, and a chartex chart never uses
1846
+ * a series name as an automatic title.
1847
+ */
1848
+ readonly title: string | null;
1849
+ /**
1850
+ * The chart's plot types in document order; a classic combination chart has more than one.
1851
+ * A chartex chart reports exactly one plot type, or none when its series layout is not one
1852
+ * of the chartex types.
1853
+ */
1854
+ readonly plotTypes: readonly DrawingChartPlotType[];
1855
+ /**
1856
+ * How the page shows the chart. The projection sets it from the renderers installed when
1857
+ * the document opened: `chart` (the record has a `vectorShape`), `fallback` (the record
1858
+ * paints the fallback content, such as a picture `resource`), or `placeholder` (the record
1859
+ * has `placeholderGraphicKind` `'chart'`). Read this field rather than the other fields.
1860
+ */
1861
+ readonly shownAs: DrawingChartShownAs;
1311
1862
  }
1312
1863
 
1313
1864
  /** Only generated, escaped SVG and relationship slots; never authored markup. */
@@ -1321,6 +1872,11 @@ interface LegacyGraphicProjection {
1321
1872
  readonly width: number;
1322
1873
  readonly height: number;
1323
1874
  readonly fragments: readonly LegacyGraphicFragment[];
1875
+ /**
1876
+ * The relationship of the one uncropped picture that fills the whole graphic, when that is
1877
+ * all it paints. The graphic then resolves to that picture, which every output can paint.
1878
+ */
1879
+ readonly soleImageRelationshipId?: string;
1324
1880
  }
1325
1881
 
1326
1882
  /** Picture color adjustments shared by projection, layout, and paint.
@@ -1335,26 +1891,6 @@ interface DrawingImageEffects {
1335
1891
  readonly bilevel?: number;
1336
1892
  }
1337
1893
 
1338
- /** One text box member of a drawing group. */
1339
- interface GroupTextboxProjection {
1340
- /** Canonical node id of the member `wps:wsp`; namespaces the story's line ids. */
1341
- readonly memberNodeId: string;
1342
- /** The member box in the group's extent space, in EMU (origin at the extent's top-left). */
1343
- readonly frameEmu: Readonly<{
1344
- x: number;
1345
- y: number;
1346
- cx: number;
1347
- cy: number;
1348
- }>;
1349
- /** The member's story, projected at the scaled member size. */
1350
- readonly story: TextboxStoryProjection;
1351
- /**
1352
- * Clockwise turn of the member's text about the member box center, in degrees [0, 360):
1353
- * the member's `rot`, plus 180 for `flipV`. `flipH` never mirrors the text.
1354
- */
1355
- readonly rotationDegrees: number;
1356
- }
1357
-
1358
1894
  /** The relationship namespace `r:id` lives in. */
1359
1895
  declare const OFFICE_RELATIONSHIP_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
1360
1896
  /** The `Type` a hyperlink relationship declares. */
@@ -1448,6 +1984,8 @@ interface DrawingDiagnostic {
1448
1984
  readonly nodeId: string;
1449
1985
  readonly detail: string | null;
1450
1986
  }
1987
+ /** @internal */
1988
+ declare function isElement(node: OoxmlNode): node is OoxmlElement;
1451
1989
 
1452
1990
  /** One picture painted as a member of a drawing group. */
1453
1991
  interface GroupPictureProjection {
@@ -1466,150 +2004,270 @@ interface GroupPictureProjection {
1466
2004
  cx: number;
1467
2005
  cy: number;
1468
2006
  }>;
1469
- /** Canonical node id of the `pic:pic` member. The vector projection skips it. */
1470
- readonly memberNodeId: string;
1471
- /**
1472
- * Whether the group is the chosen branch of a run-level `mc:AlternateContent`. Layout then
1473
- * drops the whole group when the picture resource fails, as the projection drops other
1474
- * MC payloads it cannot draw.
1475
- */
1476
- readonly alternateContent: boolean;
2007
+ /** Canonical node id of the `pic:pic` member. The vector projection skips it. */
2008
+ readonly memberNodeId: string;
2009
+ /**
2010
+ * Whether the group is the chosen branch of a run-level `mc:AlternateContent`. Layout then
2011
+ * drops the whole group when the picture resource fails, as the projection drops other
2012
+ * MC payloads it cannot draw.
2013
+ */
2014
+ readonly alternateContent: boolean;
2015
+ /** The ring that clips the picture, in the unit square of the extent; absent for a box. */
2016
+ readonly clipUnit?: readonly Readonly<{
2017
+ x: number;
2018
+ y: number;
2019
+ }>[];
2020
+ }
2021
+
2022
+ /** @internal */
2023
+ declare const DIAGRAM_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/diagram";
2024
+ /** The parts one diagram drawing renders from. @internal */
2025
+ interface DiagramParts {
2026
+ /** The data model root (`dgm:dataModel`): background and outline of the whole diagram. */
2027
+ readonly dataModel: OoxmlElement;
2028
+ /** The saved drawing root (`dsp:drawing`), or null when the package has none. */
2029
+ readonly drawing: OoxmlElement | null;
2030
+ /** Canonical name of the saved drawing part, for diagnostics and cache keys. */
2031
+ readonly drawingPartName: string | null;
2032
+ /** Canonical name of the data model part. */
2033
+ readonly dataPartName: string;
2034
+ /** The layout definition root (`dgm:layoutDef`), or null. */
2035
+ readonly layoutDef: OoxmlElement | null;
2036
+ /** The quick style root (`dgm:styleDef`), or null. */
2037
+ readonly styleDef: OoxmlElement | null;
2038
+ /** The colours root (`dgm:colorsDef`), or null. */
2039
+ readonly colorsDef: OoxmlElement | null;
2040
+ /** The theme's body (minor) Latin font, which diagram text uses unless it names one. */
2041
+ readonly fontFamily: string;
2042
+ }
2043
+ /**
2044
+ * Resolves the parts behind one `dgm:relIds` element of the owner story part. The same
2045
+ * resolver answers the chart part behind a `c:chart` element through `chart`, so the drawing
2046
+ * projection threads one resolver for every part-backed graphic.
2047
+ *
2048
+ * @internal
2049
+ */
2050
+ interface DiagramPartResolver {
2051
+ /** The diagram parts behind one `dgm:relIds` element, or null when they do not resolve. */
2052
+ (relIds: OoxmlElement): DiagramParts | null;
2053
+ /** The chart part behind one `c:chart` element of the same story part. */
2054
+ readonly chart?: ChartPartResolver;
2055
+ /** The chartex part behind one `cx:chart` element of the same story part. */
2056
+ readonly chartex?: ChartexPartResolver;
2057
+ }
2058
+
2059
+ /**
2060
+ * Whether a drawing sits in the text flow or is positioned against a frame.
2061
+ *
2062
+ * The distinction that decides everything downstream: an inline drawing occupies a character
2063
+ * position, while an anchored one has offsets relative to a page, margin or column.
2064
+ */
2065
+ type DrawingKind = 'inline' | 'anchored';
2066
+ /** Nine Word wrap menu targets (inline plus eight floating modes). @public */
2067
+ type ImageWrapTarget = 'inline' | 'square' | 'squareLeft' | 'squareRight' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
2068
+ /** Every text-wrap mode a drawing may be set to, including `inline`. */
2069
+ declare const IMAGE_WRAP_TARGETS: readonly ImageWrapTarget[];
2070
+ type DrawingWrapElement = 'none' | 'square' | 'tight' | 'through' | 'topAndBottom';
2071
+ type DrawingHorizontalReferenceFrame = 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
2072
+ type DrawingVerticalReferenceFrame = 'bottomMargin' | 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin';
2073
+ /** `a:srcRect` — how much of each edge of the source image is cropped away, as fractions. */
2074
+ interface SourceCrop {
2075
+ readonly left: number;
2076
+ readonly top: number;
2077
+ readonly right: number;
2078
+ readonly bottom: number;
2079
+ }
2080
+ interface DrawingTransform {
2081
+ readonly rotationDegrees: number;
2082
+ readonly flipHorizontal: boolean;
2083
+ readonly flipVertical: boolean;
2084
+ /** Source `a:off` in EMU; defaults to origin when absent. */
2085
+ readonly offsetEmu: Readonly<{
2086
+ x: number;
2087
+ y: number;
2088
+ }>;
2089
+ /** Source `a:ext` in EMU; zero falls back to `wp:extent` at geometry time. */
2090
+ readonly extentEmu: Readonly<{
2091
+ cx: number;
2092
+ cy: number;
2093
+ }>;
1477
2094
  }
1478
-
1479
2095
  /**
1480
- * Why a zip was refused at the trust boundary.
2096
+ * What a drawing refuses: selection, movement, resizing, aspect change.
1481
2097
  *
1482
- * `too-large` and `too-many-entries` are the zip-bomb guards; `bad-name` catches path traversal —
1483
- * an entry with `..` or a leading `/` is rejected rather than normalized.
2098
+ * Read and honoured rather than advisory — chrome that offered a handle the store will refuse
2099
+ * would promise an edit that cannot happen.
1484
2100
  */
1485
- type ZipRejection = 'too-many-entries' | 'too-large' | 'bad-name' | 'inflate-error';
1486
- /** Archive caps: entry count, total decompressed bytes, and the decompression ratio. */
1487
- interface ZipLimits {
1488
- readonly maxEntries: number;
1489
- /** Max total UNCOMPRESSED bytes across the archive. */
1490
- readonly maxTotalBytes: number;
1491
- /**
1492
- * Max ratio of the archive's total declared uncompressed bytes to the archive's own byte
1493
- * length (zip-bomb guard). Applies once that total exceeds 8 MiB, so a small archive is
1494
- * never refused for compressing well.
1495
- */
1496
- readonly maxRatio?: number;
2101
+ interface DrawingLocks {
2102
+ readonly select: boolean;
2103
+ readonly move: boolean;
2104
+ readonly resize: boolean;
2105
+ readonly changeAspect: boolean;
2106
+ }
2107
+ interface DrawingLocksInput {
2108
+ readonly select?: boolean;
2109
+ readonly move?: boolean;
2110
+ readonly resize?: boolean;
2111
+ readonly changeAspect?: boolean;
1497
2112
  }
1498
- /** The archive caps in force when a host configures none. Conservative and finite. */
1499
- declare const DEFAULT_ZIP_LIMITS: ZipLimits;
1500
- /** The read entries, or the typed refusal. Never throws — the bytes are untrusted. */
1501
- type ZipReadResult = {
1502
- readonly ok: true;
1503
- readonly entries: ReadonlyMap<string, Uint8Array>;
1504
- } | {
1505
- readonly ok: false;
1506
- readonly reason: ZipRejection;
1507
- readonly detail?: string;
1508
- readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
1509
- };
1510
2113
  /**
1511
- * Inflate a ZIP archive with bounds + OPC name normalization. Entry name, count, archive
1512
- * ratio, and total-uncompressed-size limits are enforced BEFORE each entry is decompressed
1513
- * (via fflate's pre-inflation filter), so a zip bomb or a traversal name is rejected without
1514
- * ever being inflated. Keys are canonical part names.
2114
+ * An anchored drawing's position: offsets, and the frames they are relative to.
1515
2115
  *
1516
- * The budgets count each entry's DECLARED sizes, and the declared size is also a hard cap on
1517
- * what the entry may produce: fflate inflates into a buffer of exactly `originalSize` bytes
1518
- * and never grows it, so an entry whose stream holds more than it declares is truncated (or
1519
- * refused as `inflate-error`), never expanded past its budget. A stored entry is copied at
1520
- * its compressed size, so the larger of its two declared sizes is what counts.
2116
+ * The relative-to bases matter as much as the offsets. Writing an offset without preserving its
2117
+ * base re-anchors the drawing against a different reference and moves it somewhere nobody asked.
1521
2118
  */
1522
- declare function readZip(bytes: Uint8Array, limits?: ZipLimits): ZipReadResult;
1523
- /** Deflate a set of canonical-part-name -> bytes into a ZIP archive. Every part name
1524
- * is re-validated through the OPC normalization profile before writing, so a
1525
- * traversal/encoded/normalized-alias name from an untrusted serialized model can
1526
- * never be smuggled into a ZIP entry (write-side path-traversal guard). */
1527
- declare function writeZip(entries: ReadonlyMap<string, Uint8Array>): Uint8Array;
1528
-
1529
- /** One `<Default>`: a file extension mapped to a content type. */
1530
- interface DefaultRecord {
1531
- readonly extension: string;
1532
- readonly contentType: string;
1533
- readonly order: number;
2119
+ interface DrawingPositionInput {
2120
+ /**
2121
+ * `'simple'` when `@simplePos="1"`: `horizontalEmu` / `verticalEmu` are authoritative
2122
+ * `wp:simplePos` x/y. `'frame'` (default) uses positionH/V relative frames.
2123
+ */
2124
+ readonly mode?: 'frame' | 'simple';
2125
+ readonly horizontalEmu?: number;
2126
+ readonly verticalEmu?: number;
2127
+ readonly relativeToH?: DrawingHorizontalReferenceFrame;
2128
+ readonly relativeToV?: DrawingVerticalReferenceFrame;
1534
2129
  }
1535
- /** One `<Override>`: a specific part name mapped to a content type. Beats any Default. */
1536
- interface OverrideRecord {
1537
- readonly partName: string;
1538
- readonly contentType: string;
1539
- readonly order: number;
2130
+ interface DrawingProjection {
2131
+ readonly drawingNodeId: string;
2132
+ readonly ownerPartName: string;
2133
+ readonly kind: DrawingKind;
2134
+ readonly relationshipId: string | null;
2135
+ readonly docPrId: number | null;
2136
+ readonly name: string;
2137
+ readonly title: string;
2138
+ readonly description: string;
2139
+ readonly hyperlinkHref: string | null;
2140
+ readonly hidden: boolean;
2141
+ readonly extentEmu: Readonly<{
2142
+ cx: number;
2143
+ cy: number;
2144
+ }>;
2145
+ readonly effectExtentEmu: Readonly<{
2146
+ top: number;
2147
+ right: number;
2148
+ bottom: number;
2149
+ left: number;
2150
+ }>;
2151
+ readonly inlineDistancesEmu: Readonly<{
2152
+ top: number;
2153
+ right: number;
2154
+ bottom: number;
2155
+ left: number;
2156
+ }>;
2157
+ readonly wrap: ImageWrapTarget;
2158
+ readonly wrapGeometry: DrawingWrapProjection | null;
2159
+ readonly position: DrawingPositionProjection | null;
2160
+ readonly anchor: Readonly<{
2161
+ simplePos: boolean;
2162
+ relativeHeight: number;
2163
+ behindDocument: boolean;
2164
+ layoutInCell: boolean;
2165
+ allowOverlap: boolean;
2166
+ }> | null;
2167
+ readonly picture: PictureProjection | null;
2168
+ readonly vectorShape: VectorShapeProjection | null;
2169
+ /** The picture member of a `wpg:wgp` group; `picture` stays null for a group. */
2170
+ readonly groupPicture: GroupPictureProjection | null;
2171
+ /**
2172
+ * The group's other picture members, in document order. Each paints above `groupPicture`
2173
+ * and the ones before it, and below `vectorShape`. Absent when the group has one picture.
2174
+ */
2175
+ readonly groupPictureLayers?: readonly GroupPictureProjection[];
2176
+ readonly textboxStory: TextboxStoryProjection | null;
2177
+ /** Text box members of a `wpg:wgp` group, laid out read-only; absent when none has text. */
2178
+ readonly groupTextboxes?: readonly GroupTextboxProjection[];
2179
+ /** The title and plot types of a chart: rendered, shown by its fallback, or a placeholder. */
2180
+ readonly chartSummary?: DrawingChartSummary;
2181
+ /**
2182
+ * The picture saved in the `mc:Fallback` of a chart's `mc:AlternateContent`, whichever
2183
+ * branch the page shows, for an output that exports a chart as its saved picture. Absent
2184
+ * when the fallback is not a picture that paints.
2185
+ */
2186
+ readonly chartFallbackPicture?: PictureProjection;
2187
+ /** Read-only preview of the supported native VML subset; the canonical XML is untouched. */
2188
+ readonly legacyGraphic?: LegacyGraphicProjection;
2189
+ /** Floating VML text art (a text watermark), fitted to the box by layout. */
2190
+ readonly textArt?: LegacyTextArtProjection;
2191
+ /** A horizontal rule; layout widens it to its line and gives it its `vectorShape`. */
2192
+ readonly horizontalRule?: HorizontalRuleProjection;
2193
+ readonly locks: DrawingLocks;
2194
+ readonly effects: DrawingImageEffects;
2195
+ readonly compatibilityBranchNodeId: string | null;
2196
+ readonly diagnostics: readonly DrawingDiagnostic[];
2197
+ /** Layout-only wrap area of an MC payload that cannot paint (`wrapFootprintProjection`). */
2198
+ readonly footprintOnly?: true;
1540
2199
  }
1541
- /**
1542
- * The authored `[Content_Types].xml` records, in significant order.
1543
- *
1544
- * Retained rather than collapsed into a lookup, because the file's lexical form and ordering are
1545
- * part of what a lossless save re-emits.
1546
- */
1547
- interface ContentTypeRecords {
1548
- readonly defaults: readonly DefaultRecord[];
1549
- readonly overrides: readonly OverrideRecord[];
2200
+ interface DrawingAccessibility {
2201
+ /**
2202
+ * The record takes part in layout only, for example the wrap area of a payload that cannot
2203
+ * paint. Outputs must not paint, hit-test, select, link, or export it.
2204
+ */
2205
+ readonly hidden: boolean;
2206
+ readonly decorative: boolean;
2207
+ readonly label: string | null;
1550
2208
  }
1551
- /**
1552
- * Why content-type records could not be indexed.
1553
- *
1554
- * All fail CLOSED: conflicting Defaults on one extension, duplicate normalized Override names, or
1555
- * invalid MIME syntax are refused rather than resolved by picking one.
1556
- */
1557
- type ContentTypeError = {
1558
- readonly code: 'invalid-mime';
1559
- readonly value: string;
1560
- } | {
1561
- readonly code: 'conflicting-default';
1562
- readonly extension: string;
1563
- } | {
1564
- readonly code: 'duplicate-override';
1565
- readonly partName: string;
1566
- } | {
1567
- readonly code: 'invalid-override-name';
1568
- readonly partName: string;
1569
- } | {
1570
- readonly code: 'too-many-records';
1571
- readonly limit: number;
1572
- };
1573
- /** Whether a string is syntactically a MIME type. Syntax only — no registry lookup. */
1574
- declare function isValidMime(value: string): boolean;
1575
- /** ASCII-case-insensitive extension key (leading dot removed; ASCII-only fold). */
1576
- declare function extensionKey(extension: string): string;
1577
- /** The resolved lookup: Override by case-folded part name, Default by case-insensitive extension. */
1578
- interface ContentTypeIndex {
1579
- /** ext key -> single MIME (identical duplicates collapsed). */
1580
- readonly defaults: ReadonlyMap<string, string>;
1581
- /** case-folded part name -> MIME. */
1582
- readonly overrides: ReadonlyMap<string, string>;
2209
+ interface DrawingPositionProjection {
2210
+ readonly simplePosition: Readonly<{
2211
+ xEmu: number;
2212
+ yEmu: number;
2213
+ }>;
2214
+ readonly horizontal: Readonly<{
2215
+ relativeFrom: DrawingHorizontalReferenceFrame;
2216
+ align: string | null;
2217
+ offsetEmu: number | null;
2218
+ }>;
2219
+ readonly vertical: Readonly<{
2220
+ relativeFrom: DrawingVerticalReferenceFrame;
2221
+ align: string | null;
2222
+ offsetEmu: number | null;
2223
+ }>;
2224
+ }
2225
+ interface DrawingWrapProjection {
2226
+ readonly element: DrawingWrapElement;
2227
+ readonly textSide: 'bothSides' | 'left' | 'right' | 'largest';
2228
+ readonly distancesEmu: Readonly<{
2229
+ top: number;
2230
+ right: number;
2231
+ bottom: number;
2232
+ left: number;
2233
+ }>;
2234
+ readonly polygon: readonly Readonly<{
2235
+ x: number;
2236
+ y: number;
2237
+ }>[];
2238
+ }
2239
+ interface PictureProjection {
2240
+ readonly embeddedRelationshipId: string | null;
2241
+ readonly linkedRelationshipId: string | null;
2242
+ readonly crop: SourceCrop;
2243
+ readonly fillMode: 'stretch' | 'tile';
2244
+ readonly transform: DrawingTransform;
2245
+ readonly presetGeometry: string | null;
2246
+ /** The clip ring of non-rectangular geometry, in the unit square of the extent. */
2247
+ readonly clipUnit?: readonly Readonly<{
2248
+ x: number;
2249
+ y: number;
2250
+ }>[];
2251
+ /** Effects that change how the picture itself paints: a reflection, soft edges. */
2252
+ readonly frameEffects?: PictureFrameEffects;
1583
2253
  }
1584
- /** The built index, or the conflict that made it impossible. */
1585
- type IndexResult = {
1586
- readonly ok: true;
1587
- readonly index: ContentTypeIndex;
1588
- } | {
1589
- readonly ok: false;
1590
- readonly error: ContentTypeError;
1591
- };
1592
- /**
1593
- * Build a resolved content-type index, failing closed on conflict/duplicate/MIME
1594
- * errors. `maxRecords` bounds the combined record count (N/N+1 gate).
1595
- */
1596
- declare function buildContentTypeIndex(records: ContentTypeRecords, maxRecords?: number): IndexResult;
1597
2254
  /**
1598
- * A part's content type, or why it has none.
2255
+ * Project one `w:drawing` into the resolved shape layout and chrome read.
1599
2256
  *
1600
- * An orphan record never determines a part's type — a Default with no matching part is preserved
1601
- * inertly rather than applied.
2257
+ * Bounded throughout: extents, crops and nesting all come from a file. Returns a projection that
2258
+ * reports `hidden` and its locks rather than throwing, so an unusable drawing degrades to
2259
+ * something the surface can skip.
1602
2260
  */
1603
- type ResolveResult = {
1604
- readonly ok: true;
1605
- readonly contentType: string;
1606
- readonly source: 'override' | 'default';
1607
- } | {
1608
- readonly ok: false;
1609
- readonly reason: 'unknown';
1610
- };
1611
- /** Resolve a part's content type: Override wins over Default; else unknown. */
1612
- declare function resolveContentType(index: ContentTypeIndex, partName: string): ResolveResult;
2261
+ declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
2262
+ ownerPartName: string;
2263
+ supportedMcRequires: ReadonlySet<string>;
2264
+ limits: DrawingProjectionLimits;
2265
+ namespaceScope?: ReadonlyMap<string, string>;
2266
+ resolveRelationship?: RelationshipTargetResolver;
2267
+ resolveSchemeColor?: ShapeSchemeColorResolver;
2268
+ resolveStyleMatrixReference?: ShapeStyleMatrixResolver;
2269
+ resolveDiagramParts?: DiagramPartResolver;
2270
+ }>): DrawingProjection | null;
1613
2271
 
1614
2272
  /** Caps applied while loading a package: zip, XML, part count and relationship count. */
1615
2273
  interface OoxmlPackageLimits {
@@ -1699,193 +2357,376 @@ declare function writeOoxmlPackage(pkg: OoxmlPackage): Uint8Array;
1699
2357
  /** Replace one part's tree, returning a new package. Pure, like the tree edits themselves. */
1700
2358
  declare function withPart(pkg: OoxmlPackage, part: OoxmlPart): OoxmlPackage;
1701
2359
 
1702
- /**
1703
- * Whether a drawing sits in the text flow or is positioned against a frame.
1704
- *
1705
- * The distinction that decides everything downstream: an inline drawing occupies a character
1706
- * position, while an anchored one has offsets relative to a page, margin or column.
1707
- */
1708
- type DrawingKind = 'inline' | 'anchored';
1709
- /** Nine Word wrap menu targets (inline plus eight floating modes). @public */
1710
- type ImageWrapTarget = 'inline' | 'square' | 'squareLeft' | 'squareRight' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
1711
- /** Every text-wrap mode a drawing may be set to, including `inline`. */
1712
- declare const IMAGE_WRAP_TARGETS: readonly ImageWrapTarget[];
1713
- type DrawingWrapElement = 'none' | 'square' | 'tight' | 'through' | 'topAndBottom';
1714
- type DrawingHorizontalReferenceFrame = 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
1715
- type DrawingVerticalReferenceFrame = 'bottomMargin' | 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin';
1716
- /** `a:srcRect` — how much of each edge of the source image is cropped away, as fractions. */
1717
- interface SourceCrop {
1718
- readonly left: number;
1719
- readonly top: number;
1720
- readonly right: number;
1721
- readonly bottom: number;
2360
+ /** A text watermark as the package stores it. */
2361
+ interface PackageTextWatermark {
2362
+ readonly kind: 'text';
2363
+ readonly text: string;
2364
+ readonly fontFamily: string;
2365
+ /** Null for Auto size, which fits the text to the shape box. */
2366
+ readonly fontSizePt: number | null;
2367
+ readonly bold: boolean;
2368
+ readonly italic: boolean;
2369
+ /** `RRGGBB`. */
2370
+ readonly colorHex: string;
2371
+ /** Fill opacity in [0, 1]; the dialog's Transparency is `1 - opacity`. */
2372
+ readonly opacity: number;
2373
+ readonly diagonal: boolean;
2374
+ readonly widthPt: number;
2375
+ readonly heightPt: number;
2376
+ }
2377
+ /** A picture watermark as the package stores it. */
2378
+ interface PackagePictureWatermark {
2379
+ readonly kind: 'picture';
2380
+ readonly washout: boolean;
2381
+ readonly widthPt: number;
2382
+ readonly heightPt: number;
2383
+ }
2384
+ /** One section's shape size, in points. */
2385
+ interface PackageWatermarkSize {
2386
+ readonly widthPt: number;
2387
+ readonly heightPt: number;
2388
+ }
2389
+ /**
2390
+ * A write may size the shape per section, indexed like the body's sections: a header part
2391
+ * takes the size of the first section that shows it, so a landscape section's watermark
2392
+ * fits its own text area. A missing or unusable entry falls back to `widthPt`/`heightPt`.
2393
+ */
2394
+ interface PackageWatermarkSectionSizes {
2395
+ readonly sectionSizes?: readonly (PackageWatermarkSize | null)[];
2396
+ }
2397
+ /** A picture watermark write carries the image bytes. */
2398
+ type PackageWatermarkWrite = (PackageTextWatermark & PackageWatermarkSectionSizes) | (PackagePictureWatermark & PackageWatermarkSectionSizes & {
2399
+ readonly image: {
2400
+ readonly bytes: Uint8Array;
2401
+ readonly mime: SupportedImageMime;
2402
+ };
2403
+ });
2404
+
2405
+ /**
2406
+ * How a tracked change is addressed: `@w:id`, `@w:author` and `@w:date` together, within a
2407
+ * part.
2408
+ *
2409
+ * All of them, always. `@w:id` is unique only within a part, so an id alone names two
2410
+ * revisions in any package with a header or a comments part — and it is not author-scoped
2411
+ * either, so `(part, id)` would merge two authors' distinct revisions. One logical revision is
2412
+ * also deliberately many elements sharing an id, as a tracked row insertion is, which no
2413
+ * uniqueness rule could express.
2414
+ */
2415
+ interface RevisionAddress {
2416
+ readonly id: string;
2417
+ readonly author: string;
2418
+ /** Absent when the file wrote no `@w:date`; part of the identity either way. */
2419
+ readonly date?: string;
2420
+ }
2421
+ /** The author and timestamp a tracked edit is recorded under. */
2422
+ interface RevisionAttributionInput {
2423
+ readonly author: string;
2424
+ /** ISO-8601. Omitted writes no `@w:date`. */
2425
+ readonly date?: string;
2426
+ }
2427
+
2428
+ type AutomationTableMutation = {
2429
+ readonly kind: 'insertRows';
2430
+ readonly rowId: string;
2431
+ readonly location: 'before' | 'after';
2432
+ readonly count: number;
2433
+ readonly values?: readonly (readonly string[])[];
2434
+ } | {
2435
+ readonly kind: 'values';
2436
+ readonly values: readonly (readonly string[])[];
2437
+ } | {
2438
+ readonly kind: 'addRows' | 'addColumns';
2439
+ readonly location: 'start' | 'end';
2440
+ readonly count: number;
2441
+ readonly values?: readonly (readonly string[])[];
2442
+ } | {
2443
+ readonly kind: 'deleteRows' | 'deleteColumns';
2444
+ readonly index: number;
2445
+ readonly count: number;
2446
+ } | {
2447
+ /** Merge the rectangle from one cell to another, by row and in-row cell index. */
2448
+ readonly kind: 'mergeCells';
2449
+ readonly topRow: number;
2450
+ readonly firstCell: number;
2451
+ readonly bottomRow: number;
2452
+ readonly lastCell: number;
2453
+ } | {
2454
+ readonly kind: 'splitCell';
2455
+ readonly cellId: string;
2456
+ readonly rowCount: number;
2457
+ readonly columnCount: number;
2458
+ } | {
2459
+ readonly kind: 'delete';
2460
+ } | {
2461
+ readonly kind: 'properties';
2462
+ readonly styleId?: string;
2463
+ readonly headerRowCount?: number;
2464
+ } | {
2465
+ readonly kind: 'cell';
2466
+ readonly cellId: string;
2467
+ readonly value?: string;
2468
+ readonly columnWidth?: number;
2469
+ readonly shadingColor?: string;
2470
+ readonly verticalAlignment?: 'Top' | 'Center' | 'Bottom';
2471
+ };
2472
+
2473
+ /** Select one declared entry of a legacy Word dropdown form field. */
2474
+ interface SetLegacyDropdownOp {
2475
+ readonly op: 'setLegacyDropdown';
2476
+ readonly paragraphId: string;
2477
+ readonly fieldNodeId: string;
2478
+ readonly selectedIndex: number;
2479
+ }
2480
+
2481
+ interface SetFieldCodeOp {
2482
+ readonly op: 'setFieldCode';
2483
+ readonly paragraphId: string;
2484
+ readonly fieldNodeId: string;
2485
+ readonly code: string;
2486
+ }
2487
+
2488
+ /**
2489
+ * Insert an allowlisted page-number complex field at a UTF-16 offset.
2490
+ *
2491
+ * `PAGE_X_OF_Y` is PAGE + literal " of " + NUMPAGES in one undoable op. Non-page
2492
+ * instructions are refused — never authored through this path.
2493
+ */
2494
+ interface InsertPageFieldOp {
2495
+ readonly op: 'insertPageField';
2496
+ readonly paragraphId: string;
2497
+ readonly offset: number;
2498
+ readonly field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y';
2499
+ /**
2500
+ * Write this as a TRACKED insertion, on the same terms as `insertText`.
2501
+ *
2502
+ * The whole field — every `w:fldChar`, the instruction, the `PAGE_X_OF_Y` literal —
2503
+ * goes into ONE `w:ins`, because the field is one proposal: rejecting it must take
2504
+ * the complete atom back, never leave a `begin` standing without its `end`.
2505
+ */
2506
+ readonly revision?: RevisionAttributionInput;
2507
+ }
2508
+ /**
2509
+ * Insert one complex field with an empty cached result at a UTF-16 offset.
2510
+ *
2511
+ * The instruction must be one that `inertFieldInstruction` admits: a page number, a reference
2512
+ * to a bookmark, note, or style, a sequence number, or a date. It is written as text and never
2513
+ * evaluated. Every other instruction refuses with `invalidArgs`.
2514
+ */
2515
+ interface InsertComplexFieldOp {
2516
+ readonly op: 'insertComplexField';
2517
+ readonly paragraphId: string;
2518
+ readonly offset: number;
2519
+ readonly instruction: string;
2520
+ /** Write the whole field as ONE tracked insertion, on the same terms as `insertText`. */
2521
+ readonly revision?: RevisionAttributionInput;
2522
+ }
2523
+
2524
+ /** Set one field's cached result text. See the module comment for the placements. */
2525
+ interface SetFieldResultOp {
2526
+ readonly op: 'setFieldResult';
2527
+ readonly paragraphId: string;
2528
+ /** The begin `w:fldChar`, or the `w:fldSimple` element. */
2529
+ readonly fieldNodeId: string;
2530
+ /** Plain text. A tab becomes `w:tab`; other control characters refuse. */
2531
+ readonly text: string;
2532
+ /**
2533
+ * The author whose pending insertion holds the field. The result joins that insertion. The
2534
+ * op mints no revision of its own.
2535
+ */
2536
+ readonly revision?: RevisionAttributionInput;
2537
+ }
2538
+
2539
+ /** Insert one inline `m:oMath` and the plain runs beside it. */
2540
+ interface InsertEquationOp {
2541
+ readonly op: 'insertEquation';
2542
+ readonly paragraphId: string;
2543
+ readonly offset: number;
2544
+ /** Plain runs and exactly one inline `m:oMath`, in order. Receive fresh ids at apply. */
2545
+ readonly nodes: readonly OoxmlNode[];
2546
+ /** Model length of `nodes`: their text, plus one for the equation. */
2547
+ readonly length: number;
2548
+ /** Write the nodes as ONE tracked insertion, on the same terms as `insertText`. */
2549
+ readonly revision?: RevisionAttributionInput;
2550
+ }
2551
+
2552
+ type InsertTextOp = {
2553
+ readonly op: 'insertText';
2554
+ readonly paragraphId: string;
2555
+ /** Legacy text form identity for protected filling; never an inline wrapper owner. */
2556
+ readonly textFormFieldId?: string;
2557
+ readonly offset: number;
2558
+ readonly text: string;
2559
+ /**
2560
+ * Write this as a TRACKED insertion, attributed here.
2561
+ *
2562
+ * On the op rather than on the store, so suggesting stays a decision the surface makes
2563
+ * per edit and the write vocabulary stays explicit — a global "everything is tracked
2564
+ * now" flag is exactly what `DocEdits` refuses, because it makes the meaning of an op
2565
+ * depend on state the op does not carry.
2566
+ */
2567
+ readonly revision?: RevisionAttributionInput;
2568
+ /**
2569
+ * When set, the text belongs INSIDE this content control, whatever sits at the offset.
2570
+ *
2571
+ * A boundary offset is owned by the run that starts there, which at a control's trailing
2572
+ * edge is the run after the control — so an offset alone cannot say "append to this field",
2573
+ * the way it cannot say which run of a field result to format (see `targetRunIds`). A
2574
+ * caller that names the control gets the text in the control; one that does not gets the
2575
+ * plain offset rule, which is what a keystroke beside a field means.
2576
+ */
2577
+ readonly inside?: string;
2578
+ /**
2579
+ * Which side of a run BOUNDARY the text joins. Default `'left'` — Word's typing rule:
2580
+ * the next character takes the formatting of the character before the caret.
2581
+ *
2582
+ * `'right'` is for a caller that is not typing but placing text inside the run that
2583
+ * STARTS at the offset — the hyperlink editor rewriting a link's display text, where
2584
+ * landing left of the boundary would put the new text outside the link. Ignored when
2585
+ * the offset falls strictly inside a run, which has no boundary to choose.
2586
+ */
2587
+ readonly bias?: 'left' | 'right';
2588
+ };
2589
+ type DeleteTextOp = {
2590
+ readonly op: 'deleteText';
2591
+ readonly paragraphId: string;
2592
+ /** Legacy text form identity for protected filling; never an inline wrapper owner. */
2593
+ readonly textFormFieldId?: string;
2594
+ readonly start: number;
2595
+ readonly end: number;
2596
+ /** Write this as a TRACKED deletion — the characters stay, wrapped in `w:del`. */
2597
+ readonly revision?: RevisionAttributionInput;
2598
+ };
2599
+
2600
+ /** Editable legacy text input types. Other authored types remain inert. */
2601
+ type TextFormFieldType = 'regular' | 'number' | 'date';
2602
+ /** Options stored in the legacy field definition. Zero means unlimited length. */
2603
+ interface TextFormFieldOptions {
2604
+ readonly type: TextFormFieldType;
2605
+ readonly maxLength: number;
2606
+ readonly format: string;
2607
+ readonly enabled: boolean;
2608
+ }
2609
+ /** Supported format choices for legacy text input fields. @public */
2610
+ declare const TEXT_FORM_FORMATS: {
2611
+ readonly regular: readonly ['', 'Uppercase', 'Lowercase', 'First capital', 'Title case'];
2612
+ readonly number: readonly ['', '0', '0.00', '#,##0', '#,##0.00', '0%', '0.00%'];
2613
+ readonly date: readonly ['', 'M/d/yyyy', 'MM/dd/yyyy', 'd/M/yyyy', 'dd/MM/yyyy', 'yyyy-MM-dd', 'd MMMM yyyy', 'MMMM d, yyyy'];
2614
+ };
2615
+
2616
+ /** A legacy text input in the shared paragraph offset space. */
2617
+ interface TextFormFieldRange {
2618
+ readonly fieldNodeId: string;
2619
+ readonly start: number;
2620
+ readonly end: number;
2621
+ readonly enabled: boolean;
2622
+ readonly defaultText: string;
2623
+ readonly type: string;
2624
+ readonly maxLength: number;
2625
+ readonly format: string;
2626
+ readonly chromeIds: readonly string[];
2627
+ }
2628
+ /** Uses the field parser and offset index; never introduces another inline walk. */
2629
+ declare function textFormFieldsOf(paragraph: OoxmlParagraphNode): readonly TextFormFieldRange[];
2630
+ /** Options edit for an existing legacy text form. */
2631
+ interface SetTextFormFieldDefaultOp {
2632
+ readonly op: 'setTextFormFieldDefault';
2633
+ /** Regional conventions for new date input; defaults to en-US. */
2634
+ readonly locale?: string;
2635
+ readonly paragraphId: string;
2636
+ readonly fieldNodeId: string;
2637
+ readonly text: string;
2638
+ readonly options?: TextFormFieldOptions;
2639
+ }
2640
+ /** Validate and format the existing result when a user finishes filling a field. */
2641
+ interface CommitTextFormFieldOp {
2642
+ readonly op: 'commitTextFormField';
2643
+ /** Regional conventions for new date input; defaults to en-US. */
2644
+ readonly locale?: string;
2645
+ readonly paragraphId: string;
2646
+ readonly fieldNodeId: string;
2647
+ }
2648
+
2649
+ /** One FORMCHECKBOX in the shared paragraph offset space. */
2650
+ interface LegacyCheckboxFieldRange {
2651
+ /** The begin `w:fldChar` node: what the op addresses. */
2652
+ readonly fieldNodeId: string;
2653
+ readonly start: number;
2654
+ readonly end: number;
2655
+ readonly checked: boolean;
2656
+ /** `w:enabled` under `w:ffData`; a disabled field renders but refuses the toggle. */
2657
+ readonly enabled: boolean;
2658
+ }
2659
+ /** Flip a FORMCHECKBOX's state; the only write into `w:ffData` a checkbox permits. */
2660
+ interface SetLegacyCheckboxOp {
2661
+ readonly op: 'setLegacyCheckbox';
2662
+ readonly paragraphId: string;
2663
+ readonly fieldNodeId: string;
2664
+ readonly checked: boolean;
2665
+ }
2666
+ /** Every FORMCHECKBOX in a paragraph, in document order; uses the shared field parser. */
2667
+ declare function legacyCheckboxFieldsOf(paragraph: OoxmlParagraphNode): readonly LegacyCheckboxFieldRange[];
2668
+
2669
+ /** Replace a building block gallery control's content with one block's body. */
2670
+ interface InsertBuildingBlockOp {
2671
+ readonly op: 'insertBuildingBlock';
2672
+ readonly controlId: string;
2673
+ /** `w:docPartPr/w:name` of the picked block, for the journal and the host. */
2674
+ readonly name: string;
2675
+ /**
2676
+ * Self-contained `w:docPartBody` children, cloned with fresh ids at apply.
2677
+ * Resource, style, field, bookmark, note and revision references return `unsupported`.
2678
+ */
2679
+ readonly blocks: readonly OoxmlNode[];
1722
2680
  }
1723
- interface DrawingTransform {
1724
- readonly rotationDegrees: number;
1725
- readonly flipHorizontal: boolean;
1726
- readonly flipVertical: boolean;
1727
- /** Source `a:off` in EMU; defaults to origin when absent. */
1728
- readonly offsetEmu: Readonly<{
1729
- x: number;
1730
- y: number;
1731
- }>;
1732
- /** Source `a:ext` in EMU; zero falls back to `wp:extent` at geometry time. */
1733
- readonly extentEmu: Readonly<{
1734
- cx: number;
1735
- cy: number;
1736
- }>;
2681
+
2682
+ /** A text position in the op's part. */
2683
+ interface BookmarkOpPosition {
2684
+ readonly paragraphId: string;
2685
+ readonly offset: number;
1737
2686
  }
1738
2687
  /**
1739
- * What a drawing refuses: selection, movement, resizing, aspect change.
2688
+ * Add a bookmark around `start`..`end`, or at one point when the two are equal.
1740
2689
  *
1741
- * Read and honoured rather than advisory — chrome that offered a handle the store will refuse
1742
- * would promise an edit that cannot happen.
2690
+ * The name must pass `bookmarkNameProblem`. A bookmark the part already declares under the
2691
+ * same name, compared without case, is removed in the same op.
1743
2692
  */
1744
- interface DrawingLocks {
1745
- readonly select: boolean;
1746
- readonly move: boolean;
1747
- readonly resize: boolean;
1748
- readonly changeAspect: boolean;
1749
- }
1750
- interface DrawingLocksInput {
1751
- readonly select?: boolean;
1752
- readonly move?: boolean;
1753
- readonly resize?: boolean;
1754
- readonly changeAspect?: boolean;
2693
+ interface InsertBookmarkOp {
2694
+ readonly op: 'insertBookmark';
2695
+ readonly name: string;
2696
+ readonly start: BookmarkOpPosition;
2697
+ readonly end: BookmarkOpPosition;
1755
2698
  }
1756
2699
  /**
1757
- * An anchored drawing's position: offsets, and the frames they are relative to.
2700
+ * Remove every marker pair that declares this name, compared without case. The name is the
2701
+ * one the file declares, so it is not held to the authoring rules.
1758
2702
  *
1759
- * The relative-to bases matter as much as the offsets. Writing an offset without preserving its
1760
- * base re-anchors the drawing against a different reference and moves it somewhere nobody asked.
2703
+ * With `keepFirst`, remove only the copies: the pair `listBookmarks` answers for the name
2704
+ * stays where it is. Refused when the part holds no copy. Two collaborators who both remove
2705
+ * the copies remove the same nodes, so their edits converge on one bookmark.
1761
2706
  */
1762
- interface DrawingPositionInput {
1763
- /**
1764
- * `'simple'` when `@simplePos="1"`: `horizontalEmu` / `verticalEmu` are authoritative
1765
- * `wp:simplePos` x/y. `'frame'` (default) uses positionH/V relative frames.
1766
- */
1767
- readonly mode?: 'frame' | 'simple';
1768
- readonly horizontalEmu?: number;
1769
- readonly verticalEmu?: number;
1770
- readonly relativeToH?: DrawingHorizontalReferenceFrame;
1771
- readonly relativeToV?: DrawingVerticalReferenceFrame;
1772
- }
1773
- interface DrawingProjection {
1774
- readonly drawingNodeId: string;
1775
- readonly ownerPartName: string;
1776
- readonly kind: DrawingKind;
1777
- readonly relationshipId: string | null;
1778
- readonly docPrId: number | null;
2707
+ interface DeleteBookmarkOp {
2708
+ readonly op: 'deleteBookmark';
1779
2709
  readonly name: string;
1780
- readonly title: string;
1781
- readonly description: string;
1782
- readonly hyperlinkHref: string | null;
1783
- readonly hidden: boolean;
1784
- readonly extentEmu: Readonly<{
1785
- cx: number;
1786
- cy: number;
1787
- }>;
1788
- readonly effectExtentEmu: Readonly<{
1789
- top: number;
1790
- right: number;
1791
- bottom: number;
1792
- left: number;
1793
- }>;
1794
- readonly inlineDistancesEmu: Readonly<{
1795
- top: number;
1796
- right: number;
1797
- bottom: number;
1798
- left: number;
1799
- }>;
1800
- readonly wrap: ImageWrapTarget;
1801
- readonly wrapGeometry: DrawingWrapProjection | null;
1802
- readonly position: DrawingPositionProjection | null;
1803
- readonly anchor: Readonly<{
1804
- simplePos: boolean;
1805
- relativeHeight: number;
1806
- behindDocument: boolean;
1807
- layoutInCell: boolean;
1808
- allowOverlap: boolean;
1809
- }> | null;
1810
- readonly picture: PictureProjection | null;
1811
- readonly vectorShape: VectorShapeProjection | null;
1812
- /** The picture member of a `wpg:wgp` group; `picture` stays null for a group. */
1813
- readonly groupPicture: GroupPictureProjection | null;
1814
- readonly textboxStory: TextboxStoryProjection | null;
1815
- /** Text box members of a `wpg:wgp` group, laid out read-only; absent when none has text. */
1816
- readonly groupTextboxes?: readonly GroupTextboxProjection[];
1817
- /** Read-only preview of the supported native VML subset; the canonical XML is untouched. */
1818
- readonly legacyGraphic?: LegacyGraphicProjection;
1819
- readonly locks: DrawingLocks;
1820
- readonly effects: DrawingImageEffects;
1821
- readonly compatibilityBranchNodeId: string | null;
1822
- readonly diagnostics: readonly DrawingDiagnostic[];
1823
- /** Layout-only wrap area of an MC payload that cannot paint (`wrapFootprintProjection`). */
1824
- readonly footprintOnly?: true;
1825
- }
1826
- interface DrawingAccessibility {
1827
- /**
1828
- * The record takes part in layout only, for example the wrap area of a payload that cannot
1829
- * paint. Outputs must not paint, hit-test, select, link, or export it.
1830
- */
1831
- readonly hidden: boolean;
1832
- readonly decorative: boolean;
1833
- readonly label: string | null;
1834
- }
1835
- interface DrawingPositionProjection {
1836
- readonly simplePosition: Readonly<{
1837
- xEmu: number;
1838
- yEmu: number;
1839
- }>;
1840
- readonly horizontal: Readonly<{
1841
- relativeFrom: DrawingHorizontalReferenceFrame;
1842
- align: string | null;
1843
- offsetEmu: number | null;
1844
- }>;
1845
- readonly vertical: Readonly<{
1846
- relativeFrom: DrawingVerticalReferenceFrame;
1847
- align: string | null;
1848
- offsetEmu: number | null;
1849
- }>;
1850
- }
1851
- interface DrawingWrapProjection {
1852
- readonly element: DrawingWrapElement;
1853
- readonly textSide: 'bothSides' | 'left' | 'right' | 'largest';
1854
- readonly distancesEmu: Readonly<{
1855
- top: number;
1856
- right: number;
1857
- bottom: number;
1858
- left: number;
1859
- }>;
1860
- readonly polygon: readonly Readonly<{
1861
- x: number;
1862
- y: number;
1863
- }>[];
1864
- }
1865
- interface PictureProjection {
1866
- readonly embeddedRelationshipId: string | null;
1867
- readonly linkedRelationshipId: string | null;
1868
- readonly crop: SourceCrop;
1869
- readonly fillMode: 'stretch' | 'tile';
1870
- readonly transform: DrawingTransform;
1871
- readonly presetGeometry: string | null;
2710
+ readonly keepFirst?: boolean;
2711
+ /** @internal Limit a text deletion to one enclosed pair; explicit name deletion omits this. */
2712
+ readonly pair?: {
2713
+ readonly startNodeId: string;
2714
+ readonly endNodeId: string;
2715
+ };
1872
2716
  }
1873
2717
  /**
1874
- * Project one `w:drawing` into the resolved shape layout and chrome read.
1875
- *
1876
- * Bounded throughout: extents, crops and nesting all come from a file. Returns a projection that
1877
- * reports `hidden` and its locks rather than throwing, so an unusable drawing degrades to
1878
- * something the surface can skip.
2718
+ * The package with every bookmark of this name removed from one part, for moving a name out
2719
+ * of another story inside the same transaction. The package is unchanged when that part does
2720
+ * not declare the name. Protected markers refuse the whole package transaction.
1879
2721
  */
1880
- declare function projectDrawing(drawing: OoxmlDrawingNode, context: Readonly<{
1881
- ownerPartName: string;
1882
- supportedMcRequires: ReadonlySet<string>;
1883
- limits: DrawingProjectionLimits;
1884
- namespaceScope?: ReadonlyMap<string, string>;
1885
- resolveRelationship?: RelationshipTargetResolver;
1886
- resolveSchemeColor?: ShapeSchemeColorResolver;
1887
- resolveStyleMatrixReference?: ShapeStyleMatrixResolver;
1888
- }>): DrawingProjection | null;
2722
+ declare function withoutBookmarkInPart(pkg: OoxmlPackage, partName: string, name: string): OoxmlPackage;
2723
+ /**
2724
+ * The `deleteBookmark` ops for the bookmarks an untracked deletion of `from`..`to` encloses,
2725
+ * for a deletion that crosses paragraphs. `order` lists the part's paragraph ids in document
2726
+ * order. A range bookmark goes when the deletion covers it edge to edge; a point bookmark goes
2727
+ * when it is strictly inside. Applied before the text ops, so they find nothing left to drop.
2728
+ */
2729
+ declare function enclosedBookmarkDeletions(part: OoxmlPart, from: BookmarkOpPosition, to: BookmarkOpPosition, order: readonly string[]): readonly DeleteBookmarkOp[];
1889
2730
 
1890
2731
  /** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
1891
2732
  declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
@@ -2534,13 +3375,25 @@ interface RevisionBatchEntry {
2534
3375
  /** Why a requested decision remains pending. @public */
2535
3376
  type RevisionBatchSkipReason = 'unsupported-revision' | 'incomplete-group' | 'retained-structure' | 'unknown-revision';
2536
3377
  /**
2537
- * Why an `unsupported-revision` skip happened: a refused site, a formatting change whose earlier
2538
- * properties were not recorded so it cannot be rejected, a read-only review item, or a change
2539
- * with no sites in the part.
3378
+ * The structure behind a skip.
3379
+ *
3380
+ * For `unsupported-revision`: a refused site, a formatting change whose earlier properties were
3381
+ * not recorded so it cannot be rejected, a read-only review item, a change with no sites, a
3382
+ * change a content control lock keeps (`locked-content`), or a change in a data-bound content
3383
+ * control (`bound-content`). The last two have their own codes, `review.locked-content` and
3384
+ * `review.bound-content`; `reviewCodeOfSkip` reads them.
3385
+ *
3386
+ * For `incomplete-group`, the change the decision would also decide: the other half of a move or
3387
+ * merge (`paired-change`), a change inside content the decision removes (`removed-content`) or
3388
+ * inside properties a reject replaces (`replaced-properties`), a change the decision would empty
3389
+ * (`emptied-change`), a change that encloses the selected one (`enclosing-change`), or another
3390
+ * site of a group the planner keeps together (`grouped-change`).
3391
+ *
3392
+ * For `retained-structure`: a row kept for the table nested in it (`nested-table`).
2540
3393
  *
2541
3394
  * @public
2542
3395
  */
2543
- type RevisionBatchSkipDetail = RevisionSiteRefusal | 'unrecorded-properties' | 'read-only' | 'no-sites';
3396
+ type RevisionBatchSkipDetail = RevisionSiteRefusal | 'unrecorded-properties' | 'read-only' | 'no-sites' | 'paired-change' | 'removed-content' | 'replaced-properties' | 'emptied-change' | 'enclosing-change' | 'grouped-change' | 'nested-table' | 'locked-content' | 'bound-content';
2544
3397
  /** Outcome of one selected-set decision. Counts refer to review decisions, not XML markers. @public */
2545
3398
  interface RevisionBatchResult {
2546
3399
  readonly resolved: readonly RevisionBatchEntry[];
@@ -2548,16 +3401,36 @@ interface RevisionBatchResult {
2548
3401
  readonly key: string;
2549
3402
  readonly reason: RevisionBatchSkipReason;
2550
3403
  readonly revision?: RevisionBatchEntry;
2551
- /** For `unsupported-revision`, which engine condition refused it. */
3404
+ /**
3405
+ * The condition or structure behind the skip, such as `locked-content` or `paired-change`.
3406
+ * `reviewCodeOfSkip` turns the reason and the detail into one review code.
3407
+ */
2552
3408
  readonly detail?: RevisionBatchSkipDetail;
2553
3409
  }[];
2554
3410
  /** All pending decisions in the addressed scope, including excluded and unsupported changes. */
2555
3411
  readonly remaining: number;
2556
3412
  }
2557
- /** @internal Pure preflight; callers commit its operations through their normal write guards. */
2558
- declare function planRevisionBatch(part: OoxmlPart, action: 'accept' | 'reject', keys?: readonly string[], scopeRoot?: OoxmlNode): {
3413
+ /**
3414
+ * @internal Pure preflight; callers commit its operations through their normal write guards.
3415
+ *
3416
+ * `countRemaining: false` skips the exact count of the decisions left after the batch, and
3417
+ * reports `remaining` as the decisions not resolved here. The exact count resolves the whole
3418
+ * batch once more on a copy and lists what is left, which on a long reviewed document cost more
3419
+ * than the plan itself, and a caller that reads only the operations or the skipped changes
3420
+ * (a check, one decision, an editor that recounts its queue) paid it on every call.
3421
+ */
3422
+ declare function planRevisionBatch(part: OoxmlPart, action: 'accept' | 'reject', keys?: readonly string[], scopeRoot?: OoxmlNode, options?: {
3423
+ readonly countRemaining?: boolean;
3424
+ /**
3425
+ * A decision on these changes themselves, not a filtered selection: the other half of a
3426
+ * selected move resolves with it, and changes inside content it removes go along.
3427
+ */
3428
+ readonly explicit?: boolean;
3429
+ }): {
2559
3430
  ops: readonly TreeDocOp[];
2560
3431
  result: RevisionBatchResult;
3432
+ /** Keys of unselected changes the decision removes with their content. Explicit only. */
3433
+ swept?: readonly string[];
2561
3434
  };
2562
3435
 
2563
3436
  /** Why a requested change keeps its attribution. @public */
@@ -2864,8 +3737,9 @@ interface RunFormatting {
2864
3737
  /**
2865
3738
  * Line spacing at the selection, in the unit its rule implies — LINES for `multiple`,
2866
3739
  * points for `exact` and `atLeast`. The same vocabulary `setLineSpacing` takes, so a
2867
- * control can show what it reads and send back what it shows. Absent when the
2868
- * selection's paragraphs disagree or state no line spacing.
3740
+ * control can show what it reads and send back what it shows. The effective value: a
3741
+ * paragraph whose cascade states none reads as single spacing (`multiple`, 1). Absent
3742
+ * when the selection's paragraphs disagree.
2869
3743
  */
2870
3744
  readonly lineSpacing?: {
2871
3745
  readonly rule: 'multiple' | 'exact' | 'atLeast';
@@ -3174,10 +4048,72 @@ interface Theme {
3174
4048
  }
3175
4049
  /** Theme colour slots (`accent1`, `dk1`, `lt2`, …) to hex. */
3176
4050
  type ThemeColorScheme = Readonly<Record<string, string>>;
3177
- /** A watermark, which OOXML expresses as either text or an image — never both meaningfully. */
4051
+ /**
4052
+ * A document watermark: text or a picture drawn behind the text of every page.
4053
+ *
4054
+ * Set `text` for a text watermark or `imageData` for a picture watermark, never both. Omitted
4055
+ * options take the defaults in each field's description. The watermark goes into every header
4056
+ * the document shows; a section with no header gets one.
4057
+ *
4058
+ * Text options apply only with `text`; `scale` and `washout` apply only with `imageData`.
4059
+ * `setWatermark` refuses a mixed or out-of-range value with `invalidArgs` and a reason naming
4060
+ * the field, and writes nothing.
4061
+ *
4062
+ * @example
4063
+ * ```ts
4064
+ * // A red, horizontal text watermark at 72pt.
4065
+ * editor.exec({
4066
+ * type: 'setWatermark',
4067
+ * watermark: { text: 'CONFIDENTIAL', color: 'C00000', fontSizePt: 72, layout: 'horizontal' },
4068
+ * });
4069
+ * // A washed-out picture watermark at its natural size.
4070
+ * editor.exec({ type: 'setWatermark', watermark: { imageData: pngBytes, scale: 1 } });
4071
+ * ```
4072
+ */
3178
4073
  interface Watermark {
4074
+ /** The text of a text watermark, up to 256 characters on one line. */
3179
4075
  readonly text?: string;
4076
+ /** The PNG, JPEG, GIF, BMP or WebP bytes of a picture watermark. */
3180
4077
  readonly imageData?: Uint8Array;
4078
+ /** Text: the font family. Defaults to `Calibri`. */
4079
+ readonly fontFamily?: string;
4080
+ /** Text: the size in points, from 1 to 1000. Omitted or null is Auto, which fills the page. */
4081
+ readonly fontSizePt?: number | null;
4082
+ /** Text: bold. Defaults to false. */
4083
+ readonly bold?: boolean;
4084
+ /** Text: italic. Defaults to false. */
4085
+ readonly italic?: boolean;
4086
+ /** Text: the colour as `RRGGBB`. Defaults to `C0C0C0` (silver). */
4087
+ readonly color?: string;
4088
+ /** Text: transparency from 0 (opaque) to 1. Defaults to 0.5. */
4089
+ readonly transparency?: number;
4090
+ /** Text: the orientation. Defaults to `diagonal`. */
4091
+ readonly layout?: WatermarkLayout;
4092
+ /** Picture: a factor of the picture's natural size. Omitted or null is Auto, which fits the page. */
4093
+ readonly scale?: number | null;
4094
+ /** Picture: lighten the picture so text over it stays readable. Defaults to true. */
4095
+ readonly washout?: boolean;
4096
+ }
4097
+ /** How a text watermark crosses the page. */
4098
+ type WatermarkLayout = 'diagonal' | 'horizontal';
4099
+ /**
4100
+ * The watermark a document shows, as `Editor.getWatermark()` reads it.
4101
+ *
4102
+ * The text fields are present for a text watermark, `washout` for a picture watermark.
4103
+ */
4104
+ interface WatermarkState {
4105
+ readonly kind: 'text' | 'image';
4106
+ readonly text?: string;
4107
+ readonly fontFamily?: string;
4108
+ /** Null for Auto size. */
4109
+ readonly fontSizePt?: number | null;
4110
+ readonly bold?: boolean;
4111
+ readonly italic?: boolean;
4112
+ /** `RRGGBB`. */
4113
+ readonly color?: string;
4114
+ readonly transparency?: number;
4115
+ readonly layout?: WatermarkLayout;
4116
+ readonly washout?: boolean;
3181
4117
  }
3182
4118
  /** A size in EMUs, the unit DrawingML stores extents in. 914400 EMU = 1 inch. */
3183
4119
  interface Extent {
@@ -3401,26 +4337,7 @@ type TreeDocOp = SetFieldCodeOp | {
3401
4337
  readonly offset: number;
3402
4338
  /** Write this as a TRACKED insertion, on the same terms as `insertText`. */
3403
4339
  readonly revision?: RevisionAttributionInput;
3404
- } | {
3405
- /**
3406
- * Insert an allowlisted page-number complex field at a UTF-16 offset.
3407
- *
3408
- * `PAGE_X_OF_Y` is PAGE + literal " of " + NUMPAGES in one undoable op. Non-page
3409
- * instructions are refused — never authored through this path.
3410
- */
3411
- readonly op: 'insertPageField';
3412
- readonly paragraphId: string;
3413
- readonly offset: number;
3414
- readonly field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y';
3415
- /**
3416
- * Write this as a TRACKED insertion, on the same terms as `insertText`.
3417
- *
3418
- * The whole field — every `w:fldChar`, the instruction, the `PAGE_X_OF_Y` literal —
3419
- * goes into ONE `w:ins`, because the field is one proposal: rejecting it must take
3420
- * the complete atom back, never leave a `begin` standing without its `end`.
3421
- */
3422
- readonly revision?: RevisionAttributionInput;
3423
- } | {
4340
+ } | InsertPageFieldOp | InsertComplexFieldOp | SetFieldResultOp | InsertEquationOp | {
3424
4341
  /**
3425
4342
  * Move a numbered paragraph to another `w:numPr/w:ilvl`.
3426
4343
  *
@@ -3709,6 +4626,8 @@ type TreeDocOp = SetFieldCodeOp | {
3709
4626
  readonly xpath: string;
3710
4627
  readonly storeItemId: string;
3711
4628
  };
4629
+ /** Propose the control as a tracked `w:ins`; rejecting removes it with its text. */
4630
+ readonly revision?: RevisionAttributionInput;
3712
4631
  } | {
3713
4632
  /** Repeating-section item insert — unsupported at this layer (out of scope). */
3714
4633
  readonly op: 'addRepeatingSectionItem';
@@ -3783,6 +4702,18 @@ type TreeDocOp = SetFieldCodeOp | {
3783
4702
  readonly op: 'deleteTableColumn';
3784
4703
  readonly tableId: string;
3785
4704
  readonly gridColumnId: string;
4705
+ } | {
4706
+ /** Merge cells covering one rectangle into its top-left cell, content in reading order. */
4707
+ readonly op: 'mergeTableCells';
4708
+ readonly tableId: string;
4709
+ readonly cellIds: readonly string[];
4710
+ } | {
4711
+ /** Split one cell into `rows` by `columns` equal cells; a one-row cell adds rows. */
4712
+ readonly op: 'splitTableCell';
4713
+ readonly tableId: string;
4714
+ readonly cellId: string;
4715
+ readonly rows: number;
4716
+ readonly columns: number;
3786
4717
  } | {
3787
4718
  /**
3788
4719
  * Resize one internal divider between two adjacent canonical grid columns.
@@ -3907,6 +4838,10 @@ type TreeDocOp = SetFieldCodeOp | {
3907
4838
  */
3908
4839
  readonly op: 'setDocumentProtection';
3909
4840
  readonly enforce: boolean;
4841
+ } | {
4842
+ /** Replace the watermark in every header a section shows; null removes it. Package-level. */
4843
+ readonly op: 'setWatermark';
4844
+ readonly watermark: PackageWatermarkWrite | null;
3910
4845
  } | {
3911
4846
  /**
3912
4847
  * Insert a footnote or endnote: body reference + notes-part body (+ create the
@@ -4110,7 +5045,7 @@ type TreeDocOp = SetFieldCodeOp | {
4110
5045
  readonly paragraphId: string;
4111
5046
  readonly pageNumberText: string;
4112
5047
  }[];
4113
- } | SetTextFormFieldDefaultOp | CommitTextFormFieldOp | SetLegacyCheckboxOp | SetLegacyDropdownOp | InsertBuildingBlockOp | {
5048
+ } | SetTextFormFieldDefaultOp | CommitTextFormFieldOp | SetLegacyCheckboxOp | SetLegacyDropdownOp | InsertBuildingBlockOp | InsertBookmarkOp | DeleteBookmarkOp | {
4114
5049
  /**
4115
5050
  * Rewrite recognized fields' cached RESULT runs in place — between the `separate` and
4116
5051
  * `end` fldChars, or a `w:fldSimple`'s content. The instruction is never modified; a
@@ -4210,6 +5145,11 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
4210
5145
  * pointing at a part nobody created, or a part with no declared content type.
4211
5146
  */
4212
5147
  | 'package-invariant'
5148
+ /**
5149
+ * A package edit refused the package it was given, for example because an id or part name it
5150
+ * expected to allocate is taken or a definition it addresses changed. Nothing was applied.
5151
+ */
5152
+ | 'package-changed'
4213
5153
  /** No revision in this part carries the addressed `(id, author, date)` triple. */
4214
5154
  | 'unknown-revision'
4215
5155
  /**
@@ -4217,7 +5157,13 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
4217
5157
  * implemented. Refusing is deliberate: removing the markup alone would report the decision
4218
5158
  * applied while leaving the row, cell, or section it describes untouched.
4219
5159
  */
4220
- | 'unsupported-revision' | 'tree-invariant'
5160
+ | 'unsupported-revision'
5161
+ /**
5162
+ * A tracked insertion would land inside a link, content control, or other container within
5163
+ * another author's pending insertion. The container cannot split, and nested words would
5164
+ * become part of that author's proposal.
5165
+ */
5166
+ | 'unsupported-revision:foreign-insertion' | 'tree-invariant'
4221
5167
  /** No content control in this part carries the addressed node id. */
4222
5168
  | 'unknown-content-control'
4223
5169
  /** The addressed node exists and is not a `w:sdt`. */
@@ -4247,8 +5193,18 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
4247
5193
  * mapping cannot be trusted and the inserted row would not match it.
4248
5194
  */
4249
5195
  | 'row-hides-cell'
4250
- /** Column edit refused because the table carries horizontal or vertical merges. */
5196
+ /** The table carries a legacy `w:hMerge`, which grid edits cannot place. */
4251
5197
  | 'table-has-merge'
5198
+ /** The cells to merge do not cover one rectangle, or cover only one cell. */
5199
+ | 'cells-not-rectangle'
5200
+ /** A cell merged over several rows splits only into a divisor of them. */
5201
+ | 'split-rows-not-divisor'
5202
+ /** The cells hold a tracked cell insertion, deletion, or merge. */
5203
+ | 'cell-has-revision'
5204
+ /** The split cells would be narrower than the minimum column width. */
5205
+ | 'cell-too-narrow'
5206
+ /** Without `w:tblGrid`, a cell splits only into a divisor of the columns it spans. */
5207
+ | 'split-needs-grid'
4252
5208
  /** The addressed grid column id is missing or ambiguous without `w:tblGrid`. */
4253
5209
  | 'unknown-grid-column'
4254
5210
  /** The operation would exceed bounded table topology limits. */
@@ -4259,6 +5215,8 @@ type TreeOpRejection = 'unknown-op' | 'unknown-paragraph' | 'not-a-paragraph' |
4259
5215
  | 'unknown-drawing'
4260
5216
  /** The drawing's graphic payload is not a supported picture. */
4261
5217
  | 'not-a-picture-drawing'
5218
+ /** A chart in any state: only a delete applies, and it removes the whole chart. */
5219
+ | 'chart-drawing'
4262
5220
  /** A lock flag or `@locked` forbids this mutation. */
4263
5221
  | 'drawing-locked'
4264
5222
  /** Finite EMU extent, crop, or position value is out of range. */
@@ -4286,5 +5244,5 @@ type TreeOpResult = {
4286
5244
  readonly detail?: string;
4287
5245
  };
4288
5246
 
4289
- export { IMAGE_WRAP_TARGETS as aK, TEXT_FORM_FORMATS as aL, ACCEPTED_PARAGRAPH_PROPERTIES as b2, ACCEPTED_RUN_PROPERTIES as b3, CONTENT_CONTROL_ID_MAX as b4, CONTENT_CONTROL_PROPERTY_ORDER as b5, MAX_CONTENT_CONTROL_NESTING as bA, OFFICE_RELATIONSHIP_NAMESPACE_URI as bD, OOXML_NODE_IDENTITY_RULES as bE, DEFAULT_OOXML_PACKAGE_LIMITS as bm, DEFAULT_ZIP_LIMITS as bn, HYPERLINK_RELATIONSHIP_TYPE as bq, IMAGE_RELATIONSHIP_TYPE as bt, MAX_CONTENT_CONTROLS_PER_PART as bz, hyperlinkAnchorOf as c$, allocateContentControlId as cF, asciiFold as cG, buildContentTypeIndex as cH, buildRelationshipSet as cI, childElements as cJ, commentAnchorsOfStory as cK, commentsOfPart as cL, contentControlContentChildren as cM, contentControlContentNodeOf as cN, contentControlEndPropertiesNodeOf as cO, contentControlLevelOf as cP, contentControlPropertiesNodeOf as cQ, contentControlPropertiesOf as cR, contentControlTextOf as cS, contentControlsIn as cT, detectDuplicateNames as cU, extensionKey as cV, findContentControl as cW, findElement as cX, firstReviewRange as cY, flattenContentControls as cZ, hasAnyComment as c_, TABLE_BORDER_STYLES as co, W15_NAMESPACE_URI as cu, WML_NAMESPACE_URI as cv, XMLNS_NAMESPACE_URI as cw, XML_NAMESPACE_URI as cx, hyperlinkRelationshipIdOf as d0, hyperlinkTargetOf as d1, isContentControlContentNode as d2, isContentControlNode as d3, isContentControlWrapper as d4, isContentRevisionKind as d5, isHyperlinkNode as d6, isRangeMarkerKind as d7, isValidMime as d8, legacyCheckboxFieldsOf as d9, withPart as dA, writeOoxmlPackage as dB, writeZip as dC, activeReviewItem as dE, reviewItemPositionRank as dF, reviewItemsAt as dG, reviewThreadRootOf as dH, lockForbidsEdit as da, lockForbidsRemoval as db, normalizePartName as dc, orderedContentControlProperties as dd, parseContentControlId as de, partNameKey as df, planRevisionAuthorChange as dg, planRevisionBatch as dh, projectDrawing as di, readOnOffChild as dj, readOoxmlPackage as dk, readOoxmlPart as dl, readXml as dm, readZip as dn, resolveContentControlLock as dp, resolveContentType as dq, resolveImageRelationship as dr, resolveInternalTarget as ds, resolveRelationship as dt, reviewItemKey as du, reviewItemRanges as dv, textContent as dw, textFormFieldsOf as dx, threadStateOfPart as dy, validateExternalTarget as dz };
4290
- export type { DrawingVerticalReferenceFrame as $, ParagraphTabStop as A, Block as B, CommentRecord as C, DocxDocument as D, ExecResult as E, RevisionType as F, Section as G, HeaderFooterSet as H, InsertableContentControlType as I, SectionProperties as J, StyleDefinition as K, Theme as L, ThemeColorScheme as M, OoxmlNode as N, OoxmlPart as O, Paragraph as P, OoxmlPackage as Q, ReviewModelInput as R, StyleDefinitions as S, Table as T, OoxmlNodeId as U, OoxmlGenericElementNode as V, DocxDocumentJSON as W, DrawingHorizontalReferenceFrame as X, DrawingKind as Y, DrawingLocks as Z, DrawingPositionInput as _, ReviewItem as a, OoxmlHardBreakNode as a$, FontDefinition as a0, ImageWrapTarget as a1, NumberingRef as a2, PageMargins as a3, ParagraphDisagreements as a4, ParagraphFormatCommand as a5, Point as a6, Rect as a7, RevisionAuthorResult as a8, RevisionBatchResult as a9, OoxmlNoteNode as aA, OoxmlContinuationSeparatorNode as aB, OoxmlEndnotesNode as aC, OoxmlFootnotesNode as aD, OoxmlNoteRefNode as aE, OoxmlNoteReferenceNode as aF, OoxmlSeparatorNode as aG, ImpactClass as aH, SourceCrop as aI, TreeDocColorValue as aJ, TableBorderStyle as aM, DrawingAccessibility as aN, DrawingImageEffects as aO, DrawingTransform as aP, VectorShapeProjection as aQ, OoxmlDrawingNode as aR, TextFormFieldRange as aS, TextFormFieldOptions as aT, OoxmlInvariantResult as aU, OoxmlInvariantIssue as aV, OoxmlFldCharNode as aW, OoxmlFldSimpleNode as aX, OoxmlInstrTextNode as aY, TreeOpResult as aZ, RelationshipRecord as a_, Run as aa, SelectionPin as ab, TableCell as ac, TableRow as ad, Unsubscribe as ae, Watermark as af, TreeDocOp as ag, OoxmlProperty as ah, OoxmlPackageResult as ai, OoxmlPackageRejection as aj, OoxmlElement as ak, OoxmlContentControlNode as al, OoxmlContentControlContentNode as am, DrawingProjection as an, OoxmlPackageLimits as ao, RevisionAuthorEntry as ap, RevisionAuthorSkipReason as aq, RevisionBatchEntry as ar, RevisionBatchSkipDetail as as, RevisionBatchSkipReason as at, RevisionSiteRefusal as au, TreeOpRejection as av, AutomationTableMutation as aw, RevisionAttributionInput as ax, DrawingTreeDocOp as ay, OoxmlParagraphNode as az, ReviewRevisionItem as b, OoxmlHyperlinkNode as b$, OoxmlAttribute as b0, CommentThreadState as b1, CommentAnchor as b6, CommentPosition as b7, CommitTextFormFieldOp as b8, ContentControlCheckbox as b9, NameRejection as bB, NameResult as bC, OoxmlBodyNode as bF, OoxmlBookmarkEndNode as bG, OoxmlBookmarkStartNode as bH, OoxmlContentControlCalendarNode as bI, OoxmlContentControlCheckboxNode as bJ, OoxmlContentControlCheckedNode as bK, OoxmlContentControlCheckedStateNode as bL, OoxmlContentControlComboBoxNode as bM, OoxmlContentControlDataBindingNode as bN, OoxmlContentControlDateFormatNode as bO, OoxmlContentControlDateNode as bP, OoxmlContentControlDropDownListNode as bQ, OoxmlContentControlEndPropertiesNode as bR, OoxmlContentControlLidNode as bS, OoxmlContentControlListItemNode as bT, OoxmlContentControlPropertiesNode as bU, OoxmlContentControlStoreMappedDataAsNode as bV, OoxmlContentControlTextNode as bW, OoxmlContentControlUncheckedStateNode as bX, OoxmlDocumentNode as bY, OoxmlExternalTarget as bZ, OoxmlGenericExtensionAttribute as b_, ContentControlCheckboxState as ba, ContentControlDataBinding as bb, ContentControlDateFormat as bc, ContentControlEntry as bd, ContentControlKind as be, ContentControlLevel as bf, ContentControlListItem as bg, ContentControlLock as bh, ContentControlProperties as bi, ContentTypeError as bj, ContentTypeIndex as bk, ContentTypeRecords as bl, DefaultRecord as bo, DeleteTextOp as bp, HyperlinkKind as br, HyperlinkTarget as bs, ImageRelationshipResolution as bu, IndexResult as bv, InsertBuildingBlockOp as bw, InsertTextOp as bx, LegacyCheckboxFieldRange as by, ReviewCommentItem as c, OoxmlInvariantIssueCode as c0, OoxmlKnownNodeAttribute as c1, OoxmlNamespaceBinding as c2, OoxmlNodeIdentityRules as c3, OoxmlParagraphPropertiesNode as c4, OoxmlPartMetadata as c5, OoxmlReadRejection as c6, OoxmlReadResult as c7, OoxmlRunNode as c8, OoxmlRunPropertiesNode as c9, XmlRejection as cA, XmlResult as cB, ZipLimits as cC, ZipReadResult as cD, ZipRejection as cE, OoxmlTabNode as ca, OoxmlTextElementNode as cb, OoxmlTextNode as cc, OoxmlWmlValAttribute as cd, OoxmlXmlSpaceAttribute as ce, OverrideRecord as cf, RelationshipError as cg, RelationshipSetResult as ch, RelationshipTargetResolver as ci, ResolveResult as cj, ResolvedRelationship as ck, SetLegacyCheckboxOp as cl, SetLegacyDropdownOp as cm, SetTextFormFieldDefaultOp as cn, TabStopWrite as cp, TargetMode as cq, TextFormFieldType as cr, TreeDocOpKind as cs, TreeOpEffect as ct, XmlLimits as cy, XmlNode as cz, ReviewCustomItem as d, VectorShapeComponent as dD, ReviewPosition as e, ReviewRange as f, ReviewRevisionKind as g, RevisionAddress as h, ContentControlType as i, DocTarget as j, RunFormatting as k, Extent as l, ContainerRef as m, ContentControlFilter as n, DocRange as o, Revision as p, DocComment as q, ColorValue as r, ContentControl as s, DocAnchor as t, DocAnchorRange as u, DocLocation as v, DocumentBody as w, ExecErrorCode as x, IndentFormatting as y, ParagraphFlags as z };
5247
+ export { DEFAULT_ZIP_LIMITS as b$, DEFAULT_IMAGE_RESOURCE_LIMITS as b6, IMAGE_WRAP_TARGETS as b7, TEXT_FORM_FORMATS as b8, resolveImageResourceLimits as b9, CHART_GRAPHIC_DATA_URI as bA, CHART_NAMESPACE_URI as bB, CHART_STYLE_NAMESPACE_URI as bC, CONTENT_CONTROL_ID_MAX as bD, CONTENT_CONTROL_PROPERTY_ORDER as bE, DEFAULT_LIMITS as bZ, DEFAULT_OOXML_PACKAGE_LIMITS as b_, resolveSvgIntrinsicSize as ba, sniffImageMime as bb, validateRasterHeader as bc, ACCEPTED_PARAGRAPH_PROPERTIES as bv, ACCEPTED_RUN_PROPERTIES as bw, CHARTEX_GRAPHIC_DATA_URI as by, CHARTEX_NAMESPACE_URI as bz, DIAGRAM_NAMESPACE_URI as c0, DRAWINGML_MAIN_NAMESPACE_URI as c1, HARD_CEILINGS as c7, HYPERLINK_RELATIONSHIP_TYPE as c8, IMAGE_RELATIONSHIP_TYPE as cb, IMAGE_RESOURCE_HARD_CEILINGS as cc, MAX_CONTENT_CONTROLS_PER_PART as cn, MAX_CONTENT_CONTROL_NESTING as co, MAX_SVG_SNIFF_BYTES as cp, OFFICE_RELATIONSHIP_NAMESPACE_URI as cs, OOXML_NODE_IDENTITY_RULES as ct, hasBoundedSvgRoot as d$, allocateContentControlId as dC, asciiFold as dD, buildContentTypeIndex as dE, buildRelationshipSet as dF, childElements as dG, commentAnchorsOfStory as dH, commentsOfPart as dI, contentControlContentChildren as dJ, contentControlContentNodeOf as dK, contentControlEndPropertiesNodeOf as dL, contentControlLevelOf as dM, contentControlPropertiesNodeOf as dN, contentControlPropertiesOf as dO, contentControlTextOf as dP, contentControlsIn as dQ, createImageResourceCache as dR, detectDuplicateNames as dS, directFill as dT, enclosedBookmarkDeletions as dU, extensionKey as dV, findContentControl as dW, findElement as dX, firstReviewRange as dY, flattenContentControls as dZ, hasAnyComment as d_, TABLE_BORDER_STYLES as dg, W15_NAMESPACE_URI as dr, WML_NAMESPACE_URI as ds, XMLNS_NAMESPACE_URI as dt, XML_NAMESPACE_URI as du, hyperlinkAnchorOf as e0, hyperlinkRelationshipIdOf as e1, hyperlinkTargetOf as e2, imageResourceLookupFor as e3, isContentControlContentNode as e4, isContentControlNode as e5, isContentControlWrapper as e6, isContentRevisionKind as e7, isElement as e8, isHyperlinkNode as e9, reviewItemRanges as eA, textContent as eB, textFormFieldsOf as eC, threadStateOfPart as eD, validateExternalTarget as eE, validateGifHeader as eF, validateJpegHeader as eG, validatePngHeader as eH, withPart as eI, withoutBookmarkInPart as eJ, writeOoxmlPackage as eK, writeZip as eL, activeReviewItem as eQ, reviewItemPositionRank as eR, reviewItemsAt as eS, reviewThreadRootOf as eT, isRangeMarkerKind as ea, isValidMime as eb, legacyCheckboxFieldsOf as ec, liveDrawingReferenceCount as ed, lockForbidsEdit as ee, lockForbidsRemoval as ef, normalizePartName as eg, orderedContentControlProperties as eh, parseContentControlId as ei, partNameKey as ej, planRevisionAuthorChange as ek, planRevisionBatch as el, projectDrawing as em, readOnOffChild as en, readOoxmlPackage as eo, readOoxmlPart as ep, readXml as eq, readZip as er, resolveColorNode as es, resolveContentControlLock as et, resolveContentType as eu, resolveImageRelationship as ev, resolveInternalTarget as ew, resolveLimits as ex, resolveRelationship as ey, reviewItemKey as ez };
5248
+ export type { Table as $, ParagraphDisagreements as A, Block as B, CommentRecord as C, DocxDocument as D, ExecResult as E, ParagraphFlags as F, ParagraphTabStop as G, HeaderFooterSet as H, InsertableContentControlType as I, RevisionAuthorEntry as J, RevisionAuthorResult as K, RevisionAuthorSkipReason as L, RevisionBatchEntry as M, NumberingRef as N, OoxmlPart as O, PageMargins as P, RevisionBatchResult as Q, ReviewModelInput as R, StyleDefinitions as S, RevisionBatchSkipDetail as T, RevisionBatchSkipReason as U, RevisionSiteRefusal as V, RevisionType as W, Run as X, Section as Y, SectionProperties as Z, StyleDefinition as _, ReviewItem as a, DrawingImageEffects as a$, TableCell as a0, TableRow as a1, Theme as a2, ThemeColorScheme as a3, OoxmlNode as a4, OoxmlPackage as a5, DocxDocumentJSON as a6, DrawingHorizontalReferenceFrame as a7, DrawingKind as a8, DrawingLocks as a9, OoxmlPackageRejection as aA, AutomationTableMutation as aB, OoxmlProperty as aC, OoxmlPackageResult as aD, RevisionAttributionInput as aE, TreeOpRejection as aF, OoxmlNodeId as aG, PackageWatermarkWrite as aH, OoxmlInvariantIssue as aI, DrawingTreeDocOp as aJ, ImpactClass as aK, OoxmlParagraphNode as aL, OoxmlNoteNode as aM, OoxmlContinuationSeparatorNode as aN, OoxmlEndnotesNode as aO, OoxmlFootnotesNode as aP, OoxmlNoteRefNode as aQ, OoxmlNoteReferenceNode as aR, OoxmlSeparatorNode as aS, SourceCrop as aT, TextFormFieldRange as aU, TextFormFieldOptions as aV, DrawingTransform as aW, TableBorderStyle as aX, TextboxOutlineProjection as aY, VectorShapeComponent as aZ, DrawingAccessibility as a_, DrawingPositionInput as aa, DrawingVerticalReferenceFrame as ab, FontDefinition as ac, ImageDecodePort as ad, ImageResourceLimits as ae, ImageResourceState as af, ImageWrapTarget as ag, ParagraphFormatCommand as ah, Point as ai, PreservedImageMime as aj, Rect as ak, RenderableImageMime as al, SelectionPin as am, SupportedImageMime as an, Unsubscribe as ao, ValidatedImageBytesHandle as ap, VectorImageMime as aq, Watermark as ar, WatermarkLayout as as, WatermarkState as at, TreeDocOp as au, OoxmlElement as av, OoxmlContentControlNode as aw, OoxmlGenericElementNode as ax, OoxmlContentControlContentNode as ay, OoxmlPackageLimits as az, ReviewRevisionItem as b, DrawingChartSummary as b0, VectorShapeProjection as b1, PictureFrameEffects as b2, DrawingProjection as b3, OoxmlDrawingNode as b4, TreeDocColorValue as b5, ChartPart as bF, ChartThemeFaces as bG, ChartexPart as bH, CommentAnchor as bI, CommentPosition as bJ, CommitTextFormFieldOp as bK, ContentControlCheckbox as bL, ContentControlCheckboxState as bM, ContentControlDataBinding as bN, ContentControlDateFormat as bO, ContentControlEntry as bP, ContentControlKind as bQ, ContentControlLevel as bR, ContentControlListItem as bS, ContentControlLock as bT, ContentControlProperties as bU, ContentTypeError as bV, ContentTypeIndex as bW, ContentTypeRecords as bX, CreateImageResourceCacheOptions as bY, OoxmlAttribute as bd, OoxmlInvariantResult as be, LegacyTextArtProjection as bf, ChartPartResolver as bg, ChartexPartResolver as bh, ShapeSchemeColorResolver as bi, ShapeEffectList as bj, GroupTextboxProjection as bk, MetafileImageMime as bl, OoxmlFldCharNode as bm, OoxmlFldSimpleNode as bn, OoxmlInstrTextNode as bo, TreeOpResult as bp, RelationshipRecord as bq, OoxmlHardBreakNode as br, ShapeColor as bs, ResourceLimits as bt, CommentThreadState as bu, BookmarkOpPosition as bx, ReviewCommentItem as c, OoxmlTabNode as c$, DefaultRecord as c2, DeleteBookmarkOp as c3, DeleteTextOp as c4, DiagramPartResolver as c5, DiagramParts as c6, HyperlinkKind as c9, OoxmlContentControlCheckedStateNode as cA, OoxmlContentControlComboBoxNode as cB, OoxmlContentControlDataBindingNode as cC, OoxmlContentControlDateFormatNode as cD, OoxmlContentControlDateNode as cE, OoxmlContentControlDropDownListNode as cF, OoxmlContentControlEndPropertiesNode as cG, OoxmlContentControlLidNode as cH, OoxmlContentControlListItemNode as cI, OoxmlContentControlPropertiesNode as cJ, OoxmlContentControlStoreMappedDataAsNode as cK, OoxmlContentControlTextNode as cL, OoxmlContentControlUncheckedStateNode as cM, OoxmlDocumentNode as cN, OoxmlExternalTarget as cO, OoxmlGenericExtensionAttribute as cP, OoxmlHyperlinkNode as cQ, OoxmlInvariantIssueCode as cR, OoxmlKnownNodeAttribute as cS, OoxmlNamespaceBinding as cT, OoxmlNodeIdentityRules as cU, OoxmlParagraphPropertiesNode as cV, OoxmlPartMetadata as cW, OoxmlReadRejection as cX, OoxmlReadResult as cY, OoxmlRunNode as cZ, OoxmlRunPropertiesNode as c_, HyperlinkTarget as ca, ImageRelationshipResolution as cd, ImageResourceLookup as ce, IndexResult as cf, InsertBookmarkOp as cg, InsertBuildingBlockOp as ch, InsertComplexFieldOp as ci, InsertEquationOp as cj, InsertPageFieldOp as ck, InsertTextOp as cl, LegacyCheckboxFieldRange as cm, NameRejection as cq, NameResult as cr, OoxmlBodyNode as cu, OoxmlBookmarkEndNode as cv, OoxmlBookmarkStartNode as cw, OoxmlContentControlCalendarNode as cx, OoxmlContentControlCheckboxNode as cy, OoxmlContentControlCheckedNode as cz, ReviewCustomItem as d, OoxmlTextElementNode as d0, OoxmlTextNode as d1, OoxmlWmlValAttribute as d2, OoxmlXmlSpaceAttribute as d3, OverrideRecord as d4, RelationshipError as d5, RelationshipSetResult as d6, RelationshipTargetResolver as d7, ResolveResult as d8, ResolvedRelationship as d9, ZipReadResult as dA, ZipRejection as dB, SetFieldResultOp as da, SetLegacyCheckboxOp as db, SetLegacyDropdownOp as dc, SetTextFormFieldDefaultOp as dd, ShapeReflection as de, ShapeShadow as df, TabStopWrite as dh, TargetMode as di, TextFormFieldType as dj, TextboxStoryProjection as dk, TreeDocOpKind as dl, TreeOpEffect as dm, ValidatedRasterHeader as dn, VectorGradient as dp, VectorPattern as dq, XmlLimits as dv, XmlNode as dw, XmlRejection as dx, XmlResult as dy, ZipLimits as dz, ReviewPosition as e, AffineMatrix as eM, DrawingChartPlotType as eN, DrawingChartShownAs as eO, GradientStop as eP, ReviewRange as f, ReviewRevisionKind as g, RevisionAddress as h, ContentControlType as i, DocTarget as j, RunFormatting as k, Extent as l, ContainerRef as m, ContentControlFilter as n, DocRange as o, Revision as p, DocComment as q, ColorValue as r, ContentControl as s, DocAnchor as t, DocAnchorRange as u, DocLocation as v, DocumentBody as w, ExecErrorCode as x, IndentFormatting as y, Paragraph as z };