docx-wasm 0.4.21-rc0 → 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 (290) 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/delete.js +17 -7
  6. package/dist/node/delete.js.map +1 -1
  7. package/dist/node/footer.js.map +1 -1
  8. package/dist/node/header.js.map +1 -1
  9. package/dist/node/hyperlink.js +17 -7
  10. package/dist/node/hyperlink.js.map +1 -1
  11. package/dist/node/index.d.ts +1 -1
  12. package/dist/node/index.js +17 -7
  13. package/dist/node/index.js.map +1 -1
  14. package/dist/node/insert.js +17 -7
  15. package/dist/node/insert.js.map +1 -1
  16. package/dist/node/json/bindings/DrawingPosition.d.ts +2 -2
  17. package/dist/node/json/bindings/FieldChar.d.ts +2 -2
  18. package/dist/node/json/bindings/FontGroup.d.ts +2 -2
  19. package/dist/node/json/bindings/FontScheme.d.ts +2 -2
  20. package/dist/node/json/bindings/FontSchemeFont.d.ts +2 -2
  21. package/dist/node/json/bindings/FrameProperty.d.ts +50 -14
  22. package/dist/node/json/bindings/ImageData.d.ts +2 -2
  23. package/dist/node/json/bindings/InstrHyperlink.d.ts +2 -2
  24. package/dist/node/json/bindings/InstrToC.d.ts +11 -11
  25. package/dist/node/json/bindings/PageNumType.d.ts +4 -4
  26. package/dist/node/json/bindings/Pic.d.ts +23 -2
  27. package/dist/node/json/bindings/PositionalTab.d.ts +2 -2
  28. package/dist/node/json/bindings/Shape.d.ts +4 -4
  29. package/dist/node/json/bindings/Tab.d.ts +2 -2
  30. package/dist/node/json/bindings/TableCellBorder.d.ts +2 -2
  31. package/dist/node/json/bindings/TableCellBorderPosition.d.ts +1 -1
  32. package/dist/node/json/bindings/TableCellBorders.d.ts +4 -4
  33. package/dist/node/json/bindings/TablePositionProperty.d.ts +13 -10
  34. package/dist/node/json/bindings/Theme.d.ts +2 -2
  35. package/dist/node/json/index.d.ts +10 -0
  36. package/dist/node/json/index.js.map +1 -1
  37. package/dist/node/num-pages.js +17 -7
  38. package/dist/node/num-pages.js.map +1 -1
  39. package/dist/node/page-num.js +17 -7
  40. package/dist/node/page-num.js.map +1 -1
  41. package/dist/node/paragraph-property.js +17 -7
  42. package/dist/node/paragraph-property.js.map +1 -1
  43. package/dist/node/pkg/docx_wasm.d.ts +1069 -811
  44. package/dist/node/pkg/docx_wasm.js +4108 -3962
  45. package/dist/node/pkg/docx_wasm_bg.wasm +0 -0
  46. package/dist/node/pkg/docx_wasm_bg.wasm.d.ts +318 -306
  47. package/dist/node/run-property.d.ts +1 -1
  48. package/dist/node/run-property.js +17 -7
  49. package/dist/node/run-property.js.map +1 -1
  50. package/dist/node/run.js +17 -7
  51. package/dist/node/run.js.map +1 -1
  52. package/dist/node/section-property.js +1 -1
  53. package/dist/node/section-property.js.map +1 -1
  54. package/dist/node/style.js +17 -7
  55. package/dist/node/style.js.map +1 -1
  56. package/dist/node/tab-leader.js +17 -7
  57. package/dist/node/tab-leader.js.map +1 -1
  58. package/dist/node/table-cell-borders.js.map +1 -1
  59. package/dist/node/table-cell.js +17 -7
  60. package/dist/node/table-cell.js.map +1 -1
  61. package/dist/node/table-of-contents-item.js +17 -7
  62. package/dist/node/table-of-contents-item.js.map +1 -1
  63. package/dist/node/table-of-contents.js +17 -7
  64. package/dist/node/table-of-contents.js.map +1 -1
  65. package/dist/node/table-row.js.map +1 -1
  66. package/dist/node/table.d.ts +1 -1
  67. package/dist/node/table.js +17 -7
  68. package/dist/node/table.js.map +1 -1
  69. package/dist/web/builder.js.map +1 -1
  70. package/dist/web/delete.js.map +1 -1
  71. package/dist/web/footer.js.map +1 -1
  72. package/dist/web/header.js.map +1 -1
  73. package/dist/web/hyperlink.js.map +1 -1
  74. package/dist/web/index.d.ts +1 -1
  75. package/dist/web/index.js.map +1 -1
  76. package/dist/web/insert.js.map +1 -1
  77. package/dist/web/js/abstract-numbering.d.ts +7 -0
  78. package/dist/web/js/bookmark-end.d.ts +4 -0
  79. package/dist/web/js/bookmark-start.d.ts +5 -0
  80. package/dist/web/js/border.d.ts +1 -0
  81. package/dist/web/js/break.d.ts +5 -0
  82. package/dist/web/js/builder.d.ts +7 -0
  83. package/dist/web/js/carriage-return.d.ts +2 -0
  84. package/dist/web/js/comment-end.d.ts +4 -0
  85. package/dist/web/js/comment.d.ts +14 -0
  86. package/dist/web/js/delete-text.d.ts +4 -0
  87. package/dist/web/js/delete.d.ts +11 -0
  88. package/dist/web/js/doc-defaults.d.ts +10 -0
  89. package/dist/web/js/doc-props.d.ts +10 -0
  90. package/dist/web/js/footer.d.ts +8 -0
  91. package/dist/web/js/header.d.ts +8 -0
  92. package/dist/web/js/hyperlink.d.ts +22 -0
  93. package/dist/web/js/image.d.ts +15 -0
  94. package/dist/web/js/index.d.ts +119 -0
  95. package/dist/web/js/insert.d.ts +11 -0
  96. package/dist/web/js/json/bindings/AlignmentType.d.ts +1 -0
  97. package/dist/web/js/json/bindings/Bold.d.ts +1 -0
  98. package/dist/web/js/json/bindings/BoldCs.d.ts +1 -0
  99. package/dist/web/js/json/bindings/BorderType.d.ts +1 -0
  100. package/dist/web/js/json/bindings/Break.d.ts +4 -0
  101. package/dist/web/js/json/bindings/BreakType.d.ts +1 -0
  102. package/dist/web/js/json/bindings/Caps.d.ts +1 -0
  103. package/dist/web/js/json/bindings/CharacterSpacing.d.ts +1 -0
  104. package/dist/web/js/json/bindings/Color.d.ts +1 -0
  105. package/dist/web/js/json/bindings/Comment.d.ts +7 -0
  106. package/dist/web/js/json/bindings/CommentRangeEnd.d.ts +3 -0
  107. package/dist/web/js/json/bindings/CommentRangeStart.d.ts +5 -0
  108. package/dist/web/js/json/bindings/Delete.d.ts +6 -0
  109. package/dist/web/js/json/bindings/DeleteChild.d.ts +10 -0
  110. package/dist/web/js/json/bindings/DeleteText.d.ts +4 -0
  111. package/dist/web/js/json/bindings/DrawingPosition.d.ts +6 -0
  112. package/dist/web/js/json/bindings/DrawingPositionType.d.ts +1 -0
  113. package/dist/web/js/json/bindings/FieldChar.d.ts +5 -0
  114. package/dist/web/js/json/bindings/FieldCharType.d.ts +1 -0
  115. package/dist/web/js/json/bindings/FitText.d.ts +4 -0
  116. package/dist/web/js/json/bindings/FontGroup.d.ts +7 -0
  117. package/dist/web/js/json/bindings/FontScheme.d.ts +5 -0
  118. package/dist/web/js/json/bindings/FontSchemeFont.d.ts +4 -0
  119. package/dist/web/js/json/bindings/FooterReference.d.ts +4 -0
  120. package/dist/web/js/json/bindings/FrameProperty.d.ts +50 -0
  121. package/dist/web/js/json/bindings/HeaderReference.d.ts +4 -0
  122. package/dist/web/js/json/bindings/Highlight.d.ts +1 -0
  123. package/dist/web/js/json/bindings/HyperlinkType.d.ts +1 -0
  124. package/dist/web/js/json/bindings/ImageData.d.ts +3 -0
  125. package/dist/web/js/json/bindings/Insert.d.ts +5 -0
  126. package/dist/web/js/json/bindings/InsertChild.d.ts +13 -0
  127. package/dist/web/js/json/bindings/InstrHyperlink.d.ts +4 -0
  128. package/dist/web/js/json/bindings/InstrPAGEREF.d.ts +5 -0
  129. package/dist/web/js/json/bindings/InstrTC.d.ts +6 -0
  130. package/dist/web/js/json/bindings/InstrText.d.ts +15 -0
  131. package/dist/web/js/json/bindings/InstrToC.d.ts +19 -0
  132. package/dist/web/js/json/bindings/Italic.d.ts +1 -0
  133. package/dist/web/js/json/bindings/ItalicCs.d.ts +1 -0
  134. package/dist/web/js/json/bindings/PageNumType.d.ts +4 -0
  135. package/dist/web/js/json/bindings/Pic.d.ts +46 -0
  136. package/dist/web/js/json/bindings/PicAlign.d.ts +1 -0
  137. package/dist/web/js/json/bindings/PositionalTab.d.ts +8 -0
  138. package/dist/web/js/json/bindings/PositionalTabAlignmentType.d.ts +1 -0
  139. package/dist/web/js/json/bindings/PositionalTabRelativeTo.d.ts +1 -0
  140. package/dist/web/js/json/bindings/RelativeFromHType.d.ts +1 -0
  141. package/dist/web/js/json/bindings/RelativeFromVType.d.ts +1 -0
  142. package/dist/web/js/json/bindings/Run.d.ts +5 -0
  143. package/dist/web/js/json/bindings/RunFonts.d.ts +11 -0
  144. package/dist/web/js/json/bindings/RunProperty.d.ts +44 -0
  145. package/dist/web/js/json/bindings/RunStyle.d.ts +1 -0
  146. package/dist/web/js/json/bindings/Shape.d.ts +5 -0
  147. package/dist/web/js/json/bindings/SpecVanish.d.ts +1 -0
  148. package/dist/web/js/json/bindings/Strike.d.ts +1 -0
  149. package/dist/web/js/json/bindings/StyleWithLevel.d.ts +1 -0
  150. package/dist/web/js/json/bindings/Sym.d.ts +4 -0
  151. package/dist/web/js/json/bindings/Sz.d.ts +1 -0
  152. package/dist/web/js/json/bindings/SzCs.d.ts +1 -0
  153. package/dist/web/js/json/bindings/Tab.d.ts +7 -0
  154. package/dist/web/js/json/bindings/TabLeaderType.d.ts +1 -0
  155. package/dist/web/js/json/bindings/TabValueType.d.ts +1 -0
  156. package/dist/web/js/json/bindings/TableCellBorder.d.ts +9 -0
  157. package/dist/web/js/json/bindings/TableCellBorderPosition.d.ts +1 -0
  158. package/dist/web/js/json/bindings/TableCellBorders.d.ts +11 -0
  159. package/dist/web/js/json/bindings/TablePositionProperty.d.ts +13 -0
  160. package/dist/web/js/json/bindings/Text.d.ts +4 -0
  161. package/dist/web/js/json/bindings/TextAlignmentType.d.ts +1 -0
  162. package/dist/web/js/json/bindings/TextBorder.d.ts +7 -0
  163. package/dist/web/js/json/bindings/Theme.d.ts +4 -0
  164. package/dist/web/js/json/bindings/Underline.d.ts +1 -0
  165. package/dist/web/js/json/bindings/Vanish.d.ts +1 -0
  166. package/dist/web/js/json/bindings/VertAlign.d.ts +1 -0
  167. package/dist/web/js/json/border.d.ts +7 -0
  168. package/dist/web/js/json/comment.d.ts +22 -0
  169. package/dist/web/js/json/document.d.ts +11 -0
  170. package/dist/web/js/json/drawing.d.ts +45 -0
  171. package/dist/web/js/json/footer.d.ts +13 -0
  172. package/dist/web/js/json/header.d.ts +13 -0
  173. package/dist/web/js/json/indent.d.ts +11 -0
  174. package/dist/web/js/json/index.d.ts +88 -0
  175. package/dist/web/js/json/line_spacing.d.ts +8 -0
  176. package/dist/web/js/json/numbering.d.ts +35 -0
  177. package/dist/web/js/json/paragraph.d.ts +98 -0
  178. package/dist/web/js/json/run.d.ts +124 -0
  179. package/dist/web/js/json/section-property.d.ts +43 -0
  180. package/dist/web/js/json/shading.d.ts +5 -0
  181. package/dist/web/js/json/shape.d.ts +5 -0
  182. package/dist/web/js/json/structured-data-tag.d.ts +8 -0
  183. package/dist/web/js/json/styles.d.ts +28 -0
  184. package/dist/web/js/json/table.d.ts +101 -0
  185. package/dist/web/js/json/textbox-content.d.ts +6 -0
  186. package/dist/web/js/json/web-settings.d.ts +11 -0
  187. package/dist/web/js/level.d.ts +38 -0
  188. package/dist/web/js/num-pages.d.ts +4 -0
  189. package/dist/web/js/numbering.d.ts +8 -0
  190. package/dist/web/js/page-num.d.ts +4 -0
  191. package/dist/web/js/paragraph-property.d.ts +95 -0
  192. package/dist/web/js/paragraph.d.ts +70 -0
  193. package/dist/web/js/positional-tab.d.ts +12 -0
  194. package/dist/web/js/run-property.d.ts +91 -0
  195. package/dist/web/js/run.d.ts +44 -0
  196. package/dist/web/js/section-property.d.ts +61 -0
  197. package/dist/web/js/settings.d.ts +17 -0
  198. package/dist/web/js/shading.d.ts +8 -0
  199. package/dist/web/js/style.d.ts +69 -0
  200. package/dist/web/js/styles.d.ts +12 -0
  201. package/dist/web/js/tab-leader.d.ts +3 -0
  202. package/dist/web/js/tab.d.ts +2 -0
  203. package/dist/web/js/table-cell-border.d.ts +13 -0
  204. package/dist/web/js/table-cell-borders.d.ts +15 -0
  205. package/dist/web/js/table-cell.d.ts +61 -0
  206. package/dist/web/js/table-of-contents-item.d.ts +12 -0
  207. package/dist/web/js/table-of-contents.d.ts +46 -0
  208. package/dist/web/js/table-row.d.ts +21 -0
  209. package/dist/web/js/table.d.ts +85 -0
  210. package/dist/web/js/tc.d.ts +10 -0
  211. package/dist/web/js/text.d.ts +4 -0
  212. package/dist/web/js/webextension.d.ts +12 -0
  213. package/dist/web/json/bindings/DrawingPosition.d.ts +2 -2
  214. package/dist/web/json/bindings/FieldChar.d.ts +2 -2
  215. package/dist/web/json/bindings/FontGroup.d.ts +2 -2
  216. package/dist/web/json/bindings/FontScheme.d.ts +2 -2
  217. package/dist/web/json/bindings/FontSchemeFont.d.ts +2 -2
  218. package/dist/web/json/bindings/FrameProperty.d.ts +50 -14
  219. package/dist/web/json/bindings/ImageData.d.ts +2 -2
  220. package/dist/web/json/bindings/InstrHyperlink.d.ts +2 -2
  221. package/dist/web/json/bindings/InstrToC.d.ts +11 -11
  222. package/dist/web/json/bindings/PageNumType.d.ts +4 -4
  223. package/dist/web/json/bindings/Pic.d.ts +23 -2
  224. package/dist/web/json/bindings/PositionalTab.d.ts +2 -2
  225. package/dist/web/json/bindings/Shape.d.ts +4 -4
  226. package/dist/web/json/bindings/Tab.d.ts +2 -2
  227. package/dist/web/json/bindings/TableCellBorder.d.ts +2 -2
  228. package/dist/web/json/bindings/TableCellBorderPosition.d.ts +1 -1
  229. package/dist/web/json/bindings/TableCellBorders.d.ts +4 -4
  230. package/dist/web/json/bindings/TablePositionProperty.d.ts +13 -10
  231. package/dist/web/json/bindings/Theme.d.ts +2 -2
  232. package/dist/web/json/index.d.ts +10 -0
  233. package/dist/web/json/index.js.map +1 -1
  234. package/dist/web/paragraph-property.js.map +1 -1
  235. package/dist/web/pkg/docx_wasm.d.ts +1069 -811
  236. package/dist/web/pkg/docx_wasm.js +7 -2
  237. package/dist/web/pkg/docx_wasm_bg.js +4000 -3932
  238. package/dist/web/pkg/docx_wasm_bg.wasm +0 -0
  239. package/dist/web/pkg/docx_wasm_bg.wasm.d.ts +318 -306
  240. package/dist/web/pkg/package.json +2 -1
  241. package/dist/web/run-property.d.ts +1 -1
  242. package/dist/web/run-property.js.map +1 -1
  243. package/dist/web/run.js.map +1 -1
  244. package/dist/web/section-property.js +1 -1
  245. package/dist/web/section-property.js.map +1 -1
  246. package/dist/web/style.js.map +1 -1
  247. package/dist/web/tab-leader.js.map +1 -1
  248. package/dist/web/table-cell-borders.js.map +1 -1
  249. package/dist/web/table-cell.js.map +1 -1
  250. package/dist/web/table-of-contents-item.js.map +1 -1
  251. package/dist/web/table-of-contents.js.map +1 -1
  252. package/dist/web/table-row.js.map +1 -1
  253. package/dist/web/table.d.ts +1 -1
  254. package/dist/web/table.js.map +1 -1
  255. package/js/json/bindings/AlignmentType.ts +1 -1
  256. package/js/json/bindings/BorderType.ts +1 -1
  257. package/js/json/bindings/DrawingPosition.ts +1 -1
  258. package/js/json/bindings/DrawingPositionType.ts +1 -1
  259. package/js/json/bindings/FieldChar.ts +1 -1
  260. package/js/json/bindings/FieldCharType.ts +1 -1
  261. package/js/json/bindings/FontGroup.ts +1 -1
  262. package/js/json/bindings/FontScheme.ts +1 -1
  263. package/js/json/bindings/FontSchemeFont.ts +1 -1
  264. package/js/json/bindings/FrameProperty.ts +46 -1
  265. package/js/json/bindings/HyperlinkType.ts +1 -1
  266. package/js/json/bindings/ImageData.ts +1 -1
  267. package/js/json/bindings/InstrHyperlink.ts +1 -1
  268. package/js/json/bindings/InstrToC.ts +1 -1
  269. package/js/json/bindings/PageNumType.ts +1 -1
  270. package/js/json/bindings/Pic.ts +26 -1
  271. package/js/json/bindings/PicAlign.ts +1 -1
  272. package/js/json/bindings/PositionalTab.ts +1 -1
  273. package/js/json/bindings/PositionalTabAlignmentType.ts +1 -1
  274. package/js/json/bindings/PositionalTabRelativeTo.ts +1 -1
  275. package/js/json/bindings/RelativeFromHType.ts +1 -1
  276. package/js/json/bindings/RelativeFromVType.ts +1 -1
  277. package/js/json/bindings/Shape.ts +1 -1
  278. package/js/json/bindings/StyleWithLevel.ts +1 -1
  279. package/js/json/bindings/Tab.ts +1 -1
  280. package/js/json/bindings/TabLeaderType.ts +1 -1
  281. package/js/json/bindings/TabValueType.ts +1 -1
  282. package/js/json/bindings/TableCellBorder.ts +1 -1
  283. package/js/json/bindings/TableCellBorderPosition.ts +1 -1
  284. package/js/json/bindings/TableCellBorders.ts +1 -1
  285. package/js/json/bindings/TablePositionProperty.ts +4 -1
  286. package/js/json/bindings/TextAlignmentType.ts +1 -1
  287. package/js/json/bindings/Theme.ts +1 -1
  288. package/js/json/index.ts +10 -1
  289. package/js/section-property.ts +1 -1
  290. package/package.json +17 -8
