@cj-tech-master/excelts 9.4.2 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/dist/browser/index.browser.d.ts +8 -5
  2. package/dist/browser/index.browser.js +19 -1
  3. package/dist/browser/index.d.ts +4 -2
  4. package/dist/browser/index.js +9 -1
  5. package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
  6. package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
  7. package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
  8. package/dist/browser/modules/excel/chart/chart-api.js +364 -0
  9. package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
  10. package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
  11. package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  12. package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
  13. package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  14. package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
  15. package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  16. package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
  17. package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
  18. package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
  19. package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
  20. package/dist/browser/modules/excel/chart/chart-images.js +363 -0
  21. package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
  22. package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
  23. package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
  24. package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
  25. package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
  26. package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
  27. package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
  28. package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
  29. package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
  30. package/dist/browser/modules/excel/chart/chart.js +1320 -0
  31. package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  32. package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
  33. package/dist/browser/modules/excel/chart/index.d.ts +54 -0
  34. package/dist/browser/modules/excel/chart/index.js +46 -0
  35. package/dist/browser/modules/excel/chart/install.d.ts +44 -0
  36. package/dist/browser/modules/excel/chart/install.js +91 -0
  37. package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
  38. package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
  39. package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
  40. package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
  41. package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
  42. package/dist/browser/modules/excel/chart/topojson.js +236 -0
  43. package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
  44. package/dist/browser/modules/excel/chart/types.js +8 -0
  45. package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
  46. package/dist/browser/modules/excel/chart-host-registry.js +90 -0
  47. package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
  48. package/dist/browser/modules/excel/chartsheet.js +196 -0
  49. package/dist/browser/modules/excel/defined-names.d.ts +35 -0
  50. package/dist/browser/modules/excel/defined-names.js +44 -4
  51. package/dist/browser/modules/excel/errors.d.ts +6 -0
  52. package/dist/browser/modules/excel/errors.js +9 -0
  53. package/dist/browser/modules/excel/form-control.d.ts +6 -0
  54. package/dist/browser/modules/excel/form-control.js +17 -0
  55. package/dist/browser/modules/excel/image.js +12 -2
  56. package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
  57. package/dist/browser/modules/excel/pivot-chart.js +53 -0
  58. package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
  59. package/dist/browser/modules/excel/pivot-table.js +35 -0
  60. package/dist/browser/modules/excel/range.js +5 -1
  61. package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
  62. package/dist/browser/modules/excel/sparkline/index.js +7 -0
  63. package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
  64. package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
  65. package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
  66. package/dist/browser/modules/excel/table.js +42 -6
  67. package/dist/browser/modules/excel/types.d.ts +72 -0
  68. package/dist/browser/modules/excel/utils/address.d.ts +18 -0
  69. package/dist/browser/modules/excel/utils/address.js +28 -0
  70. package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
  71. package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
  72. package/dist/browser/modules/excel/utils/guid.js +35 -0
  73. package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
  74. package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
  75. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  76. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  77. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  78. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  79. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  80. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  81. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  82. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  83. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  84. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  85. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  86. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  87. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  88. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  89. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  90. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  91. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  92. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  93. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  94. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  95. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  96. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  97. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  98. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  99. package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  100. package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
  101. package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  102. package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
  103. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  104. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  105. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  106. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  107. package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  108. package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
  109. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  110. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  111. package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
  112. package/dist/browser/modules/excel/workbook.browser.js +966 -31
  113. package/dist/browser/modules/excel/workbook.d.ts +43 -0
  114. package/dist/browser/modules/excel/workbook.js +48 -0
  115. package/dist/browser/modules/excel/worksheet.d.ts +157 -3
  116. package/dist/browser/modules/excel/worksheet.js +394 -35
  117. package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
  118. package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
  119. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  120. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  121. package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  122. package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  123. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  124. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  125. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  126. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  127. package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  128. package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  129. package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  130. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  131. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  132. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  133. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  134. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  135. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  136. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  137. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  138. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  139. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  140. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  141. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  142. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  143. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  144. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  145. package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  146. package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  147. package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  148. package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
  149. package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  150. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
  151. package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
  152. package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
  153. package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
  154. package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
  155. package/dist/browser/modules/pdf/excel-bridge.js +683 -12
  156. package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
  157. package/dist/browser/modules/pdf/font/font-manager.js +39 -0
  158. package/dist/browser/modules/pdf/index.d.ts +5 -2
  159. package/dist/browser/modules/pdf/index.js +3 -1
  160. package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
  161. package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
  162. package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
  163. package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
  164. package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
  165. package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
  166. package/dist/browser/modules/pdf/types.d.ts +227 -23
  167. package/dist/browser/modules/pdf/types.js +4 -0
  168. package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
  169. package/dist/browser/modules/pdf/word-bridge.js +304 -0
  170. package/dist/browser/modules/word/constants.d.ts +179 -0
  171. package/dist/browser/modules/word/constants.js +231 -0
  172. package/dist/browser/modules/word/content-types.d.ts +27 -0
  173. package/dist/browser/modules/word/content-types.js +53 -0
  174. package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
  175. package/dist/browser/modules/word/digital-signatures.js +134 -0
  176. package/dist/browser/modules/word/document.d.ts +728 -0
  177. package/dist/browser/modules/word/document.js +1795 -0
  178. package/dist/browser/modules/word/docx-packager.d.ts +14 -0
  179. package/dist/browser/modules/word/docx-packager.js +822 -0
  180. package/dist/browser/modules/word/docx-reader.d.ts +11 -0
  181. package/dist/browser/modules/word/docx-reader.js +4929 -0
  182. package/dist/browser/modules/word/encryption.d.ts +102 -0
  183. package/dist/browser/modules/word/encryption.js +274 -0
  184. package/dist/browser/modules/word/errors.d.ts +49 -0
  185. package/dist/browser/modules/word/errors.js +68 -0
  186. package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
  187. package/dist/browser/modules/word/font-obfuscation.js +83 -0
  188. package/dist/browser/modules/word/html-renderer.d.ts +38 -0
  189. package/dist/browser/modules/word/html-renderer.js +782 -0
  190. package/dist/browser/modules/word/index.base.d.ts +19 -0
  191. package/dist/browser/modules/word/index.base.js +51 -0
  192. package/dist/browser/modules/word/index.browser.d.ts +4 -0
  193. package/dist/browser/modules/word/index.browser.js +4 -0
  194. package/dist/browser/modules/word/index.d.ts +4 -0
  195. package/dist/browser/modules/word/index.js +4 -0
  196. package/dist/browser/modules/word/internal-utils.d.ts +23 -0
  197. package/dist/browser/modules/word/internal-utils.js +54 -0
  198. package/dist/browser/modules/word/relationships.d.ts +31 -0
  199. package/dist/browser/modules/word/relationships.js +56 -0
  200. package/dist/browser/modules/word/types.d.ts +2325 -0
  201. package/dist/browser/modules/word/types.js +10 -0
  202. package/dist/browser/modules/word/units.d.ts +49 -0
  203. package/dist/browser/modules/word/units.js +111 -0
  204. package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
  205. package/dist/browser/modules/word/writers/chart-writer.js +385 -0
  206. package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
  207. package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
  208. package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
  209. package/dist/browser/modules/word/writers/comment-writer.js +70 -0
  210. package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
  211. package/dist/browser/modules/word/writers/document-writer.js +461 -0
  212. package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
  213. package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
  214. package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
  215. package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
  216. package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
  217. package/dist/browser/modules/word/writers/image-writer.js +185 -0
  218. package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
  219. package/dist/browser/modules/word/writers/math-writer.js +428 -0
  220. package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
  221. package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
  222. package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
  223. package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
  224. package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
  225. package/dist/browser/modules/word/writers/parts-writer.js +660 -0
  226. package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
  227. package/dist/browser/modules/word/writers/run-writer.js +649 -0
  228. package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
  229. package/dist/browser/modules/word/writers/section-writer.js +238 -0
  230. package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
  231. package/dist/browser/modules/word/writers/styles-writer.js +242 -0
  232. package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
  233. package/dist/browser/modules/word/writers/table-writer.js +503 -0
  234. package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
  235. package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
  236. package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
  237. package/dist/browser/modules/word/writers/toc-writer.js +79 -0
  238. package/dist/browser/modules/xml/encode.d.ts +56 -7
  239. package/dist/browser/modules/xml/encode.js +157 -11
  240. package/dist/cjs/index.js +13 -2
  241. package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
  242. package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
  243. package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
  244. package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
  245. package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
  246. package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
  247. package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
  248. package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
  249. package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
  250. package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
  251. package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
  252. package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
  253. package/dist/cjs/modules/excel/chart/chart.js +1324 -0
  254. package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
  255. package/dist/cjs/modules/excel/chart/index.js +101 -0
  256. package/dist/cjs/modules/excel/chart/install.js +95 -0
  257. package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
  258. package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
  259. package/dist/cjs/modules/excel/chart/topojson.js +239 -0
  260. package/dist/cjs/modules/excel/chart/types.js +9 -0
  261. package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
  262. package/dist/cjs/modules/excel/chartsheet.js +199 -0
  263. package/dist/cjs/modules/excel/defined-names.js +44 -4
  264. package/dist/cjs/modules/excel/errors.js +11 -1
  265. package/dist/cjs/modules/excel/form-control.js +17 -0
  266. package/dist/cjs/modules/excel/image.js +12 -2
  267. package/dist/cjs/modules/excel/pivot-chart.js +56 -0
  268. package/dist/cjs/modules/excel/pivot-table.js +35 -0
  269. package/dist/cjs/modules/excel/range.js +5 -1
  270. package/dist/cjs/modules/excel/sparkline/index.js +23 -0
  271. package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
  272. package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
  273. package/dist/cjs/modules/excel/table.js +42 -6
  274. package/dist/cjs/modules/excel/utils/address.js +29 -0
  275. package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
  276. package/dist/cjs/modules/excel/utils/guid.js +38 -0
  277. package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
  278. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
  279. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
  280. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
  281. package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
  282. package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
  283. package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
  284. package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
  285. package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
  286. package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
  287. package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
  288. package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
  289. package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
  290. package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
  291. package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
  292. package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
  293. package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
  294. package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
  295. package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
  296. package/dist/cjs/modules/excel/workbook.browser.js +973 -38
  297. package/dist/cjs/modules/excel/workbook.js +48 -0
  298. package/dist/cjs/modules/excel/worksheet.js +393 -34
  299. package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
  300. package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  301. package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  302. package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  303. package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
  304. package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
  305. package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
  306. package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  307. package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  308. package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  309. package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
  310. package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  311. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  312. package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  313. package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
  314. package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  315. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
  316. package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  317. package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  318. package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
  319. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
  320. package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
  321. package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
  322. package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
  323. package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
  324. package/dist/cjs/modules/pdf/index.js +5 -1
  325. package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
  326. package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
  327. package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
  328. package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
  329. package/dist/cjs/modules/pdf/types.js +5 -0
  330. package/dist/cjs/modules/pdf/word-bridge.js +307 -0
  331. package/dist/cjs/modules/word/constants.js +234 -0
  332. package/dist/cjs/modules/word/content-types.js +57 -0
  333. package/dist/cjs/modules/word/digital-signatures.js +140 -0
  334. package/dist/cjs/modules/word/document.js +1909 -0
  335. package/dist/cjs/modules/word/docx-packager.js +825 -0
  336. package/dist/cjs/modules/word/docx-reader.js +4932 -0
  337. package/dist/cjs/modules/word/encryption.js +282 -0
  338. package/dist/cjs/modules/word/errors.js +88 -0
  339. package/dist/cjs/modules/word/font-obfuscation.js +88 -0
  340. package/dist/cjs/modules/word/html-renderer.js +785 -0
  341. package/dist/cjs/modules/word/index.base.js +199 -0
  342. package/dist/cjs/modules/word/index.browser.js +20 -0
  343. package/dist/cjs/modules/word/index.js +20 -0
  344. package/dist/cjs/modules/word/internal-utils.js +59 -0
  345. package/dist/cjs/modules/word/relationships.js +60 -0
  346. package/dist/cjs/modules/word/types.js +11 -0
  347. package/dist/cjs/modules/word/units.js +135 -0
  348. package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
  349. package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
  350. package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
  351. package/dist/cjs/modules/word/writers/document-writer.js +465 -0
  352. package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
  353. package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
  354. package/dist/cjs/modules/word/writers/image-writer.js +188 -0
  355. package/dist/cjs/modules/word/writers/math-writer.js +431 -0
  356. package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
  357. package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
  358. package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
  359. package/dist/cjs/modules/word/writers/run-writer.js +655 -0
  360. package/dist/cjs/modules/word/writers/section-writer.js +241 -0
  361. package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
  362. package/dist/cjs/modules/word/writers/table-writer.js +506 -0
  363. package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
  364. package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
  365. package/dist/cjs/modules/xml/encode.js +158 -11
  366. package/dist/esm/index.browser.js +20 -2
  367. package/dist/esm/index.js +9 -1
  368. package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
  369. package/dist/esm/modules/excel/chart/chart-api.js +364 -0
  370. package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
  371. package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
  372. package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
  373. package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
  374. package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
  375. package/dist/esm/modules/excel/chart/chart-images.js +363 -0
  376. package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
  377. package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
  378. package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
  379. package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
  380. package/dist/esm/modules/excel/chart/chart.js +1320 -0
  381. package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
  382. package/dist/esm/modules/excel/chart/index.js +46 -0
  383. package/dist/esm/modules/excel/chart/install.js +91 -0
  384. package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
  385. package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
  386. package/dist/esm/modules/excel/chart/topojson.js +236 -0
  387. package/dist/esm/modules/excel/chart/types.js +8 -0
  388. package/dist/esm/modules/excel/chart-host-registry.js +90 -0
  389. package/dist/esm/modules/excel/chartsheet.js +196 -0
  390. package/dist/esm/modules/excel/defined-names.js +44 -4
  391. package/dist/esm/modules/excel/errors.js +9 -0
  392. package/dist/esm/modules/excel/form-control.js +17 -0
  393. package/dist/esm/modules/excel/image.js +12 -2
  394. package/dist/esm/modules/excel/pivot-chart.js +53 -0
  395. package/dist/esm/modules/excel/pivot-table.js +35 -0
  396. package/dist/esm/modules/excel/range.js +5 -1
  397. package/dist/esm/modules/excel/sparkline/index.js +7 -0
  398. package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
  399. package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
  400. package/dist/esm/modules/excel/table.js +42 -6
  401. package/dist/esm/modules/excel/utils/address.js +28 -0
  402. package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
  403. package/dist/esm/modules/excel/utils/guid.js +35 -0
  404. package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
  405. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  406. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  407. package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  408. package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  409. package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  410. package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  411. package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  412. package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  413. package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  414. package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  415. package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  416. package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  417. package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
  418. package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
  419. package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  420. package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  421. package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
  422. package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  423. package/dist/esm/modules/excel/workbook.browser.js +969 -34
  424. package/dist/esm/modules/excel/workbook.js +48 -0
  425. package/dist/esm/modules/excel/worksheet.js +394 -35
  426. package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
  427. package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  428. package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  429. package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  430. package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  431. package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  432. package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  433. package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  434. package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  435. package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  436. package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  437. package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  438. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  439. package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  440. package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  441. package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  442. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  443. package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  444. package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  445. package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
  446. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
  447. package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
  448. package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
  449. package/dist/esm/modules/pdf/excel-bridge.js +683 -12
  450. package/dist/esm/modules/pdf/font/font-manager.js +39 -0
  451. package/dist/esm/modules/pdf/index.js +3 -1
  452. package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
  453. package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
  454. package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
  455. package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
  456. package/dist/esm/modules/pdf/types.js +4 -0
  457. package/dist/esm/modules/pdf/word-bridge.js +304 -0
  458. package/dist/esm/modules/word/constants.js +231 -0
  459. package/dist/esm/modules/word/content-types.js +53 -0
  460. package/dist/esm/modules/word/digital-signatures.js +134 -0
  461. package/dist/esm/modules/word/document.js +1795 -0
  462. package/dist/esm/modules/word/docx-packager.js +822 -0
  463. package/dist/esm/modules/word/docx-reader.js +4929 -0
  464. package/dist/esm/modules/word/encryption.js +274 -0
  465. package/dist/esm/modules/word/errors.js +68 -0
  466. package/dist/esm/modules/word/font-obfuscation.js +83 -0
  467. package/dist/esm/modules/word/html-renderer.js +782 -0
  468. package/dist/esm/modules/word/index.base.js +51 -0
  469. package/dist/esm/modules/word/index.browser.js +4 -0
  470. package/dist/esm/modules/word/index.js +4 -0
  471. package/dist/esm/modules/word/internal-utils.js +54 -0
  472. package/dist/esm/modules/word/relationships.js +56 -0
  473. package/dist/esm/modules/word/types.js +10 -0
  474. package/dist/esm/modules/word/units.js +111 -0
  475. package/dist/esm/modules/word/writers/chart-writer.js +385 -0
  476. package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
  477. package/dist/esm/modules/word/writers/comment-writer.js +70 -0
  478. package/dist/esm/modules/word/writers/document-writer.js +461 -0
  479. package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
  480. package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
  481. package/dist/esm/modules/word/writers/image-writer.js +185 -0
  482. package/dist/esm/modules/word/writers/math-writer.js +428 -0
  483. package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
  484. package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
  485. package/dist/esm/modules/word/writers/parts-writer.js +660 -0
  486. package/dist/esm/modules/word/writers/run-writer.js +649 -0
  487. package/dist/esm/modules/word/writers/section-writer.js +238 -0
  488. package/dist/esm/modules/word/writers/styles-writer.js +242 -0
  489. package/dist/esm/modules/word/writers/table-writer.js +503 -0
  490. package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
  491. package/dist/esm/modules/word/writers/toc-writer.js +79 -0
  492. package/dist/esm/modules/xml/encode.js +157 -11
  493. package/dist/iife/excelts.iife.js +11789 -687
  494. package/dist/iife/excelts.iife.js.map +1 -1
  495. package/dist/iife/excelts.iife.min.js +52 -44
  496. package/dist/types/index.browser.d.ts +8 -5
  497. package/dist/types/index.d.ts +4 -2
  498. package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
  499. package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
  500. package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
  501. package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  502. package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  503. package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  504. package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
  505. package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
  506. package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
  507. package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
  508. package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
  509. package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
  510. package/dist/types/modules/excel/chart/chart.d.ts +504 -0
  511. package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  512. package/dist/types/modules/excel/chart/index.d.ts +54 -0
  513. package/dist/types/modules/excel/chart/install.d.ts +44 -0
  514. package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
  515. package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
  516. package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
  517. package/dist/types/modules/excel/chart/types.d.ts +2559 -0
  518. package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
  519. package/dist/types/modules/excel/chartsheet.d.ts +102 -0
  520. package/dist/types/modules/excel/defined-names.d.ts +35 -0
  521. package/dist/types/modules/excel/errors.d.ts +6 -0
  522. package/dist/types/modules/excel/form-control.d.ts +6 -0
  523. package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
  524. package/dist/types/modules/excel/pivot-table.d.ts +55 -0
  525. package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
  526. package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
  527. package/dist/types/modules/excel/types.d.ts +72 -0
  528. package/dist/types/modules/excel/utils/address.d.ts +18 -0
  529. package/dist/types/modules/excel/utils/guid.d.ts +15 -0
  530. package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
  531. package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  532. package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  533. package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  534. package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  535. package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  536. package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  537. package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  538. package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  539. package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  540. package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  541. package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  542. package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  543. package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  544. package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  545. package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  546. package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  547. package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  548. package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  549. package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
  550. package/dist/types/modules/excel/workbook.d.ts +43 -0
  551. package/dist/types/modules/excel/worksheet.d.ts +157 -3
  552. package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
  553. package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  554. package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  555. package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  556. package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  557. package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  558. package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  559. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  560. package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  561. package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  562. package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  563. package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  564. package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  565. package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
  566. package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
  567. package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
  568. package/dist/types/modules/pdf/index.d.ts +5 -2
  569. package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
  570. package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
  571. package/dist/types/modules/pdf/types.d.ts +227 -23
  572. package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
  573. package/dist/types/modules/word/constants.d.ts +179 -0
  574. package/dist/types/modules/word/content-types.d.ts +27 -0
  575. package/dist/types/modules/word/digital-signatures.d.ts +87 -0
  576. package/dist/types/modules/word/document.d.ts +728 -0
  577. package/dist/types/modules/word/docx-packager.d.ts +14 -0
  578. package/dist/types/modules/word/docx-reader.d.ts +11 -0
  579. package/dist/types/modules/word/encryption.d.ts +102 -0
  580. package/dist/types/modules/word/errors.d.ts +49 -0
  581. package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
  582. package/dist/types/modules/word/html-renderer.d.ts +38 -0
  583. package/dist/types/modules/word/index.base.d.ts +19 -0
  584. package/dist/types/modules/word/index.browser.d.ts +4 -0
  585. package/dist/types/modules/word/index.d.ts +4 -0
  586. package/dist/types/modules/word/internal-utils.d.ts +23 -0
  587. package/dist/types/modules/word/relationships.d.ts +31 -0
  588. package/dist/types/modules/word/types.d.ts +2325 -0
  589. package/dist/types/modules/word/units.d.ts +49 -0
  590. package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
  591. package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
  592. package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
  593. package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
  594. package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
  595. package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
  596. package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
  597. package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
  598. package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
  599. package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
  600. package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
  601. package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
  602. package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
  603. package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
  604. package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
  605. package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
  606. package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
  607. package/dist/types/modules/xml/encode.d.ts +56 -7
  608. package/package.json +29 -11
  609. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
  610. package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
  611. package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
  612. package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
  613. package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
  614. package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
  615. package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
  616. package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
  617. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
  618. package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
