docx 7.4.1 → 7.6.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 (303) hide show
  1. package/LICENSE +21 -21
  2. package/build/export/packer/image-replacer.d.ts +2 -2
  3. package/build/export/packer/numbering-replacer.d.ts +1 -1
  4. package/build/export/packer/packer.d.ts +4 -0
  5. package/build/file/core-properties/properties.d.ts +3 -3
  6. package/build/file/custom-properties/custom-properties.d.ts +1 -1
  7. package/build/file/document/body/section-properties/properties/columns.d.ts +1 -1
  8. package/build/file/drawing/text-wrap/wrap-square.d.ts +1 -1
  9. package/build/file/file.d.ts +3 -3
  10. package/build/file/footnotes/footnote/footnote.d.ts +1 -1
  11. package/build/file/footnotes/footnotes.d.ts +1 -1
  12. package/build/file/header.d.ts +1 -1
  13. package/build/file/numbering/abstract-numbering.d.ts +1 -1
  14. package/build/file/numbering/level.d.ts +2 -2
  15. package/build/file/numbering/numbering.d.ts +4 -4
  16. package/build/file/paragraph/formatting/tab-stop.d.ts +7 -2
  17. package/build/file/paragraph/links/bookmark.d.ts +2 -2
  18. package/build/file/paragraph/links/hyperlink.d.ts +5 -5
  19. package/build/file/paragraph/math/brackets/math-angled-brackets.d.ts +1 -1
  20. package/build/file/paragraph/math/brackets/math-curly-brackets.d.ts +1 -1
  21. package/build/file/paragraph/math/brackets/math-round-brackets.d.ts +1 -1
  22. package/build/file/paragraph/math/brackets/math-square-brackets.d.ts +1 -1
  23. package/build/file/paragraph/math/fraction/math-denominator.d.ts +1 -1
  24. package/build/file/paragraph/math/fraction/math-fraction.d.ts +2 -2
  25. package/build/file/paragraph/math/fraction/math-numerator.d.ts +1 -1
  26. package/build/file/paragraph/math/function/math-function-name.d.ts +1 -1
  27. package/build/file/paragraph/math/function/math-function.d.ts +2 -2
  28. package/build/file/paragraph/math/math-component.d.ts +2 -2
  29. package/build/file/paragraph/math/math.d.ts +1 -1
  30. package/build/file/paragraph/math/n-ary/index.d.ts +1 -0
  31. package/build/file/paragraph/math/n-ary/math-base.d.ts +1 -1
  32. package/build/file/paragraph/math/n-ary/math-integral.d.ts +10 -0
  33. package/build/file/paragraph/math/n-ary/math-sub-script.d.ts +1 -1
  34. package/build/file/paragraph/math/n-ary/math-sum.d.ts +3 -3
  35. package/build/file/paragraph/math/n-ary/math-super-script.d.ts +1 -1
  36. package/build/file/paragraph/math/radical/math-degree.d.ts +1 -1
  37. package/build/file/paragraph/math/radical/math-radical.d.ts +2 -2
  38. package/build/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.d.ts +3 -3
  39. package/build/file/paragraph/math/script/sub-script/math-sub-script-function.d.ts +2 -2
  40. package/build/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.d.ts +3 -3
  41. package/build/file/paragraph/math/script/super-script/math-super-script-function.d.ts +2 -2
  42. package/build/file/paragraph/paragraph.d.ts +1 -1
  43. package/build/file/paragraph/properties.d.ts +2 -6
  44. package/build/file/paragraph/run/comment-run.d.ts +1 -1
  45. package/build/file/paragraph/run/run.d.ts +1 -1
  46. package/build/file/styles/sample/default-style.d.ts +1 -102
  47. package/build/file/styles/styles.d.ts +3 -3
  48. package/build/file/table/grid.d.ts +1 -1
  49. package/build/file/table/table-cell/table-cell.d.ts +1 -1
  50. package/build/file/table/table-row/table-row.d.ts +2 -2
  51. package/build/file/table/table.d.ts +2 -2
  52. package/build/file/table-of-contents/table-of-contents-properties.d.ts +1 -1
  53. package/build/file/xml-components/default-attributes.d.ts +3 -3
  54. package/build/file/xml-components/imported-xml-component.d.ts +2 -2
  55. package/build/index.js +1 -1
  56. package/build/index.js.LICENSE.txt +0 -12
  57. package/build/util/values.d.ts +17 -17
  58. package/package.json +15 -8
  59. package/src/export/packer/image-replacer.ts +2 -2
  60. package/src/export/packer/next-compiler.spec.ts +2 -2
  61. package/src/export/packer/next-compiler.ts +8 -8
  62. package/src/export/packer/numbering-replacer.ts +1 -1
  63. package/src/export/packer/packer.spec.ts +65 -7
  64. package/src/export/packer/packer.ts +24 -0
  65. package/src/file/app-properties/app-properties.ts +1 -1
  66. package/src/file/border/border.ts +1 -1
  67. package/src/file/content-types/content-types.ts +1 -1
  68. package/src/file/content-types/default/default.ts +1 -1
  69. package/src/file/content-types/override/override.ts +1 -1
  70. package/src/file/core-properties/properties.ts +5 -5
  71. package/src/file/custom-properties/custom-properties.ts +4 -2
  72. package/src/file/custom-properties/custom-property.ts +2 -2
  73. package/src/file/document/body/body.ts +3 -1
  74. package/src/file/document/body/section-properties/properties/column.ts +1 -1
  75. package/src/file/document/body/section-properties/properties/columns.spec.ts +7 -0
  76. package/src/file/document/body/section-properties/properties/columns.ts +2 -2
  77. package/src/file/document/body/section-properties/properties/doc-grid.ts +1 -1
  78. package/src/file/document/body/section-properties/properties/header-footer-reference.ts +1 -1
  79. package/src/file/document/body/section-properties/properties/line-number.ts +1 -1
  80. package/src/file/document/body/section-properties/properties/page-borders.ts +1 -1
  81. package/src/file/document/body/section-properties/properties/page-margin.ts +1 -1
  82. package/src/file/document/body/section-properties/properties/page-number.ts +1 -1
  83. package/src/file/document/body/section-properties/properties/page-size.ts +1 -1
  84. package/src/file/document/body/section-properties/properties/page-text-direction.ts +1 -1
  85. package/src/file/document/body/section-properties/properties/section-type.ts +1 -1
  86. package/src/file/document/body/section-properties/section-properties.ts +1 -1
  87. package/src/file/document/document-background/document-background.ts +1 -1
  88. package/src/file/document/document.ts +1 -1
  89. package/src/file/document-wrapper.spec.ts +0 -2
  90. package/src/file/document-wrapper.ts +1 -1
  91. package/src/file/drawing/anchor/anchor.spec.ts +2 -3
  92. package/src/file/drawing/anchor/anchor.ts +1 -1
  93. package/src/file/drawing/doc-properties/doc-properties.ts +1 -1
  94. package/src/file/drawing/drawing.spec.ts +2 -3
  95. package/src/file/drawing/drawing.ts +1 -1
  96. package/src/file/drawing/effect-extent/effect-extent.ts +1 -1
  97. package/src/file/drawing/extent/extent.ts +1 -1
  98. package/src/file/drawing/floating/align.ts +1 -1
  99. package/src/file/drawing/floating/horizontal-position.ts +1 -1
  100. package/src/file/drawing/floating/position-offset.ts +1 -1
  101. package/src/file/drawing/floating/simple-pos.ts +1 -1
  102. package/src/file/drawing/floating/vertical-position.ts +1 -1
  103. package/src/file/drawing/graphic-frame/graphic-frame-locks/graphic-frame-locks.ts +1 -1
  104. package/src/file/drawing/graphic-frame/graphic-frame-properties.ts +1 -1
  105. package/src/file/drawing/inline/graphic/graphic-data/graphic-data.ts +1 -1
  106. package/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts +1 -1
  107. package/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts +1 -1
  108. package/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts +1 -1
  109. package/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts +2 -2
  110. package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/child-non-visual-pic-properties.ts +1 -1
  111. package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/pic-locks/pic-locks.ts +1 -1
  112. package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-pic-properties.ts +1 -1
  113. package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties.ts +1 -1
  114. package/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts +1 -1
  115. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts +1 -1
  116. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts +1 -1
  117. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts +1 -1
  118. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts +1 -1
  119. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts +1 -1
  120. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts +1 -1
  121. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts +1 -1
  122. package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts +1 -1
  123. package/src/file/drawing/inline/graphic/graphic.ts +1 -1
  124. package/src/file/drawing/inline/inline.ts +1 -1
  125. package/src/file/drawing/text-wrap/wrap-none.ts +1 -1
  126. package/src/file/drawing/text-wrap/wrap-square.ts +3 -2
  127. package/src/file/drawing/text-wrap/wrap-tight.ts +1 -1
  128. package/src/file/drawing/text-wrap/wrap-top-and-bottom.ts +1 -1
  129. package/src/file/file.spec.ts +55 -2
  130. package/src/file/file.ts +18 -13
  131. package/src/file/footer/footer.ts +1 -1
  132. package/src/file/footer-wrapper.spec.ts +1 -1
  133. package/src/file/footer-wrapper.ts +1 -1
  134. package/src/file/footnotes/footnote/footnote.ts +2 -2
  135. package/src/file/footnotes/footnote/run/continuation-seperator-run.ts +1 -1
  136. package/src/file/footnotes/footnote/run/continuation-seperator.ts +1 -1
  137. package/src/file/footnotes/footnote/run/footnote-ref-run.ts +1 -1
  138. package/src/file/footnotes/footnote/run/footnote-ref.ts +1 -1
  139. package/src/file/footnotes/footnote/run/reference-run.ts +2 -2
  140. package/src/file/footnotes/footnote/run/seperator-run.ts +1 -1
  141. package/src/file/footnotes/footnote/run/seperator.ts +1 -1
  142. package/src/file/footnotes/footnotes.ts +2 -2
  143. package/src/file/footnotes-wrapper.spec.ts +0 -2
  144. package/src/file/footnotes-wrapper.ts +1 -1
  145. package/src/file/header/header.ts +1 -1
  146. package/src/file/header-wrapper.spec.ts +1 -1
  147. package/src/file/header-wrapper.ts +1 -1
  148. package/src/file/header.ts +11 -3
  149. package/src/file/media/media.spec.ts +4 -2
  150. package/src/file/media/media.ts +3 -1
  151. package/src/file/numbering/abstract-numbering.ts +1 -1
  152. package/src/file/numbering/level.spec.ts +40 -3
  153. package/src/file/numbering/level.ts +27 -8
  154. package/src/file/numbering/multi-level-type.ts +1 -1
  155. package/src/file/numbering/num.ts +4 -4
  156. package/src/file/numbering/numbering.spec.ts +2 -1
  157. package/src/file/numbering/numbering.ts +18 -18
  158. package/src/file/paragraph/formatting/alignment.ts +1 -1
  159. package/src/file/paragraph/formatting/border.ts +2 -2
  160. package/src/file/paragraph/formatting/break.ts +4 -4
  161. package/src/file/paragraph/formatting/indent.ts +1 -1
  162. package/src/file/paragraph/formatting/spacing.ts +1 -1
  163. package/src/file/paragraph/formatting/style.ts +1 -1
  164. package/src/file/paragraph/formatting/tab-stop.spec.ts +2 -2
  165. package/src/file/paragraph/formatting/tab-stop.ts +14 -5
  166. package/src/file/paragraph/formatting/unordered-list.ts +3 -3
  167. package/src/file/paragraph/frame/frame-properties.ts +1 -1
  168. package/src/file/paragraph/links/bookmark.ts +4 -4
  169. package/src/file/paragraph/links/hyperlink.ts +6 -4
  170. package/src/file/paragraph/links/outline-level.ts +1 -1
  171. package/src/file/paragraph/links/pageref-field-instruction.ts +1 -1
  172. package/src/file/paragraph/links/pageref.ts +1 -1
  173. package/src/file/paragraph/math/brackets/math-angled-brackets.ts +1 -1
  174. package/src/file/paragraph/math/brackets/math-beginning-character.ts +1 -1
  175. package/src/file/paragraph/math/brackets/math-bracket-properties.ts +1 -1
  176. package/src/file/paragraph/math/brackets/math-curly-brackets.ts +1 -1
  177. package/src/file/paragraph/math/brackets/math-ending-char.ts +1 -1
  178. package/src/file/paragraph/math/brackets/math-round-brackets.ts +1 -1
  179. package/src/file/paragraph/math/brackets/math-square-brackets.ts +1 -1
  180. package/src/file/paragraph/math/fraction/math-denominator.ts +1 -1
  181. package/src/file/paragraph/math/fraction/math-fraction.ts +3 -3
  182. package/src/file/paragraph/math/fraction/math-numerator.ts +1 -1
  183. package/src/file/paragraph/math/function/math-function-name.ts +1 -1
  184. package/src/file/paragraph/math/function/math-function-properties.ts +1 -1
  185. package/src/file/paragraph/math/function/math-function.ts +3 -3
  186. package/src/file/paragraph/math/math-component.ts +2 -1
  187. package/src/file/paragraph/math/math-run.ts +1 -1
  188. package/src/file/paragraph/math/math-text.ts +1 -1
  189. package/src/file/paragraph/math/math.ts +2 -2
  190. package/src/file/paragraph/math/n-ary/index.ts +1 -0
  191. package/src/file/paragraph/math/n-ary/math-accent-character.ts +1 -1
  192. package/src/file/paragraph/math/n-ary/math-base.ts +1 -1
  193. package/src/file/paragraph/math/n-ary/math-integral.spec.ts +116 -0
  194. package/src/file/paragraph/math/n-ary/math-integral.ts +31 -0
  195. package/src/file/paragraph/math/n-ary/math-limit-location.ts +1 -1
  196. package/src/file/paragraph/math/n-ary/math-n-ary-properties.ts +4 -2
  197. package/src/file/paragraph/math/n-ary/math-sub-script-hide.ts +1 -1
  198. package/src/file/paragraph/math/n-ary/math-sub-script.ts +1 -1
  199. package/src/file/paragraph/math/n-ary/math-sum.ts +4 -4
  200. package/src/file/paragraph/math/n-ary/math-super-script-hide.ts +1 -1
  201. package/src/file/paragraph/math/n-ary/math-super-script.ts +1 -1
  202. package/src/file/paragraph/math/radical/math-degree-hide.ts +1 -1
  203. package/src/file/paragraph/math/radical/math-degree.ts +1 -1
  204. package/src/file/paragraph/math/radical/math-radical-properties.ts +1 -1
  205. package/src/file/paragraph/math/radical/math-radical.ts +3 -3
  206. package/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.ts +1 -1
  207. package/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.ts +4 -4
  208. package/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.ts +1 -1
  209. package/src/file/paragraph/math/script/sub-script/math-sub-script-function.ts +3 -3
  210. package/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.ts +1 -1
  211. package/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.ts +4 -4
  212. package/src/file/paragraph/math/script/super-script/math-super-script-function-properties.ts +1 -1
  213. package/src/file/paragraph/math/script/super-script/math-super-script-function.ts +3 -3
  214. package/src/file/paragraph/paragraph.spec.ts +2 -6
  215. package/src/file/paragraph/paragraph.ts +2 -2
  216. package/src/file/paragraph/properties.spec.ts +1 -3
  217. package/src/file/paragraph/properties.ts +18 -18
  218. package/src/file/paragraph/run/break.ts +1 -1
  219. package/src/file/paragraph/run/comment-run.ts +6 -6
  220. package/src/file/paragraph/run/emphasis-mark.ts +2 -2
  221. package/src/file/paragraph/run/field.ts +3 -3
  222. package/src/file/paragraph/run/formatting.ts +4 -4
  223. package/src/file/paragraph/run/image-run.spec.ts +9 -9
  224. package/src/file/paragraph/run/image-run.ts +2 -1
  225. package/src/file/paragraph/run/page-number.ts +3 -3
  226. package/src/file/paragraph/run/properties.ts +2 -2
  227. package/src/file/paragraph/run/run-components/symbol.ts +1 -1
  228. package/src/file/paragraph/run/run-components/text.ts +1 -1
  229. package/src/file/paragraph/run/run-fonts.ts +5 -5
  230. package/src/file/paragraph/run/run.spec.ts +1 -3
  231. package/src/file/paragraph/run/run.ts +2 -2
  232. package/src/file/paragraph/run/script.ts +3 -3
  233. package/src/file/paragraph/run/sequential-identifier-instruction.ts +1 -1
  234. package/src/file/paragraph/run/sequential-identifier.ts +1 -1
  235. package/src/file/paragraph/run/simple-field.ts +2 -2
  236. package/src/file/paragraph/run/symbol-run.spec.ts +1 -3
  237. package/src/file/paragraph/run/symbol-run.ts +1 -1
  238. package/src/file/paragraph/run/tab.ts +1 -1
  239. package/src/file/paragraph/run/text-run.ts +1 -1
  240. package/src/file/paragraph/run/underline.ts +1 -1
  241. package/src/file/relationships/relationship/relationship.ts +1 -1
  242. package/src/file/relationships/relationships.ts +1 -1
  243. package/src/file/settings/compatibility-setting/compatibility-setting.ts +1 -1
  244. package/src/file/settings/compatibility.ts +1 -1
  245. package/src/file/settings/settings.ts +1 -1
  246. package/src/file/shading/shading.ts +1 -1
  247. package/src/file/styles/defaults/document-defaults.spec.ts +2 -2
  248. package/src/file/styles/defaults/document-defaults.ts +1 -1
  249. package/src/file/styles/defaults/paragraph-properties.ts +1 -1
  250. package/src/file/styles/defaults/run-properties.ts +1 -1
  251. package/src/file/styles/external-styles-factory.spec.ts +3 -3
  252. package/src/file/styles/external-styles-factory.ts +1 -0
  253. package/src/file/styles/latent-styles/exceptions.ts +1 -1
  254. package/src/file/styles/latent-styles/latent-styles.ts +1 -1
  255. package/src/file/styles/sample/default-style.ts +6 -6
  256. package/src/file/styles/style/character-style.ts +1 -1
  257. package/src/file/styles/style/components.ts +2 -2
  258. package/src/file/styles/style/default-styles.spec.ts +1 -2
  259. package/src/file/styles/style/default-styles.ts +14 -14
  260. package/src/file/styles/style/paragraph-style.ts +1 -1
  261. package/src/file/styles/style/style.ts +1 -1
  262. package/src/file/styles/styles.ts +4 -4
  263. package/src/file/table/grid.spec.ts +1 -2
  264. package/src/file/table/grid.ts +2 -2
  265. package/src/file/table/table-cell/table-cell-components.ts +4 -4
  266. package/src/file/table/table-cell/table-cell-properties.ts +1 -1
  267. package/src/file/table/table-cell/table-cell.ts +2 -2
  268. package/src/file/table/table-properties/table-borders.ts +1 -1
  269. package/src/file/table/table-properties/table-cell-margin.ts +4 -1
  270. package/src/file/table/table-properties/table-float-properties.ts +1 -1
  271. package/src/file/table/table-properties/table-layout.ts +1 -1
  272. package/src/file/table/table-properties/table-overlap.ts +1 -1
  273. package/src/file/table/table-properties/table-properties.ts +1 -1
  274. package/src/file/table/table-row/table-row-height.ts +1 -1
  275. package/src/file/table/table-row/table-row-properties.ts +1 -1
  276. package/src/file/table/table-row/table-row.ts +3 -3
  277. package/src/file/table/table-width.ts +1 -1
  278. package/src/file/table/table.ts +4 -3
  279. package/src/file/table-of-contents/alias.ts +1 -1
  280. package/src/file/table-of-contents/field-instruction.ts +1 -1
  281. package/src/file/table-of-contents/sdt-content.ts +1 -1
  282. package/src/file/table-of-contents/sdt-properties.ts +1 -1
  283. package/src/file/table-of-contents/table-of-contents-properties.ts +2 -2
  284. package/src/file/table-of-contents/table-of-contents.spec.ts +1 -3
  285. package/src/file/table-of-contents/table-of-contents.ts +1 -1
  286. package/src/file/track-revision/track-revision-components/deleted-page-number.ts +3 -3
  287. package/src/file/track-revision/track-revision-components/deleted-text-run.ts +2 -2
  288. package/src/file/track-revision/track-revision-components/deleted-text.ts +1 -1
  289. package/src/file/track-revision/track-revision-components/inserted-text-run.ts +1 -1
  290. package/src/file/vertical-align/vertical-align.ts +1 -1
  291. package/src/file/xml-components/base.ts +1 -1
  292. package/src/file/xml-components/default-attributes.ts +5 -4
  293. package/src/file/xml-components/imported-xml-component.spec.ts +3 -2
  294. package/src/file/xml-components/imported-xml-component.ts +13 -8
  295. package/src/file/xml-components/initializable-xml-component.ts +1 -1
  296. package/src/file/xml-components/simple-elements.ts +5 -5
  297. package/src/file/xml-components/xml-component.ts +4 -2
  298. package/src/import-dotx/import-dotx.ts +2 -0
  299. package/src/index.spec.ts +0 -1
  300. package/src/tests/utility.ts +1 -1
  301. package/src/util/convenience-functions.spec.ts +0 -2
  302. package/src/util/convenience-functions.ts +4 -12
  303. package/src/util/values.ts +29 -41
