docx-wasm 0.4.20 → 0.4.21

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 (308) hide show
  1. package/dist/index.html +8 -0
  2. package/dist/index.js +32 -0
  3. package/dist/node/builder.js +18 -9
  4. package/dist/node/builder.js.map +1 -1
  5. package/dist/node/carriage-return.d.ts +2 -0
  6. package/dist/node/carriage-return.js +7 -0
  7. package/dist/node/carriage-return.js.map +1 -0
  8. package/dist/node/delete.js +17 -7
  9. package/dist/node/delete.js.map +1 -1
  10. package/dist/node/footer.js.map +1 -1
  11. package/dist/node/header.js.map +1 -1
  12. package/dist/node/hyperlink.js +17 -7
  13. package/dist/node/hyperlink.js.map +1 -1
  14. package/dist/node/index.d.ts +2 -1
  15. package/dist/node/index.js +18 -7
  16. package/dist/node/index.js.map +1 -1
  17. package/dist/node/insert.js +17 -7
  18. package/dist/node/insert.js.map +1 -1
  19. package/dist/node/json/bindings/DrawingPosition.d.ts +2 -2
  20. package/dist/node/json/bindings/FieldChar.d.ts +2 -2
  21. package/dist/node/json/bindings/FontGroup.d.ts +2 -2
  22. package/dist/node/json/bindings/FontScheme.d.ts +2 -2
  23. package/dist/node/json/bindings/FontSchemeFont.d.ts +2 -2
  24. package/dist/node/json/bindings/FrameProperty.d.ts +50 -14
  25. package/dist/node/json/bindings/ImageData.d.ts +2 -2
  26. package/dist/node/json/bindings/InstrHyperlink.d.ts +2 -2
  27. package/dist/node/json/bindings/InstrToC.d.ts +11 -11
  28. package/dist/node/json/bindings/PageNumType.d.ts +4 -4
  29. package/dist/node/json/bindings/Pic.d.ts +23 -2
  30. package/dist/node/json/bindings/PositionalTab.d.ts +2 -2
  31. package/dist/node/json/bindings/Shape.d.ts +4 -4
  32. package/dist/node/json/bindings/Tab.d.ts +2 -2
  33. package/dist/node/json/bindings/TableCellBorder.d.ts +2 -2
  34. package/dist/node/json/bindings/TableCellBorderPosition.d.ts +1 -1
  35. package/dist/node/json/bindings/TableCellBorders.d.ts +4 -4
  36. package/dist/node/json/bindings/TablePositionProperty.d.ts +13 -10
  37. package/dist/node/json/bindings/Theme.d.ts +2 -2
  38. package/dist/node/json/index.d.ts +10 -0
  39. package/dist/node/json/index.js.map +1 -1
  40. package/dist/node/json/run.d.ts +4 -1
  41. package/dist/node/num-pages.js +17 -7
  42. package/dist/node/num-pages.js.map +1 -1
  43. package/dist/node/page-num.js +17 -7
  44. package/dist/node/page-num.js.map +1 -1
  45. package/dist/node/paragraph-property.d.ts +1 -1
  46. package/dist/node/paragraph-property.js +17 -7
  47. package/dist/node/paragraph-property.js.map +1 -1
  48. package/dist/node/pkg/docx_wasm.d.ts +1069 -810
  49. package/dist/node/pkg/docx_wasm.js +4114 -3959
  50. package/dist/node/pkg/docx_wasm_bg.wasm +0 -0
  51. package/dist/node/pkg/docx_wasm_bg.wasm.d.ts +274 -261
  52. package/dist/node/run-property.d.ts +1 -1
  53. package/dist/node/run-property.js +17 -7
  54. package/dist/node/run-property.js.map +1 -1
  55. package/dist/node/run.d.ts +3 -1
  56. package/dist/node/run.js +25 -7
  57. package/dist/node/run.js.map +1 -1
  58. package/dist/node/section-property.js +1 -1
  59. package/dist/node/section-property.js.map +1 -1
  60. package/dist/node/style.js +17 -7
  61. package/dist/node/style.js.map +1 -1
  62. package/dist/node/tab-leader.js +17 -7
  63. package/dist/node/tab-leader.js.map +1 -1
  64. package/dist/node/table-cell-borders.js.map +1 -1
  65. package/dist/node/table-cell.js +17 -7
  66. package/dist/node/table-cell.js.map +1 -1
  67. package/dist/node/table-of-contents-item.js +17 -7
  68. package/dist/node/table-of-contents-item.js.map +1 -1
  69. package/dist/node/table-of-contents.js +17 -7
  70. package/dist/node/table-of-contents.js.map +1 -1
  71. package/dist/node/table-row.js.map +1 -1
  72. package/dist/node/table.d.ts +1 -1
  73. package/dist/node/table.js +17 -7
  74. package/dist/node/table.js.map +1 -1
  75. package/dist/web/builder.js.map +1 -1
  76. package/dist/web/carriage-return.d.ts +2 -0
  77. package/dist/web/carriage-return.js +3 -0
  78. package/dist/web/carriage-return.js.map +1 -0
  79. package/dist/web/delete.js.map +1 -1
  80. package/dist/web/footer.js.map +1 -1
  81. package/dist/web/header.js.map +1 -1
  82. package/dist/web/hyperlink.js.map +1 -1
  83. package/dist/web/index.d.ts +2 -1
  84. package/dist/web/index.js +1 -0
  85. package/dist/web/index.js.map +1 -1
  86. package/dist/web/insert.js.map +1 -1
  87. package/dist/web/js/abstract-numbering.d.ts +7 -0
  88. package/dist/web/js/bookmark-end.d.ts +4 -0
  89. package/dist/web/js/bookmark-start.d.ts +5 -0
  90. package/dist/web/js/border.d.ts +1 -0
  91. package/dist/web/js/break.d.ts +5 -0
  92. package/dist/web/js/builder.d.ts +7 -0
  93. package/dist/web/js/carriage-return.d.ts +2 -0
  94. package/dist/web/js/comment-end.d.ts +4 -0
  95. package/dist/web/js/comment.d.ts +14 -0
  96. package/dist/web/js/delete-text.d.ts +4 -0
  97. package/dist/web/js/delete.d.ts +11 -0
  98. package/dist/web/js/doc-defaults.d.ts +10 -0
  99. package/dist/web/js/doc-props.d.ts +10 -0
  100. package/dist/web/js/footer.d.ts +8 -0
  101. package/dist/web/js/header.d.ts +8 -0
  102. package/dist/web/js/hyperlink.d.ts +22 -0
  103. package/dist/web/js/image.d.ts +15 -0
  104. package/dist/web/js/index.d.ts +119 -0
  105. package/dist/web/js/insert.d.ts +11 -0
  106. package/dist/web/js/json/bindings/AlignmentType.d.ts +1 -0
  107. package/dist/web/js/json/bindings/Bold.d.ts +1 -0
  108. package/dist/web/js/json/bindings/BoldCs.d.ts +1 -0
  109. package/dist/web/js/json/bindings/BorderType.d.ts +1 -0
  110. package/dist/web/js/json/bindings/Break.d.ts +4 -0
  111. package/dist/web/js/json/bindings/BreakType.d.ts +1 -0
  112. package/dist/web/js/json/bindings/Caps.d.ts +1 -0
  113. package/dist/web/js/json/bindings/CharacterSpacing.d.ts +1 -0
  114. package/dist/web/js/json/bindings/Color.d.ts +1 -0
  115. package/dist/web/js/json/bindings/Comment.d.ts +7 -0
  116. package/dist/web/js/json/bindings/CommentRangeEnd.d.ts +3 -0
  117. package/dist/web/js/json/bindings/CommentRangeStart.d.ts +5 -0
  118. package/dist/web/js/json/bindings/Delete.d.ts +6 -0
  119. package/dist/web/js/json/bindings/DeleteChild.d.ts +10 -0
  120. package/dist/web/js/json/bindings/DeleteText.d.ts +4 -0
  121. package/dist/web/js/json/bindings/DrawingPosition.d.ts +6 -0
  122. package/dist/web/js/json/bindings/DrawingPositionType.d.ts +1 -0
  123. package/dist/web/js/json/bindings/FieldChar.d.ts +5 -0
  124. package/dist/web/js/json/bindings/FieldCharType.d.ts +1 -0
  125. package/dist/web/js/json/bindings/FitText.d.ts +4 -0
  126. package/dist/web/js/json/bindings/FontGroup.d.ts +7 -0
  127. package/dist/web/js/json/bindings/FontScheme.d.ts +5 -0
  128. package/dist/web/js/json/bindings/FontSchemeFont.d.ts +4 -0
  129. package/dist/web/js/json/bindings/FooterReference.d.ts +4 -0
  130. package/dist/web/js/json/bindings/FrameProperty.d.ts +50 -0
  131. package/dist/web/js/json/bindings/HeaderReference.d.ts +4 -0
  132. package/dist/web/js/json/bindings/Highlight.d.ts +1 -0
  133. package/dist/web/js/json/bindings/HyperlinkType.d.ts +1 -0
  134. package/dist/web/js/json/bindings/ImageData.d.ts +3 -0
  135. package/dist/web/js/json/bindings/Insert.d.ts +5 -0
  136. package/dist/web/js/json/bindings/InsertChild.d.ts +13 -0
  137. package/dist/web/js/json/bindings/InstrHyperlink.d.ts +4 -0
  138. package/dist/web/js/json/bindings/InstrPAGEREF.d.ts +5 -0
  139. package/dist/web/js/json/bindings/InstrTC.d.ts +6 -0
  140. package/dist/web/js/json/bindings/InstrText.d.ts +15 -0
  141. package/dist/web/js/json/bindings/InstrToC.d.ts +19 -0
  142. package/dist/web/js/json/bindings/Italic.d.ts +1 -0
  143. package/dist/web/js/json/bindings/ItalicCs.d.ts +1 -0
  144. package/dist/web/js/json/bindings/PageNumType.d.ts +4 -0
  145. package/dist/web/js/json/bindings/Pic.d.ts +46 -0
  146. package/dist/web/js/json/bindings/PicAlign.d.ts +1 -0
  147. package/dist/web/js/json/bindings/PositionalTab.d.ts +8 -0
  148. package/dist/web/js/json/bindings/PositionalTabAlignmentType.d.ts +1 -0
  149. package/dist/web/js/json/bindings/PositionalTabRelativeTo.d.ts +1 -0
  150. package/dist/web/js/json/bindings/RelativeFromHType.d.ts +1 -0
  151. package/dist/web/js/json/bindings/RelativeFromVType.d.ts +1 -0
  152. package/dist/web/js/json/bindings/Run.d.ts +5 -0
  153. package/dist/web/js/json/bindings/RunFonts.d.ts +11 -0
  154. package/dist/web/js/json/bindings/RunProperty.d.ts +44 -0
  155. package/dist/web/js/json/bindings/RunStyle.d.ts +1 -0
  156. package/dist/web/js/json/bindings/Shape.d.ts +5 -0
  157. package/dist/web/js/json/bindings/SpecVanish.d.ts +1 -0
  158. package/dist/web/js/json/bindings/Strike.d.ts +1 -0
  159. package/dist/web/js/json/bindings/StyleWithLevel.d.ts +1 -0
  160. package/dist/web/js/json/bindings/Sym.d.ts +4 -0
  161. package/dist/web/js/json/bindings/Sz.d.ts +1 -0
  162. package/dist/web/js/json/bindings/SzCs.d.ts +1 -0
  163. package/dist/web/js/json/bindings/Tab.d.ts +7 -0
  164. package/dist/web/js/json/bindings/TabLeaderType.d.ts +1 -0
  165. package/dist/web/js/json/bindings/TabValueType.d.ts +1 -0
  166. package/dist/web/js/json/bindings/TableCellBorder.d.ts +9 -0
  167. package/dist/web/js/json/bindings/TableCellBorderPosition.d.ts +1 -0
  168. package/dist/web/js/json/bindings/TableCellBorders.d.ts +11 -0
  169. package/dist/web/js/json/bindings/TablePositionProperty.d.ts +13 -0
  170. package/dist/web/js/json/bindings/Text.d.ts +4 -0
  171. package/dist/web/js/json/bindings/TextAlignmentType.d.ts +1 -0
  172. package/dist/web/js/json/bindings/TextBorder.d.ts +7 -0
  173. package/dist/web/js/json/bindings/Theme.d.ts +4 -0
  174. package/dist/web/js/json/bindings/Underline.d.ts +1 -0
  175. package/dist/web/js/json/bindings/Vanish.d.ts +1 -0
  176. package/dist/web/js/json/bindings/VertAlign.d.ts +1 -0
  177. package/dist/web/js/json/border.d.ts +7 -0
  178. package/dist/web/js/json/comment.d.ts +22 -0
  179. package/dist/web/js/json/document.d.ts +11 -0
  180. package/dist/web/js/json/drawing.d.ts +45 -0
  181. package/dist/web/js/json/footer.d.ts +13 -0
  182. package/dist/web/js/json/header.d.ts +13 -0
  183. package/dist/web/js/json/indent.d.ts +11 -0
  184. package/dist/web/js/json/index.d.ts +88 -0
  185. package/dist/web/js/json/line_spacing.d.ts +8 -0
  186. package/dist/web/js/json/numbering.d.ts +35 -0
  187. package/dist/web/js/json/paragraph.d.ts +98 -0
  188. package/dist/web/js/json/run.d.ts +124 -0
  189. package/dist/web/js/json/section-property.d.ts +43 -0
  190. package/dist/web/js/json/shading.d.ts +5 -0
  191. package/dist/web/js/json/shape.d.ts +5 -0
  192. package/dist/web/js/json/structured-data-tag.d.ts +8 -0
  193. package/dist/web/js/json/styles.d.ts +28 -0
  194. package/dist/web/js/json/table.d.ts +101 -0
  195. package/dist/web/js/json/textbox-content.d.ts +6 -0
  196. package/dist/web/js/json/web-settings.d.ts +11 -0
  197. package/dist/web/js/level.d.ts +38 -0
  198. package/dist/web/js/num-pages.d.ts +4 -0
  199. package/dist/web/js/numbering.d.ts +8 -0
  200. package/dist/web/js/page-num.d.ts +4 -0
  201. package/dist/web/js/paragraph-property.d.ts +95 -0
  202. package/dist/web/js/paragraph.d.ts +70 -0
  203. package/dist/web/js/positional-tab.d.ts +12 -0
  204. package/dist/web/js/run-property.d.ts +91 -0
  205. package/dist/web/js/run.d.ts +44 -0
  206. package/dist/web/js/section-property.d.ts +61 -0
  207. package/dist/web/js/settings.d.ts +17 -0
  208. package/dist/web/js/shading.d.ts +8 -0
  209. package/dist/web/js/style.d.ts +69 -0
  210. package/dist/web/js/styles.d.ts +12 -0
  211. package/dist/web/js/tab-leader.d.ts +3 -0
  212. package/dist/web/js/tab.d.ts +2 -0
  213. package/dist/web/js/table-cell-border.d.ts +13 -0
  214. package/dist/web/js/table-cell-borders.d.ts +15 -0
  215. package/dist/web/js/table-cell.d.ts +61 -0
  216. package/dist/web/js/table-of-contents-item.d.ts +12 -0
  217. package/dist/web/js/table-of-contents.d.ts +46 -0
  218. package/dist/web/js/table-row.d.ts +21 -0
  219. package/dist/web/js/table.d.ts +85 -0
  220. package/dist/web/js/tc.d.ts +10 -0
  221. package/dist/web/js/text.d.ts +4 -0
  222. package/dist/web/js/webextension.d.ts +12 -0
  223. package/dist/web/json/bindings/DrawingPosition.d.ts +2 -2
  224. package/dist/web/json/bindings/FieldChar.d.ts +2 -2
  225. package/dist/web/json/bindings/FontGroup.d.ts +2 -2
  226. package/dist/web/json/bindings/FontScheme.d.ts +2 -2
  227. package/dist/web/json/bindings/FontSchemeFont.d.ts +2 -2
  228. package/dist/web/json/bindings/FrameProperty.d.ts +50 -14
  229. package/dist/web/json/bindings/ImageData.d.ts +2 -2
  230. package/dist/web/json/bindings/InstrHyperlink.d.ts +2 -2
  231. package/dist/web/json/bindings/InstrToC.d.ts +11 -11
  232. package/dist/web/json/bindings/PageNumType.d.ts +4 -4
  233. package/dist/web/json/bindings/Pic.d.ts +23 -2
  234. package/dist/web/json/bindings/PositionalTab.d.ts +2 -2
  235. package/dist/web/json/bindings/Shape.d.ts +4 -4
  236. package/dist/web/json/bindings/Tab.d.ts +2 -2
  237. package/dist/web/json/bindings/TableCellBorder.d.ts +2 -2
  238. package/dist/web/json/bindings/TableCellBorderPosition.d.ts +1 -1
  239. package/dist/web/json/bindings/TableCellBorders.d.ts +4 -4
  240. package/dist/web/json/bindings/TablePositionProperty.d.ts +13 -10
  241. package/dist/web/json/bindings/Theme.d.ts +2 -2
  242. package/dist/web/json/index.d.ts +10 -0
  243. package/dist/web/json/index.js.map +1 -1
  244. package/dist/web/json/run.d.ts +4 -1
  245. package/dist/web/paragraph-property.d.ts +1 -1
  246. package/dist/web/paragraph-property.js.map +1 -1
  247. package/dist/web/pkg/docx_wasm.d.ts +1069 -810
  248. package/dist/web/pkg/docx_wasm.js +7 -2
  249. package/dist/web/pkg/docx_wasm_bg.js +3947 -3870
  250. package/dist/web/pkg/docx_wasm_bg.wasm +0 -0
  251. package/dist/web/pkg/docx_wasm_bg.wasm.d.ts +274 -261
  252. package/dist/web/pkg/package.json +2 -1
  253. package/dist/web/run-property.d.ts +1 -1
  254. package/dist/web/run-property.js.map +1 -1
  255. package/dist/web/run.d.ts +3 -1
  256. package/dist/web/run.js +8 -0
  257. package/dist/web/run.js.map +1 -1
  258. package/dist/web/section-property.js +1 -1
  259. package/dist/web/section-property.js.map +1 -1
  260. package/dist/web/style.js.map +1 -1
  261. package/dist/web/tab-leader.js.map +1 -1
  262. package/dist/web/table-cell-borders.js.map +1 -1
  263. package/dist/web/table-cell.js.map +1 -1
  264. package/dist/web/table-of-contents-item.js.map +1 -1
  265. package/dist/web/table-of-contents.js.map +1 -1
  266. package/dist/web/table-row.js.map +1 -1
  267. package/dist/web/table.d.ts +1 -1
  268. package/dist/web/table.js.map +1 -1
  269. package/js/carriage-return.ts +1 -0
  270. package/js/index.ts +1 -0
  271. package/js/json/bindings/AlignmentType.ts +1 -1
  272. package/js/json/bindings/BorderType.ts +1 -1
  273. package/js/json/bindings/DrawingPosition.ts +1 -1
  274. package/js/json/bindings/DrawingPositionType.ts +1 -1
  275. package/js/json/bindings/FieldChar.ts +1 -1
  276. package/js/json/bindings/FieldCharType.ts +1 -1
  277. package/js/json/bindings/FontGroup.ts +1 -1
  278. package/js/json/bindings/FontScheme.ts +1 -1
  279. package/js/json/bindings/FontSchemeFont.ts +1 -1
  280. package/js/json/bindings/FrameProperty.ts +46 -1
  281. package/js/json/bindings/HyperlinkType.ts +1 -1
  282. package/js/json/bindings/ImageData.ts +1 -1
  283. package/js/json/bindings/InstrHyperlink.ts +1 -1
  284. package/js/json/bindings/InstrToC.ts +1 -1
  285. package/js/json/bindings/PageNumType.ts +1 -1
  286. package/js/json/bindings/Pic.ts +26 -1
  287. package/js/json/bindings/PicAlign.ts +1 -1
  288. package/js/json/bindings/PositionalTab.ts +1 -1
  289. package/js/json/bindings/PositionalTabAlignmentType.ts +1 -1
  290. package/js/json/bindings/PositionalTabRelativeTo.ts +1 -1
  291. package/js/json/bindings/RelativeFromHType.ts +1 -1
  292. package/js/json/bindings/RelativeFromVType.ts +1 -1
  293. package/js/json/bindings/Shape.ts +1 -1
  294. package/js/json/bindings/StyleWithLevel.ts +1 -1
  295. package/js/json/bindings/Tab.ts +1 -1
  296. package/js/json/bindings/TabLeaderType.ts +1 -1
  297. package/js/json/bindings/TabValueType.ts +1 -1
  298. package/js/json/bindings/TableCellBorder.ts +1 -1
  299. package/js/json/bindings/TableCellBorderPosition.ts +1 -1
  300. package/js/json/bindings/TableCellBorders.ts +1 -1
  301. package/js/json/bindings/TablePositionProperty.ts +4 -1
  302. package/js/json/bindings/TextAlignmentType.ts +1 -1
  303. package/js/json/bindings/Theme.ts +1 -1
  304. package/js/json/index.ts +10 -1
  305. package/js/json/run.ts +5 -0
  306. package/js/run.ts +9 -0
  307. package/js/section-property.ts +1 -1
  308. package/package.json +17 -8
