docx-wasm 0.0.249 → 0.0.252

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 (59) hide show
  1. package/dist/node/json/bindings/DrawingPosition.d.ts +6 -0
  2. package/dist/node/json/bindings/DrawingPosition.js +3 -0
  3. package/dist/node/json/bindings/DrawingPosition.js.map +1 -0
  4. package/dist/node/json/bindings/DrawingPositionType.d.ts +1 -0
  5. package/dist/node/json/bindings/DrawingPositionType.js +3 -0
  6. package/dist/node/json/bindings/DrawingPositionType.js.map +1 -0
  7. package/dist/node/json/bindings/Pic.d.ts +24 -0
  8. package/dist/node/json/bindings/Pic.js +3 -0
  9. package/dist/node/json/bindings/Pic.js.map +1 -0
  10. package/dist/node/json/bindings/PicAlign.d.ts +1 -0
  11. package/dist/node/json/bindings/PicAlign.js +3 -0
  12. package/dist/node/json/bindings/PicAlign.js.map +1 -0
  13. package/dist/node/json/bindings/RelativeFromHType.d.ts +1 -0
  14. package/dist/node/json/bindings/RelativeFromHType.js +3 -0
  15. package/dist/node/json/bindings/RelativeFromHType.js.map +1 -0
  16. package/dist/node/json/bindings/RelativeFromVType.d.ts +1 -0
  17. package/dist/node/json/bindings/RelativeFromVType.js +3 -0
  18. package/dist/node/json/bindings/RelativeFromVType.js.map +1 -0
  19. package/dist/node/json/drawing.d.ts +12 -2
  20. package/dist/node/json/index.d.ts +1 -0
  21. package/dist/node/json/index.js.map +1 -1
  22. package/dist/node/pkg/docx_wasm.d.ts +166 -92
  23. package/dist/node/pkg/docx_wasm.js +197 -142
  24. package/dist/node/pkg/docx_wasm_bg.wasm +0 -0
  25. package/dist/node/pkg/docx_wasm_bg.wasm.d.ts +86 -86
  26. package/dist/web/json/bindings/DrawingPosition.d.ts +6 -0
  27. package/dist/web/json/bindings/DrawingPosition.js +2 -0
  28. package/dist/web/json/bindings/DrawingPosition.js.map +1 -0
  29. package/dist/web/json/bindings/DrawingPositionType.d.ts +1 -0
  30. package/dist/web/json/bindings/DrawingPositionType.js +2 -0
  31. package/dist/web/json/bindings/DrawingPositionType.js.map +1 -0
  32. package/dist/web/json/bindings/Pic.d.ts +24 -0
  33. package/dist/web/json/bindings/Pic.js +2 -0
  34. package/dist/web/json/bindings/Pic.js.map +1 -0
  35. package/dist/web/json/bindings/PicAlign.d.ts +1 -0
  36. package/dist/web/json/bindings/PicAlign.js +2 -0
  37. package/dist/web/json/bindings/PicAlign.js.map +1 -0
  38. package/dist/web/json/bindings/RelativeFromHType.d.ts +1 -0
  39. package/dist/web/json/bindings/RelativeFromHType.js +2 -0
  40. package/dist/web/json/bindings/RelativeFromHType.js.map +1 -0
  41. package/dist/web/json/bindings/RelativeFromVType.d.ts +1 -0
  42. package/dist/web/json/bindings/RelativeFromVType.js +2 -0
  43. package/dist/web/json/bindings/RelativeFromVType.js.map +1 -0
  44. package/dist/web/json/drawing.d.ts +12 -2
  45. package/dist/web/json/index.d.ts +1 -0
  46. package/dist/web/json/index.js.map +1 -1
  47. package/dist/web/pkg/docx_wasm.d.ts +166 -92
  48. package/dist/web/pkg/docx_wasm_bg.js +197 -142
  49. package/dist/web/pkg/docx_wasm_bg.wasm +0 -0
  50. package/dist/web/pkg/docx_wasm_bg.wasm.d.ts +86 -86
  51. package/js/json/bindings/DrawingPosition.ts +3 -0
  52. package/js/json/bindings/DrawingPositionType.ts +2 -0
  53. package/js/json/bindings/Pic.ts +6 -0
  54. package/js/json/bindings/PicAlign.ts +2 -0
  55. package/js/json/bindings/RelativeFromHType.ts +2 -0
  56. package/js/json/bindings/RelativeFromVType.ts +2 -0
  57. package/js/json/drawing.ts +17 -5
  58. package/js/json/index.ts +2 -0
  59. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import type { PicAlign } from "./PicAlign";