@@ -1,15 +1,3 @@
1
- /*!
2
-
3
- JSZip v3.10.0 - A JavaScript class for generating and reading zip files
4
- <http://stuartk.com/jszip>
5
-
6
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
7
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
8
-
9
- JSZip uses the library pako released under the MIT license :
10
- https://github.com/nodeca/pako/blob/main/LICENSE
11
- */
12
-
13
1
  /*!
14
2
  * The buffer module from node.js, for the browser.
15
3
  *
@@ -1,17 +1,17 @@
1
- export declare function decimalNumber(val: number): number;
2
- export declare function unsignedDecimalNumber(val: number): number;
3
- export declare function longHexNumber(val: string): string;
4
- export declare function shortHexNumber(val: string): string;
5
- export declare function uCharHexNumber(val: string): string;
6
- export declare function universalMeasureValue(val: string): string;
7
- export declare function positiveUniversalMeasureValue(val: string): string;
8
- export declare function hexColorValue(val: string): string;
9
- export declare function signedTwipsMeasureValue(val: string | number): string | number;
10
- export declare function hpsMeasureValue(val: string | number): string | number;
11
- export declare function signedHpsMeasureValue(val: string | number): string | number;
12
- export declare function twipsMeasureValue(val: string | number): string | number;
13
- export declare function percentageValue(val: string): string;
14
- export declare function measurementOrPercentValue(val: number | string): number | string;
15
- export declare const eighthPointMeasureValue: typeof unsignedDecimalNumber;
16
- export declare const pointMeasureValue: typeof unsignedDecimalNumber;
17
- export declare function dateTimeValue(val: Date): string;
1
+ export declare const decimalNumber: (val: number) => number;
2
+ export declare const unsignedDecimalNumber: (val: number) => number;
3
+ export declare const longHexNumber: (val: string) => string;
4
+ export declare const shortHexNumber: (val: string) => string;
5
+ export declare const uCharHexNumber: (val: string) => string;
6
+ export declare const universalMeasureValue: (val: string) => string;
7
+ export declare const positiveUniversalMeasureValue: (val: string) => string;
8
+ export declare const hexColorValue: (val: string) => string;
9
+ export declare const signedTwipsMeasureValue: (val: string | number) => string | number;
10
+ export declare const hpsMeasureValue: (val: string | number) => string | number;
11
+ export declare const signedHpsMeasureValue: (val: string | number) => string | number;
12
+ export declare const twipsMeasureValue: (val: string | number) => string | number;
13
+ export declare const percentageValue: (val: string) => string;
14
+ export declare const measurementOrPercentValue: (val: number | string) => number | string;
15
+ export declare const eighthPointMeasureValue: (val: number) => number;
16
+ export declare const pointMeasureValue: (val: number) => number;
17
+ export declare const dateTimeValue: (val: Date) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docx",
3
- "version": "7.4.1",
3
+ "version": "7.6.0",
4
4
  "description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "test.coverage": "nyc npm test",
10
10
  "test.watch": "npm test -- --watch",
11
11
  "prepublishOnly": "npm run build --production",
12
- "lint": "tslint --project .",
12
+ "lint": "eslint -c .eslintrc.js --ext .ts src",
13
13
  "build": "npm run webpack && npm run fix-types",
14
14
  "webpack": "rimraf ./build && webpack --config ./webpack.config.ts",
15
15
  "demo": "npm run build && npm run ts-node --skip-project ./demo",
@@ -64,18 +64,27 @@
64
64
  "homepage": "https://github.com/dolanmiu/docx#readme",
65
65
  "devDependencies": {
66
66
  "@types/chai": "^4.2.15",
67
- "@types/glob": "^7.1.4",
68
- "@types/mocha": "^9.0.0",
67
+ "@types/glob": "^8.0.0",
68
+ "@types/mocha": "^10.0.0",
69
69
  "@types/prompt": "^1.1.1",
70
70
  "@types/request-promise": "^4.1.42",
71
71
  "@types/shelljs": "^0.8.9",
72
72
  "@types/sinon": "^10.0.0",
73
73
  "@types/unzipper": "^0.10.4",
74
74
  "@types/webpack": "^5.0.0",
75
+ "@typescript-eslint/eslint-plugin": "^5.36.1",
76
+ "@typescript-eslint/parser": "^5.36.1",
75
77
  "buffer": "^6.0.3",
76
78
  "chai": "^3.5.0",
77
79
  "cspell": "^6.2.2",
78
80
  "docsify-cli": "^4.3.0",
81
+ "eslint": "^8.23.0",
82
+ "eslint-plugin-functional": "^4.3.1",
83
+ "eslint-plugin-import": "^2.26.0",
84
+ "eslint-plugin-jsdoc": "^39.3.6",
85
+ "eslint-plugin-no-null": "^1.0.2",
86
+ "eslint-plugin-prefer-arrow": "^1.2.3",
87
+ "eslint-plugin-unicorn": "^44.0.0",
79
88
  "glob": "^8.0.1",
80
89
  "jszip": "^3.1.5",
81
90
  "mocha": "^10.0.0",
@@ -94,11 +103,9 @@
94
103
  "ts-loader": "^9.0.0",
95
104
  "ts-node": "^10.2.1",
96
105
  "tsconfig-paths": "^4.0.0",
97
- "tsconfig-paths-webpack-plugin": "^3.5.2",
98
- "tslint": "^6.1.3",
99
- "tslint-immutable": "^6.0.1",
106
+ "tsconfig-paths-webpack-plugin": "^4.0.0",
100
107
  "typedoc": "^0.23.2",
101
- "typescript": "4.7.4",
108
+ "typescript": "4.8.4",
102
109
  "unzipper": "^0.10.11",
103
110
  "webpack": "^5.28.0",
104
111
  "webpack-cli": "^4.6.0"
@@ -1,7 +1,7 @@
1
1
  import { IMediaData, Media } from "@file/media";
2
2
 
3
3
  export class ImageReplacer {
4
- public replace(xmlData: string, mediaData: IMediaData[], offset: number): string {
4
+ public replace(xmlData: string, mediaData: readonly IMediaData[], offset: number): string {
5
5
  let currentXmlData = xmlData;
6
6
 
7
7
  mediaData.forEach((image, i) => {
@@ -11,7 +11,7 @@ export class ImageReplacer {
11
11
  return currentXmlData;
12
12
  }
13
13
 
14
- public getMediaData(xmlData: string, media: Media): IMediaData[] {
14
+ public getMediaData(xmlData: string, media: Media): readonly IMediaData[] {
15
15
  return media.Array.filter((image) => xmlData.search(`{${image.fileName}}`) > 0);
16
16
  }
17
17
  }
@@ -25,7 +25,7 @@ describe("Compiler", () => {
25
25
  });
26
26
 
27
27
  describe("#compile()", () => {
28
- it("should pack all the content", async function () {
28
+ it("should pack all the content", function () {
29
29
  this.timeout(99999999);
30
30
  const file = new File({
31
31
  sections: [],
@@ -53,7 +53,7 @@ describe("Compiler", () => {
53
53
  expect(fileNames).to.include("_rels/.rels");
54
54
  });
55
55
 
56
- it("should pack all additional headers and footers", async function () {
56
+ it("should pack all additional headers and footers", function () {
57
57
  const file = new File({
58
58
  sections: [
59
59
  {
@@ -20,10 +20,10 @@ interface IXmlifyedFileMapping {
20
20
  readonly Numbering: IXmlifyedFile;
21
21
  readonly Relationships: IXmlifyedFile;
22
22
  readonly FileRelationships: IXmlifyedFile;
23
- readonly Headers: IXmlifyedFile[];
24
- readonly Footers: IXmlifyedFile[];
25
- readonly HeaderRelationships: IXmlifyedFile[];
26
- readonly FooterRelationships: IXmlifyedFile[];
23
+ readonly Headers: readonly IXmlifyedFile[];
24
+ readonly Footers: readonly IXmlifyedFile[];
25
+ readonly HeaderRelationships: readonly IXmlifyedFile[];
26
+ readonly FooterRelationships: readonly IXmlifyedFile[];
27
27
  readonly ContentTypes: IXmlifyedFile;
28
28
  readonly CustomProperties: IXmlifyedFile;
29
29
  readonly AppProperties: IXmlifyedFile;
@@ -38,7 +38,7 @@ export class Compiler {
38
38
  private readonly imageReplacer: ImageReplacer;
39
39
  private readonly numberingReplacer: NumberingReplacer;
40
40
 
41
- constructor() {
41
+ public constructor() {
42
42
  this.formatter = new Formatter();
43
43
  this.imageReplacer = new ImageReplacer();
44
44
  this.numberingReplacer = new NumberingReplacer();
@@ -47,15 +47,15 @@ export class Compiler {
47
47
  public compile(file: File, prettifyXml?: boolean | PrettifyType): JSZip {
48
48
  const zip = new JSZip();
49
49
  const xmlifiedFileMapping = this.xmlifyFile(file, prettifyXml);
50
- const map = new Map<string, IXmlifyedFile | IXmlifyedFile[]>(Object.entries(xmlifiedFileMapping));
50
+ const map = new Map<string, IXmlifyedFile | readonly IXmlifyedFile[]>(Object.entries(xmlifiedFileMapping));
51
51
 
52
52
  for (const [, obj] of map) {
53
53
  if (Array.isArray(obj)) {
54
- for (const subFile of obj) {
54
+ for (const subFile of obj as readonly IXmlifyedFile[]) {
55
55
  zip.file(subFile.path, subFile.data);
56
56
  }
57
57
  } else {
58
- zip.file(obj.path, obj.data);
58
+ zip.file((obj as IXmlifyedFile).path, (obj as IXmlifyedFile).data);
59
59
  }
60
60
  }
61
61
 
@@ -1,7 +1,7 @@
1
1
  import { ConcreteNumbering } from "@file/numbering";
2
2
 
3
3
  export class NumberingReplacer {
4
- public replace(xmlData: string, concreteNumberings: ConcreteNumbering[]): string {
4
+ public replace(xmlData: string, concreteNumberings: readonly ConcreteNumbering[]): string {
5
5
  let currentXmlData = xmlData;
6
6
 
7
7
  for (const concreteNumbering of concreteNumberings) {
@@ -37,6 +37,14 @@ describe("Packer", () => {
37
37
  });
38
38
  });
39
39
 
40
+ describe("#toString()", () => {
41
+ it("should return a non-empty string", async () => {
42
+ const result = await Packer.toString(file);
43
+
44
+ assert.isAbove(result.length, 0);
45
+ });
46
+ });
47
+
40
48
  describe("#toBuffer()", () => {
41
49
  it("should create a standard docx file", async function () {
42
50
  this.timeout(99999999);
@@ -47,7 +55,7 @@ describe("Packer", () => {
47
55
  });
48
56
 
49
57
  it("should handle exception if it throws any", () => {
50
- // tslint:disable-next-line:no-any
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
59
  const compiler = stub((Packer as any).compiler, "compile");
52
60
 
53
61
  compiler.throwsException();
@@ -57,7 +65,7 @@ describe("Packer", () => {
57
65
  });
58
66
 
59
67
  after(() => {
60
- // tslint:disable-next-line:no-any
68
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
69
  (Packer as any).compiler.compile.restore();
62
70
  });
63
71
  });
@@ -72,7 +80,7 @@ describe("Packer", () => {
72
80
  });
73
81
 
74
82
  it("should handle exception if it throws any", () => {
75
- // tslint:disable-next-line:no-any
83
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
84
  const compiler = stub((Packer as any).compiler, "compile");
77
85
 
78
86
  compiler.throwsException();
@@ -82,14 +90,14 @@ describe("Packer", () => {
82
90
  });
83
91
 
84
92
  after(() => {
85
- // tslint:disable-next-line:no-any
93
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
94
  (Packer as any).compiler.compile.restore();
87
95
  });
88
96
  });
89
97
 
90
98
  describe("#toBlob()", () => {
91
99
  it("should create a standard docx file", async () => {
92
- // tslint:disable-next-line: no-any
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
101
  stub((Packer as any).compiler, "compile").callsFake(() => ({
94
102
  // tslint:disable-next-line: no-empty
95
103
  generateAsync: () => mock({}),
@@ -100,7 +108,7 @@ describe("Packer", () => {
100
108
  });
101
109
 
102
110
  it("should handle exception if it throws any", () => {
103
- // tslint:disable-next-line:no-any
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
112
  const compiler = stub((Packer as any).compiler, "compile");
105
113
 
106
114
  compiler.throwsException();
@@ -110,7 +118,57 @@ describe("Packer", () => {
110
118
  });
111
119
 
112
120
  afterEach(() => {
113
- // tslint:disable-next-line:no-any
121
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
122
+ (Packer as any).compiler.compile.restore();
123
+ });
124
+ });
125
+
126
+ describe("#toStream()", () => {
127
+ it("should create a standard docx file", async () => {
128
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
+ stub((Packer as any).compiler, "compile").callsFake(() => ({
130
+ // tslint:disable-next-line: no-empty
131
+ generateNodeStream: () => ({
132
+ on: (event: string, cb: () => void) => {
133
+ if (event === "end") {
134
+ cb();
135
+ }
136
+ },
137
+ }),
138
+ }));
139
+ const stream = await Packer.toStream(file);
140
+ return new Promise((resolve, reject) => {
141
+ stream.on("error", () => {
142
+ reject(new Error());
143
+ });
144
+
145
+ stream.on("end", () => {
146
+ resolve();
147
+ });
148
+ });
149
+ });
150
+
151
+ it("should handle exception if it throws any", () => {
152
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
+ const compiler = stub((Packer as any).compiler, "compile").callsFake(() => ({
154
+ // tslint:disable-next-line: no-empty
155
+ on: (event: string, cb: () => void) => {
156
+ if (event === "error") {
157
+ cb();
158
+ }
159
+ },
160
+ }));
161
+
162
+ compiler.throwsException();
163
+ try {
164
+ Packer.toStream(file);
165
+ } catch (error) {
166
+ assert.isDefined(error);
167
+ }
168
+ });
169
+
170
+ afterEach(() => {
171
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
172
  (Packer as any).compiler.compile.restore();
115
173
  });
116
174
  });
@@ -1,3 +1,4 @@
1
+ import { Stream } from "stream";
1
2
  import { File } from "@file/file";
2
3
 
3
4
  import { Compiler } from "./next-compiler";
@@ -13,6 +14,17 @@ export enum PrettifyType {
13
14
  }
14
15
 
15
16
  export class Packer {
17
+ public static async toString(file: File, prettify?: boolean | PrettifyType): Promise<string> {
18
+ const zip = this.compiler.compile(file, prettify);
19
+ const zipData = await zip.generateAsync({
20
+ type: "string",
21
+ mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
22
+ compression: "DEFLATE",
23
+ });
24
+
25
+ return zipData;
26
+ }
27
+
16
28
  public static async toBuffer(file: File, prettify?: boolean | PrettifyType): Promise<Buffer> {
17
29
  const zip = this.compiler.compile(file, prettify);
18
30
  const zipData = await zip.generateAsync({
@@ -46,5 +58,17 @@ export class Packer {
46
58
  return zipData;
47
59
  }
48
60
 
61
+ public static toStream(file: File, prettify?: boolean | PrettifyType): Stream {
62
+ const zip = this.compiler.compile(file, prettify);
63
+ const zipData = zip.generateNodeStream({
64
+ type: "nodebuffer",
65
+ streamFiles: true,
66
+ mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
67
+ compression: "DEFLATE",
68
+ });
69
+
70
+ return zipData;
71
+ }
72
+
49
73
  private static readonly compiler = new Compiler();
50
74
  }
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
2
2
  import { AppPropertiesAttributes } from "./app-properties-attributes";
3
3
 
4
4
  export class AppProperties extends XmlComponent {
5
- constructor() {
5
+ public constructor() {
6
6
  super("Properties");
7
7
 
8
8
  this.root.push(
@@ -33,7 +33,7 @@ export interface IBorderOptions {
33
33
  }
34
34
 
35
35
  export class BorderElement extends XmlComponent {
36
- constructor(elementName: string, { color, size, space, style }: IBorderOptions) {
36
+ public constructor(elementName: string, { color, size, space, style }: IBorderOptions) {
37
37
  super(elementName);
38
38
  this.root.push(
39
39
  new BordersAttributes({
@@ -4,7 +4,7 @@ import { Default } from "./default/default";
4
4
  import { Override } from "./override/override";
5
5
 
6
6
  export class ContentTypes extends XmlComponent {
7
- constructor() {
7
+ public constructor() {
8
8
  super("Types");
9
9
 
10
10
  this.root.push(
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
2
2
  import { DefaultAttributes } from "./default-attributes";
3
3
 
4
4
  export class Default extends XmlComponent {
5
- constructor(contentType: string, extension?: string) {
5
+ public constructor(contentType: string, extension?: string) {
6
6
  super("Default");
7
7
 
8
8
  this.root.push(
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
2
2
  import { OverrideAttributes } from "./override-attributes";
3
3
 
4
4
  export class Override extends XmlComponent {
5
- constructor(contentType: string, partName?: string) {
5
+ public constructor(contentType: string, partName?: string) {
6
6
  super("Override");
7
7
 
8
8
  this.root.push(
@@ -12,7 +12,7 @@ import { Paragraph } from "../paragraph";
12
12
  import { IStylesOptions } from "../styles";
13
13
 
14
14
  export interface IPropertiesOptions {
15
- readonly sections: ISectionOptions[];
15
+ readonly sections: readonly ISectionOptions[];
16
16
  readonly title?: string;
17
17
  readonly subject?: string;
18
18
  readonly creator?: string;
@@ -26,7 +26,7 @@ export interface IPropertiesOptions {
26
26
  readonly comments?: ICommentsOptions;
27
27
  readonly footnotes?: {
28
28
  readonly [key: string]: {
29
- readonly children: Paragraph[];
29
+ readonly children: readonly Paragraph[];
30
30
  };
31
31
  };
32
32
  readonly background?: IDocumentBackgroundOptions;
@@ -35,7 +35,7 @@ export interface IPropertiesOptions {
35
35
  readonly updateFields?: boolean;
36
36
  };
37
37
  readonly compatabilityModeVersion?: number;
38
- readonly customProperties?: ICustomPropertyOptions[];
38
+ readonly customProperties?: readonly ICustomPropertyOptions[];
39
39
  readonly evenAndOddHeaderAndFooters?: boolean;
40
40
  }
41
41
 
@@ -64,7 +64,7 @@ export interface IPropertiesOptions {
64
64
  /* cSpell:enable */
