@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,728 @@
1
+ /**
2
+ * DOCX Module - Document Builder
3
+ *
4
+ * High-level fluent API for constructing DOCX documents programmatically.
5
+ * Provides convenience methods for common operations including comments,
6
+ * track changes, TOC, math, text boxes, checkboxes, and custom properties.
7
+ */
8
+ import type { DocxDocument, BodyContent, Paragraph, ParagraphProperties, ParagraphChild, Run, RunProperties, Table, TableRow, TableCell, TableProperties, TableRowProperties, TableCellProperties, SectionProperties, StyleDef, DocDefaults, BookmarkStart, Hyperlink, HeaderFooterContent, ImageDef, ImageMediaType, CoreProperties, AppProperties, DocumentSettings, FontDef, Border, TableWidth, TableBorders, Emu, Twips, CommentDef, DocumentBackground, CustomPropertyValue, TableOfContents, MathBlock, MathContent, CheckBox, RevisionInfo, InsertedRun, DeletedRun, MovedFromRun, MovedToRun, MoveRangeMarker, Chart, ChartSeries, ChartAxis, ChartLegendPosition, ChartContent, CommentRangeStart, CommentRangeEnd, CommentReference, FloatingImage, StructuredDocumentTag, SdtProperties, Watermark, DocumentTheme, ColorSpec, HexColor, DrawingShape, PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader, RubyProperties } from "./types.js";
9
+ /** Create a text run. */
10
+ export declare function text(content: string, properties?: RunProperties): Run;
11
+ /** Create a bold text run. */
12
+ export declare function bold(content: string, properties?: Omit<RunProperties, "bold">): Run;
13
+ /** Create an italic text run. */
14
+ export declare function italic(content: string, properties?: Omit<RunProperties, "italic">): Run;
15
+ /** Create a run with a page break. */
16
+ export declare function pageBreak(): Run;
17
+ /** Create a run with a line break. */
18
+ export declare function lineBreak(): Run;
19
+ /** Create a run with a column break. */
20
+ export declare function columnBreak(): Run;
21
+ /** Create a tab run. */
22
+ export declare function tab(): Run;
23
+ /** Create a positional tab (w:ptab). */
24
+ export declare function positionalTab(options: {
25
+ alignment: PositionalTabAlignment;
26
+ relativeTo: PositionalTabRelativeTo;
27
+ leader?: PositionalTabLeader;
28
+ }): Run;
29
+ /**
30
+ * Create a ruby (phonetic guide) run — e.g. Japanese furigana or Chinese pinyin.
31
+ *
32
+ * @param baseText - The main text being annotated.
33
+ * @param rubyText - The phonetic text shown above the base.
34
+ * @param properties - Optional ruby properties (alignment, font size, language).
35
+ */
36
+ export declare function ruby(baseText: string | Run | readonly Run[], rubyText: string | Run | readonly Run[], properties?: RubyProperties): Run;
37
+ /** Create a carriage return run. */
38
+ export declare function carriageReturn(): Run;
39
+ /** Create a no-break hyphen run. */
40
+ export declare function noBreakHyphen(): Run;
41
+ /** Create a soft hyphen run. */
42
+ export declare function softHyphen(): Run;
43
+ /** Create a run with a field code. */
44
+ export declare function field(instruction: string, cachedValue?: string): Run;
45
+ /** Create a PAGE field (current page number). */
46
+ export declare function pageNumberField(cachedValue?: string): Run;
47
+ /** Create a NUMPAGES field (total page count). */
48
+ export declare function totalPagesField(cachedValue?: string): Run;
49
+ /** Create a SECTIONPAGES field (pages in section). */
50
+ export declare function sectionPagesField(cachedValue?: string): Run;
51
+ /** Create a SECTION field (current section number). */
52
+ export declare function sectionField(cachedValue?: string): Run;
53
+ /** Create a DATE field. */
54
+ export declare function dateField(format?: string, cachedValue?: string): Run;
55
+ /** Create a SEQ (sequence) field for numbering figures, tables, etc. */
56
+ export declare function sequenceField(identifier: string, options?: {
57
+ cachedValue?: string;
58
+ hide?: boolean;
59
+ }): Run;
60
+ /** Create a TIME field (current time). */
61
+ export declare function timeField(format?: string, cachedValue?: string): Run;
62
+ /** Create an AUTHOR field. */
63
+ export declare function authorField(cachedValue?: string): Run;
64
+ /** Create a TITLE field. */
65
+ export declare function titleField(cachedValue?: string): Run;
66
+ /** Create a SUBJECT field. */
67
+ export declare function subjectField(cachedValue?: string): Run;
68
+ /** Create a KEYWORDS field. */
69
+ export declare function keywordsField(cachedValue?: string): Run;
70
+ /** Create a FILENAME field. */
71
+ export declare function fileNameField(options?: {
72
+ includePath?: boolean;
73
+ cachedValue?: string;
74
+ }): Run;
75
+ /** Create a FILESIZE field. */
76
+ export declare function fileSizeField(cachedValue?: string): Run;
77
+ /**
78
+ * Create a STYLEREF field (references text from nearest paragraph with given style).
79
+ *
80
+ * Commonly used in headers to show current chapter/section heading.
81
+ */
82
+ export declare function styleRefField(styleName: string, options?: {
83
+ /** Search from bottom of page (default: top). */
84
+ fromBottom?: boolean;
85
+ /** Insert paragraph number instead of text. */
86
+ insertParagraphNumber?: boolean;
87
+ /** Insert position (above/below) reference. */
88
+ insertPosition?: boolean;
89
+ /** Suppress non-delimiter/non-numerical text. */
90
+ suppressNonNumeric?: boolean;
91
+ cachedValue?: string;
92
+ }): Run;
93
+ /**
94
+ * Create a REF field (references a bookmark).
95
+ */
96
+ export declare function refField(bookmarkName: string, options?: {
97
+ /** Insert bookmark number. */
98
+ insertNumber?: boolean;
99
+ /** Hyperlink to bookmark. */
100
+ hyperlink?: boolean;
101
+ /** Paragraph number (no context). */
102
+ paragraphNumber?: boolean;
103
+ /** Relative paragraph number. */
104
+ relativeParagraphNumber?: boolean;
105
+ /** Full context paragraph number. */
106
+ fullContext?: boolean;
107
+ /** Suppress non-delimiter. */
108
+ suppressNonDelimiter?: boolean;
109
+ cachedValue?: string;
110
+ }): Run;
111
+ /** Create a PAGEREF field (references page of bookmark). */
112
+ export declare function pageRefField(bookmarkName: string, options?: {
113
+ hyperlink?: boolean;
114
+ relativePosition?: boolean;
115
+ cachedValue?: string;
116
+ }): Run;
117
+ /** Create a NOTEREF field (references a footnote/endnote). */
118
+ export declare function noteRefField(bookmarkName: string, options?: {
119
+ hyperlink?: boolean;
120
+ insertNumberFormat?: boolean;
121
+ cachedValue?: string;
122
+ }): Run;
123
+ /** Create a HYPERLINK field (alternative to w:hyperlink element). */
124
+ export declare function hyperlinkField(target: string, options?: {
125
+ /** Anchor within target (bookmark). */
126
+ anchor?: string;
127
+ /** Open in new window. */
128
+ newWindow?: boolean;
129
+ /** Display text (if omitted, uses target). */
130
+ displayText?: string;
131
+ /** Screen tip tooltip. */
132
+ tooltip?: string;
133
+ cachedValue?: string;
134
+ }): Run;
135
+ /** Create a QUOTE field (literal text). */
136
+ export declare function quoteField(text: string, cachedValue?: string): Run;
137
+ /**
138
+ * Create a TOC field for table of contents.
139
+ *
140
+ * @param options - TOC options.
141
+ */
142
+ export declare function tocField(options?: {
143
+ /** Heading levels to include (e.g. "1-3"). */
144
+ headingLevels?: string;
145
+ /** Include paragraphs with these styles. */
146
+ styles?: readonly string[];
147
+ /** Include table entries (TC fields) with these levels. */
148
+ tcLevels?: string;
149
+ /** Hyperlinks for entries. */
150
+ hyperlink?: boolean;
151
+ /** Right-align page numbers. */
152
+ rightAlignedPageNumbers?: boolean;
153
+ /** Use tab leader (default "." dots). */
154
+ tabLeader?: "." | "-" | "_" | " ";
155
+ /** Suppress page numbers. */
156
+ noPageNumbers?: boolean;
157
+ /** Identifier for table of captions. */
158
+ captionIdentifier?: string;
159
+ cachedValue?: string;
160
+ }): Run;
161
+ /** Create a TC (table of contents entry) field. */
162
+ export declare function tcField(text: string, options?: {
163
+ level?: number;
164
+ suppressPageNumber?: boolean;
165
+ cachedValue?: string;
166
+ }): Run;
167
+ /** Create an XE (index entry) field. */
168
+ export declare function indexEntryField(text: string, options?: {
169
+ bold?: boolean;
170
+ italic?: boolean;
171
+ cachedValue?: string;
172
+ }): Run;
173
+ /** Create an INDEX field (renders index from XE entries). */
174
+ export declare function indexField(options?: {
175
+ bookmark?: string;
176
+ columns?: number;
177
+ entryType?: string;
178
+ cachedValue?: string;
179
+ }): Run;
180
+ /** Create an IF field (conditional content). */
181
+ export declare function ifField(condition: string, trueText: string, falseText: string, cachedValue?: string): Run;
182
+ /** Create an INCLUDETEXT field (includes external file content). */
183
+ export declare function includeTextField(filePath: string, options?: {
184
+ bookmark?: string;
185
+ cachedValue?: string;
186
+ }): Run;
187
+ /** Create an INCLUDEPICTURE field. */
188
+ export declare function includePictureField(filePath: string, cachedValue?: string): Run;
189
+ /** Create a FORMTEXT field (legacy text form field). */
190
+ export declare function formTextField(cachedValue?: string): Run;
191
+ /** Create a FORMCHECKBOX field (legacy checkbox form field). */
192
+ export declare function formCheckboxField(cachedValue?: string): Run;
193
+ /** Create a FORMDROPDOWN field (legacy dropdown form field). */
194
+ export declare function formDropdownField(cachedValue?: string): Run;
195
+ /** Create a paragraph. */
196
+ export declare function paragraph(children: ParagraphChild[], properties?: ParagraphProperties): Paragraph;
197
+ /** Create a simple text paragraph. */
198
+ export declare function textParagraph(content: string, properties?: ParagraphProperties & {
199
+ run?: RunProperties;
200
+ }): Paragraph;
201
+ /** Create a heading paragraph. */
202
+ export declare function heading(content: string, level: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9): Paragraph;
203
+ /** Create a hyperlink. */
204
+ export declare function hyperlink(linkText: string, options: {
205
+ rId?: string;
206
+ url?: string;
207
+ anchor?: string;
208
+ tooltip?: string;
209
+ properties?: RunProperties;
210
+ }): ParagraphChild;
211
+ /** Create a bookmark start. */
212
+ export declare function bookmarkStart(id: number, name: string): ParagraphChild;
213
+ /** Create a bookmark end. */
214
+ export declare function bookmarkEnd(id: number): ParagraphChild;
215
+ /** Create a comment range start marker. */
216
+ export declare function commentRangeStart(id: number): CommentRangeStart;
217
+ /** Create a comment range end marker. */
218
+ export declare function commentRangeEnd(id: number): CommentRangeEnd;
219
+ /** Create a comment reference (inside paragraph children). */
220
+ export declare function commentReference(id: number): CommentReference;
221
+ /** Create an inserted run (track changes). */
222
+ export declare function insertedRun(run: Run, revision: RevisionInfo): InsertedRun;
223
+ /** Create a deleted run (track changes). */
224
+ export declare function deletedRun(run: Run, revision: RevisionInfo): DeletedRun;
225
+ /** Create a moved-from run (track changes — source of a move). */
226
+ export declare function movedFromRun(run: Run, revision: RevisionInfo): MovedFromRun;
227
+ /** Create a moved-to run (track changes — destination of a move). */
228
+ export declare function movedToRun(run: Run, revision: RevisionInfo): MovedToRun;
229
+ /** Create a move range start marker. */
230
+ export declare function moveFromRangeStart(id: number, author: string, options?: {
231
+ date?: string;
232
+ name?: string;
233
+ }): MoveRangeMarker;
234
+ /** Create a move range end marker. */
235
+ export declare function moveFromRangeEnd(id: number): MoveRangeMarker;
236
+ /** Create a move-to range start marker. */
237
+ export declare function moveToRangeStart(id: number, author: string, options?: {
238
+ date?: string;
239
+ name?: string;
240
+ }): MoveRangeMarker;
241
+ /** Create a move-to range end marker. */
242
+ export declare function moveToRangeEnd(id: number): MoveRangeMarker;
243
+ /** Create a checkbox. */
244
+ export declare function checkBox(options?: {
245
+ checked?: boolean;
246
+ checkedState?: {
247
+ value: string;
248
+ font?: string;
249
+ };
250
+ uncheckedState?: {
251
+ value: string;
252
+ font?: string;
253
+ };
254
+ }): CheckBox;
255
+ /** Create a math block. */
256
+ export declare function mathBlock(content: MathContent[]): MathBlock;
257
+ /** Create a math text run. */
258
+ export declare function mathRun(mathText: string, properties?: {
259
+ italic?: boolean;
260
+ bold?: boolean;
261
+ font?: string;
262
+ }): MathContent;
263
+ /** Create a math fraction. */
264
+ export declare function mathFraction(numerator: MathContent[], denominator: MathContent[], fractionType?: "bar" | "skw" | "lin" | "noBar"): MathContent;
265
+ /** Create a math square root. */
266
+ export declare function mathSqrt(content: MathContent[]): MathContent;
267
+ /** Create a math nth root. */
268
+ export declare function mathRoot(degree: MathContent[], content: MathContent[]): MathContent;
269
+ /** Create a math summation. */
270
+ export declare function mathSum(content: MathContent[], sub?: MathContent[], sup?: MathContent[]): MathContent;
271
+ /** Create a math integral. */
272
+ export declare function mathIntegral(content: MathContent[], sub?: MathContent[], sup?: MathContent[]): MathContent;
273
+ /** Create a math product. */
274
+ export declare function mathProduct(content: MathContent[], sub?: MathContent[], sup?: MathContent[]): MathContent;
275
+ /** Create a math superscript. */
276
+ export declare function mathSuperScript(base: MathContent[], superScript: MathContent[]): MathContent;
277
+ /** Create a math subscript. */
278
+ export declare function mathSubScript(base: MathContent[], subScript: MathContent[]): MathContent;
279
+ /** Create a math sub-superscript. */
280
+ export declare function mathSubSuperScript(base: MathContent[], subScript: MathContent[], superScript: MathContent[]): MathContent;
281
+ /** Create a math pre-sub-superscript (subscript/superscript before the base). */
282
+ export declare function mathPreSubSuperScript(base: MathContent[], preSubScript: MathContent[], preSuperScript: MathContent[]): MathContent;
283
+ /** Create a math phantom (invisible expression that takes up space). */
284
+ export declare function mathPhantom(content: MathContent[], options?: {
285
+ show?: boolean;
286
+ zeroWidth?: boolean;
287
+ zeroAscent?: boolean;
288
+ zeroDescent?: boolean;
289
+ transparent?: boolean;
290
+ }): MathContent;
291
+ /** Create a math group character (e.g. a horizontal brace over an expression). */
292
+ export declare function mathGroupChar(base: MathContent[], options?: {
293
+ char?: string;
294
+ position?: "top" | "bottom";
295
+ verticalAlign?: "top" | "center" | "bottom";
296
+ }): MathContent;
297
+ /** Create a math border box (draw borders around / strike through an expression). */
298
+ export declare function mathBorderBox(content: MathContent[], options?: {
299
+ hideTop?: boolean;
300
+ hideBottom?: boolean;
301
+ hideLeft?: boolean;
302
+ hideRight?: boolean;
303
+ strikeBlTr?: boolean;
304
+ strikeTlBr?: boolean;
305
+ strikeH?: boolean;
306
+ strikeV?: boolean;
307
+ }): MathContent;
308
+ /** Create a math delimiter (parentheses, brackets, etc.). */
309
+ export declare function mathDelimiter(content: MathContent[][], options?: {
310
+ beginChar?: string;
311
+ endChar?: string;
312
+ separatorChar?: string;
313
+ }): MathContent;
314
+ /** Create a math n-ary operator (sum, integral, product, etc.). */
315
+ export declare function mathNary(char: string, content: MathContent[], sub?: MathContent[], sup?: MathContent[]): MathContent;
316
+ /** Create a math function (sin, cos, lim, etc.). */
317
+ export declare function mathFunction(name: MathContent[], content: MathContent[]): MathContent;
318
+ /** Create a math limit (upper or lower). */
319
+ export declare function mathLimit(base: MathContent[], limit: MathContent[], limitType?: "upper" | "lower"): MathContent;
320
+ /** Create a math matrix. */
321
+ export declare function mathMatrix(rows: MathContent[][][]): MathContent;
322
+ /** Create a math accent (hat, tilde, etc.). */
323
+ export declare function mathAccent(content: MathContent[], char?: string): MathContent;
324
+ /** Create a math bar (overbar/underbar). */
325
+ export declare function mathBar(content: MathContent[], position?: "top" | "bottom"): MathContent;
326
+ /** Create a math box. */
327
+ export declare function mathBox(content: MathContent[]): MathContent;
328
+ /** Create a math equation array. */
329
+ export declare function mathEquationArray(rows: MathContent[][]): MathContent;
330
+ /** Create a symbol run. */
331
+ export declare function symbol(font: string, char: string, properties?: RunProperties): Run;
332
+ /** Create a floating image (body-level). */
333
+ export declare function floatingImage(options: {
334
+ rId: string;
335
+ width: Emu;
336
+ height: Emu;
337
+ horizontalPosition?: FloatingImage["horizontalPosition"];
338
+ verticalPosition?: FloatingImage["verticalPosition"];
339
+ wrap?: FloatingImage["wrap"];
340
+ altText?: string;
341
+ name?: string;
342
+ behindDoc?: boolean;
343
+ lockAnchor?: boolean;
344
+ layoutInCell?: boolean;
345
+ allowOverlap?: boolean;
346
+ simplePos?: {
347
+ x: Emu;
348
+ y: Emu;
349
+ };
350
+ distT?: Emu;
351
+ distB?: Emu;
352
+ distL?: Emu;
353
+ distR?: Emu;
354
+ rotation?: number;
355
+ flipHorizontal?: boolean;
356
+ flipVertical?: boolean;
357
+ srcRect?: FloatingImage["srcRect"];
358
+ }): FloatingImage;
359
+ /** Create a DrawingML shape. */
360
+ export declare function drawingShape(options: {
361
+ shapeType: DrawingShape["shapeType"];
362
+ width: Emu;
363
+ height: Emu;
364
+ fillColor?: HexColor;
365
+ noFill?: boolean;
366
+ outlineColor?: HexColor;
367
+ outlineWidth?: Emu;
368
+ noOutline?: boolean;
369
+ textContent?: readonly Paragraph[];
370
+ altText?: string;
371
+ name?: string;
372
+ horizontalPosition?: DrawingShape["horizontalPosition"];
373
+ verticalPosition?: DrawingShape["verticalPosition"];
374
+ wrap?: DrawingShape["wrap"];
375
+ behindDoc?: boolean;
376
+ rotation?: number;
377
+ }): DrawingShape;
378
+ /** Create a chart content block. */
379
+ export declare function chart(options: {
380
+ type: Chart["type"];
381
+ series: readonly ChartSeries[];
382
+ title?: string;
383
+ legend?: ChartLegendPosition;
384
+ categoryAxis?: ChartAxis;
385
+ valueAxis?: ChartAxis;
386
+ plotAreaColor?: HexColor;
387
+ chartAreaColor?: HexColor;
388
+ view3d?: boolean;
389
+ style?: number;
390
+ width?: Emu;
391
+ height?: Emu;
392
+ altText?: string;
393
+ name?: string;
394
+ }): ChartContent;
395
+ /** Create a structured document tag (content control). */
396
+ export declare function structuredDocumentTag(content: (Paragraph | Table)[], properties?: SdtProperties): StructuredDocumentTag;
397
+ /** Shorthand border. */
398
+ export declare function border(style?: Border["style"], size?: number, color?: string): Border;
399
+ /** Create standard grid borders for a table. */
400
+ export declare function gridBorders(size?: number, color?: string): TableBorders;
401
+ /** Create a table cell. */
402
+ export declare function cell(content: string | (Paragraph | Table)[], properties?: TableCellProperties): TableCell;
403
+ /** Create a table row. */
404
+ export declare function row(cells: TableCell[], properties?: TableRowProperties): TableRow;
405
+ /** Create a table. */
406
+ export declare function table(rows: TableRow[], properties?: TableProperties, columnWidths?: Twips[]): Table;
407
+ /** Create a simple table from a 2D string array. */
408
+ export declare function simpleTable(data: string[][], options?: {
409
+ headerRow?: boolean;
410
+ borders?: boolean;
411
+ width?: TableWidth;
412
+ columnWidths?: Twips[];
413
+ }): Table;
414
+ /**
415
+ * Fluent builder for constructing DOCX documents.
416
+ *
417
+ * @example
418
+ * ```ts
419
+ * const doc = new DocumentBuilder()
420
+ * .addHeading("Hello World", 1)
421
+ * .addParagraph("This is a paragraph.")
422
+ * .addTable([["Name", "Age"], ["Alice", "30"]])
423
+ * .build();
424
+ *
425
+ * const bytes = await doc.toBuffer();
426
+ * ```
427
+ */
428
+ export declare class DocumentBuilder {
429
+ private _body;
430
+ private _sectionProperties?;
431
+ private _styles;
432
+ private _docDefaults?;
433
+ private _abstractNumberings;
434
+ private _numberingInstances;
435
+ private _headers;
436
+ private _footers;
437
+ private _footnotes;
438
+ private _endnotes;
439
+ private _images;
440
+ private _fonts;
441
+ private _settings?;
442
+ private _coreProperties?;
443
+ private _appProperties?;
444
+ private _comments;
445
+ private _background?;
446
+ private _customProperties;
447
+ private _watermark?;
448
+ private _nextImageId;
449
+ private _nextFootnoteId;
450
+ private _nextEndnoteId;
451
+ private _nextBookmarkId;
452
+ private _nextAbstractNumId;
453
+ private _nextNumId;
454
+ private _nextDrawingId;
455
+ private _nextCommentId;
456
+ /** Add raw body content. */
457
+ addContent(content: BodyContent): this;
458
+ /** Add a paragraph with runs. */
459
+ addParagraphElement(para: Paragraph): this;
460
+ /** Add a simple text paragraph. */
461
+ addParagraph(content: string, properties?: ParagraphProperties & {
462
+ run?: RunProperties;
463
+ }): this;
464
+ /** Add a heading. */
465
+ addHeading(content: string, level?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9): this;
466
+ /** Add a page break. */
467
+ addPageBreak(): this;
468
+ /** Add a table from a 2D array. */
469
+ addTable(data: string[][], options?: {
470
+ headerRow?: boolean;
471
+ borders?: boolean;
472
+ width?: TableWidth;
473
+ columnWidths?: Twips[];
474
+ }): this;
475
+ /** Add a table element. */
476
+ addTableElement(tbl: Table): this;
477
+ /** Add an inline image. Returns the image relationship ID and drawing ID. */
478
+ addImage(data: Uint8Array, mediaType: ImageMediaType, width: Emu, height: Emu, options?: {
479
+ altText?: string;
480
+ name?: string;
481
+ }): {
482
+ rId: string;
483
+ drawingId: number;
484
+ };
485
+ /** Add a floating image. Returns the image relationship ID. */
486
+ addFloatingImage(data: Uint8Array, mediaType: ImageMediaType, width: Emu, height: Emu, options?: {
487
+ altText?: string;
488
+ name?: string;
489
+ horizontalPosition?: FloatingImage["horizontalPosition"];
490
+ verticalPosition?: FloatingImage["verticalPosition"];
491
+ wrap?: FloatingImage["wrap"];
492
+ behindDoc?: boolean;
493
+ lockAnchor?: boolean;
494
+ layoutInCell?: boolean;
495
+ allowOverlap?: boolean;
496
+ distT?: Emu;
497
+ distB?: Emu;
498
+ distL?: Emu;
499
+ distR?: Emu;
500
+ rotation?: number;
501
+ flipHorizontal?: boolean;
502
+ flipVertical?: boolean;
503
+ }): string;
504
+ /** Add a custom font definition. */
505
+ addFont(font: FontDef): this;
506
+ /** Set a text watermark on the document. */
507
+ setWatermark(watermark: Watermark): this;
508
+ /** Add a footnote. Returns the footnote ID. */
509
+ addFootnote(content: string | Paragraph[]): number;
510
+ /** Add an endnote. Returns the endnote ID. */
511
+ addEndnote(content: string | Paragraph[]): number;
512
+ /** Add a comment. Returns the comment ID. */
513
+ addComment(author: string, content: string | Paragraph[], options?: {
514
+ date?: string;
515
+ initials?: string;
516
+ }): number;
517
+ /** Add a Table of Contents. */
518
+ addTableOfContents(options?: Partial<Omit<TableOfContents, "type">>): this;
519
+ /** Add a math equation block. */
520
+ addMath(content: MathContent[]): this;
521
+ /** Add a text box. */
522
+ addTextBox(content: string | Paragraph[], options?: {
523
+ width?: Twips;
524
+ height?: Twips;
525
+ stroke?: boolean;
526
+ fill?: boolean;
527
+ }): this;
528
+ /** Add a bullet list. */
529
+ addBulletList(items: string[], level?: number): this;
530
+ /** Add a numbered list. */
531
+ addNumberedList(items: string[], level?: number): this;
532
+ /** Set section properties (page size, margins, etc.). */
533
+ setSectionProperties(props: SectionProperties): this;
534
+ /** Set document defaults. */
535
+ setDocDefaults(defaults: DocDefaults): this;
536
+ /** Add a style definition. */
537
+ addStyle(style: StyleDef): this;
538
+ /** Set default styles (Normal, Heading1-6, Hyperlink, etc.). */
539
+ useDefaultStyles(): this;
540
+ /** Set a header for the given type. */
541
+ setHeader(type: string, content: HeaderFooterContent): this;
542
+ /** Set a footer for the given type. */
543
+ setFooter(type: string, content: HeaderFooterContent): this;
544
+ /** Set document settings. */
545
+ setSettings(settings: DocumentSettings): this;
546
+ /** Set core properties (metadata). */
547
+ setCoreProperties(props: CoreProperties): this;
548
+ /** Set application properties. */
549
+ setAppProperties(props: AppProperties): this;
550
+ /** Set document background. */
551
+ setBackground(background: DocumentBackground): this;
552
+ /** Add a custom document property. */
553
+ addCustomProperty(name: string, value: CustomPropertyValue): this;
554
+ /** Add a section break with properties. */
555
+ addSectionBreak(props: SectionProperties): this;
556
+ /** Get next available bookmark ID. */
557
+ nextBookmarkId(): number;
558
+ /** Build the DocxDocument model. */
559
+ build(): DocxDocument;
560
+ /** Build and package to DOCX bytes. */
561
+ toBuffer(compressionLevel?: number): Promise<Uint8Array>;
562
+ /** Build and package to base64 string. */
563
+ toBase64(compressionLevel?: number): Promise<string>;
564
+ }
565
+ /**
566
+ * Resolve a ColorSpec to an actual hex RGB color using the document theme.
567
+ *
568
+ * Applies theme color lookup + tint/shade transformations per OOXML spec.
569
+ *
570
+ * @param color - The color value (HexColor string or ColorSpec).
571
+ * @param theme - The document theme (from `doc.theme`).
572
+ * @returns Resolved hex color string (6 chars, no #), or undefined if unresolvable.
573
+ */
574
+ export declare function resolveThemeColor(color: HexColor | ColorSpec | undefined, theme?: DocumentTheme): HexColor | undefined;
575
+ /** Result of a text search in a document. */
576
+ export interface SearchResult {
577
+ /** Paragraph index in body. */
578
+ readonly paragraphIndex: number;
579
+ /** The matched text. */
580
+ readonly match: string;
581
+ /** Character offset within the paragraph's concatenated text. */
582
+ readonly offset: number;
583
+ }
584
+ /**
585
+ * Count all top-level paragraphs in the document body.
586
+ */
587
+ export declare function paragraphCount(doc: DocxDocument): number;
588
+ /**
589
+ * Count words across all paragraphs in the document body.
590
+ * Uses simple whitespace splitting; for East Asian text, each CJK character
591
+ * is counted as one "word" to approximate meaningful unit count.
592
+ */
593
+ export declare function countWords(doc: DocxDocument): number;
594
+ /** A heading extracted from a document. */
595
+ export interface DocumentHeading {
596
+ /** Heading level (1-9). */
597
+ readonly level: number;
598
+ /** Plain text of the heading. */
599
+ readonly text: string;
600
+ /** Index into doc.body where the paragraph resides. */
601
+ readonly paragraphIndex: number;
602
+ /** Style ID used (e.g. "Heading1"). */
603
+ readonly style?: string;
604
+ }
605
+ /**
606
+ * Extract the heading outline from a document.
607
+ *
608
+ * Matches paragraphs whose style is `Heading1` through `Heading9` (case-insensitive),
609
+ * or whose `outlineLevel` property is set (0-8).
610
+ */
611
+ export declare function getHeadings(doc: DocxDocument): DocumentHeading[];
612
+ /**
613
+ * Find a bookmark by name.
614
+ *
615
+ * @returns The bookmark start marker + its location, or `undefined` if not found.
616
+ */
617
+ export declare function findBookmark(doc: DocxDocument, name: string): {
618
+ bookmark: BookmarkStart;
619
+ paragraphIndex: number;
620
+ childIndex: number;
621
+ } | undefined;
622
+ /**
623
+ * Find a comment by its ID.
624
+ */
625
+ export declare function findComment(doc: DocxDocument, id: number): CommentDef | undefined;
626
+ /**
627
+ * List all images registered in the document.
628
+ */
629
+ export declare function listImages(doc: DocxDocument): readonly ImageDef[];
630
+ /**
631
+ * List all tables in the document body (top-level only).
632
+ */
633
+ export declare function listTables(doc: DocxDocument): readonly Table[];
634
+ /**
635
+ * Collect all hyperlinks in the document body.
636
+ */
637
+ export declare function listHyperlinks(doc: DocxDocument): readonly Hyperlink[];
638
+ /**
639
+ * Get the total number of tables (top-level) and nested tables.
640
+ */
641
+ export declare function tableCount(doc: DocxDocument): number;
642
+ /**
643
+ * Extract plain text from the entire document body.
644
+ *
645
+ * Paragraphs are separated by `\n`. Tables render as tab-separated cell text.
646
+ */
647
+ export declare function extractText(doc: DocxDocument): string;
648
+ /**
649
+ * Search for text occurrences in a document's body paragraphs.
650
+ *
651
+ * @param doc - The document model to search.
652
+ * @param query - String or RegExp to search for.
653
+ * @returns Array of search results.
654
+ */
655
+ export declare function searchText(doc: DocxDocument, query: string | RegExp): SearchResult[];
656
+ /**
657
+ * Replace text in a document's body paragraphs (mutates the document).
658
+ *
659
+ * Performs simple text replacement within run content. Each run's text content
660
+ * is individually searched and replaced. For cross-run matches, the paragraph
661
+ * text is reconstructed and split back into runs.
662
+ *
663
+ * @param doc - The document model to modify (mutated in place).
664
+ * @param search - String or RegExp to find.
665
+ * @param replacement - Replacement string (supports $1, $2 etc. for RegExp).
666
+ * @returns Number of replacements made.
667
+ */
668
+ export declare function replaceText(doc: DocxDocument, search: string | RegExp, replacement: string): number;
669
+ /**
670
+ * Execute a mail merge: replace all MERGEFIELD fields in the document with values from the data map.
671
+ *
672
+ * Fields not found in the data map are left unchanged (or optionally cleared).
673
+ *
674
+ * @param doc - The document to modify (mutated in place).
675
+ * @param data - Map of field names to replacement values.
676
+ * @param options - Optional settings.
677
+ * @returns The number of fields replaced.
678
+ */
679
+ export declare function mailMerge(doc: DocxDocument, data: Record<string, string>, options?: {
680
+ /** If true, remove fields not found in data. Default: false (leave unchanged). */
681
+ removeUnmatched?: boolean;
682
+ }): number;
683
+ /** Type of content to patch into a placeholder. */
684
+ export type PatchContent = {
685
+ readonly type: "text";
686
+ readonly text: string;
687
+ } | {
688
+ readonly type: "paragraph";
689
+ readonly children: readonly Paragraph[];
690
+ } | {
691
+ readonly type: "table";
692
+ readonly table: Table;
693
+ } | {
694
+ readonly type: "image";
695
+ readonly image: ImageDef;
696
+ readonly width: number;
697
+ readonly height: number;
698
+ };
699
+ /** A single patch operation mapping a placeholder to replacement content. */
700
+ export interface PatchOperation {
701
+ /** Placeholder string to find (e.g. "{{name}}"). */
702
+ readonly placeholder: string;
703
+ /** Content to replace the placeholder with. */
704
+ readonly content: PatchContent;
705
+ }
706
+ /** Options for patchDocument. */
707
+ export interface PatchOptions {
708
+ /** Compression level (0-9). Default: 6. */
709
+ readonly compressionLevel?: number;
710
+ }
711
+ /**
712
+ * Read an existing DOCX file, replace placeholders with content, and produce a new DOCX.
713
+ *
714
+ * Placeholders are strings like `{{name}}` embedded in the document text.
715
+ * They may span across multiple runs — the patcher handles cross-run matching.
716
+ *
717
+ * Supported patch content types:
718
+ * - `text` — simple text replacement (preserves formatting of the first run)
719
+ * - `paragraph` — replaces the entire paragraph containing the placeholder
720
+ * - `table` — replaces the entire paragraph with a table
721
+ * - `image` — replaces the placeholder with an inline image
722
+ *
723
+ * @param buffer - The source DOCX file as a Uint8Array.
724
+ * @param patches - Array of patch operations to apply.
725
+ * @param options - Optional compression settings.
726
+ * @returns New DOCX file as a Uint8Array.
727
+ */
728
+ export declare function patchDocument(buffer: Uint8Array, patches: readonly PatchOperation[], options?: PatchOptions): Promise<Uint8Array>;