2
+ export declare type DrawingPosition = {
3
+ offset: number;
4
+ } | {
5
+ align: PicAlign;
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DrawingPosition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingPosition.js","sourceRoot":"","sources":["../../../../js/json/bindings/DrawingPosition.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type DrawingPositionType = "anchor" | "inline";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DrawingPositionType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingPositionType.js","sourceRoot":"","sources":["../../../../js/json/bindings/DrawingPositionType.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import type { DrawingPosition } from "./DrawingPosition";
2
+ import type { DrawingPositionType } from "./DrawingPositionType";
3
+ import type { RelativeFromHType } from "./RelativeFromHType";
4
+ import type { RelativeFromVType } from "./RelativeFromVType";
5
+ export interface Pic {
6
+ id: string;
7
+ image: Array<number>;
8
+ size: [number, number];
9
+ positionType: DrawingPositionType;
10
+ simplePos: boolean;
11
+ simplePosX: number;
12
+ simplePosY: number;
13
+ layoutInCell: boolean;
14
+ relativeHeight: number;
15
+ allowOverlap: boolean;
16
+ positionH: DrawingPosition;
17
+ positionV: DrawingPosition;
18
+ relativeFromH: RelativeFromHType;
19
+ relativeFromV: RelativeFromVType;
20
+ distT: number;
21
+ distB: number;
22
+ distL: number;
23
+ distR: number;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Pic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pic.js","sourceRoot":"","sources":["../../../../js/json/bindings/Pic.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type PicAlign = "left" | "right" | "bottom" | "top";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PicAlign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PicAlign.js","sourceRoot":"","sources":["../../../../js/json/bindings/PicAlign.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type RelativeFromHType = "character" | "column" | "insideMargin" | "leftMargin" | "margin" | "outsizeMargin" | "page" | "rightMargin";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=RelativeFromHType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelativeFromHType.js","sourceRoot":"","sources":["../../../../js/json/bindings/RelativeFromHType.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type RelativeFromVType = "bottomMargin" | "insideMargin" | "line" | "margin" | "outsizeMargin" | "page" | "paragraph" | "topMargin";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=RelativeFromVType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelativeFromVType.js","sourceRoot":"","sources":["../../../../js/json/bindings/RelativeFromVType.ts"],"names":[],"mappings":""}
@@ -1,11 +1,21 @@
1
1
  import { TextBoxContentJSON } from "./textbox-content";
2
+ import { Pic as InnerPic } from "./bindings/Pic";
3
+ import { ParagraphJSON, TableJSON } from "..";
4
+ export interface Pic extends Omit<InnerPic, "image"> {
5
+ image: string;
6
+ }
2
7
  export declare type DrawingJSON = {
3
8
  type: "drawing";
4
9
  data: {
5
- children: DrawingChildJSON[];
10
+ type: "pic";
11
+ data: Pic;
12
+ } | {
13
+ type: "textBox";
14
+ data: {
15
+ children: (ParagraphJSON | TableJSON)[];
16
+ };
6
17
  };
7
18
  };
8
- export declare type DrawingChildJSON = WpAnchorJSON;
9
19
  export declare type WpAnchorJSON = {
10
20
  type: "anchor";
11
21
  data: {
@@ -45,6 +45,7 @@ export declare type DocxJSON = {
45
45
  webSettings: WebSettingsJSON;
46
46
  fontTable: {};
47
47
  themes: ThemeJSON[];
48
+ images: string[];
48
49
  };
49
50
  export declare type SettingsJSON = {
50
51
  docId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/json/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA2DA,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,iDAA+B;AAC/B,4CAA0B;AAC1B,oDAAkC;AAClC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/json/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA6DA,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,iDAA+B;AAC/B,4CAA0B;AAC1B,oDAAkC;AAClC,qDAAmC"}
@@ -1,6 +1,43 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * @param {Uint8Array} buf
5
+ * @returns {string}
6
+ */
7
+ export function readDocx(buf: Uint8Array): string;
8
+ /**
9
+ * @returns {RunFonts}
10
+ */
11
+ export function createRunFonts(): RunFonts;
12
+ /**
13
+ * @returns {TableOfContents}
14
+ */
15
+ export function createTableOfContents(): TableOfContents;
16
+ /**
17
+ * @param {number} id
18
+ * @returns {AbstractNumbering}
19
+ */
20
+ export function createAbstractNumbering(id: number): AbstractNumbering;
21
+ /**
22
+ * @returns {Footer}
23
+ */
24
+ export function createFooter(): Footer;
25
+ /**
26
+ * @returns {Header}
27
+ */
28
+ export function createHeader(): Header;
29
+ /**
30
+ * @param {Run} run
31
+ * @returns {Insert}
32
+ */
33
+ export function createInsert(run: Run): Insert;
34
+ /**
35
+ * @param {number} id
36
+ * @param {number} abstract_num_id
37
+ * @returns {Numbering}
38
+ */
39
+ export function createNumbering(id: number, abstract_num_id: number): Numbering;
40
+ /**
4
41
  * @param {number} id
5
42
  * @param {number} start
6
43
  * @param {string} format
@@ -23,26 +60,17 @@ export function createComment(id: number): Comment;
23
60
  */
24
61
  export function createTableCell(): TableCell;
25
62
  /**
26
- * @returns {TableOfContentsItem}
27
- */
28
- export function createTableOfContentsItem(): TableOfContentsItem;
29
- /**
30
63
  * @returns {Hyperlink}
31
64
  */
32
65
  export function createHyperlink(): Hyperlink;
33
66
  /**
34
- * @param {Uint8Array} buf
35
- * @returns {string}
36
- */
37
- export function readDocx(buf: Uint8Array): string;
38
- /**
39
- * @returns {RunFonts}
67
+ * @returns {TableOfContentsItem}
40
68
  */
41
- export function createRunFonts(): RunFonts;
69
+ export function createTableOfContentsItem(): TableOfContentsItem;
42
70
  /**
43
- * @returns {TableOfContents}
71
+ * @returns {Run}
44
72
  */
45
- export function createTableOfContents(): TableOfContents;
73
+ export function createRun(): Run;
46
74
  /**
47
75
  * @param {string} id
48
76
  * @param {string} reference_id
@@ -69,74 +97,60 @@ export function createDocx(): Docx;
69
97
  */
70
98
  export function createPageMargin(): PageMargin;
71
99
  /**
72
- * @returns {Run}
100
+ * @param {Run} run
101
+ * @returns {Delete}
73
102
  */
74
- export function createRun(): Run;
103
+ export function createDelete(run: Run): Delete;
75
104
  /**
76
105
  * @param {number} level
77
106
  * @returns {LevelOverride}
78
107
  */
79
108
  export function createLevelOverride(level: number): LevelOverride;
80
109
  /**
81
- * @param {string} style_id
82
- * @param {number} style_type
83
- * @returns {Style}
84
- */
85
- export function createStyle(style_id: string, style_type: number): Style;
86
- /**
87
- * @param {Run} run
88
- * @returns {Delete}
89
- */
90
- export function createDelete(run: Run): Delete;
91
- /**
92
- * @param {Run} run
93
- * @returns {Insert}
110
+ * @returns {TableRow}
94
111
  */
95
- export function createInsert(run: Run): Insert;
112
+ export function createTableRow(): TableRow;
96
113
  /**
97
114
  * @returns {LineSpacing}
98
115
  */
99
116
  export function createLineSpacing(): LineSpacing;
100
117
  /**
118
+ * @param {string} style_id
119
+ * @param {number} style_type
120
+ * @returns {Style}
121
+ */
122
+ export function createStyle(style_id: string, style_type: number): Style;
123
+ /**
101
124
  * @param {number} position
102
125
  * @returns {TableCellBorder}
103
126
  */
104
127
  export function createTableCellBorder(position: number): TableCellBorder;
105
128
  /**
106
- * @returns {TableRow}
107
129
  */
108
- export function createTableRow(): TableRow;
109
- /**
110
- * @param {number} id
111
- * @returns {AbstractNumbering}
112
- */
113
- export function createAbstractNumbering(id: number): AbstractNumbering;
114
- /**
115
- * @returns {Footer}
116
- */
117
- export function createFooter(): Footer;
130
+ export enum DrawingPositionType {
131
+ Anchor,
132
+ Inline,
133
+ }
118
134
  /**
119
- * @returns {Header}
120
135
  */
121
- export function createHeader(): Header;
122
- /**
123
- * @param {number} id
124
- * @param {number} abstract_num_id
125
- * @returns {Numbering}
126
- */
127
- export function createNumbering(id: number, abstract_num_id: number): Numbering;
136
+ export enum PicAlign {
137
+ Left,
138
+ Right,
139
+ Bottom,
140
+ Top,
141
+ }
128
142
  /**
129
143
  */
130
- export enum PageOrientationType {
131
- Landscape,
132
- Portrait,
144
+ export enum SpecialIndentKind {
145
+ FirstLine,
146
+ Hanging,
133
147
  }
134
148
  /**
135
149
  */
136
- export enum TableAlignmentType {
137
- Center,
138
- Left,
139
- Right,
150
+ export enum VMergeType {
151
+ Continue,
152
+ Restart,
153
+ Unsupported,
140
154
  }
141
155
  /**
142
156
  */
@@ -201,12 +215,6 @@ export enum LevelSuffixType {
201
215
  }
202
216
  /**
203
217
  */
204
- export enum SpecialIndentKind {
205
- FirstLine,
206
- Hanging,
207
- }
208
- /**
209
- */
210
218
  export enum TabLeaderType {
211
219
  Dot,
212
220
  Heavy,
@@ -217,17 +225,9 @@ export enum TabLeaderType {
217
225
  }
218
226
  /**
219
227
  */
220
- export enum VMergeType {
221
- Continue,
222
- Restart,
223
- Unsupported,
224
- }
225
- /**
226
- */
227
- export enum FontPitchType {
228
- Default,
229
- Fixed,
230
- Variable,
228
+ export enum PageOrientationType {
229
+ Landscape,
230
+ Portrait,
231
231
  }
232
232
  /**
233
233
  */
@@ -240,6 +240,20 @@ export enum SectionType {
240
240
  }
241
241
  /**
242
242
  */
243
+ export enum TableAlignmentType {
244
+ Center,
245
+ Left,
246
+ Right,
247
+ }
248
+ /**
249
+ */
250
+ export enum FontPitchType {
251
+ Default,
252
+ Fixed,
253
+ Variable,
254
+ }
255
+ /**
256
+ */
243
257
  export enum WidthType {
244
258
  Dxa,
245
259
  Auto,
@@ -271,6 +285,66 @@ export enum TableCellBorderPosition {
271
285
  }
272
286
  /**
273
287
  */
288
+ export enum RelativeFromHType {
289
+ /**
290
+ * Specifies that the horizontal positioning shall be
291
+ * relative to the position of the anchor within its run
292
+ * content.
293
+ */
294
+ Character,
295
+ /**
296
+ * Specifies that the horizontal positioning shall be
297
+ * relative to the extents of the column which contains its
298
+ * anchor.
299
+ */
300
+ Column,
301
+ /**
302
+ * Specifies that the horizontal positioning shall be
303
+ * relative to the inside margin of the current page (the
304
+ * left margin on odd pages, right on even pages).
305
+ */
306
+ InsideMargin,
307
+ /**
308
+ * Specifies that the horizontal positioning shall be
309
+ * relative to the left margin of the page.
310
+ */
311
+ LeftMargin,
312
+ /**
313
+ * Specifies that the horizontal positioning shall be
314
+ * relative to the page margins.
315
+ */
316
+ Margin,
317
+ /**
318
+ * Specifies that the horizontal positioning shall be
319
+ * relative to the outside margin of the current page (the
320
+ * right margin on odd pages, left on even pages).
321
+ */
322
+ OutsizeMargin,
323
+ /**
324
+ * Specifies that the horizontal positioning shall be
325
+ * relative to the edge of the page.
326
+ */
327
+ Page,
328
+ /**
329
+ * Specifies that the horizontal positioning shall be
330
+ * relative to the right margin of the page.
331
+ */
332
+ RightMargin,
333
+ }
334
+ /**
335
+ */
336
+ export enum RelativeFromVType {
337
+ BottomMargin,
338
+ InsideMargin,
339
+ Line,
340
+ Margin,
341
+ OutsizeMargin,
342
+ Page,
343
+ Paragraph,
344
+ TopMargin,
345
+ }
346
+ /**
347
+ */
274
348
  export enum StyleType {
275
349
  Paragraph,
276
350
  Character,
@@ -294,14 +368,6 @@ export enum DocGridType {
294
368
  }
295
369
  /**
296
370
  */
297
- export enum FieldCharType {
298
- Begin,
299
- Separate,
300
- End,
301
- Unsupported,
302
- }
303
- /**
304
- */
305
371
  export enum TabValueType {
306
372
  Bar,
307
373
  Center,
@@ -315,6 +381,21 @@ export enum TabValueType {
315
381
  }
316
382
  /**
317
383
  */
384
+ export enum FieldCharType {
385
+ Begin,
386
+ Separate,
387
+ End,
388
+ Unsupported,
389
+ }
390
+ /**
391
+ */
392
+ export enum LineSpacingType {
393
+ Auto,
394
+ AtLeast,
395
+ Exact,
396
+ }
397
+ /**
398
+ */
318
399
  export enum ShdType {
319
400
  Nil,
320
401
  Clear,
@@ -379,10 +460,11 @@ export enum BreakType {
379
460
  }
380
461
  /**
381
462
  */
382
- export enum LineSpacingType {
383
- Auto,
384
- AtLeast,
385
- Exact,
463
+ export enum VAlignType {
464
+ Top,
465
+ Center,
466
+ Bottom,
467
+ Unsupported,
386
468
  }
387
469
  /**
388
470
  */
@@ -394,14 +476,6 @@ export enum VertAlignType {
394
476
  }
395
477
  /**
396
478
  */
397
- export enum VAlignType {
398
- Top,
399
- Center,
400
- Bottom,
401
- Unsupported,
402
- }
403
- /**
404
- */
405
479
  export class AbstractNumbering {
406
480
  free(): void;
407
481
  /**