65
65
 
66
66
  export class CoreProperties extends XmlComponent {
67
- constructor(options: Omit<IPropertiesOptions, "sections">) {
67
+ public constructor(options: Omit<IPropertiesOptions, "sections">) {
68
68
  super("cp:coreProperties");
69
69
  this.root.push(
70
70
  new DocumentAttributes({
@@ -102,7 +102,7 @@ export class CoreProperties extends XmlComponent {
102
102
  }
103
103
 
104
104
  class TimestampElement extends XmlComponent {
105
- constructor(name: string) {
105
+ public constructor(name: string) {
106
106
  super(name);
107
107
  this.root.push(
108
108
  new DocumentAttributes({
@@ -3,11 +3,12 @@ import { CustomPropertiesAttributes } from "./custom-properties-attributes";
3
3
  import { CustomProperty, ICustomPropertyOptions } from "./custom-property";
4
4
 
5
5
  export class CustomProperties extends XmlComponent {
6
- // tslint:disable-next-line:readonly-keyword
6
+ // eslint-disable-next-line functional/prefer-readonly-type
7
7
  private nextId: number;
8
+ // eslint-disable-next-line functional/prefer-readonly-type
8
9
  private readonly properties: CustomProperty[] = [];
9
10
 
10
- constructor(properties: ICustomPropertyOptions[]) {
11
+ public constructor(properties: readonly ICustomPropertyOptions[]) {
11
12
  super("Properties");
12
13
 
13
14
  this.root.push(
@@ -32,6 +33,7 @@ export class CustomProperties extends XmlComponent {
32
33
  }
33
34
 
34
35
  public addCustomProperty(property: ICustomPropertyOptions): void {
36
+ // eslint-disable-next-line functional/immutable-data
35
37
  this.properties.push(new CustomProperty(this.nextId++, property));
36
38
  }
37
39
  }
@@ -7,7 +7,7 @@ export interface ICustomPropertyOptions {
7
7
  }
8
8
 
9
9
  export class CustomProperty extends XmlComponent {
10
- constructor(id: number, properties: ICustomPropertyOptions) {
10
+ public constructor(id: number, properties: ICustomPropertyOptions) {
11
11
  super("property");
12
12
  this.root.push(
13
13
  new CustomPropertyAttributes({
@@ -21,7 +21,7 @@ export class CustomProperty extends XmlComponent {
21
21
  }
22
22
 
23
23
  export class CustomPropertyValue extends XmlComponent {
24
- constructor(value: string) {
24
+ public constructor(value: string) {
25
25
  super("vt:lpwstr");
26
26
  this.root.push(value);
27
27
  }
@@ -4,9 +4,10 @@ import { IContext, IXmlableObject, XmlComponent } from "@file/xml-components";
4
4
  import { ISectionPropertiesOptions, SectionProperties } from "./section-properties/section-properties";
5
5
 
6
6
  export class Body extends XmlComponent {
7
+ // eslint-disable-next-line functional/prefer-readonly-type
7
8
  private readonly sections: SectionProperties[] = [];
8
9
 
9
- constructor() {
10
+ public constructor() {
10
11
  super("w:body");
11
12
  }
12
13
 
@@ -16,6 +17,7 @@ export class Body extends XmlComponent {
16
17
  * The spec says:
17
18
  * - section element should be in the last paragraph of the section
18
19
  * - last section should be direct child of body
20
+ *
19
21
  * @param options new section options
20
22
  */
21
23
  public addSection(options: ISectionPropertiesOptions): void {
@@ -14,7 +14,7 @@ export class ColumnAttributes extends XmlAttributeComponent<IColumnAttributes> {
14
14
  }
15
15
 
16
16
  export class Column extends XmlComponent {
17
- constructor({ width, space }: IColumnAttributes) {
17
+ public constructor({ width, space }: IColumnAttributes) {
18
18
  super("w:col");
19
19
  this.root.push(
20
20
  new ColumnAttributes({
@@ -13,6 +13,13 @@ describe("Columns", () => {
13
13
  expect(tree["w:cols"]).to.deep.equal({ _attr: { "w:num": 3, "w:space": 720 } });
14
14
  });
15
15
 
16
+ it("should create set space and count to undefined if they are undefined", () => {
17
+ const columns = new Columns({});
18
+ const tree = new Formatter().format(columns);
19
+
20
+ expect(tree["w:cols"]).to.deep.equal({ _attr: {} });
21
+ });
22
+
16
23
  it("should ignore individual column attributes if equalWidth is true", () => {
17
24
  const unequalColumns = [new Column({ width: 1000, space: 400 }), new Column({ width: 2000 })];
18
25
  const columns = new Columns({ count: 3, space: 720, equalWidth: true, children: unequalColumns });
@@ -17,7 +17,7 @@ export interface IColumnsAttributes {
17
17
  readonly count?: number;
18
18
  readonly separate?: boolean;
19
19
  readonly equalWidth?: boolean;
20
- readonly children?: Column[];
20
+ readonly children?: readonly Column[];
21
21
  }
22
22
 
23
23
  export class ColumnsAttributes extends XmlAttributeComponent<IColumnsAttributes> {
@@ -30,7 +30,7 @@ export class ColumnsAttributes extends XmlAttributeComponent<IColumnsAttributes>
30
30
  }
31
31
 
32
32
  export class Columns extends XmlComponent {
33
- constructor({ space, count, separate, equalWidth, children }: IColumnsAttributes) {
33
+ public constructor({ space, count, separate, equalWidth, children }: IColumnsAttributes) {
34
34
  super("w:cols");
35
35
  this.root.push(
36
36
  new ColumnsAttributes({
@@ -38,7 +38,7 @@ export class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesP
38
38
  }
39
39
 
40
40
  export class DocumentGrid extends XmlComponent {
41
- constructor(linePitch: number, charSpace?: number, type?: DocumentGridType) {
41
+ public constructor(linePitch: number, charSpace?: number, type?: DocumentGridType) {
42
42
  super("w:docGrid");
43
43
 
44
44
  this.root.push(
@@ -52,7 +52,7 @@ export enum HeaderFooterType {
52
52
  FOOTER = "w:footerReference",
53
53
  }
54
54
  export class HeaderFooterReference extends XmlComponent {
55
- constructor(type: HeaderFooterType, options: IHeaderFooterOptions) {
55
+ public constructor(type: HeaderFooterType, options: IHeaderFooterOptions) {
56
56
  super(type);
57
57
 
58
58
  this.root.push(
@@ -39,7 +39,7 @@ export class LineNumberAttributes extends XmlAttributeComponent<ILineNumberAttri
39
39
  }
40
40
 
41
41
  export class LineNumberType extends XmlComponent {
42
- constructor({ countBy, start, restart, distance }: ILineNumberAttributes) {
42
+ public constructor({ countBy, start, restart, distance }: ILineNumberAttributes) {
43
43
  super("w:lnNumType");
44
44
  this.root.push(
45
45
  new LineNumberAttributes({
@@ -71,7 +71,7 @@ class PageBordersAttributes extends XmlAttributeComponent<IPageBorderAttributes>
71
71
  // <xsd:attribute name="offsetFrom" type="ST_PageBorderOffset" use="optional" default="text"/>
72
72
  // </xsd:complexType>
73
73
  export class PageBorders extends IgnoreIfEmptyXmlComponent {
74
- constructor(options?: IPageBordersOptions) {
74
+ public constructor(options?: IPageBordersOptions) {
75
75
  super("w:pgBorders");
76
76
 
77
77
  if (!options) {
@@ -33,7 +33,7 @@ export class PageMarginAttributes extends XmlAttributeComponent<IPageMarginAttri
33
33
  }
34
34
 
35
35
  export class PageMargin extends XmlComponent {
36
- constructor(
36
+ public constructor(
37
37
  top: number | string,
38
38
  right: number | string,
39
39
  bottom: number | string,
@@ -41,7 +41,7 @@ export class PageNumberTypeAttributes extends XmlAttributeComponent<IPageNumberT
41
41
  };
42
42
  }
43
43
  export class PageNumberType extends XmlComponent {
44
- constructor({ start, formatType, separator }: IPageNumberTypeAttributes) {
44
+ public constructor({ start, formatType, separator }: IPageNumberTypeAttributes) {
45
45
  super("w:pgNumType");
46
46
  this.root.push(
47
47
  new PageNumberTypeAttributes({
@@ -33,7 +33,7 @@ export class PageSizeAttributes extends XmlAttributeComponent<IPageSizeAttribute
33
33
  }
34
34
 
35
35
  export class PageSize extends XmlComponent {
36
- constructor(width: number | string, height: number | string, orientation: PageOrientation) {
36
+ public constructor(width: number | string, height: number | string, orientation: PageOrientation) {
37
37
  super("w:pgSz");
38
38
 
39
39
  const flip = orientation === PageOrientation.LANDSCAPE;