@@ -0,0 +1,88 @@
1
+ import { StylesJSON } from "./styles";
2
+ import { DocumentJSON } from "./document";
3
+ import { NumberingsJSON } from "./numbering";
4
+ import { CommentJSON } from "./comment";
5
+ import { WebSettingsJSON } from "./web-settings";
6
+ import { Theme as ThemeJSON } from "./bindings/Theme";
7
+ import { CharacterSpacingValues } from "../settings";
8
+ export type DocxJSON = {
9
+ contentType: {
10
+ types: {
11
+ [k: string]: string;
12
+ };
13
+ };
14
+ rels: [string, string, string][];
15
+ documentRels: {
16
+ hasComments: boolean;
17
+ hasNumberings: boolean;
18
+ };
19
+ docProps: {
20
+ app: {};
21
+ core: {
22
+ config: {
23
+ creator: string | null;
24
+ description: string | null;
25
+ language: string | null;
26
+ lastModifiedBy: string | null;
27
+ modified: string | null;
28
+ revision: string | null;
29
+ subject: string | null;
30
+ title: string | null;
31
+ };
32
+ };
33
+ custom: {
34
+ properties: {
35
+ [key: string]: string;
36
+ };
37
+ };
38
+ };
39
+ styles: StylesJSON;
40
+ document: DocumentJSON;
41
+ comments: {
42
+ comments: CommentJSON[];
43
+ };
44
+ numberings: NumberingsJSON;
45
+ settings: SettingsJSON;
46
+ webSettings: WebSettingsJSON;
47
+ fontTable: {};
48
+ themes: ThemeJSON[];
49
+ /**
50
+ * `[id, path, base64 original bytes, base64 preview bytes]`.
51
+ *
52
+ * The preview is PNG for raster originals (PNG / JPEG / GIF / BMP / TIFF).
53
+ * For EMF originals (path ends with `.emf`) the preview is SVG bytes
54
+ * instead — decoded via emf-core on the Rust side. Distinguish the
55
+ * two cases via the file extension on `path`, or by sniffing the
56
+ * decoded preview bytes (PNG starts with `\x89PNG`, SVG starts with
57
+ * `<svg` / `<?xml`).
58
+ */
59
+ images: [string, string, string, string][];
60
+ hyperlinks: [string, string, string][];
61
+ };
62
+ export type SettingsJSON = {
63
+ docId: string | null;
64
+ defaultTabStop: number;
65
+ adjustLineHeightInTable: boolean;
66
+ characterSpacingControl?: CharacterSpacingValues | null;
67
+ evenAndOddHeaders: boolean;
68
+ zoom: number;
69
+ docVars: {
70
+ name: string;
71
+ val: string;
72
+ }[];
73
+ };
74
+ export * from "../settings";
75
+ export * from "./styles";
76
+ export * from "./border";
77
+ export * from "./document";
78
+ export * from "./paragraph";
79
+ export * from "./run";
80
+ export * from "./table";
81
+ export * from "./numbering";
82
+ export * from "./drawing";
83
+ export * from "./shading";
84
+ export * from "./web-settings";
85
+ export * from "./comment";
86
+ export * from "./textbox-content";
87
+ export * from "./section-property";
88
+ export { ThemeJSON };
@@ -0,0 +1,8 @@
1
+ export type LineSpacingJSON = {
2
+ before?: number | null;
3
+ after?: number | null;
4
+ beforeLines?: number | null;
5
+ afterLines?: number | null;
6
+ line?: number | null;
7
+ lineRule?: "atLeast" | "auto" | "exact" | null;
8
+ };
@@ -0,0 +1,35 @@
1
+ import { ParagraphPropertyJSON } from "./paragraph";
2
+ import { RunPropertyJSON } from "./run";
3
+ export type LevelJSON = {
4
+ level: number;
5
+ start: number;
6
+ format: string;
7
+ text: string;
8
+ jc: string;
9
+ suffix: "tab" | "nothing" | "space";
10
+ paragraphProperty: ParagraphPropertyJSON;
11
+ runProperty: RunPropertyJSON;
12
+ pstyle: string | null;
13
+ levelRestart: number | null;
14
+ isLgl?: boolean | null;
15
+ };
16
+ export type AbstractNumberingJSON = {
17
+ id: number;
18
+ levels: LevelJSON[];
19
+ numStyleLink: string | null;
20
+ styleLink: string | null;
21
+ };
22
+ export type NumberingJSON = {
23
+ id: number;
24
+ abstractNumId: number;
25
+ levelOverrides: LevelOverrideJSON[];
26
+ };
27
+ export type LevelOverrideJSON = {
28
+ level: number;
29
+ overrideStart: number | null;
30
+ overrideLevel: LevelJSON | null;
31
+ };
32
+ export type NumberingsJSON = {
33
+ abstractNums: AbstractNumberingJSON[];
34
+ numberings: NumberingJSON[];
35
+ };
@@ -0,0 +1,98 @@
1
+ import { RunJSON, RunPropertyJSON } from "./run";
2
+ import { IndentJSON } from "./indent";
3
+ import { CommentRangeEndJSON, CommentRangeStartJSON, SectionPropertyJSON } from "..";
4
+ import { LineSpacingJSON } from "./line_spacing";
5
+ import { FrameProperty as FramePropertyJSON } from "./bindings/FrameProperty";
6
+ import { TextAlignmentType } from "./bindings/TextAlignmentType";
7
+ import { AlignmentType } from "./bindings/AlignmentType";
8
+ export { FrameProperty as FramePropertyJSON } from "./bindings/FrameProperty";
9
+ export type ParagraphChildJSON = RunJSON | InsertJSON | DeleteJSON | HyperlinkJSON | CommentRangeStartJSON | CommentRangeEndJSON | BookmarkStartJSON | BookmarkEndJSON;
10
+ export type HyperlinkChildJSON = RunJSON | InsertJSON | DeleteJSON | CommentRangeStartJSON | CommentRangeEndJSON | BookmarkStartJSON | BookmarkEndJSON;
11
+ export type CustomTabStopType = "bar" | "center" | "clear" | "decimal" | "end" | "right" | "num" | "start" | "left";
12
+ export type CustomTabStopJSON = {
13
+ val: CustomTabStopType | null;
14
+ leader: string | null;
15
+ pos: number | null;
16
+ };
17
+ export type NumberingPropertyJSON = {
18
+ id: number | null;
19
+ level: number | null;
20
+ };
21
+ export type ParagraphPropertyJSON = {
22
+ runProperty: RunPropertyJSON;
23
+ style?: string | null;
24
+ numberingProperty?: NumberingPropertyJSON | null;
25
+ alignment?: AlignmentType;
26
+ textAlignment?: TextAlignmentType;
27
+ adjustRightInd?: number;
28
+ indent?: IndentJSON | null;
29
+ lineSpacing?: LineSpacingJSON | null;
30
+ divId?: string | null;
31
+ keepNext?: boolean;
32
+ keepLines?: boolean;
33
+ snapToGrid?: boolean;
34
+ pageBreakBefore?: boolean;
35
+ widowControl?: boolean;
36
+ outlineLvl?: number | null;
37
+ paragraphPropertyChange?: {
38
+ author: string;
39
+ date: string;
40
+ property: ParagraphPropertyJSON;
41
+ };
42
+ sectionProperty?: SectionPropertyJSON;
43
+ tabs: CustomTabStopJSON[];
44
+ frameProperty?: FramePropertyJSON;
45
+ };
46
+ export type ParagraphJSON = {
47
+ type: "paragraph";
48
+ data: {
49
+ id: string;
50
+ property: ParagraphPropertyJSON;
51
+ children: ParagraphChildJSON[];
52
+ };
53
+ };
54
+ export type InsertJSONData = {
55
+ children: (DeleteJSON | RunJSON | CommentRangeStartJSON | CommentRangeEndJSON)[];
56
+ author: string;
57
+ date: string;
58
+ };
59
+ export type InsertJSON = {
60
+ type: "insert";
61
+ data: InsertJSONData;
62
+ };
63
+ export type DeleteJSONData = {
64
+ children: DeleteChildJSON[];
65
+ author: string;
66
+ date: string;
67
+ };
68
+ export type DeleteJSON = {
69
+ type: "delete";
70
+ data: DeleteJSONData;
71
+ };
72
+ export type HyperlinkJSON = {
73
+ type: "hyperlink";
74
+ data: {
75
+ type: "external";
76
+ rid: string;
77
+ children: HyperlinkChildJSON[];
78
+ history: number | null;
79
+ } | {
80
+ type: "anchor";
81
+ anchor: string;
82
+ children: HyperlinkChildJSON[];
83
+ };
84
+ };
85
+ export type DeleteChildJSON = RunJSON | CommentRangeStartJSON | CommentRangeEndJSON;
86
+ export type BookmarkStartJSON = {
87
+ type: "bookmarkStart";
88
+ data: {
89
+ id: number;
90
+ name: string;
91
+ };
92
+ };
93
+ export type BookmarkEndJSON = {
94
+ type: "bookmarkEnd";
95
+ data: {
96
+ id: number;
97
+ };
98
+ };
@@ -0,0 +1,124 @@
1
+ import { DrawingJSON } from "./drawing";
2
+ import { ShapeJSON } from "./shape";
3
+ import { CommentRangeStartJSON, CommentRangeEndJSON, InsertJSONData, DeleteJSONData, ShadingJSON } from "..";
4
+ import { BorderType } from "../border";
5
+ import { VertAlignType } from "../run-property";
6
+ import { FieldChar } from "./bindings/FieldChar";
7
+ import { InstrHyperlink } from "./bindings/InstrHyperlink";
8
+ import { InstrToC } from "./bindings/InstrToC";
9
+ import { PositionalTabAlignmentType } from "./bindings/PositionalTabAlignmentType";
10
+ import { PositionalTabRelativeTo } from "./bindings/PositionalTabRelativeTo";
11
+ import { TabLeaderType } from "./bindings/TabLeaderType";
12
+ export type TextBorderJSON = {
13
+ borderType: BorderType;
14
+ size: number;
15
+ space: number;
16
+ color: string;
17
+ };
18
+ export type RunFontsJSON = {
19
+ ascii?: string;
20
+ hiAnsi?: string;
21
+ eastAsia?: string;
22
+ cs?: string;
23
+ asciiTheme?: string;
24
+ hiAnsiTheme?: string;
25
+ eastAsiaTheme?: string;
26
+ csTheme?: string;
27
+ hint?: string;
28
+ };
29
+ export type FitTextJSON = {
30
+ val: number;
31
+ id?: number;
32
+ };
33
+ export type RunPropertyJSON = {
34
+ style?: string | null;
35
+ sz?: number | null;
36
+ szCs?: number | null;
37
+ fonts?: RunFontsJSON | null;
38
+ color?: string | null;
39
+ highlight?: string | null;
40
+ vertAlign?: VertAlignType | null;
41
+ underline?: string | null;
42
+ bold?: boolean | null;
43
+ boldCs?: boolean | null;
44
+ caps?: boolean | null;
45
+ italic?: boolean | null;
46
+ italicCs?: boolean | null;
47
+ vanish?: boolean | null;
48
+ specVanish?: boolean | null;
49
+ characterSpacing?: number | null;
50
+ fitText?: FitTextJSON | null;
51
+ textBorder?: TextBorderJSON | null;
52
+ ins?: InsertJSONData | null;
53
+ del?: DeleteJSONData | null;
54
+ strike?: boolean;
55
+ dstrike?: boolean;
56
+ shading?: ShadingJSON | null;
57
+ };
58
+ export type RunChildJSON = TextJSON | SymJSON | DeleteTextJSON | TabJSON | CarriageReturnJSON | BreakJSON | DrawingJSON | PtabJSON | ShapeJSON | CommentRangeStartJSON | CommentRangeEndJSON | FieldCharJSON | InstrTextStringJSON;
59
+ export type TextJSON = {
60
+ type: "text";
61
+ data: {
62
+ preserveSpace: boolean;
63
+ text: string;
64
+ };
65
+ };
66
+ export type PtabJSON = {
67
+ type: "ptab";
68
+ data: {
69
+ alignment: PositionalTabAlignmentType;
70
+ relativeTo: PositionalTabRelativeTo;
71
+ leader: TabLeaderType;
72
+ };
73
+ };
74
+ export type SymJSON = {
75
+ type: "sym";
76
+ data: {
77
+ font: string;
78
+ char: string;
79
+ };
80
+ };
81
+ export type DeleteTextJSON = {
82
+ type: "deleteText";
83
+ data: {
84
+ preserveSpace: boolean;
85
+ text: string;
86
+ };
87
+ };
88
+ export type TabJSON = {
89
+ type: "tab";
90
+ };
91
+ export type CarriageReturnJSON = {
92
+ type: "carriageReturn";
93
+ };
94
+ export type BreakJSON = {
95
+ type: "break";
96
+ data: {
97
+ breakType: "page" | "column" | "textWrapping";
98
+ };
99
+ };
100
+ export type RunJSON = {
101
+ type: "run";
102
+ data: {
103
+ runProperty: RunPropertyJSON;
104
+ children: RunChildJSON[];
105
+ };
106
+ };
107
+ export type FieldCharJSON = {
108
+ type: "fieldChar";
109
+ data: FieldChar;
110
+ };
111
+ export type InstrTextJSON = {
112
+ type: "instrText";
113
+ data: {
114
+ type: "hyperlink";
115
+ data: InstrHyperlink;
116
+ } | {
117
+ type: "toc";
118
+ data: InstrToC;
119
+ };
120
+ };
121
+ export type InstrTextStringJSON = {
122
+ type: "instrTextString";
123
+ data: string;
124
+ };
@@ -0,0 +1,43 @@
1
+ import { HeaderJSON, HeaderReferenceJSON } from "./header";
2
+ import { FooterJSON, FooterReferenceJSON } from "./footer";
3
+ import { PageNumType as PageNumTypeJSON } from "./bindings/PageNumType";
4
+ export { PageNumType as PageNumTypeJSON } from "./bindings/PageNumType";
5
+ export type DocGridType = "default" | "lines" | "linesAndChars" | "snapToChars";
6
+ export type SectionType = "nextPage" | "nextColumn" | "continuous" | "evenPage" | "oddPage";
7
+ export type DocGridJSON = {
8
+ gridType: DocGridType;
9
+ linePitch: number | null;
10
+ charSpace: number | null;
11
+ };
12
+ export type SectionPropertyJSON = {
13
+ pageSize: {
14
+ w: number;
15
+ h: number;
16
+ };
17
+ pageMargin: {
18
+ top: number;
19
+ left: number;
20
+ bottom: number;
21
+ right: number;
22
+ header: number;
23
+ footer: number;
24
+ gutter: number;
25
+ };
26
+ columns: number;
27
+ docGrid?: DocGridJSON;
28
+ sectionType?: SectionType;
29
+ titlePg?: boolean;
30
+ headerReference?: HeaderReferenceJSON;
31
+ header?: HeaderJSON;
32
+ firstHeaderReference?: HeaderReferenceJSON;
33
+ firstHeader?: HeaderJSON;
34
+ evenHeaderReference?: HeaderReferenceJSON;
35
+ evenHeader?: HeaderJSON;
36
+ footerReference?: FooterReferenceJSON;
37
+ footer?: FooterJSON;
38
+ firstFooterReference?: FooterReferenceJSON;
39
+ firstFooter?: FooterJSON;
40
+ evenFooterReference?: FooterReferenceJSON;
41
+ evenFooter?: FooterJSON;
42
+ pageNumType?: PageNumTypeJSON;
43
+ };
@@ -0,0 +1,5 @@
1
+ export type ShadingJSON = {
2
+ shdType: string;
3
+ color: string;
4
+ fill: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { Shape } from "./bindings/Shape";
2
+ export type ShapeJSON = {
3
+ type: "shape";
4
+ data: Shape;
5
+ };
@@ -0,0 +1,8 @@
1
+ import { BookmarkEndJSON, BookmarkStartJSON, CommentRangeEndJSON, CommentRangeStartJSON, ParagraphJSON, TableJSON } from "..";
2
+ export type StructuredTagJSON = {
3
+ type: "structuredDataTag";
4
+ data: {
5
+ children: StructuredDataTagChildJSON[];
6
+ };
7
+ };
8
+ export type StructuredDataTagChildJSON = ParagraphJSON | TableJSON | CommentRangeStartJSON | CommentRangeEndJSON | BookmarkStartJSON | BookmarkEndJSON;
@@ -0,0 +1,28 @@
1
+ import { RunPropertyJSON } from "./run";
2
+ import { ParagraphPropertyJSON } from "./paragraph";
3
+ import { TablePropertyJSON } from "./table";
4
+ import { TableCellPropertyJSON } from "..";
5
+ import { StyleType } from "../style";
6
+ export type StyleJSON = {
7
+ styleId: string;
8
+ name: string;
9
+ styleType: StyleType;
10
+ runProperty: RunPropertyJSON;
11
+ paragraphProperty: ParagraphPropertyJSON;
12
+ tableProperty: TablePropertyJSON;
13
+ tableCellProperty: TableCellPropertyJSON;
14
+ basedOn: string | null;
15
+ link?: string | null | undefined;
16
+ next?: string | null;
17
+ };
18
+ export type StylesJSON = {
19
+ docDefaults: {
20
+ runPropertyDefault: {
21
+ runProperty: RunPropertyJSON;
22
+ };
23
+ paragraphPropertyDefault: {
24
+ paragraphProperty: ParagraphPropertyJSON;
25
+ };
26
+ };
27
+ styles: StyleJSON[];
28
+ };
@@ -0,0 +1,101 @@
1
+ import { ParagraphJSON } from "./paragraph";
2
+ import { BorderJSON } from "./border";
3
+ import { HeightRule } from "../table-row";
4
+ import { TextDirectionType } from "../table-cell";
5
+ import { ShadingJSON } from "./shading";
6
+ import { TableLayoutType } from "../table";
7
+ import { DeleteJSONData, InsertJSONData, TableCellBordersJSON } from "..";
8
+ import { StructuredTagJSON } from "./structured-data-tag";
9
+ import { TablePositionProperty as TablePositionPropertyJSON } from "./bindings/TablePositionProperty";
10
+ export { TablePositionProperty as TablePositionPropertyJSON } from "./bindings/TablePositionProperty";
11
+ export { TableCellBorder as TableCellBorderJSON } from "./bindings/TableCellBorder";
12
+ export { TableCellBorders as TableCellBordersJSON } from "./bindings/TableCellBorders";
13
+ export type TableCellChildJSON = ParagraphJSON | TableJSON | StructuredTagJSON;
14
+ export type WidthType = "dxa" | "auto" | "pct" | "nil";
15
+ export { TextDirectionType } from "../table-cell";
16
+ export { HeightRule } from "../table-row";
17
+ export type TableCellPropertyJSON = {
18
+ width: {
19
+ width: number;
20
+ widthType: WidthType;
21
+ } | null;
22
+ borders: TableCellBordersJSON | null;
23
+ gridSpan: number | null;
24
+ verticalMerge: "restart" | "continue" | null;
25
+ verticalAlign: "top" | "center" | "bottom" | null;
26
+ textDirection: TextDirectionType | null;
27
+ shading: ShadingJSON | null;
28
+ margins?: CellMarginsJSON;
29
+ };
30
+ export type TableRowPropertyJSON = {
31
+ gridAfter: number | null;
32
+ gridBefore: number | null;
33
+ rowHeight: number | null;
34
+ heightRule: HeightRule | null;
35
+ widthAfter: number | null;
36
+ widthBefore: number | null;
37
+ del?: DeleteJSONData;
38
+ ins?: InsertJSONData;
39
+ };
40
+ export type TableCellJSON = {
41
+ type: "tableCell";
42
+ data: {
43
+ children: TableCellChildJSON[];
44
+ property: TableCellPropertyJSON;
45
+ };
46
+ };
47
+ export type TableRowJSON = {
48
+ type: "tableRow";
49
+ data: {
50
+ cells: TableCellJSON[];
51
+ property: TableRowPropertyJSON;
52
+ };
53
+ };
54
+ export type TableCellMarginJSON = {
55
+ val: number;
56
+ widthType: WidthType;
57
+ };
58
+ export type TableCellMarginsJSON = {
59
+ top: TableCellMarginJSON;
60
+ left: TableCellMarginJSON;
61
+ bottom: TableCellMarginJSON;
62
+ right: TableCellMarginJSON;
63
+ };
64
+ export type CellMarginsJSON = {
65
+ top: TableCellMarginJSON;
66
+ left: TableCellMarginJSON;
67
+ bottom: TableCellMarginJSON;
68
+ right: TableCellMarginJSON;
69
+ };
70
+ export type TablePropertyJSON = {
71
+ width: {
72
+ width: number;
73
+ widthType: WidthType;
74
+ } | null;
75
+ justification: "left" | "center" | "right";
76
+ borders?: {
77
+ top?: BorderJSON | null;
78
+ left?: BorderJSON | null;
79
+ bottom?: BorderJSON | null;
80
+ right?: BorderJSON | null;
81
+ insideH?: BorderJSON | null;
82
+ insideV?: BorderJSON | null;
83
+ } | null;
84
+ margins?: TableCellMarginsJSON | null;
85
+ indent?: {
86
+ width: number;
87
+ widthType: WidthType;
88
+ } | null;
89
+ style?: string | null;
90
+ layout?: TableLayoutType | null;
91
+ position?: TablePositionPropertyJSON;
92
+ };
93
+ export type TableJSON = {
94
+ type: "table";
95
+ data: {
96
+ rows: TableRowJSON[];
97
+ grid: number[];
98
+ hasNumbering: boolean;
99
+ property: TablePropertyJSON;
100
+ };
101
+ };
@@ -0,0 +1,6 @@
1
+ import { ParagraphJSON } from "./paragraph";
2
+ import { TableJSON } from "./table";
3
+ export type TextBoxContentChildJSON = ParagraphJSON | TableJSON;
4
+ export type TextBoxContentJSON = {
5
+ children: TextBoxContentChildJSON[];
6
+ };
@@ -0,0 +1,11 @@
1
+ export type WebSettingsJSON = {
2
+ divs: DivJSON[];
3
+ };
4
+ export type DivJSON = {
5
+ id: string;
6
+ marginLeft: number;
7
+ marginRight: number;
8
+ marginTop: number;
9
+ marginBottom: number;
10
+ divsChild: DivJSON[];
11
+ };
@@ -0,0 +1,38 @@
1
+ import { LevelJSON } from "./json";
2
+ import { ParagraphProperty, SpecialIndentKind } from "./paragraph-property";
3
+ import { RunFonts, RunProperty } from "./run-property";
4
+ export type LevelSuffixType = "nothing" | "tab" | "space";
5
+ export declare class Level {
6
+ id: number;
7
+ start: number;
8
+ format: string;
9
+ text: string;
10
+ jc: string;
11
+ paragraphProperty: ParagraphProperty;
12
+ runProperty: RunProperty;
13
+ levelSuffix: LevelSuffixType;
14
+ constructor(id: number, start: number, format: string, text: string, jc: string);
15
+ indent(left: number, specialIndentKind?: SpecialIndentKind, specialIndentSize?: number): this;
16
+ suffix(s: LevelSuffixType): this;
17
+ size(size: number): this;
18
+ color(color: string): this;
19
+ highlight(color: string): this;
20
+ bold(): this;
21
+ disableBold(): this;
22
+ italic(): this;
23
+ disableItalic(): this;
24
+ strike(): this;
25
+ disableStrike(): this;
26
+ underline(type: string): this;
27
+ vanish(): this;
28
+ fonts(fonts: RunFonts): this;
29
+ characterSpacing(characterSpacing: number): this;
30
+ }
31
+ export declare class LevelOverride {
32
+ level: number;
33
+ startOverride: number | null;
34
+ levelOverride: LevelJSON | null;
35
+ constructor(level: number);
36
+ overrideStart(start: number): this;
37
+ overrideLevel(level: LevelJSON): this;
38
+ }
@@ -0,0 +1,4 @@
1
+ import * as wasm from "./pkg/docx_wasm";
2
+ export declare class NumPages {
3
+ build(): wasm.NumPages;
4
+ }
@@ -0,0 +1,8 @@
1
+ import { LevelOverride } from "./level";
2
+ export declare class Numbering {
3
+ id: number;
4
+ abstractNumId: number;
5
+ overrides: LevelOverride[];
6
+ constructor(id: number, abstractNumId: number);
7
+ addOverride(o: LevelOverride): void;
8
+ }
@@ -0,0 +1,4 @@
1
+ import * as wasm from "./pkg/docx_wasm";
2
+ export declare class PageNum {
3
+ build(): wasm.PageNum;
4
+ }