@@ -0,0 +1,70 @@
1
+ import { Run } from "./run";
2
+ import { RunFonts } from "./run-property";
3
+ import { ParagraphProperty, LineSpacing, AlignmentType, SpecialIndentKind, ParagraphPropertyChange } from "./paragraph-property";
4
+ import { Insert } from "./insert";
5
+ import { Delete } from "./delete";
6
+ import { BookmarkStart } from "./bookmark-start";
7
+ import { BookmarkEnd } from "./bookmark-end";
8
+ import { Comment } from "./comment";
9
+ import { CommentEnd } from "./comment-end";
10
+ import { Hyperlink } from "./hyperlink";
11
+ import { TextAlignmentType } from "./json/bindings/TextAlignmentType";
12
+ import { TabValueType } from "./json/bindings/TabValueType";
13
+ import { TabLeaderType } from "./json/bindings/TabLeaderType";
14
+ import { NumPages } from "./num-pages";
15
+ import { PageNum } from "./page-num";
16
+ export type ParagraphChild = Run | Insert | Delete | Hyperlink | BookmarkStart | BookmarkEnd | Comment | CommentEnd | NumPages | PageNum;
17
+ export declare class Paragraph {
18
+ hasNumberings: boolean;
19
+ children: ParagraphChild[];
20
+ property: ParagraphProperty;
21
+ addRun(run: Run): this;
22
+ addHyperlink(link: Hyperlink): this;
23
+ addInsert(ins: Insert): this;
24
+ addDelete(del: Delete): this;
25
+ addBookmarkStart(id: number, name: string): this;
26
+ addBookmarkEnd(id: number): this;
27
+ addCommentStart(comment: Comment): this;
28
+ addCommentEnd(end: CommentEnd): this;
29
+ addPageNum(): this;
30
+ addNumPages(): this;
31
+ tabs(tabs: {
32
+ val: TabValueType | null;
33
+ leader: TabLeaderType | null;
34
+ pos: number | null;
35
+ }[]): this;
36
+ align(type: AlignmentType): this;
37
+ textAlignment(type: TextAlignmentType): this;
38
+ adjustRightInd(v: number): this;
39
+ style(id: string): this;
40
+ indent(left: number, specialIndentKind?: SpecialIndentKind, specialIndentSize?: number, right?: number): this;
41
+ numbering(id: number, level: number): this;
42
+ lineSpacing(spacing: LineSpacing): this;
43
+ characterSpacing(spacing: number): this;
44
+ snapToGrid(v: boolean): this;
45
+ keepNext(v: boolean): this;
46
+ keepLines(v: boolean): this;
47
+ pageBreakBefore(v: boolean): this;
48
+ widowControl(v: boolean): this;
49
+ size(size: number): this;
50
+ color(color: string): this;
51
+ bold(): this;
52
+ italic(): this;
53
+ fonts(fonts: RunFonts): this;
54
+ delete(author: string, date: string): this;
55
+ insert(author: string, date: string): this;
56
+ outlineLevel(v: number): this;
57
+ paragraphPropertyChange(propertyChange: ParagraphPropertyChange): this;
58
+ frameHeight(h: number): this;
59
+ hRule(r: string): this;
60
+ hAnchor(a: string): this;
61
+ hSpace(s: number): this;
62
+ vAnchor(a: string): this;
63
+ vSpace(s: number): this;
64
+ frameWidth(w: number): this;
65
+ wrap(w: string): this;
66
+ frameX(x: number): this;
67
+ xAlign(a: string): this;
68
+ frameY(y: number): this;
69
+ yAlign(y: string): this;
70
+ }
@@ -0,0 +1,12 @@
1
+ import { PositionalTabAlignmentType } from "./json/bindings/PositionalTabAlignmentType";
2
+ import { PositionalTabRelativeTo } from "./json/bindings/PositionalTabRelativeTo";
3
+ import { TabLeaderType } from "./json/bindings/TabLeaderType";
4
+ export declare class PositionalTab {
5
+ _alignment: PositionalTabAlignmentType;
6
+ _relativeTo: PositionalTabRelativeTo;
7
+ _leader: TabLeaderType;
8
+ alignment(t: PositionalTabAlignmentType): this;
9
+ relativeTo(t: PositionalTabRelativeTo): this;
10
+ leader(l: TabLeaderType): this;
11
+ buildWasmObject(): import("./pkg/docx_wasm").PositionalTab;
12
+ }
@@ -0,0 +1,91 @@
1
+ import * as wasm from "./pkg/docx_wasm";
2
+ import { BorderType } from "./border";
3
+ import { Shading } from "./shading";
4
+ export type TextBorder = {
5
+ borderType: BorderType;
6
+ color: string;
7
+ space: number;
8
+ size: number;
9
+ };
10
+ export type FitText = {
11
+ val: number;
12
+ id?: number;
13
+ };
14
+ export type VertAlignType = "baseline" | "superscript" | "subscript";
15
+ export type RunPropertyDel = {
16
+ author: string;
17
+ date: string;
18
+ };
19
+ export type RunPropertyIns = {
20
+ author: string;
21
+ date: string;
22
+ };
23
+ export declare class RunProperty {
24
+ _style?: string;
25
+ _size?: number;
26
+ _color?: string;
27
+ _highlight?: string;
28
+ _vertAlign?: VertAlignType;
29
+ _bold?: boolean;
30
+ _italic?: boolean;
31
+ _strike?: boolean;
32
+ _dstrike?: boolean;
33
+ _caps?: boolean;
34
+ _underline?: string;
35
+ _vanish?: boolean;
36
+ _fonts?: RunFonts;
37
+ _characterSpacing?: number;
38
+ _fitText?: FitText;
39
+ _textBorder?: TextBorder;
40
+ _ins?: RunPropertyIns;
41
+ _del?: RunPropertyDel;
42
+ _shading?: Shading;
43
+ style(style: string): this;
44
+ size(size: number): this;
45
+ color(color: string): this;
46
+ highlight(color: string): this;
47
+ vertAlign(vertAlign: VertAlignType): this;
48
+ bold(): this;
49
+ disableBold(): this;
50
+ strike(): this;
51
+ disableStrike(): this;
52
+ dstrike(): this;
53
+ disableDstrike(): this;
54
+ italic(): this;
55
+ disableItalic(): this;
56
+ caps(): this;
57
+ underline(type: string): this;
58
+ vanish(): this;
59
+ fonts(fonts: RunFonts): this;
60
+ spacing(characterSpacing: number): this;
61
+ fitText(val: number, id?: number): this;
62
+ delete(author: string, date: string): this;
63
+ insert(author: string, date: string): this;
64
+ textBorder(type: BorderType, size: number, space: number, color: string): this;
65
+ shading(type: string, color: string, fill: string): this;
66
+ }
67
+ export declare const convertBorderType: (t: BorderType) => wasm.BorderType.Nil | wasm.BorderType.None | wasm.BorderType.Single | wasm.BorderType.Thick | wasm.BorderType.Double | wasm.BorderType.Dotted | wasm.BorderType.Dashed | wasm.BorderType.DotDash | wasm.BorderType.DotDotDash | wasm.BorderType.Triple;
68
+ export declare const createDefaultRunProperty: () => RunProperty;
69
+ export declare class RunFonts {
70
+ _ascii?: string;
71
+ _hiAnsi?: string;
72
+ _eastAsia?: string;
73
+ _cs?: string;
74
+ _asciiTheme?: string;
75
+ _hiAnsiTheme?: string;
76
+ _eastAsiaTheme?: string;
77
+ _csTheme?: string;
78
+ _hint?: string;
79
+ ascii(f: string): this;
80
+ hiAnsi(f: string): this;
81
+ cs(f: string): this;
82
+ eastAsia(f: string): this;
83
+ asciiTheme(f: string): this;
84
+ hiAnsiTheme(f: string): this;
85
+ csTheme(f: string): this;
86
+ eastAsiaTheme(f: string): this;
87
+ hint(f: string): this;
88
+ buildWasmObject: () => wasm.RunFonts;
89
+ }
90
+ export declare const setRunProperty: <T extends wasm.Run | wasm.Style>(target: T, property: RunProperty) => T;
91
+ export declare const createRunProperty: (property: RunProperty) => wasm.RunProperty;
@@ -0,0 +1,44 @@
1
+ import * as wasm from "./pkg";
2
+ import { Text } from "./text";
3
+ import { DeleteText } from "./delete-text";
4
+ import { Tab } from "./tab";
5
+ import { Break, BreakType } from "./break";
6
+ import { CarriageReturn } from "./carriage-return";
7
+ import { BorderType } from "./border";
8
+ import { Image } from "./image";
9
+ import { PositionalTab } from "./positional-tab";
10
+ import { RunFonts, RunProperty, VertAlignType } from "./run-property";
11
+ import { Tc } from "./tc";
12
+ export type RunChild = Text | DeleteText | Tab | CarriageReturn | Break | Image | PositionalTab | Tc;
13
+ export declare class Run {
14
+ children: RunChild[];
15
+ property: RunProperty;
16
+ addText(text: string): this;
17
+ addImage(image: Image): this;
18
+ addDeleteText(text: string): this;
19
+ addTab(): this;
20
+ addPositionalTab(ptab: PositionalTab): this;
21
+ addBreak(type: BreakType): this;
22
+ addCarriageReturn(): this;
23
+ addTc(tc: Tc): this;
24
+ style(style: string): this;
25
+ size(size: number): this;
26
+ color(color: string): this;
27
+ highlight(color: string): this;
28
+ vertAlign(vertAlign: VertAlignType): this;
29
+ bold(): this;
30
+ strike(): this;
31
+ dstrike(): this;
32
+ italic(): this;
33
+ underline(type: string): this;
34
+ vanish(): this;
35
+ caps(): this;
36
+ fonts(fonts: RunFonts): this;
37
+ spacing(characterSpacing: number): this;
38
+ fitText(val: number, id?: number): this;
39
+ delete(author: string, date: string): this;
40
+ insert(author: string, date: string): this;
41
+ textBorder(type: BorderType, size: number, space: number, color: string): this;
42
+ shading(type: string, color: string, fill: string): this;
43
+ build(): wasm.Run;
44
+ }
@@ -0,0 +1,61 @@
1
+ import { DocGridType } from ".";
2
+ import { Footer } from "./footer";
3
+ import { Header } from "./header";
4
+ import { PageNumType } from "./json/bindings/PageNumType";
5
+ export type DocGrid = {
6
+ gridType: DocGridType;
7
+ linePitch?: number;
8
+ charSpace?: number;
9
+ };
10
+ export declare class SectionProperty {
11
+ _pageSize: PageSize;
12
+ _titlePg: boolean | null;
13
+ _pageMargin: PageMargin | null;
14
+ _docGrid: DocGrid | null;
15
+ _header: Header | null;
16
+ _firstHeader: Header | null;
17
+ _evenHeader: Header | null;
18
+ _footer: Footer | null;
19
+ _firstFooter: Footer | null;
20
+ _evenFooter: Footer | null;
21
+ _pageTypeNum: PageNumType | null;
22
+ titlePg(): this;
23
+ pageSize(w: number, h: number): this;
24
+ pageMargin(margin: Partial<PageMargin>): this;
25
+ pageOrientation(orient: PageOrientationType): this;
26
+ docGrid(gridType: DocGridType, linePitch?: number, charSpace?: number): this;
27
+ header(header: Header): this;
28
+ firstHeader(header: Header): this;
29
+ evenHeader(header: Header): this;
30
+ footer(footer: Footer): this;
31
+ firstFooter(footer: Footer): this;
32
+ evenFooter(footer: Footer): this;
33
+ pageTypeNum({ start, chapStyle }: {
34
+ start?: number;
35
+ chapStyle?: string;
36
+ }): this;
37
+ }
38
+ export type PageOrientationType = "landscape" | "portrait";
39
+ export type PageSize = {
40
+ w: number;
41
+ h: number;
42
+ orient?: PageOrientationType;
43
+ };
44
+ export type PageMargin = {
45
+ top: number;
46
+ right: number;
47
+ bottom: number;
48
+ left: number;
49
+ header: number;
50
+ footer: number;
51
+ gutter: number;
52
+ };
53
+ export declare const defaultPageMargin: () => {
54
+ top: number;
55
+ left: number;
56
+ bottom: number;
57
+ right: number;
58
+ header: number;
59
+ footer: number;
60
+ gutter: number;
61
+ };
@@ -0,0 +1,17 @@
1
+ export type DocVar = {
2
+ name: string;
3
+ val: string;
4
+ };
5
+ export type CharacterSpacingValues = "doNotCompress" | "compressPunctuation" | "compressPunctuationAndJapaneseKana";
6
+ export declare class Settings {
7
+ _docId: string | null;
8
+ _docVars: DocVar[];
9
+ _defaultTabStop: number;
10
+ _adjustLineHeightInTable: boolean;
11
+ _characterSpacingControl: CharacterSpacingValues | null;
12
+ docId(id: string): this;
13
+ defaultTabStop(stop: number): this;
14
+ addDocVar(name: string, val: string): this;
15
+ adjustLineHeightInTable(): this;
16
+ characterSpacingControl(t: CharacterSpacingValues): this;
17
+ }
@@ -0,0 +1,8 @@
1
+ export declare class Shading {
2
+ _type: string;
3
+ _color: string;
4
+ _fill: string;
5
+ type(t: string): void;
6
+ color(c: string): void;
7
+ fill(c: string): void;
8
+ }
@@ -0,0 +1,69 @@
1
+ import * as wasm from "./pkg";
2
+ import { TableAlignmentType, TableLayoutType, TableProperty } from "./table";
3
+ import { RunProperty, VertAlignType, RunFonts } from "./run-property";
4
+ import { AlignmentType, LineSpacing, ParagraphProperty, SpecialIndentKind } from "./paragraph-property";
5
+ import { BorderType } from "./border";
6
+ import { WidthType } from ".";
7
+ export type StyleType = "paragraph" | "character" | "numbering" | "table";
8
+ export declare class Style {
9
+ _styleId: string;
10
+ _name: string;
11
+ _styleType: StyleType;
12
+ _runProperty: RunProperty;
13
+ _paragraphProperty: ParagraphProperty;
14
+ _tableProperty: TableProperty;
15
+ _basedOn: string | null;
16
+ _link: string | null;
17
+ _qFormat: boolean;
18
+ _uiPriority: number | null;
19
+ _semiHidden: boolean;
20
+ _unhideWhenUsed: boolean;
21
+ constructor(id: string, type: StyleType);
22
+ name: (n: string) => this;
23
+ basedOn: (n: string) => this;
24
+ link: (n: string) => this;
25
+ qFormat: (v: boolean) => this;
26
+ uiPriority: (v: number) => this;
27
+ semiHidden: () => this;
28
+ unhideWhenUsed: () => this;
29
+ style(style: string): this;
30
+ size(size: number): this;
31
+ color(color: string): this;
32
+ highlight(color: string): this;
33
+ vertAlign(vertAlign: VertAlignType): this;
34
+ bold(): this;
35
+ strike(): this;
36
+ dstrike(): this;
37
+ italic(): this;
38
+ underline(type: string): this;
39
+ vanish(): this;
40
+ fonts(fonts: RunFonts): this;
41
+ characterSpacing(characterSpacing: number): this;
42
+ fitText(val: number, id?: number): this;
43
+ delete(author: string, date: string): this;
44
+ insert(author: string, date: string): this;
45
+ textBorder(type: BorderType, size: number, space: number, color: string): this;
46
+ paragraphProperty: (p: ParagraphProperty) => this;
47
+ runProperty: (p: RunProperty) => this;
48
+ align(type: AlignmentType): this;
49
+ indent(left: number, specialIndentKind?: SpecialIndentKind, specialIndentSize?: number): this;
50
+ numbering(id: number, level: number): this;
51
+ lineSpacing(spacing: LineSpacing): this;
52
+ keepNext(v: boolean): this;
53
+ keepLines(v: boolean): this;
54
+ snapToGrid(v: boolean): this;
55
+ pageBreakBefore(v: boolean): this;
56
+ widowControl(v: boolean): this;
57
+ outlineLevel(v: number): this;
58
+ tableIndent(v: number): this;
59
+ tableAlign(v: TableAlignmentType): this;
60
+ layout(l: TableLayoutType): this;
61
+ width(w: number): this;
62
+ cellMargins(top: number, right: number, bottom: number, left: number): this;
63
+ cellMarginTop(v: number, t: WidthType): this;
64
+ cellMarginLeft(v: number, t: WidthType): this;
65
+ cellMarginRight(v: number, t: WidthType): this;
66
+ cellMarginBottom(v: number, t: WidthType): this;
67
+ buildStyleType: () => wasm.StyleType.Paragraph | wasm.StyleType.Character | wasm.StyleType.Numbering | wasm.StyleType.Table;
68
+ buildWasmObject: () => wasm.Style;
69
+ }
@@ -0,0 +1,12 @@
1
+ import { Style } from "./style";
2
+ import { DocDefaults } from "./doc-defaults";
3
+ import { RunFonts } from "./run-property";
4
+ import { LineSpacing } from "./paragraph-property";
5
+ export declare class Styles {
6
+ styles: Style[];
7
+ docDefaults: DocDefaults;
8
+ defaultSize(size: number): this;
9
+ defaultFonts(fonts: RunFonts): this;
10
+ defaultCharacterSpacing(spacing: number): this;
11
+ defaultLineSpacing(spacing: LineSpacing): this;
12
+ }
@@ -0,0 +1,3 @@
1
+ import * as wasm from "./pkg";
2
+ import { TabLeaderType } from "./json/bindings/TabLeaderType";
3
+ export declare const convertTabLeader: (leader: TabLeaderType) => wasm.TabLeaderType;
@@ -0,0 +1,2 @@
1
+ export declare class Tab {
2
+ }
@@ -0,0 +1,13 @@
1
+ import { BorderType } from "./border";
2
+ export type TableCellBorderPosition = "left" | "right" | "top" | "bottom" | "insideH" | "insideV" | "tl2br" | "tr2bl";
3
+ export declare class TableCellBorder {
4
+ _border_type: BorderType;
5
+ _size: number;
6
+ _color: string;
7
+ position: TableCellBorderPosition;
8
+ space: number;
9
+ constructor(position: TableCellBorderPosition);
10
+ color(color: string): this;
11
+ size(size: number): this;
12
+ border_type(border_type: BorderType): this;
13
+ }
@@ -0,0 +1,15 @@
1
+ import { TableCellBorderPosition, TableCellBorder } from "./table-cell-border";
2
+ export type PositionKeys = "top" | "left" | "bottom" | "right" | "insideH" | "insideV" | "tl2br" | "tr2bl";
3
+ export declare class TableCellBorders {
4
+ top: TableCellBorder | null;
5
+ left: TableCellBorder | null;
6
+ bottom: TableCellBorder | null;
7
+ right: TableCellBorder | null;
8
+ insideH: TableCellBorder | null;
9
+ insideV: TableCellBorder | null;
10
+ tl2br: TableCellBorder | null;
11
+ tr2bl: TableCellBorder | null;
12
+ set(border: TableCellBorder): this;
13
+ clear(position: TableCellBorderPosition): this;
14
+ clearAll(): this;
15
+ }
@@ -0,0 +1,61 @@
1
+ import { Paragraph } from "./paragraph";
2
+ import { Table } from "./table";
3
+ import { Shading } from "./shading";
4
+ import { TableCellBorders } from "./table-cell-borders";
5
+ import { TableCellBorderPosition, TableCellBorder } from "./table-cell-border";
6
+ import * as wasm from "./pkg";
7
+ import { TableOfContents } from "./table-of-contents";
8
+ import { WidthType } from ".";
9
+ export type VMergeType = "restart" | "continue";
10
+ export type VAlignType = "top" | "center" | "bottom";
11
+ export type TextDirectionType = "lr" | "lrV" | "rl" | "rlV" | "tb" | "tbV" | "tbRlV" | "tbRl" | "btLr" | "lrTbV";
12
+ export declare const toTextDirectionWasmType: (t: TextDirectionType) => wasm.TextDirectionType;
13
+ export type CellProperty = {
14
+ borders: TableCellBorders;
15
+ verticalMerge?: VMergeType;
16
+ verticalAlign?: VAlignType;
17
+ gridSpan?: number;
18
+ width?: number;
19
+ textDirection?: TextDirectionType;
20
+ shading?: Shading;
21
+ margins?: {
22
+ top?: {
23
+ val: number;
24
+ type: WidthType;
25
+ };
26
+ left?: {
27
+ val: number;
28
+ type: WidthType;
29
+ };
30
+ bottom?: {
31
+ val: number;
32
+ type: WidthType;
33
+ };
34
+ right?: {
35
+ val: number;
36
+ type: WidthType;
37
+ };
38
+ };
39
+ };
40
+ export declare class TableCell {
41
+ children: (Paragraph | Table | TableOfContents)[];
42
+ hasNumberings: boolean;
43
+ property: CellProperty;
44
+ addParagraph(p: Paragraph): this;
45
+ addTableOfContents(t: TableOfContents): this;
46
+ addTable(t: Table): this;
47
+ verticalMerge(t: VMergeType): this;
48
+ verticalAlign(t: VAlignType): this;
49
+ gridSpan(v: number): this;
50
+ width(v: number): this;
51
+ shading(type: string, color: string, fill: string): this;
52
+ textDirection(t: TextDirectionType): this;
53
+ setBorder(border: TableCellBorder): this;
54
+ clearBorder(position: TableCellBorderPosition): this;
55
+ marginTop(v: number, t: WidthType): this;
56
+ marginLeft(v: number, t: WidthType): this;
57
+ marginRight(v: number, t: WidthType): this;
58
+ marginBottom(v: number, t: WidthType): this;
59
+ buildCellBorders(cell: wasm.TableCell): wasm.TableCell;
60
+ build(): wasm.TableCell;
61
+ }
@@ -0,0 +1,12 @@
1
+ import * as wasm from "./pkg/docx_wasm";
2
+ export declare class TableOfContentsItem {
3
+ _text: string;
4
+ _tocKey: string;
5
+ _level: number;
6
+ _pageRef: string;
7
+ text: (text: string) => this;
8
+ tocKey: (key: string) => this;
9
+ level: (l: number) => this;
10
+ pageRef: (r: string) => this;
11
+ buildWasmObject: () => wasm.TableOfContentsItem;
12
+ }
@@ -0,0 +1,46 @@
1
+ import { Paragraph } from "./paragraph";
2
+ import * as wasm from "./pkg";
3
+ import { Table } from "./table";
4
+ import { TableOfContentsItem } from "./table-of-contents-item";
5
+ import { ParagraphProperty } from "./paragraph-property";
6
+ export declare class TableOfContents {
7
+ _instrText?: string;
8
+ _headingStylesRange: [number, number] | null;
9
+ _styleWithLevels: {
10
+ styleId: string;
11
+ level: number;
12
+ }[];
13
+ _hyperlink: boolean;
14
+ _alias: string;
15
+ _auto: boolean;
16
+ _withoutSdt: boolean;
17
+ _dirty: boolean;
18
+ _items: TableOfContentsItem[];
19
+ _pageRefPlaceholder: string;
20
+ _beforeContents: (Paragraph | Table)[];
21
+ _afterContents: (Paragraph | Table)[];
22
+ _delete: {
23
+ author: string;
24
+ date: string;
25
+ } | null;
26
+ _paragraphProperty: ParagraphProperty | null;
27
+ _tcFieldIdentifier?: string | null;
28
+ constructor(instrText?: string);
29
+ addBeforeParagraph(p: Paragraph): this;
30
+ addBeforeTable(t: Table): this;
31
+ addAfterParagraph(p: Paragraph): this;
32
+ addAfterTable(t: Table): this;
33
+ headingStylesRange: (r: [number, number]) => this;
34
+ tcFieldIdentifier: (f?: string) => this;
35
+ addStyleWithLevel: (styleId: string, level: number) => this;
36
+ hyperlink: () => this;
37
+ alias: (alias: string) => this;
38
+ pageRefPlaceholder: (placeholder: string) => this;
39
+ auto: () => this;
40
+ dirty: () => this;
41
+ withoutSdt: () => this;
42
+ delete: (author: string, date: string) => this;
43
+ addItem: (item: TableOfContentsItem) => this;
44
+ paragraphProperty(p: ParagraphProperty): this;
45
+ buildWasmObject: () => wasm.TableOfContents;
46
+ }
@@ -0,0 +1,21 @@
1
+ import { TableCell } from "./table-cell";
2
+ export type HeightRule = "auto" | "atLeast" | "exact";
3
+ export declare class TableRow {
4
+ cells: TableCell[];
5
+ hasNumberings: boolean;
6
+ height: number | null;
7
+ hRule: HeightRule | null;
8
+ del: {
9
+ author: string;
10
+ date: string;
11
+ } | null;
12
+ ins: {
13
+ author: string;
14
+ date: string;
15
+ } | null;
16
+ addCell(cell: TableCell): this;
17
+ rowHeight(h: number): this;
18
+ heightRule(r: HeightRule): this;
19
+ delete(author: string, date: string): this;
20
+ insert(author: string, date: string): this;
21
+ }
@@ -0,0 +1,85 @@
1
+ import * as wasm from "./pkg";
2
+ import { WidthType } from ".";
3
+ import { TableRow } from "./table-row";
4
+ import { TablePositionProperty } from "./json/bindings/TablePositionProperty";
5
+ export { TablePositionProperty } from "./json/bindings/TablePositionProperty";
6
+ export type TableAlignmentType = "center" | "left" | "right";
7
+ export type TableLayoutType = "fixed" | "autofit";
8
+ export declare class TablePosition {
9
+ property: Partial<TablePositionProperty>;
10
+ leftFromText(n: number): this;
11
+ rightFromText(n: number): this;
12
+ verticalAnchor(n: string): this;
13
+ horizontalAnchor(n: string): this;
14
+ positionXAlignment(n: string): this;
15
+ positionYAlignment(n: string): this;
16
+ positionX(n: number): this;
17
+ positionY(n: number): this;
18
+ build(): wasm.TablePositionProperty;
19
+ }
20
+ export type TableProperty = {
21
+ indent?: number;
22
+ align?: TableAlignmentType;
23
+ width?: number;
24
+ styleId?: string;
25
+ cellMargins: {
26
+ top: {
27
+ val: number;
28
+ type: WidthType;
29
+ };
30
+ left: {
31
+ val: number;
32
+ type: WidthType;
33
+ };
34
+ bottom: {
35
+ val: number;
36
+ type: WidthType;
37
+ };
38
+ right: {
39
+ val: number;
40
+ type: WidthType;
41
+ };
42
+ };
43
+ layout?: TableLayoutType;
44
+ position?: TablePosition;
45
+ };
46
+ export declare const createDefaultTableCellMargins: () => {
47
+ readonly top: {
48
+ readonly val: 0;
49
+ readonly type: "dxa";
50
+ };
51
+ readonly left: {
52
+ readonly val: 55;
53
+ readonly type: "dxa";
54
+ };
55
+ readonly bottom: {
56
+ readonly val: 0;
57
+ readonly type: "dxa";
58
+ };
59
+ readonly right: {
60
+ readonly val: 55;
61
+ readonly type: "dxa";
62
+ };
63
+ };
64
+ export declare class Table {
65
+ hasNumberings: boolean;
66
+ rows: TableRow[];
67
+ grid: number[];
68
+ property: TableProperty;
69
+ addRow(row: TableRow): this;
70
+ style(id: string): this;
71
+ setGrid(grid: number[]): this;
72
+ indent(v: number): this;
73
+ align(v: TableAlignmentType): this;
74
+ layout(l: TableLayoutType): this;
75
+ width(w: number): this;
76
+ cellMargins(top: number, right: number, bottom: number, left: number): this;
77
+ cellMarginTop(v: number, t: WidthType): this;
78
+ cellMarginLeft(v: number, t: WidthType): this;
79
+ cellMarginRight(v: number, t: WidthType): this;
80
+ cellMarginBottom(v: number, t: WidthType): this;
81
+ position(p: TablePosition): this;
82
+ build(): wasm.Table;
83
+ }
84
+ export declare const convertWidthType: (t: string) => wasm.WidthType.Dxa | wasm.WidthType.Auto | wasm.WidthType.Pct | wasm.WidthType.Nil;
85
+ export declare const setTableProperty: <T extends wasm.Table | wasm.Style>(target: T, property: TableProperty) => T;
@@ -0,0 +1,10 @@
1
+ export declare class Tc {
2
+ _text: string;
3
+ _level?: number | undefined;
4
+ _omitPageNumber: boolean;
5
+ _identifier?: string | undefined;
6
+ constructor(t: string);
7
+ level(l: number): this;
8
+ omitPageNumber(): this;
9
+ identifier(id: string): this;
10
+ }
@@ -0,0 +1,4 @@
1
+ export declare class Text {
2
+ text: string;
3
+ constructor(text: string);
4
+ }