@@ -0,0 +1,2325 @@
1
+ /**
2
+ * DOCX Module - Core Types
3
+ *
4
+ * Comprehensive type definitions for WordprocessingML (OOXML) documents.
5
+ * Covers paragraphs, runs, tables, images, headers/footers, numbering,
6
+ * styles, sections, footnotes/endnotes, bookmarks, hyperlinks, comments,
7
+ * track changes, TOC, math equations, text boxes, checkboxes, custom
8
+ * properties, page borders, document background, and more.
9
+ */
10
+ /**
11
+ * Half-point value (used for font sizes).
12
+ * A value of 24 = 12pt.
13
+ */
14
+ export type HalfPoint = number;
15
+ /**
16
+ * Twips (twentieths of a point).
17
+ * 1 inch = 1440 twips, 1 cm = 567 twips, 1 pt = 20 twips.
18
+ */
19
+ export type Twips = number;
20
+ /**
21
+ * English Metric Units (EMU).
22
+ * 1 inch = 914400 EMU, 1 cm = 360000 EMU, 1 pt = 12700 EMU.
23
+ */
24
+ export type Emu = number;
25
+ /**
26
+ * Eighths of a point (used for border widths).
27
+ * A value of 4 = 0.5pt, 8 = 1pt.
28
+ */
29
+ export type EighthPoint = number;
30
+ /**
31
+ * 6-digit hex RGB color string (e.g. "FF0000") or "auto" for default.
32
+ */
33
+ export type HexColor = string;
34
+ /** Shading pattern type (ST_Shd). */
35
+ export type ShadingType = "clear" | "solid" | "horzStripe" | "vertStripe" | "reverseDiagStripe" | "diagStripe" | "horzCross" | "diagCross" | "thinHorzStripe" | "thinVertStripe" | "thinReverseDiagStripe" | "thinDiagStripe" | "thinHorzCross" | "thinDiagCross" | "pct5" | "pct10" | "pct12" | "pct15" | "pct20" | "pct25" | "pct30" | "pct35" | "pct37" | "pct40" | "pct45" | "pct50" | "pct55" | "pct60" | "pct62" | "pct65" | "pct70" | "pct75" | "pct80" | "pct85" | "pct87" | "pct90" | "pct95" | "nil";
36
+ /** Border style type (ST_Border). */
37
+ export type BorderStyle = "single" | "double" | "thick" | "dotted" | "dashed" | "dotDash" | "dotDotDash" | "triple" | "thinThickSmallGap" | "thickThinSmallGap" | "thinThickThinSmallGap" | "thinThickMediumGap" | "thickThinMediumGap" | "thinThickThinMediumGap" | "thinThickLargeGap" | "thickThinLargeGap" | "thinThickThinLargeGap" | "wave" | "doubleWave" | "dashSmallGap" | "dashDotStroked" | "threeDEmboss" | "threeDEngrave" | "outset" | "inset" | "none" | "nil";
38
+ /** Page orientation. */
39
+ export type PageOrientation = "portrait" | "landscape";
40
+ /** Page size preset. */
41
+ export interface PageSize {
42
+ /** Width in twips. */
43
+ readonly width: Twips;
44
+ /** Height in twips. */
45
+ readonly height: Twips;
46
+ /** Orientation. Default: "portrait". */
47
+ readonly orientation?: PageOrientation;
48
+ }
49
+ /** Page margins in twips. */
50
+ export interface PageMargins {
51
+ readonly top: Twips;
52
+ readonly right: Twips;
53
+ readonly bottom: Twips;
54
+ readonly left: Twips;
55
+ /** Header distance from top edge. Default: 720 (0.5 inch). */
56
+ readonly header?: Twips;
57
+ /** Footer distance from bottom edge. Default: 720 (0.5 inch). */
58
+ readonly footer?: Twips;
59
+ /** Gutter margin. Default: 0. */
60
+ readonly gutter?: Twips;
61
+ }
62
+ /** Column definition for multi-column sections. */
63
+ export interface ColumnDef {
64
+ /** Column width in twips. */
65
+ readonly width: Twips;
66
+ /** Space after this column in twips. */
67
+ readonly space?: Twips;
68
+ }
69
+ /** Section column layout. */
70
+ export interface SectionColumns {
71
+ /** Number of columns (when equal width). */
72
+ readonly count?: number;
73
+ /** Space between columns in twips (when equal width). */
74
+ readonly space?: Twips;
75
+ /** Whether columns have equal width. Default: true. */
76
+ readonly equalWidth?: boolean;
77
+ /** Individual column definitions (when not equal width). */
78
+ readonly columns?: readonly ColumnDef[];
79
+ /** Whether to draw a line between columns. */
80
+ readonly separator?: boolean;
81
+ }
82
+ /** Section break type. */
83
+ export type SectionBreakType = "nextPage" | "continuous" | "evenPage" | "oddPage" | "nextColumn";
84
+ /** Page number format. */
85
+ export type PageNumberFormat = "decimal" | "upperRoman" | "lowerRoman" | "upperLetter" | "lowerLetter";
86
+ /** Header/footer reference type. */
87
+ export type HeaderFooterType = "default" | "first" | "even";
88
+ /** Reference to a header or footer part. */
89
+ export interface HeaderFooterRef {
90
+ /** Type of header/footer. */
91
+ readonly type: HeaderFooterType;
92
+ /** Relationship ID referencing the header/footer part. */
93
+ readonly rId: string;
94
+ }
95
+ /** Page vertical alignment. */
96
+ export type PageVerticalAlign = "top" | "center" | "both" | "bottom";
97
+ /** Document grid type. */
98
+ export type DocumentGridType = "default" | "lines" | "linesAndChars" | "snapToChars";
99
+ /** Page text direction. */
100
+ export type PageTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV";
101
+ /** A single border definition. */
102
+ export interface Border {
103
+ /** Border style. */
104
+ readonly style: BorderStyle;
105
+ /** Width in eighths of a point. */
106
+ readonly size?: EighthPoint;
107
+ /** Space between border and content in points. */
108
+ readonly space?: number;
109
+ /** Color (hex RGB or "auto"). */
110
+ readonly color?: HexColor;
111
+ /** Theme color. */
112
+ readonly themeColor?: string;
113
+ /** Shadow. */
114
+ readonly shadow?: boolean;
115
+ /** Frame. */
116
+ readonly frame?: boolean;
117
+ /** Artistic border preset (for page borders only, w:art attribute). */
118
+ readonly art?: ArtBorderType;
119
+ }
120
+ /** Artistic page border types. There are 160+ standard Office artwork borders. */
121
+ export type ArtBorderType = string;
122
+ /** Page borders. */
123
+ export interface PageBorders {
124
+ readonly top?: Border;
125
+ readonly left?: Border;
126
+ readonly bottom?: Border;
127
+ readonly right?: Border;
128
+ /** Display setting: "allPages" | "firstPage" | "notFirstPage". */
129
+ readonly display?: "allPages" | "firstPage" | "notFirstPage";
130
+ /** Offset from: "page" | "text". */
131
+ readonly offsetFrom?: "page" | "text";
132
+ /** Z-ordering: "front" | "back". */
133
+ readonly zOrder?: "front" | "back";
134
+ }
135
+ /** Section properties. */
136
+ export interface SectionProperties {
137
+ /** Page size. */
138
+ readonly pageSize?: PageSize;
139
+ /** Page margins. */
140
+ readonly margins?: PageMargins;
141
+ /** Section break type. */
142
+ readonly breakType?: SectionBreakType;
143
+ /** Column layout. */
144
+ readonly columns?: SectionColumns;
145
+ /** Header references. */
146
+ readonly headers?: readonly HeaderFooterRef[];
147
+ /** Footer references. */
148
+ readonly footers?: readonly HeaderFooterRef[];
149
+ /** Different first page header/footer. */
150
+ readonly titlePage?: boolean;
151
+ /** Page number settings. */
152
+ readonly pageNumbering?: {
153
+ readonly start?: number;
154
+ readonly format?: PageNumberFormat;
155
+ };
156
+ /** Document grid. */
157
+ readonly docGrid?: {
158
+ readonly linePitch?: Twips;
159
+ readonly charSpace?: number;
160
+ readonly type?: DocumentGridType;
161
+ };
162
+ /** Line numbering. */
163
+ readonly lineNumbers?: {
164
+ readonly countBy?: number;
165
+ readonly start?: number;
166
+ readonly restart?: "newPage" | "newSection" | "continuous";
167
+ readonly distance?: Twips;
168
+ };
169
+ /** Page borders. */
170
+ readonly pageBorders?: PageBorders;
171
+ /** Page vertical alignment. */
172
+ readonly verticalAlign?: PageVerticalAlign;
173
+ /** Page text direction. */
174
+ readonly textDirection?: PageTextDirection;
175
+ /** Footnote properties for this section. */
176
+ readonly footnoteProperties?: FootnoteProperties;
177
+ /** Endnote properties for this section. */
178
+ readonly endnoteProperties?: EndnoteProperties;
179
+ /** Section property change revision (track changes). */
180
+ readonly propertyChange?: SectionPropertyChange;
181
+ /** Right-to-left section (w:bidi). */
182
+ readonly bidi?: boolean;
183
+ /** Form protection (w:formProt). */
184
+ readonly formProtection?: boolean;
185
+ /** Register (w:rtlGutter for right-to-left). */
186
+ readonly rtlGutter?: boolean;
187
+ }
188
+ /** Underline styles. */
189
+ export type UnderlineStyle = "single" | "double" | "thick" | "dotted" | "dash" | "dotDash" | "dotDotDash" | "wave" | "wavyHeavy" | "wavyDouble" | "dashLong" | "dashLongHeavy" | "words" | "none";
190
+ /** Vertical alignment for superscript/subscript. */
191
+ export type VerticalAlign = "superscript" | "subscript" | "baseline";
192
+ /** Highlight colors. */
193
+ export type HighlightColor = "black" | "blue" | "cyan" | "darkBlue" | "darkCyan" | "darkGray" | "darkGreen" | "darkMagenta" | "darkRed" | "darkYellow" | "green" | "lightGray" | "magenta" | "none" | "red" | "white" | "yellow";
194
+ /** Font specification. */
195
+ export interface FontSpec {
196
+ /** ASCII / Latin font name. */
197
+ readonly ascii?: string;
198
+ /** High ANSI font name (often same as ascii). */
199
+ readonly hAnsi?: string;
200
+ /** East Asian font name. */
201
+ readonly eastAsia?: string;
202
+ /** Complex Script font name. */
203
+ readonly cs?: string;
204
+ /** Font hint. */
205
+ readonly hint?: "default" | "eastAsia" | "cs";
206
+ /** ASCII theme font reference (e.g. "minorHAnsi"). */
207
+ readonly asciiTheme?: string;
208
+ /** High ANSI theme font reference. */
209
+ readonly hAnsiTheme?: string;
210
+ /** East Asian theme font reference. */
211
+ readonly eastAsiaTheme?: string;
212
+ /** Complex Script theme font reference. */
213
+ readonly cstheme?: string;
214
+ }
215
+ /** Shading / background fill. */
216
+ export interface Shading {
217
+ /** Shading pattern. Default: "clear". */
218
+ readonly pattern?: ShadingType;
219
+ /** Pattern color. Usually "auto". */
220
+ readonly color?: HexColor;
221
+ /** Fill / background color. */
222
+ readonly fill: HexColor;
223
+ }
224
+ /** Underline specification (style + optional color). */
225
+ export interface UnderlineSpec {
226
+ /** Underline style. */
227
+ readonly style: UnderlineStyle;
228
+ /** Underline color (hex RGB or "auto"). Independent of text color. */
229
+ readonly color?: HexColor;
230
+ }
231
+ /** Text effect animation. */
232
+ export type TextEffect = "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle" | "none";
233
+ /** Emphasis mark type. */
234
+ export type EmphasisMarkType = "dot" | "comma" | "circle" | "underDot" | "none";
235
+ /** Color specification with optional theme support. */
236
+ export interface ColorSpec {
237
+ /** Hex RGB color value (e.g. "FF0000") or "auto". */
238
+ readonly val: HexColor;
239
+ /** Theme color reference. */
240
+ readonly themeColor?: string;
241
+ /** Theme tint (hex, e.g. "99"). */
242
+ readonly themeTint?: string;
243
+ /** Theme shade (hex, e.g. "BF"). */
244
+ readonly themeShade?: string;
245
+ }
246
+ /** Run properties (character-level formatting). */
247
+ export interface RunProperties {
248
+ /** Font specification. */
249
+ readonly font?: FontSpec | string;
250
+ /** Font size in half-points. val=24 -> 12pt. */
251
+ readonly size?: HalfPoint;
252
+ /** Complex script font size in half-points. */
253
+ readonly sizeCs?: HalfPoint;
254
+ /** Bold. */
255
+ readonly bold?: boolean;
256
+ /** Bold for complex scripts. */
257
+ readonly boldCs?: boolean;
258
+ /** Italic. */
259
+ readonly italic?: boolean;
260
+ /** Italic for complex scripts. */
261
+ readonly italicCs?: boolean;
262
+ /** Underline style, boolean shorthand, or full spec with color. */
263
+ readonly underline?: UnderlineStyle | boolean | UnderlineSpec;
264
+ /** Strikethrough. */
265
+ readonly strike?: boolean;
266
+ /** Double strikethrough. */
267
+ readonly doubleStrike?: boolean;
268
+ /** All caps. */
269
+ readonly caps?: boolean;
270
+ /** Small caps. */
271
+ readonly smallCaps?: boolean;
272
+ /** Text color (hex RGB, "auto", or full spec with theme support). */
273
+ readonly color?: HexColor | ColorSpec;
274
+ /** Highlight color. */
275
+ readonly highlight?: HighlightColor;
276
+ /** Background shading. */
277
+ readonly shading?: Shading;
278
+ /** Superscript / subscript. */
279
+ readonly vertAlign?: VerticalAlign;
280
+ /** Character spacing in twips. */
281
+ readonly spacing?: Twips;
282
+ /** Character style ID. */
283
+ readonly style?: string;
284
+ /** Language. */
285
+ readonly language?: {
286
+ readonly val?: string;
287
+ readonly eastAsia?: string;
288
+ readonly bidi?: string;
289
+ };
290
+ /** Vanish (hidden text). */
291
+ readonly vanish?: boolean;
292
+ /** Emboss effect. */
293
+ readonly emboss?: boolean;
294
+ /** Imprint (engrave) effect. */
295
+ readonly imprint?: boolean;
296
+ /** Do not check spelling/grammar. */
297
+ readonly noProof?: boolean;
298
+ /** Snap to document grid. */
299
+ readonly snapToGrid?: boolean;
300
+ /** Special vanish (hidden but still affects layout). */
301
+ readonly specVanish?: boolean;
302
+ /** Kerning threshold in half-points. Characters at or above this size will be kerned. */
303
+ readonly kern?: HalfPoint;
304
+ /** Vertical position offset in half-points (distinct from vertAlign). */
305
+ readonly position?: HalfPoint;
306
+ /** Character width scaling percentage (e.g. 100 = normal, 200 = double width). */
307
+ readonly scale?: number;
308
+ /** Right-to-left text. */
309
+ readonly rightToLeft?: boolean;
310
+ /** Complex script toggle (use CS font / bold / italic). */
311
+ readonly complexScript?: boolean;
312
+ /** Math mode flag. */
313
+ readonly math?: boolean;
314
+ /** Text effect / animation. */
315
+ readonly effect?: TextEffect;
316
+ /** Emphasis mark (East Asian typography). */
317
+ readonly emphasisMark?: EmphasisMarkType;
318
+ /** Character border (border around individual run). */
319
+ readonly border?: Border;
320
+ /** Fit text: force text to fit a specific width (in twips). */
321
+ readonly fitText?: {
322
+ /** Width in twips. */
323
+ readonly val: Twips;
324
+ /** Grouping ID for consecutive fitText runs. */
325
+ readonly id?: number;
326
+ };
327
+ /** Outline (display only character outlines). */
328
+ readonly outline?: boolean;
329
+ /** Shadow effect on text. */
330
+ readonly shadow?: boolean;
331
+ /** Web hidden (hidden in web layout view). */
332
+ readonly webHidden?: boolean;
333
+ /** Run property change revision (track changes). */
334
+ readonly propertyChange?: RunPropertyChange;
335
+ }
336
+ /** Text content within a run. */
337
+ export interface TextContent {
338
+ readonly type: "text";
339
+ /** Text string. */
340
+ readonly text: string;
341
+ }
342
+ /** Line break. */
343
+ export interface BreakContent {
344
+ readonly type: "break";
345
+ /** Break type. Default: line break (no breakType = line break). */
346
+ readonly breakType?: "page" | "column" | "textWrapping";
347
+ }
348
+ /** Tab character. */
349
+ export interface TabContent {
350
+ readonly type: "tab";
351
+ }
352
+ /** Ruby alignment. */
353
+ export type RubyAlign = "center" | "distributeLetter" | "distributeSpace" | "left" | "right" | "rightVertical";
354
+ /** Ruby (phonetic guide) properties. */
355
+ export interface RubyProperties {
356
+ /** Alignment of ruby text over base. */
357
+ readonly align?: RubyAlign;
358
+ /** Ruby text font size (half-points). */
359
+ readonly fontSize?: HalfPoint;
360
+ /** Raise of ruby text (half-points above base). */
361
+ readonly raise?: HalfPoint;
362
+ /** Base text font size (half-points). */
363
+ readonly baseFontSize?: HalfPoint;
364
+ /** Language ID (e.g. "ja-JP", "zh-CN"). */
365
+ readonly language?: string;
366
+ }
367
+ /** Ruby (phonetic guide) content — e.g. Japanese furigana or Chinese pinyin. */
368
+ export interface RubyContent {
369
+ readonly type: "ruby";
370
+ /** Ruby properties (styling). */
371
+ readonly properties?: RubyProperties;
372
+ /** Ruby text (the small phonetic text, shown above). */
373
+ readonly rubyText: readonly Run[];
374
+ /** Base text (the main text being annotated). */
375
+ readonly baseText: readonly Run[];
376
+ }
377
+ /** Positional tab character (w:ptab). */
378
+ export interface PositionalTabContent {
379
+ readonly type: "ptab";
380
+ /** Alignment of content at tab. */
381
+ readonly alignment: PositionalTabAlignment;
382
+ /** Base of the positioning. */
383
+ readonly relativeTo: PositionalTabRelativeTo;
384
+ /** Leader character. */
385
+ readonly leader?: PositionalTabLeader;
386
+ }
387
+ /** Symbol character. */
388
+ export interface SymbolContent {
389
+ readonly type: "symbol";
390
+ readonly font: string;
391
+ readonly char: string;
392
+ }
393
+ /** Footnote reference within a run. */
394
+ export interface FootnoteRefContent {
395
+ readonly type: "footnoteRef";
396
+ readonly id: number;
397
+ /** If true, the reference is followed by a custom mark character. */
398
+ readonly customMarkFollows?: boolean;
399
+ }
400
+ /** Endnote reference within a run. */
401
+ export interface EndnoteRefContent {
402
+ readonly type: "endnoteRef";
403
+ readonly id: number;
404
+ /** If true, the reference is followed by a custom mark character. */
405
+ readonly customMarkFollows?: boolean;
406
+ }
407
+ /** Field code (PAGE, NUMPAGES, DATE, TOC, etc.). */
408
+ export interface FieldContent {
409
+ readonly type: "field";
410
+ /** Field instruction text (e.g. " PAGE ", " NUMPAGES "). */
411
+ readonly instruction: string;
412
+ /** Cached display value. */
413
+ readonly cachedValue?: string;
414
+ /** Legacy form field data (from w:ffData). */
415
+ readonly formField?: FormField;
416
+ }
417
+ /** Inline image within a run. */
418
+ export interface InlineImageContent {
419
+ readonly type: "image";
420
+ /** Relationship ID for the image. */
421
+ readonly rId: string;
422
+ /** Width in EMU. */
423
+ readonly width: Emu;
424
+ /** Height in EMU. */
425
+ readonly height: Emu;
426
+ /** Alternative text for accessibility. */
427
+ readonly altText?: string;
428
+ /** Image name. */
429
+ readonly name?: string;
430
+ /** Unique drawing ID. */
431
+ readonly drawingId?: number;
432
+ /** Rotation in 60,000ths of a degree. */
433
+ readonly rotation?: number;
434
+ /** Flip horizontal. */
435
+ readonly flipHorizontal?: boolean;
436
+ /** Flip vertical. */
437
+ readonly flipVertical?: boolean;
438
+ /** Outline line properties. */
439
+ readonly outline?: {
440
+ readonly width?: Emu;
441
+ readonly color?: HexColor;
442
+ };
443
+ /** SVG image relationship ID (for SVG images with raster fallback). */
444
+ readonly svgRId?: string;
445
+ /** Source rectangle for cropping (fractions: 100000 = 100%). */
446
+ readonly srcRect?: {
447
+ readonly l?: number;
448
+ readonly t?: number;
449
+ readonly r?: number;
450
+ readonly b?: number;
451
+ };
452
+ }
453
+ /** Carriage return element. */
454
+ export interface CarriageReturnContent {
455
+ readonly type: "carriageReturn";
456
+ }
457
+ /** No-break hyphen. */
458
+ export interface NoBreakHyphenContent {
459
+ readonly type: "noBreakHyphen";
460
+ }
461
+ /** Soft hyphen. */
462
+ export interface SoftHyphenContent {
463
+ readonly type: "softHyphen";
464
+ }
465
+ /** Last rendered page break (read-only, informational). */
466
+ export interface LastRenderedPageBreakContent {
467
+ readonly type: "lastRenderedPageBreak";
468
+ }
469
+ /** Annotation reference (for comments). */
470
+ export interface AnnotationReferenceContent {
471
+ readonly type: "annotationReference";
472
+ readonly id: number;
473
+ }
474
+ /** Page number constants for convenience fields. */
475
+ export type PageNumberType = "current" | "totalPages" | "totalPagesInSection" | "currentSection";
476
+ /** Date/time field. */
477
+ export interface DateFieldContent {
478
+ readonly type: "dateField";
479
+ /** Date format string (e.g. "yyyy-MM-dd"). */
480
+ readonly format?: string;
481
+ /** Language tag. */
482
+ readonly language?: string;
483
+ }
484
+ /** Content that can appear inside a run. */
485
+ export type RunContent = TextContent | BreakContent | TabContent | PositionalTabContent | RubyContent | SymbolContent | FootnoteRefContent | EndnoteRefContent | FieldContent | InlineImageContent | CarriageReturnContent | NoBreakHyphenContent | SoftHyphenContent | LastRenderedPageBreakContent | AnnotationReferenceContent | DateFieldContent;
486
+ /** A run of text with uniform formatting. */
487
+ export interface Run {
488
+ /** Run properties (formatting). */
489
+ readonly properties?: RunProperties;
490
+ /** Content items within this run. */
491
+ readonly content: readonly RunContent[];
492
+ }
493
+ /** Base revision information. */
494
+ export interface RevisionInfo {
495
+ /** Author name. */
496
+ readonly author: string;
497
+ /** Date (ISO 8601 string). */
498
+ readonly date?: string;
499
+ /** Revision ID. */
500
+ readonly id: number;
501
+ }
502
+ /** An inserted text run (track changes). */
503
+ export interface InsertedRun {
504
+ readonly type: "insertedRun";
505
+ /** Revision metadata. */
506
+ readonly revision: RevisionInfo;
507
+ /** The run data. */
508
+ readonly run: Run;
509
+ }
510
+ /** A deleted text run (track changes). */
511
+ export interface DeletedRun {
512
+ readonly type: "deletedRun";
513
+ /** Revision metadata. */
514
+ readonly revision: RevisionInfo;
515
+ /** The run data (contains the deleted text for display). */
516
+ readonly run: Run;
517
+ }
518
+ /** A moved-from run (track changes — source of a move). */
519
+ export interface MovedFromRun {
520
+ readonly type: "movedFromRun";
521
+ /** Revision metadata. */
522
+ readonly revision: RevisionInfo;
523
+ /** The run data. */
524
+ readonly run: Run;
525
+ }
526
+ /** A moved-to run (track changes — destination of a move). */
527
+ export interface MovedToRun {
528
+ readonly type: "movedToRun";
529
+ /** Revision metadata. */
530
+ readonly revision: RevisionInfo;
531
+ /** The run data. */
532
+ readonly run: Run;
533
+ }
534
+ /** Move range marker (w:moveFromRangeStart/End, w:moveToRangeStart/End). */
535
+ export interface MoveRangeMarker {
536
+ readonly type: "moveFromRangeStart" | "moveFromRangeEnd" | "moveToRangeStart" | "moveToRangeEnd";
537
+ /** Revision ID. */
538
+ readonly id: number;
539
+ /** Author (required for start, optional for end). */
540
+ readonly author?: string;
541
+ /** Date. */
542
+ readonly date?: string;
543
+ /** Name of the move (for pairing start/end). */
544
+ readonly name?: string;
545
+ }
546
+ /** Custom XML tracking range marker. */
547
+ export interface CustomXmlTrackingMarker {
548
+ readonly type: "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd";
549
+ readonly id: number;
550
+ readonly author?: string;
551
+ readonly date?: string;
552
+ }
553
+ /** Paragraph property change revision. */
554
+ export interface ParagraphPropertyChange {
555
+ /** Revision metadata. */
556
+ readonly revision: RevisionInfo;
557
+ /** Previous paragraph properties. */
558
+ readonly previousProperties?: ParagraphProperties;
559
+ }
560
+ /** Run property change revision. */
561
+ export interface RunPropertyChange {
562
+ /** Revision metadata. */
563
+ readonly revision: RevisionInfo;
564
+ /** Previous run properties. */
565
+ readonly previousProperties?: RunProperties;
566
+ }
567
+ /** Section property change revision. */
568
+ export interface SectionPropertyChange {
569
+ /** Revision metadata. */
570
+ readonly revision: RevisionInfo;
571
+ /** Previous section properties. */
572
+ readonly previousProperties?: SectionProperties;
573
+ }
574
+ /** Table property change revision (w:tblPrChange). */
575
+ export interface TablePropertyChange {
576
+ readonly revision: RevisionInfo;
577
+ readonly previousProperties?: TableProperties;
578
+ }
579
+ /** Table row property change revision (w:trPrChange). */
580
+ export interface TableRowPropertyChange {
581
+ readonly revision: RevisionInfo;
582
+ readonly previousProperties?: TableRowProperties;
583
+ }
584
+ /** Table cell property change revision (w:tcPrChange). */
585
+ export interface TableCellPropertyChange {
586
+ readonly revision: RevisionInfo;
587
+ readonly previousProperties?: TableCellProperties;
588
+ }
589
+ /** Table grid cell revision (w:cellIns / w:cellDel / w:cellMerge). */
590
+ export interface CellMergeRevision {
591
+ /** Merge type. */
592
+ readonly vMerge: "cont" | "rest";
593
+ readonly revision: RevisionInfo;
594
+ }
595
+ /** Table row insertion/deletion revision. */
596
+ export interface TableRowRevision {
597
+ /** Revision metadata. */
598
+ readonly revision: RevisionInfo;
599
+ }
600
+ /** A comment definition. */
601
+ export interface CommentDef {
602
+ /** Unique comment ID. */
603
+ readonly id: number;
604
+ /** Author name. */
605
+ readonly author: string;
606
+ /** Date (ISO 8601 string). */
607
+ readonly date?: string;
608
+ /** Author initials. */
609
+ readonly initials?: string;
610
+ /** Comment content (paragraphs). */
611
+ readonly content: readonly Paragraph[];
612
+ /** Whether the comment has been marked resolved/done (w15:done). */
613
+ readonly done?: boolean;
614
+ /** Parent comment paraId (for reply threads; w15:paraIdParent). */
615
+ readonly parentId?: string;
616
+ }
617
+ /** Comment range start marker. */
618
+ export interface CommentRangeStart {
619
+ readonly type: "commentRangeStart";
620
+ readonly id: number;
621
+ }
622
+ /** Comment range end marker. */
623
+ export interface CommentRangeEnd {
624
+ readonly type: "commentRangeEnd";
625
+ readonly id: number;
626
+ }
627
+ /** Comment reference (in a run, links to a comment). */
628
+ export interface CommentReference {
629
+ readonly type: "commentReference";
630
+ readonly id: number;
631
+ }
632
+ /** Horizontal alignment. */
633
+ export type Alignment = "start" | "center" | "end" | "both" | "distribute" | "left" | "right";
634
+ /** Line spacing rule. */
635
+ export type LineSpacingRule = "auto" | "exact" | "atLeast";
636
+ /** Line spacing. */
637
+ export interface LineSpacing {
638
+ /** Spacing value. For "auto": 240ths of a line (240=single, 360=1.5, 480=double). For "exact"/"atLeast": twips. */
639
+ readonly line?: number;
640
+ /** Spacing rule. Default: "auto". */
641
+ readonly lineRule?: LineSpacingRule;
642
+ /** Spacing before paragraph in twips. */
643
+ readonly before?: Twips;
644
+ /** Spacing after paragraph in twips. */
645
+ readonly after?: Twips;
646
+ /** Automatic spacing before. */
647
+ readonly beforeAutoSpacing?: boolean;
648
+ /** Automatic spacing after. */
649
+ readonly afterAutoSpacing?: boolean;
650
+ }
651
+ /** Paragraph indentation in twips. */
652
+ export interface Indentation {
653
+ readonly left?: Twips;
654
+ readonly right?: Twips;
655
+ /** Hanging indent (mutually exclusive with firstLine). */
656
+ readonly hanging?: Twips;
657
+ /** First line indent (mutually exclusive with hanging). */
658
+ readonly firstLine?: Twips;
659
+ /** Start indent (logical direction, for BiDi). */
660
+ readonly start?: Twips;
661
+ /** End indent (logical direction, for BiDi). */
662
+ readonly end?: Twips;
663
+ }
664
+ /** Tab stop alignment. */
665
+ export type TabStopType = "left" | "center" | "right" | "decimal" | "bar" | "clear";
666
+ /** Tab stop leader character. */
667
+ export type TabStopLeader = "dot" | "hyphen" | "underscore" | "none" | "heavy" | "middleDot";
668
+ /** Tab stop definition. */
669
+ export interface TabStop {
670
+ readonly type: TabStopType;
671
+ /** Position in twips. */
672
+ readonly position: Twips;
673
+ readonly leader?: TabStopLeader;
674
+ }
675
+ /** Paragraph borders. */
676
+ export interface ParagraphBorders {
677
+ readonly top?: Border;
678
+ readonly bottom?: Border;
679
+ readonly left?: Border;
680
+ readonly right?: Border;
681
+ readonly between?: Border;
682
+ readonly bar?: Border;
683
+ }
684
+ /** Numbering reference for lists. */
685
+ export interface NumberingRef {
686
+ /** Numbering instance ID. */
687
+ readonly numId: number;
688
+ /** Indentation level (0-8). */
689
+ readonly level: number;
690
+ }
691
+ /** Frame anchor type. */
692
+ export type FrameAnchorType = "margin" | "page" | "text";
693
+ /** Drop cap type. */
694
+ export type DropCapType = "drop" | "margin" | "none";
695
+ /** Paragraph frame properties. */
696
+ export interface ParagraphFrame {
697
+ /** Drop cap type. */
698
+ readonly dropCap?: DropCapType;
699
+ /** Number of lines for drop cap. */
700
+ readonly lines?: number;
701
+ /** Width in twips. */
702
+ readonly width?: Twips;
703
+ /** Height in twips. */
704
+ readonly height?: Twips;
705
+ /** Horizontal space (margin from text) in twips. */
706
+ readonly hSpace?: Twips;
707
+ /** Vertical space in twips. */
708
+ readonly vSpace?: Twips;
709
+ /** Wrap text around frame. */
710
+ readonly wrap?: "auto" | "around" | "none" | "notBeside" | "through" | "tight";
711
+ /** Horizontal anchor. */
712
+ readonly hAnchor?: FrameAnchorType;
713
+ /** Vertical anchor. */
714
+ readonly vAnchor?: FrameAnchorType;
715
+ /** X position in twips. */
716
+ readonly x?: Twips;
717
+ /** Horizontal alignment. */
718
+ readonly xAlign?: "left" | "center" | "right" | "inside" | "outside";
719
+ /** Y position in twips. */
720
+ readonly y?: Twips;
721
+ /** Vertical alignment. */
722
+ readonly yAlign?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
723
+ }
724
+ /** Positional tab alignment. */
725
+ export type PositionalTabAlignment = "center" | "left" | "right";
726
+ /** Positional tab relative to. */
727
+ export type PositionalTabRelativeTo = "indent" | "margin";
728
+ /** Positional tab leader. */
729
+ export type PositionalTabLeader = "dot" | "hyphen" | "middleDot" | "none" | "underscore";
730
+ /** Paragraph properties. */
731
+ export interface ParagraphProperties {
732
+ /** Paragraph style ID. */
733
+ readonly style?: string;
734
+ /** Alignment. */
735
+ readonly alignment?: Alignment;
736
+ /** Indentation. */
737
+ readonly indent?: Indentation;
738
+ /** Spacing. */
739
+ readonly spacing?: LineSpacing;
740
+ /** Numbering/list reference. */
741
+ readonly numbering?: NumberingRef;
742
+ /** Paragraph borders. */
743
+ readonly borders?: ParagraphBorders;
744
+ /** Background shading. */
745
+ readonly shading?: Shading;
746
+ /** Tab stops. */
747
+ readonly tabs?: readonly TabStop[];
748
+ /** Keep with next paragraph on same page. */
749
+ readonly keepNext?: boolean;
750
+ /** Keep all lines on same page. */
751
+ readonly keepLines?: boolean;
752
+ /** Page break before paragraph. */
753
+ readonly pageBreakBefore?: boolean;
754
+ /** Widow/orphan control. */
755
+ readonly widowControl?: boolean;
756
+ /** Bidirectional text. */
757
+ readonly bidi?: boolean;
758
+ /** Section properties (for section breaks within paragraphs). */
759
+ readonly sectionProperties?: SectionProperties;
760
+ /** Run properties applied to the paragraph mark. */
761
+ readonly markRunProperties?: RunProperties;
762
+ /** Contextual spacing (ignore before/after for same-style paragraphs). */
763
+ readonly contextualSpacing?: boolean;
764
+ /** Thematic break (horizontal rule below paragraph). */
765
+ readonly thematicBreak?: boolean;
766
+ /** Suppress line numbers for this paragraph. */
767
+ readonly suppressLineNumbers?: boolean;
768
+ /** Allow automatic word wrap. */
769
+ readonly wordWrap?: boolean;
770
+ /** Allow punctuation to overflow margins (East Asian). */
771
+ readonly overflowPunctuation?: boolean;
772
+ /** Auto-space East Asian and Latin text. */
773
+ readonly autoSpaceEastAsianText?: boolean;
774
+ /** Auto-space between East Asian text and numbers (w:autoSpaceDN). */
775
+ readonly autoSpaceEastAsianDigit?: boolean;
776
+ /** Disable kinsoku (East Asian line-break rules). When false, kinsoku is enabled. */
777
+ readonly kinsoku?: boolean;
778
+ /** Top-line punctuation compression (East Asian). */
779
+ readonly topLinePunctuation?: boolean;
780
+ /** Outline level (0-9, used for TOC). */
781
+ readonly outlineLevel?: number;
782
+ /** Frame properties (paragraph positioning). */
783
+ readonly frame?: ParagraphFrame;
784
+ /** Paragraph property change revision (track changes). */
785
+ readonly propertyChange?: ParagraphPropertyChange;
786
+ /** Paragraph insertion revision (the paragraph mark itself was inserted). */
787
+ readonly paragraphInsertion?: RevisionInfo;
788
+ /** Paragraph deletion revision (the paragraph mark itself was deleted). */
789
+ readonly paragraphDeletion?: RevisionInfo;
790
+ /** Suppress auto-hyphens. */
791
+ readonly suppressAutoHyphens?: boolean;
792
+ /** Conditional formatting style mask (w:cnfStyle). */
793
+ readonly cnfStyle?: string;
794
+ /** Mirror indents for odd/even pages. */
795
+ readonly mirrorIndents?: boolean;
796
+ /** Text alignment within line (for East Asian vertical text). */
797
+ readonly textAlignment?: "auto" | "baseline" | "bottom" | "center" | "top";
798
+ /** Snap to grid. */
799
+ readonly snapToGrid?: boolean;
800
+ /** Text direction for paragraph. */
801
+ readonly textDirection?: PageTextDirection;
802
+ }
803
+ /** A paragraph. */
804
+ export interface Paragraph {
805
+ readonly type: "paragraph";
806
+ /** Paragraph properties. */
807
+ readonly properties?: ParagraphProperties;
808
+ /** Runs and hyperlinks within this paragraph. */
809
+ readonly children: readonly ParagraphChild[];
810
+ /** Paragraph ID (w14:paraId) for commenting/collaboration features. */
811
+ readonly paraId?: string;
812
+ /** Text ID (w14:textId) for commenting/collaboration features. */
813
+ readonly textId?: string;
814
+ }
815
+ /** A hyperlink within a paragraph. */
816
+ export interface Hyperlink {
817
+ readonly type: "hyperlink";
818
+ /** Relationship ID for external hyperlinks. */
819
+ readonly rId?: string;
820
+ /** Resolved URL for external hyperlinks (populated by reader, used by builder). */
821
+ readonly url?: string;
822
+ /** Anchor name for internal bookmark links. */
823
+ readonly anchor?: string;
824
+ /** Tooltip text displayed on hover. */
825
+ readonly tooltip?: string;
826
+ /** Whether the hyperlink has been visited (w:history). */
827
+ readonly history?: boolean;
828
+ /** Target frame name for web views (w:tgtFrame). */
829
+ readonly tgtFrame?: string;
830
+ /** Document location bookmark/fragment ID (w:docLocation). */
831
+ readonly docLocation?: string;
832
+ /** Runs within the hyperlink. */
833
+ readonly children: readonly Run[];
834
+ }
835
+ /** Bookmark start marker. */
836
+ export interface BookmarkStart {
837
+ readonly type: "bookmarkStart";
838
+ readonly id: number;
839
+ readonly name: string;
840
+ /** Column first (for column bookmarks in tables). */
841
+ readonly colFirst?: number;
842
+ /** Column last (for column bookmarks in tables). */
843
+ readonly colLast?: number;
844
+ /** Displaced by custom XML. */
845
+ readonly displacedByCustomXml?: "next" | "prev";
846
+ }
847
+ /** Bookmark end marker. */
848
+ export interface BookmarkEnd {
849
+ readonly type: "bookmarkEnd";
850
+ readonly id: number;
851
+ }
852
+ /** Items that can appear as children of a paragraph. */
853
+ export type ParagraphChild = Run | Hyperlink | BookmarkStart | BookmarkEnd | CommentRangeStart | CommentRangeEnd | CommentReference | InsertedRun | DeletedRun | MovedFromRun | MovedToRun | MoveRangeMarker | CustomXmlTrackingMarker;
854
+ /** Table width specification. */
855
+ export interface TableWidth {
856
+ /** Width value. */
857
+ readonly value: number;
858
+ /** Width type: "auto", "dxa" (twips), "pct" (fiftieths of a percent, 5000=100%). */
859
+ readonly type: "auto" | "dxa" | "pct" | "nil";
860
+ }
861
+ /** Table borders. */
862
+ export interface TableBorders {
863
+ readonly top?: Border;
864
+ readonly left?: Border;
865
+ readonly bottom?: Border;
866
+ readonly right?: Border;
867
+ readonly insideH?: Border;
868
+ readonly insideV?: Border;
869
+ /** Start border (logical direction). */
870
+ readonly start?: Border;
871
+ /** End border (logical direction). */
872
+ readonly end?: Border;
873
+ /** Top-left to bottom-right diagonal border (cells only). */
874
+ readonly tl2br?: Border;
875
+ /** Top-right to bottom-left diagonal border (cells only). */
876
+ readonly tr2bl?: Border;
877
+ }
878
+ /** Table cell margins. */
879
+ export interface TableCellMargins {
880
+ readonly top?: TableWidth;
881
+ readonly left?: TableWidth;
882
+ readonly bottom?: TableWidth;
883
+ readonly right?: TableWidth;
884
+ /** Start margin (logical). */
885
+ readonly start?: TableWidth;
886
+ /** End margin (logical). */
887
+ readonly end?: TableWidth;
888
+ }
889
+ /** Table layout algorithm. */
890
+ export type TableLayout = "fixed" | "autofit";
891
+ /** Table look (conditional formatting flags). */
892
+ export interface TableLook {
893
+ /** Apply first row conditional formatting. */
894
+ readonly firstRow?: boolean;
895
+ /** Apply last row conditional formatting. */
896
+ readonly lastRow?: boolean;
897
+ /** Apply first column conditional formatting. */
898
+ readonly firstColumn?: boolean;
899
+ /** Apply last column conditional formatting. */
900
+ readonly lastColumn?: boolean;
901
+ /** Do not apply horizontal banding. */
902
+ readonly noHBand?: boolean;
903
+ /** Do not apply vertical banding. */
904
+ readonly noVBand?: boolean;
905
+ }
906
+ /** Table floating properties. */
907
+ export interface TableFloat {
908
+ /** Horizontal anchor: "margin" | "page" | "text". */
909
+ readonly horizontalAnchor?: "margin" | "page" | "text";
910
+ /** Vertical anchor: "margin" | "page" | "text". */
911
+ readonly verticalAnchor?: "margin" | "page" | "text";
912
+ /** Horizontal absolute position in twips. */
913
+ readonly absoluteHorizontalPosition?: Twips;
914
+ /** Vertical absolute position in twips. */
915
+ readonly absoluteVerticalPosition?: Twips;
916
+ /** Relative horizontal position. */
917
+ readonly relativeHorizontalPosition?: "center" | "inside" | "left" | "outside" | "right";
918
+ /** Relative vertical position. */
919
+ readonly relativeVerticalPosition?: "center" | "inside" | "bottom" | "outside" | "top" | "inline";
920
+ /** Top margin from text in twips. */
921
+ readonly topFromText?: Twips;
922
+ /** Bottom margin from text in twips. */
923
+ readonly bottomFromText?: Twips;
924
+ /** Left margin from text in twips. */
925
+ readonly leftFromText?: Twips;
926
+ /** Right margin from text in twips. */
927
+ readonly rightFromText?: Twips;
928
+ /** Allow overlap with other floating tables. */
929
+ readonly overlap?: "never" | "overlap";
930
+ }
931
+ /** Table properties. */
932
+ export interface TableProperties {
933
+ /** Table style ID. */
934
+ readonly style?: string;
935
+ /** Table width. */
936
+ readonly width?: TableWidth;
937
+ /** Table borders. */
938
+ readonly borders?: TableBorders;
939
+ /** Table layout. */
940
+ readonly layout?: TableLayout;
941
+ /** Cell margins (defaults for all cells). */
942
+ readonly cellMargins?: TableCellMargins;
943
+ /** Table alignment. */
944
+ readonly alignment?: Alignment;
945
+ /** Table indent in twips. */
946
+ readonly indent?: Twips;
947
+ /** Table look (conditional formatting). */
948
+ readonly look?: TableLook;
949
+ /** Floating table properties. */
950
+ readonly float?: TableFloat;
951
+ /** Cell spacing in twips. */
952
+ readonly cellSpacing?: TableWidth;
953
+ /** Visual right-to-left. */
954
+ readonly visuallyRightToLeft?: boolean;
955
+ /** Background shading for entire table. */
956
+ readonly shading?: Shading;
957
+ /** Table caption (accessibility). */
958
+ readonly caption?: string;
959
+ /** Table description (accessibility). */
960
+ readonly description?: string;
961
+ /** Table property change revision (track changes). */
962
+ readonly propertyChange?: TablePropertyChange;
963
+ }
964
+ /** Table row height rule. */
965
+ export type RowHeightRule = "auto" | "atLeast" | "exact";
966
+ /** Table row properties. */
967
+ export interface TableRowProperties {
968
+ /** Row height. */
969
+ readonly height?: {
970
+ readonly value: Twips;
971
+ readonly rule?: RowHeightRule;
972
+ };
973
+ /** Repeat as header row across pages. */
974
+ readonly tableHeader?: boolean;
975
+ /** Don't split row across pages. */
976
+ readonly cantSplit?: boolean;
977
+ /** Cell spacing for this row. */
978
+ readonly cellSpacing?: TableWidth;
979
+ /** Hidden row (track changes). */
980
+ readonly hidden?: boolean;
981
+ /** Row insertion revision (track changes). */
982
+ readonly inserted?: TableRowRevision;
983
+ /** Row deletion revision (track changes). */
984
+ readonly deleted?: TableRowRevision;
985
+ /** Number of grid units before the first cell (w:gridBefore). */
986
+ readonly gridBefore?: number;
987
+ /** Number of grid units after the last cell (w:gridAfter). */
988
+ readonly gridAfter?: number;
989
+ /** Width of the grid before (w:wBefore). */
990
+ readonly widthBefore?: TableWidth;
991
+ /** Width of the grid after (w:wAfter). */
992
+ readonly widthAfter?: TableWidth;
993
+ /** Conditional formatting style mask (w:cnfStyle). */
994
+ readonly cnfStyle?: string;
995
+ /** Table row property change revision (track changes). */
996
+ readonly propertyChange?: TableRowPropertyChange;
997
+ /** Row-level table property exceptions (w:tblPrEx) — override of table props. */
998
+ readonly tblPrEx?: TableProperties;
999
+ }
1000
+ /** Vertical alignment in a cell. */
1001
+ export type VerticalCellAlign = "top" | "center" | "bottom";
1002
+ /** Text direction in a cell. */
1003
+ export type TextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV";
1004
+ /** Vertical merge type. */
1005
+ export type VerticalMerge = "restart" | "continue";
1006
+ /** Table cell properties. */
1007
+ export interface TableCellProperties {
1008
+ /** Cell width. */
1009
+ readonly width?: TableWidth;
1010
+ /** Horizontal span (gridSpan). */
1011
+ readonly gridSpan?: number;
1012
+ /** Vertical merge. "restart" starts a merge, "continue" continues it. */
1013
+ readonly verticalMerge?: VerticalMerge;
1014
+ /** Cell borders. */
1015
+ readonly borders?: TableBorders;
1016
+ /** Cell background shading. */
1017
+ readonly shading?: Shading;
1018
+ /** Vertical alignment. */
1019
+ readonly verticalAlign?: VerticalCellAlign;
1020
+ /** Text direction. */
1021
+ readonly textDirection?: TextDirection;
1022
+ /** No text wrapping. */
1023
+ readonly noWrap?: boolean;
1024
+ /** Cell margins (overrides table defaults). */
1025
+ readonly margins?: TableCellMargins;
1026
+ /** Convenience rowSpan. Used by builder to auto-generate vMerge. */
1027
+ readonly rowSpan?: number;
1028
+ /** Conditional formatting style mask (w:cnfStyle). */
1029
+ readonly cnfStyle?: string;
1030
+ /** Hide cell end-of-cell marker (w:hideMark). */
1031
+ readonly hideMark?: boolean;
1032
+ /** Fits text in cell width (w:tcFitText). */
1033
+ readonly fitText?: boolean;
1034
+ /** Cell property change revision (track changes). */
1035
+ readonly propertyChange?: TableCellPropertyChange;
1036
+ /** Cell inserted revision (w:cellIns — cell was inserted). */
1037
+ readonly inserted?: TableRowRevision;
1038
+ /** Cell deleted revision (w:cellDel — cell was deleted). */
1039
+ readonly deleted?: TableRowRevision;
1040
+ /** Cell merge revision (w:cellMerge). */
1041
+ readonly cellMerge?: CellMergeRevision;
1042
+ }
1043
+ /** Table cell. */
1044
+ export interface TableCell {
1045
+ /** Cell properties. */
1046
+ readonly properties?: TableCellProperties;
1047
+ /** Cell content (must contain at least one paragraph). */
1048
+ readonly content: readonly (Paragraph | Table)[];
1049
+ }
1050
+ /** Table row. */
1051
+ export interface TableRow {
1052
+ /** Row properties. */
1053
+ readonly properties?: TableRowProperties;
1054
+ /** Cells in this row. */
1055
+ readonly cells: readonly TableCell[];
1056
+ }
1057
+ /** A table. */
1058
+ export interface Table {
1059
+ readonly type: "table";
1060
+ /** Table properties. */
1061
+ readonly properties?: TableProperties;
1062
+ /** Column widths in twips (for tblGrid). */
1063
+ readonly columnWidths?: readonly Twips[];
1064
+ /** Rows. */
1065
+ readonly rows: readonly TableRow[];
1066
+ }
1067
+ /** Horizontal position relative to. */
1068
+ export type HorizontalPositionRelative = "character" | "column" | "insideMargin" | "leftMargin" | "margin" | "outsideMargin" | "page" | "rightMargin";
1069
+ /** Vertical position relative to. */
1070
+ export type VerticalPositionRelative = "insideMargin" | "line" | "margin" | "outsideMargin" | "page" | "paragraph" | "topMargin" | "bottomMargin";
1071
+ /** Text wrapping style. */
1072
+ export type WrapStyle = "square" | "tight" | "through" | "topAndBottom" | "none";
1073
+ /** Wrap text side. */
1074
+ export type WrapTextSide = "bothSides" | "left" | "right" | "largest";
1075
+ /** Wrap distance margins. */
1076
+ export interface WrapMargins {
1077
+ readonly top?: Emu;
1078
+ readonly bottom?: Emu;
1079
+ readonly left?: Emu;
1080
+ readonly right?: Emu;
1081
+ }
1082
+ /** Floating image (anchor). */
1083
+ export interface FloatingImage {
1084
+ readonly type: "floatingImage";
1085
+ /** Relationship ID for the image. */
1086
+ readonly rId: string;
1087
+ /** Width in EMU. */
1088
+ readonly width: Emu;
1089
+ /** Height in EMU. */
1090
+ readonly height: Emu;
1091
+ /** Alternative text. */
1092
+ readonly altText?: string;
1093
+ /** Image name. */
1094
+ readonly name?: string;
1095
+ /** Horizontal position. */
1096
+ readonly horizontalPosition?: {
1097
+ readonly relativeTo?: HorizontalPositionRelative;
1098
+ readonly offset?: Emu;
1099
+ readonly align?: "left" | "center" | "right" | "inside" | "outside";
1100
+ };
1101
+ /** Vertical position. */
1102
+ readonly verticalPosition?: {
1103
+ readonly relativeTo?: VerticalPositionRelative;
1104
+ readonly offset?: Emu;
1105
+ readonly align?: "top" | "center" | "bottom" | "inside" | "outside";
1106
+ };
1107
+ /** Text wrapping. */
1108
+ readonly wrap?: {
1109
+ readonly style: WrapStyle;
1110
+ readonly side?: WrapTextSide;
1111
+ /** Wrap distance margins. */
1112
+ readonly margins?: WrapMargins;
1113
+ };
1114
+ /** Z-order relative height. */
1115
+ readonly relativeHeight?: number;
1116
+ /** Place behind document text. */
1117
+ readonly behindDoc?: boolean;
1118
+ /** Unique drawing ID. */
1119
+ readonly drawingId?: number;
1120
+ /** Rotation in 60,000ths of a degree. */
1121
+ readonly rotation?: number;
1122
+ /** Flip horizontal. */
1123
+ readonly flipHorizontal?: boolean;
1124
+ /** Flip vertical. */
1125
+ readonly flipVertical?: boolean;
1126
+ /** Lock anchor position. */
1127
+ readonly lockAnchor?: boolean;
1128
+ /** Layout in cell (default: true). */
1129
+ readonly layoutInCell?: boolean;
1130
+ /** Allow overlap with other floating content (default: true). */
1131
+ readonly allowOverlap?: boolean;
1132
+ /** Simple positioning with absolute x/y (alternative to relative anchor positioning). */
1133
+ readonly simplePos?: {
1134
+ readonly x: Emu;
1135
+ readonly y: Emu;
1136
+ };
1137
+ /** Distance from top/bottom/left/right of surrounding text (EMU). */
1138
+ readonly distT?: Emu;
1139
+ readonly distB?: Emu;
1140
+ readonly distL?: Emu;
1141
+ readonly distR?: Emu;
1142
+ /** Outline / border. */
1143
+ readonly outline?: {
1144
+ readonly width?: Emu;
1145
+ readonly color?: HexColor;
1146
+ };
1147
+ /** SVG image relationship ID (for SVG images with raster fallback). */
1148
+ readonly svgRId?: string;
1149
+ /** Source rectangle for cropping (fractions: 100000 = 100%). */
1150
+ readonly srcRect?: {
1151
+ readonly l?: number;
1152
+ readonly t?: number;
1153
+ readonly r?: number;
1154
+ readonly b?: number;
1155
+ };
1156
+ }
1157
+ /** Table of Contents properties. */
1158
+ export interface TableOfContents {
1159
+ readonly type: "tableOfContents";
1160
+ /** Heading style range (e.g. "1-3" for Heading 1 through 3). */
1161
+ readonly headingStyleRange?: string;
1162
+ /** Whether entries are hyperlinks. */
1163
+ readonly hyperlink?: boolean;
1164
+ /** Styles with levels (e.g. [{ styleName: "MyStyle", level: 1 }]). */
1165
+ readonly stylesWithLevels?: readonly {
1166
+ readonly styleName: string;
1167
+ readonly level: number;
1168
+ }[];
1169
+ /** Caption label (for table of figures). */
1170
+ readonly captionLabel?: string;
1171
+ /** Sequence field identifier (for table of figures). */
1172
+ readonly sequenceFieldIdentifier?: string;
1173
+ /** Tab stop leader for page numbers. */
1174
+ readonly leader?: TabStopLeader;
1175
+ /** Cached/fallback paragraphs to display when not updated by Word. */
1176
+ readonly cachedParagraphs?: readonly Paragraph[];
1177
+ }
1178
+ /** Math run (text in math context). */
1179
+ export interface MathRun {
1180
+ readonly type: "mathRun";
1181
+ /** Math text content. */
1182
+ readonly text: string;
1183
+ /** Math run properties (italic, font, etc.). */
1184
+ readonly properties?: {
1185
+ readonly italic?: boolean;
1186
+ readonly bold?: boolean;
1187
+ readonly font?: string;
1188
+ };
1189
+ }
1190
+ /** Math fraction. */
1191
+ export interface MathFraction {
1192
+ readonly type: "mathFraction";
1193
+ /** Fraction type. */
1194
+ readonly fractionType?: "bar" | "skw" | "lin" | "noBar";
1195
+ /** Numerator. */
1196
+ readonly numerator: readonly MathContent[];
1197
+ /** Denominator. */
1198
+ readonly denominator: readonly MathContent[];
1199
+ }
1200
+ /** Math superscript. */
1201
+ export interface MathSuperScript {
1202
+ readonly type: "mathSuperScript";
1203
+ readonly base: readonly MathContent[];
1204
+ readonly superScript: readonly MathContent[];
1205
+ }
1206
+ /** Math subscript. */
1207
+ export interface MathSubScript {
1208
+ readonly type: "mathSubScript";
1209
+ readonly base: readonly MathContent[];
1210
+ readonly subScript: readonly MathContent[];
1211
+ }
1212
+ /** Math sub-superscript. */
1213
+ export interface MathSubSuperScript {
1214
+ readonly type: "mathSubSuperScript";
1215
+ readonly base: readonly MathContent[];
1216
+ readonly subScript: readonly MathContent[];
1217
+ readonly superScript: readonly MathContent[];
1218
+ }
1219
+ /** Math pre-sub-superscript (m:sPre) — subscript and superscript attached before the base. */
1220
+ export interface MathPreSubSuperScript {
1221
+ readonly type: "mathPreSubSuperScript";
1222
+ readonly base: readonly MathContent[];
1223
+ readonly preSubScript: readonly MathContent[];
1224
+ readonly preSuperScript: readonly MathContent[];
1225
+ }
1226
+ /** Math phantom (m:phant) — rendered invisibly but occupies space. */
1227
+ export interface MathPhantom {
1228
+ readonly type: "mathPhantom";
1229
+ readonly content: readonly MathContent[];
1230
+ /** Phantom shows up in the layout (default: false). */
1231
+ readonly show?: boolean;
1232
+ /** Zero width (default: false). */
1233
+ readonly zeroWidth?: boolean;
1234
+ /** Zero ascent (default: false). */
1235
+ readonly zeroAscent?: boolean;
1236
+ /** Zero descent (default: false). */
1237
+ readonly zeroDescent?: boolean;
1238
+ /** Transparent (default: false). */
1239
+ readonly transparent?: boolean;
1240
+ }
1241
+ /** Math group character (m:groupChr) — a character grouping (e.g. horizontal brace). */
1242
+ export interface MathGroupChar {
1243
+ readonly type: "mathGroupChar";
1244
+ readonly base: readonly MathContent[];
1245
+ /** The group character (e.g. "{" or "⏞"). */
1246
+ readonly char?: string;
1247
+ /** Position: top or bottom. */
1248
+ readonly position?: "top" | "bottom";
1249
+ /** Vertical alignment. */
1250
+ readonly verticalAlign?: "top" | "center" | "bottom";
1251
+ }
1252
+ /** Math border box (m:borderBox) — a box around the expression with optional borders. */
1253
+ export interface MathBorderBox {
1254
+ readonly type: "mathBorderBox";
1255
+ readonly content: readonly MathContent[];
1256
+ readonly hideTop?: boolean;
1257
+ readonly hideBottom?: boolean;
1258
+ readonly hideLeft?: boolean;
1259
+ readonly hideRight?: boolean;
1260
+ /** Strike diagonals (bltr = bottom-left to top-right; tlbr = top-left to bottom-right; h = horizontal; v = vertical). */
1261
+ readonly strikeBlTr?: boolean;
1262
+ readonly strikeTlBr?: boolean;
1263
+ readonly strikeH?: boolean;
1264
+ readonly strikeV?: boolean;
1265
+ }
1266
+ /** Math radical (square root / nth root). */
1267
+ export interface MathRadical {
1268
+ readonly type: "mathRadical";
1269
+ /** Degree (for nth root). If omitted, square root. */
1270
+ readonly degree?: readonly MathContent[];
1271
+ /** Content under the radical. */
1272
+ readonly content: readonly MathContent[];
1273
+ /** Hide the degree. */
1274
+ readonly hideDegree?: boolean;
1275
+ }
1276
+ /** Math delimiter (parentheses, brackets, etc.). */
1277
+ export interface MathDelimiter {
1278
+ readonly type: "mathDelimiter";
1279
+ /** Beginning character (default: "("). */
1280
+ readonly beginChar?: string;
1281
+ /** Ending character (default: ")"). */
1282
+ readonly endChar?: string;
1283
+ /** Separator character (default: "|"). */
1284
+ readonly separatorChar?: string;
1285
+ /** Content elements. */
1286
+ readonly content: readonly (readonly MathContent[])[];
1287
+ }
1288
+ /** Math summation / product / integral with limits. */
1289
+ export interface MathNary {
1290
+ readonly type: "mathNary";
1291
+ /** The operator character (e.g. "\u2211" for sum, "\u220F" for product, "\u222B" for integral). */
1292
+ readonly char?: string;
1293
+ /** Lower limit (subscript). */
1294
+ readonly sub?: readonly MathContent[];
1295
+ /** Upper limit (superscript). */
1296
+ readonly sup?: readonly MathContent[];
1297
+ /** Content. */
1298
+ readonly content: readonly MathContent[];
1299
+ /** Place limits above/below (true) or as sub/superscript (false). */
1300
+ readonly limitsLocation?: "subSup" | "undOvr";
1301
+ /** Hide upper limit. */
1302
+ readonly supHide?: boolean;
1303
+ /** Hide lower limit. */
1304
+ readonly subHide?: boolean;
1305
+ }
1306
+ /** Math function (e.g. sin, cos). */
1307
+ export interface MathFunction {
1308
+ readonly type: "mathFunction";
1309
+ /** Function name content. */
1310
+ readonly name: readonly MathContent[];
1311
+ /** Function argument. */
1312
+ readonly content: readonly MathContent[];
1313
+ }
1314
+ /** Math limit (upper or lower). */
1315
+ export interface MathLimit {
1316
+ readonly type: "mathLimit";
1317
+ /** "upper" or "lower". */
1318
+ readonly limitType: "upper" | "lower";
1319
+ /** Base content. */
1320
+ readonly base: readonly MathContent[];
1321
+ /** Limit content. */
1322
+ readonly limit: readonly MathContent[];
1323
+ }
1324
+ /** Math matrix. */
1325
+ export interface MathMatrix {
1326
+ readonly type: "mathMatrix";
1327
+ /** Matrix rows, each containing cells. */
1328
+ readonly rows: readonly (readonly (readonly MathContent[])[])[];
1329
+ }
1330
+ /** Math accent (hat, tilde, etc.). */
1331
+ export interface MathAccent {
1332
+ readonly type: "mathAccent";
1333
+ /** Accent character (e.g. "\u0302" for hat). */
1334
+ readonly char?: string;
1335
+ /** Base content. */
1336
+ readonly content: readonly MathContent[];
1337
+ }
1338
+ /** Math bar (overline / underline). */
1339
+ export interface MathBar {
1340
+ readonly type: "mathBar";
1341
+ /** Bar position. */
1342
+ readonly position: "top" | "bottom";
1343
+ /** Content. */
1344
+ readonly content: readonly MathContent[];
1345
+ }
1346
+ /** Math box (invisible grouping). */
1347
+ export interface MathBox {
1348
+ readonly type: "mathBox";
1349
+ readonly content: readonly MathContent[];
1350
+ }
1351
+ /** Math equation array (system of equations). */
1352
+ export interface MathEquationArray {
1353
+ readonly type: "mathEquationArray";
1354
+ /** Array of equation rows. */
1355
+ readonly rows: readonly (readonly MathContent[])[];
1356
+ }
1357
+ /** All math content types. */
1358
+ export type MathContent = MathRun | MathFraction | MathSuperScript | MathSubScript | MathSubSuperScript | MathPreSubSuperScript | MathRadical | MathDelimiter | MathNary | MathFunction | MathLimit | MathMatrix | MathAccent | MathBar | MathBox | MathPhantom | MathGroupChar | MathBorderBox | MathEquationArray;
1359
+ /** A math block (inline or display). */
1360
+ export interface MathBlock {
1361
+ readonly type: "math";
1362
+ /** Math content elements. */
1363
+ readonly content: readonly MathContent[];
1364
+ }
1365
+ /** Text box definition. */
1366
+ export interface TextBox {
1367
+ readonly type: "textBox";
1368
+ /** Content paragraphs. */
1369
+ readonly content: readonly Paragraph[];
1370
+ /** Width in twips. */
1371
+ readonly width?: Twips;
1372
+ /** Height in twips. */
1373
+ readonly height?: Twips;
1374
+ /** Style string for VML (e.g. CSS-like position/size). */
1375
+ readonly style?: string;
1376
+ /** Stroke visible. */
1377
+ readonly stroke?: boolean;
1378
+ /** Stroke color. */
1379
+ readonly strokeColor?: HexColor;
1380
+ /** Fill visible. */
1381
+ readonly fill?: boolean;
1382
+ /** Fill color. */
1383
+ readonly fillColor?: HexColor;
1384
+ }
1385
+ /** Common preset shape types. */
1386
+ export type PresetShapeType = string;
1387
+ /** DrawingML shape (wsp:). */
1388
+ export interface DrawingShape {
1389
+ readonly type: "drawingShape";
1390
+ /** Preset shape type (e.g. "rect", "roundRect", "ellipse"). */
1391
+ readonly shapeType: PresetShapeType;
1392
+ /** Width in EMU. */
1393
+ readonly width: Emu;
1394
+ /** Height in EMU. */
1395
+ readonly height: Emu;
1396
+ /** Fill color (hex). */
1397
+ readonly fillColor?: HexColor;
1398
+ /** No fill. */
1399
+ readonly noFill?: boolean;
1400
+ /** Outline/stroke color (hex). */
1401
+ readonly outlineColor?: HexColor;
1402
+ /** Outline width in EMU. */
1403
+ readonly outlineWidth?: Emu;
1404
+ /** No outline. */
1405
+ readonly noOutline?: boolean;
1406
+ /** Text content inside the shape. */
1407
+ readonly textContent?: readonly Paragraph[];
1408
+ /** Alternative text. */
1409
+ readonly altText?: string;
1410
+ /** Shape name. */
1411
+ readonly name?: string;
1412
+ /** Horizontal position. */
1413
+ readonly horizontalPosition?: {
1414
+ readonly relativeTo?: HorizontalPositionRelative;
1415
+ readonly offset?: Emu;
1416
+ readonly align?: "left" | "center" | "right";
1417
+ };
1418
+ /** Vertical position. */
1419
+ readonly verticalPosition?: {
1420
+ readonly relativeTo?: VerticalPositionRelative;
1421
+ readonly offset?: Emu;
1422
+ readonly align?: "top" | "center" | "bottom";
1423
+ };
1424
+ /** Text wrapping. */
1425
+ readonly wrap?: {
1426
+ readonly style: WrapStyle;
1427
+ readonly side?: WrapTextSide;
1428
+ };
1429
+ /** Behind document text. */
1430
+ readonly behindDoc?: boolean;
1431
+ /** Rotation in 60,000ths of a degree. */
1432
+ readonly rotation?: number;
1433
+ /** Raw XML string (for preserving unrecognized shape details on round-trip). */
1434
+ readonly rawXml?: string;
1435
+ }
1436
+ /** Checkbox state. */
1437
+ export interface CheckBox {
1438
+ readonly type: "checkBox";
1439
+ /** Whether checked. */
1440
+ readonly checked?: boolean;
1441
+ /** Checked state character. */
1442
+ readonly checkedState?: {
1443
+ readonly value: string;
1444
+ readonly font?: string;
1445
+ };
1446
+ /** Unchecked state character. */
1447
+ readonly uncheckedState?: {
1448
+ readonly value: string;
1449
+ readonly font?: string;
1450
+ };
1451
+ }
1452
+ /** SDT dropdown/combobox list item. */
1453
+ export interface SdtListItem {
1454
+ /** Display text. */
1455
+ readonly displayText?: string;
1456
+ /** Value. */
1457
+ readonly value: string;
1458
+ }
1459
+ /** SDT date picker properties. */
1460
+ export interface SdtDateProperties {
1461
+ /** Full date value (ISO 8601). */
1462
+ readonly fullDate?: string;
1463
+ /** Date format string (e.g. "M/d/yyyy"). */
1464
+ readonly dateFormat?: string;
1465
+ /** Language ID. */
1466
+ readonly lid?: string;
1467
+ /** Storage type for date mappings. */
1468
+ readonly storeMappedDataAs?: "dateTime" | "date" | "text";
1469
+ }
1470
+ /** Structured Document Tag properties. */
1471
+ export interface SdtProperties {
1472
+ /** SDT unique ID. */
1473
+ readonly id?: number;
1474
+ /** Tag name. */
1475
+ readonly tag?: string;
1476
+ /** Alias/title. */
1477
+ readonly alias?: string;
1478
+ /** Lock content from editing. */
1479
+ readonly lockContent?: boolean;
1480
+ /** Lock SDT from deletion. */
1481
+ readonly lockSdt?: boolean;
1482
+ /** Dropdown list items. */
1483
+ readonly dropdownList?: readonly SdtListItem[];
1484
+ /** ComboBox list items. */
1485
+ readonly comboBox?: readonly SdtListItem[];
1486
+ /** Date picker properties. */
1487
+ readonly date?: SdtDateProperties;
1488
+ /** Plain text content (vs rich text). */
1489
+ readonly plainText?: boolean;
1490
+ /** Appearance (w15:appearance): how the SDT is visually delineated. */
1491
+ readonly appearance?: "boundingBox" | "tags" | "hidden";
1492
+ /**
1493
+ * Show placeholder text toggle (w:showingPlcHdr). When true, the control
1494
+ * shows placeholder text; cleared automatically on first edit.
1495
+ */
1496
+ readonly showingPlaceholder?: boolean;
1497
+ /** @deprecated Use `appearance` instead. Mapped to w:appearance for backwards compatibility. */
1498
+ readonly showAs?: "boundingBox" | "startEnd" | "none";
1499
+ /** Placeholder text doc part reference. */
1500
+ readonly placeholder?: string;
1501
+ /** Data binding to Custom XML part. */
1502
+ readonly dataBinding?: SdtDataBinding;
1503
+ /** Rich text SDT marker. */
1504
+ readonly richText?: boolean;
1505
+ /** Picture SDT marker. */
1506
+ readonly picture?: boolean;
1507
+ /** Grouping SDT marker (groups content, prevents editing). */
1508
+ readonly group?: boolean;
1509
+ /** Checkbox SDT properties (w14:checkbox). */
1510
+ readonly checkbox?: SdtCheckboxProperties;
1511
+ /** Equation SDT marker. */
1512
+ readonly equation?: boolean;
1513
+ /** Citation SDT marker. */
1514
+ readonly citation?: boolean;
1515
+ /** Bibliography SDT marker. */
1516
+ readonly bibliography?: boolean;
1517
+ /** Temporary (does not persist if content is edited). */
1518
+ readonly temporary?: boolean;
1519
+ /** Repeating section properties. */
1520
+ readonly repeatingSection?: SdtRepeatingSectionProperties;
1521
+ /** Repeating section item properties. */
1522
+ readonly repeatingSectionItem?: boolean;
1523
+ }
1524
+ /** SDT data binding to Custom XML part. */
1525
+ export interface SdtDataBinding {
1526
+ /** XPath expression. */
1527
+ readonly xpath: string;
1528
+ /** Storage item ID (GUID of the Custom XML part). */
1529
+ readonly storeItemId: string;
1530
+ /** Prefix mappings for XPath namespaces. */
1531
+ readonly prefixMappings?: string;
1532
+ }
1533
+ /** SDT checkbox properties (w14:checkbox extension). */
1534
+ export interface SdtCheckboxProperties {
1535
+ /** Is checked. */
1536
+ readonly checked?: boolean;
1537
+ /** Checked state character (default: ☒ / u+2612). */
1538
+ readonly checkedChar?: string;
1539
+ /** Checked state font. */
1540
+ readonly checkedFont?: string;
1541
+ /** Unchecked state character (default: ☐ / u+2610). */
1542
+ readonly uncheckedChar?: string;
1543
+ /** Unchecked state font. */
1544
+ readonly uncheckedFont?: string;
1545
+ }
1546
+ /** SDT repeating section properties. */
1547
+ export interface SdtRepeatingSectionProperties {
1548
+ /** Title. */
1549
+ readonly title?: string;
1550
+ /** Section item name (item displayed in UI). */
1551
+ readonly sectionTitle?: string;
1552
+ /** Allow insert/delete of repeating items. */
1553
+ readonly allowInsertDelete?: boolean;
1554
+ }
1555
+ /** SDT content. */
1556
+ export interface StructuredDocumentTag {
1557
+ readonly type: "sdt";
1558
+ /** SDT properties. */
1559
+ readonly properties?: SdtProperties;
1560
+ /** Content (paragraphs, runs, etc.). */
1561
+ readonly content: readonly (Paragraph | Run | Table)[];
1562
+ }
1563
+ /** Legacy form field type. */
1564
+ export type FormFieldType = "text" | "checkBox" | "dropDown";
1565
+ /** Legacy text form field. */
1566
+ export interface TextFormField {
1567
+ readonly type: "text";
1568
+ /** Field name. */
1569
+ readonly name?: string;
1570
+ /** Default value. */
1571
+ readonly default?: string;
1572
+ /** Maximum length (0 = unlimited). */
1573
+ readonly maxLength?: number;
1574
+ /** Text format (e.g. "UPPERCASE", "LOWERCASE", "First capital"). */
1575
+ readonly format?: string;
1576
+ /** Help text. */
1577
+ readonly helpText?: string;
1578
+ /** Status bar text. */
1579
+ readonly statusText?: string;
1580
+ /** Enable/disable field. */
1581
+ readonly enabled?: boolean;
1582
+ }
1583
+ /** Legacy checkbox form field. */
1584
+ export interface CheckBoxFormField {
1585
+ readonly type: "checkBox";
1586
+ /** Field name. */
1587
+ readonly name?: string;
1588
+ /** Whether checked. */
1589
+ readonly checked?: boolean;
1590
+ /** Default checked state. */
1591
+ readonly default?: boolean;
1592
+ /** Size in half-points (auto if omitted). */
1593
+ readonly size?: number;
1594
+ }
1595
+ /** Legacy dropdown form field. */
1596
+ export interface DropDownFormField {
1597
+ readonly type: "dropDown";
1598
+ /** Field name. */
1599
+ readonly name?: string;
1600
+ /** List entries. */
1601
+ readonly entries?: readonly string[];
1602
+ /** Default selected index. */
1603
+ readonly default?: number;
1604
+ /** Help text. */
1605
+ readonly helpText?: string;
1606
+ /** Status bar text. */
1607
+ readonly statusText?: string;
1608
+ /** Enable/disable field. */
1609
+ readonly enabled?: boolean;
1610
+ }
1611
+ /** Any legacy form field. */
1612
+ export type FormField = TextFormField | CheckBoxFormField | DropDownFormField;
1613
+ /** Text watermark properties. */
1614
+ export interface TextWatermark {
1615
+ readonly type: "text";
1616
+ /** Watermark text. */
1617
+ readonly text: string;
1618
+ /** Font name. */
1619
+ readonly font?: string;
1620
+ /** Font size (half-points). */
1621
+ readonly fontSize?: number;
1622
+ /** Color (hex, e.g. "C0C0C0"). */
1623
+ readonly color?: HexColor;
1624
+ /** Semi-transparent. */
1625
+ readonly semiTransparent?: boolean;
1626
+ /** Rotation in degrees (default -45 for diagonal). */
1627
+ readonly rotation?: number;
1628
+ }
1629
+ /** Image watermark properties. */
1630
+ export interface ImageWatermark {
1631
+ readonly type: "image";
1632
+ /** Relationship ID for the watermark image. */
1633
+ readonly rId: string;
1634
+ /** Scale percentage (e.g. 100). */
1635
+ readonly scale?: number;
1636
+ /** Washout effect. */
1637
+ readonly washout?: boolean;
1638
+ }
1639
+ /** Watermark (text or image). */
1640
+ export type Watermark = TextWatermark | ImageWatermark;
1641
+ /** Block-level content that can appear in the document body. */
1642
+ export type BodyContent = Paragraph | Table | FloatingImage | TableOfContents | MathBlock | TextBox | CheckBox | DrawingShape | OpaqueDrawing | ChartContent | AltChunk | StructuredDocumentTag;
1643
+ /** Alternate content chunk (w:altChunk) — embedded HTML/RTF/TXT/etc. in DOCX. */
1644
+ export interface AltChunk {
1645
+ readonly type: "altChunk";
1646
+ /** Relationship ID for the alt chunk content. */
1647
+ readonly rId: string;
1648
+ /** MIME content type of the chunk (e.g. "text/html"). */
1649
+ readonly contentType?: string;
1650
+ /** Chunk binary data (filled by reader from the archive). */
1651
+ readonly data?: Uint8Array;
1652
+ /** File name within the archive (e.g. "afchunk.html"). */
1653
+ readonly fileName?: string;
1654
+ }
1655
+ /** Chart type. */
1656
+ export type ChartType = "bar" | "barStacked" | "barPercentStacked" | "column" | "columnStacked" | "columnPercentStacked" | "line" | "lineStacked" | "lineMarked" | "pie" | "pie3D" | "doughnut" | "area" | "areaStacked" | "scatter" | "scatterSmooth" | "radar";
1657
+ /** A data series in a chart. */
1658
+ export interface ChartSeries {
1659
+ readonly name: string;
1660
+ readonly categories: readonly string[];
1661
+ readonly values: readonly number[];
1662
+ readonly color?: HexColor;
1663
+ readonly pointColors?: readonly HexColor[];
1664
+ readonly showDataLabels?: boolean;
1665
+ }
1666
+ /** Chart legend position. */
1667
+ export type ChartLegendPosition = "b" | "l" | "r" | "t" | "tr" | "none";
1668
+ /** Chart axis configuration. */
1669
+ export interface ChartAxis {
1670
+ readonly title?: string;
1671
+ readonly min?: number;
1672
+ readonly max?: number;
1673
+ readonly majorUnit?: number;
1674
+ readonly numberFormat?: string;
1675
+ readonly hidden?: boolean;
1676
+ }
1677
+ /** Chart definition. */
1678
+ export interface Chart {
1679
+ readonly type: ChartType;
1680
+ readonly title?: string;
1681
+ readonly series: readonly ChartSeries[];
1682
+ readonly legend?: ChartLegendPosition;
1683
+ readonly categoryAxis?: ChartAxis;
1684
+ readonly valueAxis?: ChartAxis;
1685
+ readonly secondaryValueAxis?: ChartAxis;
1686
+ readonly plotAreaColor?: HexColor;
1687
+ readonly chartAreaColor?: HexColor;
1688
+ readonly view3d?: boolean;
1689
+ readonly style?: number;
1690
+ readonly width?: Emu;
1691
+ readonly height?: Emu;
1692
+ }
1693
+ /** Chart content placed in a document. */
1694
+ export interface ChartContent {
1695
+ readonly type: "chart";
1696
+ readonly chart: Chart;
1697
+ readonly altText?: string;
1698
+ readonly name?: string;
1699
+ }
1700
+ /** Style type. */
1701
+ export type StyleType = "paragraph" | "character" | "table" | "numbering";
1702
+ /** Table style conditional format type. */
1703
+ export type TableStyleConditionType = "firstRow" | "lastRow" | "firstColumn" | "lastColumn" | "oddRowBanding" | "evenRowBanding" | "oddColumnBanding" | "evenColumnBanding" | "topLeftCell" | "topRightCell" | "bottomLeftCell" | "bottomRightCell";
1704
+ /** Table style conditional formatting. */
1705
+ export interface TableStyleConditionalFormat {
1706
+ /** Condition type. */
1707
+ readonly type: TableStyleConditionType;
1708
+ /** Paragraph properties for this condition. */
1709
+ readonly paragraphProperties?: ParagraphProperties;
1710
+ /** Run properties for this condition. */
1711
+ readonly runProperties?: RunProperties;
1712
+ /** Table properties for this condition. */
1713
+ readonly tableProperties?: TableProperties;
1714
+ /** Table row properties for this condition. */
1715
+ readonly rowProperties?: TableRowProperties;
1716
+ /** Table cell properties for this condition. */
1717
+ readonly cellProperties?: TableCellProperties;
1718
+ }
1719
+ /** Style definition. */
1720
+ export interface StyleDef {
1721
+ /** Style type. */
1722
+ readonly type: StyleType;
1723
+ /** Unique style ID. */
1724
+ readonly styleId: string;
1725
+ /** Display name. */
1726
+ readonly name: string;
1727
+ /** Parent style ID. */
1728
+ readonly basedOn?: string;
1729
+ /** Next paragraph style ID. */
1730
+ readonly next?: string;
1731
+ /** Linked style ID. */
1732
+ readonly link?: string;
1733
+ /** Show in Quick Styles gallery. */
1734
+ readonly qFormat?: boolean;
1735
+ /** UI priority (lower = higher priority). */
1736
+ readonly uiPriority?: number;
1737
+ /** Is this the default style for its type. */
1738
+ readonly isDefault?: boolean;
1739
+ /** Paragraph properties. */
1740
+ readonly paragraphProperties?: ParagraphProperties;
1741
+ /** Run properties. */
1742
+ readonly runProperties?: RunProperties;
1743
+ /** Table properties (for table styles). */
1744
+ readonly tableProperties?: TableProperties;
1745
+ /** Outline level (0-8 for Heading styles). */
1746
+ readonly outlineLevel?: number;
1747
+ /** Semi-hidden (not shown in style gallery). */
1748
+ readonly semiHidden?: boolean;
1749
+ /** Unhide when used. */
1750
+ readonly unhideWhenUsed?: boolean;
1751
+ /** Custom (user-created) style (w:customStyle attribute). */
1752
+ readonly customStyle?: boolean;
1753
+ /** Hidden (not shown anywhere). */
1754
+ readonly hidden?: boolean;
1755
+ /** Lock style (prevent modifications). */
1756
+ readonly locked?: boolean;
1757
+ /** Enable auto-redefining the style when used. */
1758
+ readonly autoRedefine?: boolean;
1759
+ /** Table style conditional formats. */
1760
+ readonly tableStyleConditions?: readonly TableStyleConditionalFormat[];
1761
+ }
1762
+ /** Document defaults for styles.xml. */
1763
+ export interface DocDefaults {
1764
+ /** Default run properties. */
1765
+ readonly runProperties?: RunProperties;
1766
+ /** Default paragraph properties. */
1767
+ readonly paragraphProperties?: ParagraphProperties;
1768
+ }
1769
+ /** Number format type. */
1770
+ export type NumberFormat = "decimal" | "lowerLetter" | "upperLetter" | "lowerRoman" | "upperRoman" | "bullet" | "none" | "chineseCounting" | "ordinal" | "cardinalText" | "ordinalText" | "ideographDigital" | "ideographTraditional" | "japaneseCounting" | "decimalZero" | "decimalEnclosedCircle";
1771
+ /** Level justification. */
1772
+ export type LevelJustification = "left" | "center" | "right";
1773
+ /** Level suffix (character after number). */
1774
+ export type LevelSuffix = "tab" | "space" | "nothing";
1775
+ /** Numbering level definition. */
1776
+ export interface NumberingLevel {
1777
+ /** Level index (0-8). */
1778
+ readonly level: number;
1779
+ /** Start value. */
1780
+ readonly start?: number;
1781
+ /** Number format. */
1782
+ readonly format: NumberFormat;
1783
+ /** Level text (e.g. "%1." or "%1.%2"). For bullet, a symbol character. */
1784
+ readonly text: string;
1785
+ /** Paragraph style ID linked to this level. */
1786
+ readonly paragraphStyle?: string;
1787
+ /** Justification. */
1788
+ readonly justification?: LevelJustification;
1789
+ /** Paragraph properties for this level. */
1790
+ readonly paragraphProperties?: ParagraphProperties;
1791
+ /** Run properties for the numbering symbol. */
1792
+ readonly runProperties?: RunProperties;
1793
+ /** Character after number: tab, space, or nothing. */
1794
+ readonly suffix?: LevelSuffix;
1795
+ /** Legal numbering style (override all lower levels to decimal). */
1796
+ readonly isLegalNumberingStyle?: boolean;
1797
+ /** Restart after which level (-1 = never, 0 = level 0 restarts this). */
1798
+ readonly restartAfterLevel?: number;
1799
+ /** Picture bullet ID (references w:numPicBullet in numbering.xml). */
1800
+ readonly picBulletId?: number;
1801
+ }
1802
+ /** Picture bullet definition (for numbering with image bullets). */
1803
+ export interface NumPicBullet {
1804
+ /** Unique ID (referenced by NumberingLevel.picBulletId). */
1805
+ readonly id: number;
1806
+ /** Relationship ID to the image in numbering.xml.rels. */
1807
+ readonly rId?: string;
1808
+ /** Width in EMU. */
1809
+ readonly width?: Emu;
1810
+ /** Height in EMU. */
1811
+ readonly height?: Emu;
1812
+ /** Raw VML fallback XML. */
1813
+ readonly rawVmlXml?: string;
1814
+ }
1815
+ /** Multi-level type. */
1816
+ export type MultiLevelType = "singleLevel" | "multilevel" | "hybridMultilevel";
1817
+ /** Abstract numbering definition (template). */
1818
+ export interface AbstractNumbering {
1819
+ /** Unique abstract numbering ID. */
1820
+ readonly abstractNumId: number;
1821
+ /** Multi-level type. */
1822
+ readonly multiLevelType?: MultiLevelType;
1823
+ /** Level definitions. */
1824
+ readonly levels: readonly NumberingLevel[];
1825
+ /** Numbering style link. */
1826
+ readonly numStyleLink?: string;
1827
+ /** Style link. */
1828
+ readonly styleLink?: string;
1829
+ }
1830
+ /** Level override for a numbering instance. */
1831
+ export interface LevelOverride {
1832
+ readonly level: number;
1833
+ readonly startOverride?: number;
1834
+ /** Level definition override. */
1835
+ readonly levelDef?: NumberingLevel;
1836
+ }
1837
+ /** Numbering instance (referenced by paragraphs). */
1838
+ export interface NumberingInstance {
1839
+ /** Unique numbering ID (referenced by paragraphs via numId). */
1840
+ readonly numId: number;
1841
+ /** Abstract numbering ID this instance is based on. */
1842
+ readonly abstractNumId: number;
1843
+ /** Level overrides. */
1844
+ readonly overrides?: readonly LevelOverride[];
1845
+ }
1846
+ /** Header/footer content (same structure as document body). */
1847
+ export interface HeaderFooterContent {
1848
+ /** Content paragraphs. */
1849
+ readonly children: readonly (Paragraph | Table)[];
1850
+ }
1851
+ /** Header definition. */
1852
+ export interface HeaderDef {
1853
+ /** Header content. */
1854
+ readonly content: HeaderFooterContent;
1855
+ /** Relationship ID (assigned during packaging). */
1856
+ rId?: string;
1857
+ }
1858
+ /** Footer definition. */
1859
+ export interface FooterDef {
1860
+ /** Footer content. */
1861
+ readonly content: HeaderFooterContent;
1862
+ /** Relationship ID (assigned during packaging). */
1863
+ rId?: string;
1864
+ }
1865
+ /** Footnote/endnote numbering format. */
1866
+ export type NoteNumberFormat = "decimal" | "upperRoman" | "lowerRoman" | "upperLetter" | "lowerLetter" | "chicago" | "bullet";
1867
+ /** Footnote/endnote numbering restart. */
1868
+ export type NoteNumberRestart = "continuous" | "eachSect" | "eachPage";
1869
+ /** Footnote properties (w:footnotePr). */
1870
+ export interface FootnoteProperties {
1871
+ /** Numbering format. */
1872
+ readonly numFmt?: NoteNumberFormat;
1873
+ /** Starting number. */
1874
+ readonly numStart?: number;
1875
+ /** Numbering restart rule. */
1876
+ readonly numRestart?: NoteNumberRestart;
1877
+ /** Footnote position: pageBottom or beneathText. */
1878
+ readonly position?: "pageBottom" | "beneathText";
1879
+ }
1880
+ /** Endnote properties (w:endnotePr). */
1881
+ export interface EndnoteProperties {
1882
+ /** Numbering format. */
1883
+ readonly numFmt?: NoteNumberFormat;
1884
+ /** Starting number. */
1885
+ readonly numStart?: number;
1886
+ /** Numbering restart rule. */
1887
+ readonly numRestart?: NoteNumberRestart;
1888
+ /** Endnote position: sectEnd or docEnd. */
1889
+ readonly position?: "sectEnd" | "docEnd";
1890
+ }
1891
+ /** Footnote definition. */
1892
+ /** Footnote/endnote note type. */
1893
+ export type NoteType = "normal" | "separator" | "continuationSeparator" | "continuationNotice";
1894
+ export interface FootnoteDef {
1895
+ /** Unique footnote ID (starts from 1; -1 and 0 are reserved for separators). */
1896
+ readonly id: number;
1897
+ /** Note type (default: "normal"). */
1898
+ readonly type?: NoteType;
1899
+ /** Footnote content. */
1900
+ readonly content: readonly Paragraph[];
1901
+ }
1902
+ /** Endnote definition. */
1903
+ export interface EndnoteDef {
1904
+ /** Unique endnote ID (starts from 1; -1 and 0 are reserved for separators). */
1905
+ readonly id: number;
1906
+ /** Note type (default: "normal"). */
1907
+ readonly type?: NoteType;
1908
+ /** Endnote content. */
1909
+ readonly content: readonly Paragraph[];
1910
+ }
1911
+ /** Image media type. */
1912
+ export type ImageMediaType = "png" | "jpeg" | "gif" | "bmp" | "tiff" | "svg" | "webp" | "emf" | "wmf";
1913
+ /** Image definition in the media collection. */
1914
+ export interface ImageDef {
1915
+ /** Image data. */
1916
+ readonly data: Uint8Array;
1917
+ /** MIME media type. */
1918
+ readonly mediaType: ImageMediaType;
1919
+ /** File name within word/media/ (e.g. "image1.png"). */
1920
+ readonly fileName: string;
1921
+ /** Relationship ID (assigned during packaging). */
1922
+ rId?: string;
1923
+ /** SVG fallback image data (PNG). Required for SVG images in Word. */
1924
+ readonly fallbackData?: Uint8Array;
1925
+ }
1926
+ /** Font family classification. */
1927
+ export type FontFamily = "roman" | "swiss" | "modern" | "decorative" | "script" | "auto";
1928
+ /** Font pitch. */
1929
+ export type FontPitch = "fixed" | "variable" | "default";
1930
+ /** Font definition for fontTable.xml. */
1931
+ export interface FontDef {
1932
+ readonly name: string;
1933
+ readonly panose1?: string;
1934
+ readonly charset?: string;
1935
+ readonly family?: FontFamily;
1936
+ readonly pitch?: FontPitch;
1937
+ /** Signature bytes (usb0-3, csb0-1). */
1938
+ readonly sig?: {
1939
+ readonly usb0?: string;
1940
+ readonly usb1?: string;
1941
+ readonly usb2?: string;
1942
+ readonly usb3?: string;
1943
+ readonly csb0?: string;
1944
+ readonly csb1?: string;
1945
+ };
1946
+ /** Embedded regular font relationship ID. */
1947
+ readonly embedRegular?: string;
1948
+ /** Embedded regular font key (GUID used for obfuscation). */
1949
+ readonly embedRegularKey?: string;
1950
+ /** Embedded bold font relationship ID. */
1951
+ readonly embedBold?: string;
1952
+ /** Embedded bold font key. */
1953
+ readonly embedBoldKey?: string;
1954
+ /** Embedded italic font relationship ID. */
1955
+ readonly embedItalic?: string;
1956
+ /** Embedded italic font key. */
1957
+ readonly embedItalicKey?: string;
1958
+ /** Embedded bold-italic font relationship ID. */
1959
+ readonly embedBoldItalic?: string;
1960
+ /** Embedded bold-italic font key. */
1961
+ readonly embedBoldItalicKey?: string;
1962
+ }
1963
+ /** Embedded font binary data. */
1964
+ export interface EmbeddedFont {
1965
+ /** Relationship ID (as referenced in FontDef.embedRegular etc.). */
1966
+ readonly rId: string;
1967
+ /** Font data — can be raw TTF/OTF or obfuscated ODTTF. */
1968
+ readonly data: Uint8Array;
1969
+ /** GUID key used for obfuscation (if obfuscated). When set, data is ODTTF (first 32 bytes XORed with GUID). */
1970
+ readonly fontKey?: string;
1971
+ /** File name inside word/fonts/ (e.g. "font1.odttf"). */
1972
+ readonly fileName: string;
1973
+ }
1974
+ /** Document protection type. */
1975
+ export type ProtectionType = "none" | "readOnly" | "comments" | "trackedChanges" | "forms";
1976
+ /** Hyphenation settings. */
1977
+ export interface HyphenationSettings {
1978
+ /** Automatic hyphenation. */
1979
+ readonly autoHyphenation?: boolean;
1980
+ /** Hyphenation zone (distance from right margin in twips). */
1981
+ readonly hyphenationZone?: Twips;
1982
+ /** Maximum consecutive hyphenated lines (0 = unlimited). */
1983
+ readonly consecutiveHyphenLimit?: number;
1984
+ /** Do not hyphenate words in all caps. */
1985
+ readonly doNotHyphenateCaps?: boolean;
1986
+ }
1987
+ /** Document settings. */
1988
+ export interface DocumentSettings {
1989
+ /** Zoom percentage. */
1990
+ readonly zoom?: number;
1991
+ /** Default tab stop distance in twips. */
1992
+ readonly defaultTabStop?: Twips;
1993
+ /** Character spacing compression control. */
1994
+ readonly characterSpacingControl?: "doNotCompress" | "compressPunctuation" | "compressPunctuationAndJapaneseKana";
1995
+ /** Compatibility mode version. */
1996
+ readonly compatibilityMode?: number;
1997
+ /** Even and odd page headers/footers. */
1998
+ readonly evenAndOddHeaders?: boolean;
1999
+ /** Track changes / revisions enabled. */
2000
+ readonly trackRevisions?: boolean;
2001
+ /** Document protection. */
2002
+ readonly documentProtection?: {
2003
+ readonly type: ProtectionType;
2004
+ readonly enforcement?: boolean;
2005
+ };
2006
+ /** Hyphenation settings. */
2007
+ readonly hyphenation?: HyphenationSettings;
2008
+ /** Auto-hyphenation. */
2009
+ readonly autoHyphenation?: boolean;
2010
+ /** Mirror margins. */
2011
+ readonly mirrorMargins?: boolean;
2012
+ /** Gutter at top. */
2013
+ readonly gutterAtTop?: boolean;
2014
+ /** Display background colors/images in print layout. */
2015
+ readonly displayBackgroundShape?: boolean;
2016
+ /** Update fields on open. */
2017
+ readonly updateFieldsOnOpen?: boolean;
2018
+ /** Document variables (key-value pairs). */
2019
+ readonly docVars?: ReadonlyMap<string, string>;
2020
+ /** Document-level footnote properties. */
2021
+ readonly footnoteProperties?: FootnoteProperties;
2022
+ /** Document-level endnote properties. */
2023
+ readonly endnoteProperties?: EndnoteProperties;
2024
+ /** All w:compatSetting entries (except compatibilityMode which has its own field). */
2025
+ readonly compatSettings?: ReadonlyArray<CompatSetting>;
2026
+ /** Legacy w:compat child elements (e.g. w:useFELayout, w:balanceSingleByteDoubleByteWidth). */
2027
+ readonly compatFlags?: ReadonlyArray<CompatFlag>;
2028
+ /** Mail merge settings (opaque). */
2029
+ readonly mailMergeRawXml?: string;
2030
+ /** Write protection (separate from documentProtection). */
2031
+ readonly writeProtection?: {
2032
+ readonly recommended?: boolean;
2033
+ readonly algorithmName?: string;
2034
+ readonly hashValue?: string;
2035
+ readonly saltValue?: string;
2036
+ readonly spinCount?: number;
2037
+ };
2038
+ /** RSID revision save IDs (raw). */
2039
+ readonly rsids?: {
2040
+ readonly rsidRoot?: string;
2041
+ readonly rsid?: readonly string[];
2042
+ };
2043
+ /** Decimal symbol for numbers (e.g. "."). */
2044
+ readonly decimalSymbol?: string;
2045
+ /** List separator for fields (e.g. ","). */
2046
+ readonly listSeparator?: string;
2047
+ /** Do not track move revisions separately. */
2048
+ readonly doNotTrackMoves?: boolean;
2049
+ /** Do not track formatting changes. */
2050
+ readonly doNotTrackFormatting?: boolean;
2051
+ /** Save subset fonts (only used glyphs). */
2052
+ readonly saveSubsetFonts?: boolean;
2053
+ /** Borders should not surround header area. */
2054
+ readonly bordersDoNotSurroundHeader?: boolean;
2055
+ /** Borders should not surround footer area. */
2056
+ readonly bordersDoNotSurroundFooter?: boolean;
2057
+ /** Theme language defaults (for themeFontLang). */
2058
+ readonly themeFontLang?: {
2059
+ readonly val?: string;
2060
+ readonly eastAsia?: string;
2061
+ readonly bidi?: string;
2062
+ };
2063
+ /** Click-and-type default style ID. */
2064
+ readonly clickAndTypeStyle?: string;
2065
+ /** Disable punctuation kerning. */
2066
+ readonly noPunctuationKerning?: boolean;
2067
+ /** Style pane format filter (bitmask hex string). */
2068
+ readonly stylePaneFormatFilter?: string;
2069
+ /** Style pane sort method. */
2070
+ readonly stylePaneSortMethod?: string;
2071
+ /** Do not demote first line of Asian text. */
2072
+ readonly doNotDemoteAsianTextFirstLine?: boolean;
2073
+ }
2074
+ /** A w:compatSetting entry in settings.xml. */
2075
+ export interface CompatSetting {
2076
+ readonly name: string;
2077
+ readonly uri: string;
2078
+ readonly val: string;
2079
+ }
2080
+ /** A legacy w:compat child flag. */
2081
+ export interface CompatFlag {
2082
+ /** Element name without namespace (e.g. "useFELayout"). */
2083
+ readonly name: string;
2084
+ /** Optional w:val attribute. */
2085
+ readonly val?: string;
2086
+ }
2087
+ /** Document background (w:background). */
2088
+ export interface DocumentBackground {
2089
+ /** Background color (hex). */
2090
+ readonly color?: HexColor;
2091
+ /** Theme color. */
2092
+ readonly themeColor?: string;
2093
+ /** Theme shade. */
2094
+ readonly themeShade?: string;
2095
+ /** Theme tint. */
2096
+ readonly themeTint?: string;
2097
+ }
2098
+ /** Custom property value type. */
2099
+ export type CustomPropertyValue = {
2100
+ readonly type: "string";
2101
+ readonly value: string;
2102
+ } | {
2103
+ readonly type: "number";
2104
+ readonly value: number;
2105
+ } | {
2106
+ readonly type: "boolean";
2107
+ readonly value: boolean;
2108
+ } | {
2109
+ readonly type: "date";
2110
+ readonly value: Date;
2111
+ };
2112
+ /** Custom document property. */
2113
+ export interface CustomProperty {
2114
+ /** Property name. */
2115
+ readonly name: string;
2116
+ /** Property value. */
2117
+ readonly value: CustomPropertyValue;
2118
+ }
2119
+ /** Dublin Core metadata. */
2120
+ export interface CoreProperties {
2121
+ readonly title?: string;
2122
+ readonly subject?: string;
2123
+ readonly creator?: string;
2124
+ readonly description?: string;
2125
+ readonly keywords?: string;
2126
+ readonly lastModifiedBy?: string;
2127
+ readonly revision?: string;
2128
+ readonly created?: Date;
2129
+ readonly modified?: Date;
2130
+ readonly category?: string;
2131
+ }
2132
+ /** Application properties. */
2133
+ export interface AppProperties {
2134
+ readonly application?: string;
2135
+ readonly appVersion?: string;
2136
+ readonly pages?: number;
2137
+ readonly words?: number;
2138
+ readonly characters?: number;
2139
+ readonly lines?: number;
2140
+ readonly paragraphs?: number;
2141
+ readonly company?: string;
2142
+ readonly manager?: string;
2143
+ }
2144
+ /** Standard OOXML theme color names. */
2145
+ export type ThemeColorName = "dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink";
2146
+ /** Theme color scheme — maps color names to hex RGB values. */
2147
+ export interface ThemeColorScheme {
2148
+ readonly name: string;
2149
+ readonly colors: Readonly<Record<ThemeColorName, HexColor>>;
2150
+ }
2151
+ /** Theme font definition (major or minor). */
2152
+ export interface ThemeFont {
2153
+ /** Latin typeface. */
2154
+ readonly latin: string;
2155
+ /** East Asian typeface (CJK). */
2156
+ readonly eastAsia?: string;
2157
+ /** Complex Script typeface (Arabic, Hebrew, etc.). */
2158
+ readonly complexScript?: string;
2159
+ /** Supplemental fonts: script name → typeface. */
2160
+ readonly supplementalFonts?: Readonly<Record<string, string>>;
2161
+ }
2162
+ /** Theme font scheme. */
2163
+ export interface ThemeFontScheme {
2164
+ readonly name: string;
2165
+ /** Major (heading) font — legacy simple form. */
2166
+ readonly majorFont: string;
2167
+ /** Minor (body) font — legacy simple form. */
2168
+ readonly minorFont: string;
2169
+ /** Full major font with EA/CS/supplemental. */
2170
+ readonly major?: ThemeFont;
2171
+ /** Full minor font with EA/CS/supplemental. */
2172
+ readonly minor?: ThemeFont;
2173
+ }
2174
+ /** Theme format scheme — preserves the opaque XML for fillStyleLst/lnStyleLst/effectStyleLst/bgFillStyleLst. */
2175
+ export interface ThemeFormatScheme {
2176
+ readonly name: string;
2177
+ /** Raw XML for a:fmtScheme children (for round-trip preservation). */
2178
+ readonly rawXml?: string;
2179
+ }
2180
+ /** Parsed document theme. */
2181
+ export interface DocumentTheme {
2182
+ readonly name?: string;
2183
+ readonly colorScheme: ThemeColorScheme;
2184
+ readonly fontScheme: ThemeFontScheme;
2185
+ /** Format scheme (effect/fill/line/bg styles). */
2186
+ readonly formatScheme?: ThemeFormatScheme;
2187
+ /** Raw XML of extra <a:extLst> element inside <a:theme>, for round-trip. */
2188
+ readonly extLstXml?: string;
2189
+ }
2190
+ /** Complete DOCX document model. */
2191
+ /** Web settings (word/webSettings.xml). */
2192
+ export interface WebSettings {
2193
+ /** Optimize for specific browser. */
2194
+ readonly optimizeForBrowser?: {
2195
+ readonly target?: string;
2196
+ readonly majorVersion?: number;
2197
+ };
2198
+ /** Allow PNG images. */
2199
+ readonly allowPng?: boolean;
2200
+ /** Rely on VML (for older browsers). */
2201
+ readonly relyOnVml?: boolean;
2202
+ /** Do not save file as single HTML. */
2203
+ readonly doNotSaveAsSingleFile?: boolean;
2204
+ /** Do not organize into folders. */
2205
+ readonly doNotOrganizeInFolder?: boolean;
2206
+ /** Use target machine type (for embedded resources). */
2207
+ readonly useTargetMachineType?: boolean;
2208
+ /** Raw XML (for unsupported settings, round-trip preservation). */
2209
+ readonly rawXml?: string;
2210
+ }
2211
+ /** Person info (word/people.xml) — co-author/commenter metadata. */
2212
+ export interface PersonInfo {
2213
+ /** Author name (w15:person w15:author). */
2214
+ readonly author: string;
2215
+ /** Presence info (optional). */
2216
+ readonly presenceInfo?: {
2217
+ readonly providerId?: string;
2218
+ readonly userId?: string;
2219
+ };
2220
+ }
2221
+ export interface DocxDocument {
2222
+ /** Document body content. */
2223
+ readonly body: readonly BodyContent[];
2224
+ /** Final section properties (for the last section). */
2225
+ readonly sectionProperties?: SectionProperties;
2226
+ /** Style definitions. */
2227
+ readonly styles?: readonly StyleDef[];
2228
+ /** Document defaults. */
2229
+ readonly docDefaults?: DocDefaults;
2230
+ /** Abstract numbering definitions. */
2231
+ readonly abstractNumberings?: readonly AbstractNumbering[];
2232
+ /** Numbering instances. */
2233
+ readonly numberingInstances?: readonly NumberingInstance[];
2234
+ /** Picture bullet definitions (for numbering with images). */
2235
+ readonly numPicBullets?: readonly NumPicBullet[];
2236
+ /** Headers (keyed by internal name, e.g. "default", "first", "even"). */
2237
+ readonly headers?: ReadonlyMap<string, HeaderDef>;
2238
+ /** Footers. */
2239
+ readonly footers?: ReadonlyMap<string, FooterDef>;
2240
+ /** Footnotes. */
2241
+ readonly footnotes?: readonly FootnoteDef[];
2242
+ /** Endnotes. */
2243
+ readonly endnotes?: readonly EndnoteDef[];
2244
+ /** Images / media. */
2245
+ readonly images?: readonly ImageDef[];
2246
+ /** Font table entries. */
2247
+ readonly fonts?: readonly FontDef[];
2248
+ /** Embedded font binaries (stored in word/fonts/). */
2249
+ readonly embeddedFonts?: readonly EmbeddedFont[];
2250
+ /** Custom XML parts (for data binding with SDT). */
2251
+ readonly customXmlParts?: readonly CustomXmlPart[];
2252
+ /** Document settings. */
2253
+ readonly settings?: DocumentSettings;
2254
+ /** Web settings (word/webSettings.xml). */
2255
+ readonly webSettings?: WebSettings;
2256
+ /** Document thumbnail for file manager previews. */
2257
+ readonly thumbnail?: {
2258
+ readonly contentType: "image/jpeg" | "image/x-wmf" | "image/png";
2259
+ readonly data: Uint8Array;
2260
+ };
2261
+ /** Authors/commenters metadata (word/people.xml). */
2262
+ readonly people?: readonly PersonInfo[];
2263
+ /** Core properties (metadata). */
2264
+ readonly coreProperties?: CoreProperties;
2265
+ /** Application properties. */
2266
+ readonly appProperties?: AppProperties;
2267
+ /** Comments. */
2268
+ readonly comments?: readonly CommentDef[];
2269
+ /** Document background. */
2270
+ readonly background?: DocumentBackground;
2271
+ /** Custom properties. */
2272
+ readonly customProperties?: readonly CustomProperty[];
2273
+ /** Watermark (rendered in default header). */
2274
+ readonly watermark?: Watermark;
2275
+ /** Document theme (from theme1.xml). */
2276
+ readonly theme?: DocumentTheme;
2277
+ /** Opaque (unrecognized) ZIP parts preserved for round-trip fidelity. */
2278
+ readonly opaqueParts?: readonly OpaquePart[];
2279
+ }
2280
+ /** A relationship entry preserved for round-trip. */
2281
+ export interface OpaqueRelationship {
2282
+ /** Relationship ID (e.g. "rId5"). */
2283
+ readonly id: string;
2284
+ /** Relationship type URI. */
2285
+ readonly type: string;
2286
+ /** Target path (relative to source part). */
2287
+ readonly target: string;
2288
+ /** External target mode. */
2289
+ readonly targetMode?: "External";
2290
+ }
2291
+ /** Custom XML part (for data binding). Stored in word/customXml/. */
2292
+ export interface CustomXmlPart {
2293
+ /** Unique item ID (GUID). Referenced by SdtDataBinding.storeItemId. */
2294
+ readonly itemId: string;
2295
+ /** Raw XML content (word/customXml/item*.xml). */
2296
+ readonly xmlContent: string;
2297
+ /** Schema references (XML namespaces used). */
2298
+ readonly schemaReferences?: readonly string[];
2299
+ /** File name (e.g. "item1.xml"). */
2300
+ readonly fileName: string;
2301
+ }
2302
+ /** An opaque ZIP part preserved for round-trip fidelity. */
2303
+ export interface OpaquePart {
2304
+ /** Part path in the ZIP (e.g. "word/charts/chart1.xml"). */
2305
+ readonly path: string;
2306
+ /** Raw content of the part. */
2307
+ readonly data: Uint8Array;
2308
+ /** Content type (from [Content_Types].xml). */
2309
+ readonly contentType?: string;
2310
+ /** Relationships of this part (from its .rels file). */
2311
+ readonly relationships?: readonly OpaqueRelationship[];
2312
+ }
2313
+ /** An opaque drawing element (e.g. chart) preserved in a paragraph. */
2314
+ export interface OpaqueDrawing {
2315
+ readonly type: "opaqueDrawing";
2316
+ /** Raw XML of the w:drawing element. */
2317
+ readonly rawXml: string;
2318
+ /** Relationship IDs referenced within this drawing (for part resolution). */
2319
+ readonly referencedRIds: readonly string[];
2320
+ }
2321
+ /** Options for creating a DOCX file. */
2322
+ export interface DocxOptions {
2323
+ /** Compression level (0-9). Default: 6. */
2324
+ readonly compressionLevel?: number;
2325
+ }