docx-wasm 0.0.249 → 0.0.250

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 +1 -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 +177 -103
  23. package/dist/node/pkg/docx_wasm.js +199 -144
  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 +1 -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 +177 -103
  48. package/dist/web/pkg/docx_wasm_bg.js +199 -144
  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 +1 -3
  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":""}
@@ -2,10 +2,9 @@ import { TextBoxContentJSON } from "./textbox-content";
2
2
  export declare type DrawingJSON = {
3
3
  type: "drawing";
4
4
  data: {
5
- children: DrawingChildJSON[];
5
+ type: "pic";
6
6
  };
7
7
  };
8
- export declare type DrawingChildJSON = WpAnchorJSON;
9
8
  export declare type WpAnchorJSON = {
10
9
  type: "anchor";
11
10
  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,67 +97,53 @@ 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;
118
- /**
119
- * @returns {Header}
120
- */
121
- export function createHeader(): Header;
130
+ export enum DrawingPositionType {
131
+ Anchor,
132
+ Inline,
133
+ }
122
134
  /**
123
- * @param {number} id
124
- * @param {number} abstract_num_id
125
- * @returns {Numbering}
126
135
  */
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
  */
@@ -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,
@@ -224,10 +232,9 @@ export enum VMergeType {
224
232
  }
225
233
  /**
226
234
  */
227
- export enum FontPitchType {
228
- Default,
229
- Fixed,
230
- Variable,
235
+ export enum PageOrientationType {
236
+ Landscape,
237
+ Portrait,
231
238
  }
232
239
  /**
233
240
  */
@@ -240,15 +247,6 @@ export enum SectionType {
240
247
  }
241
248
  /**
242
249
  */
243
- export enum WidthType {
244
- Dxa,
245
- Auto,
246
- Pct,
247
- Nil,
248
- Unsupported,
249
- }
250
- /**
251
- */
252
250
  export enum TableBorderPosition {
253
251
  Left,
254
252
  Right,
@@ -271,6 +269,13 @@ export enum TableCellBorderPosition {
271
269
  }
272
270
  /**
273
271
  */
272
+ export enum FontPitchType {
273
+ Default,
274
+ Fixed,
275
+ Variable,
276
+ }
277
+ /**
278
+ */
274
279
  export enum StyleType {
275
280
  Paragraph,
276
281
  Character,
@@ -286,6 +291,75 @@ export enum TableLayoutType {
286
291
  }
287
292
  /**
288
293
  */
294
+ export enum WidthType {
295
+ Dxa,
296
+ Auto,
297
+ Pct,
298
+ Nil,
299
+ Unsupported,
300
+ }
301
+ /**
302
+ */
303
+ export enum RelativeFromHType {
304
+ /**
305
+ * Specifies that the horizontal positioning shall be
306
+ * relative to the position of the anchor within its run
307
+ * content.
308
+ */
309
+ Character,
310
+ /**
311
+ * Specifies that the horizontal positioning shall be
312
+ * relative to the extents of the column which contains its
313
+ * anchor.
314
+ */
315
+ Column,
316
+ /**
317
+ * Specifies that the horizontal positioning shall be
318
+ * relative to the inside margin of the current page (the
319
+ * left margin on odd pages, right on even pages).
320
+ */
321
+ InsideMargin,
322
+ /**
323
+ * Specifies that the horizontal positioning shall be
324
+ * relative to the left margin of the page.
325
+ */
326
+ LeftMargin,
327
+ /**
328
+ * Specifies that the horizontal positioning shall be
329
+ * relative to the page margins.
330
+ */
331
+ Margin,
332
+ /**
333
+ * Specifies that the horizontal positioning shall be
334
+ * relative to the outside margin of the current page (the
335
+ * right margin on odd pages, left on even pages).
336
+ */
337
+ OutsizeMargin,
338
+ /**
339
+ * Specifies that the horizontal positioning shall be
340
+ * relative to the edge of the page.
341
+ */
342
+ Page,
343
+ /**
344
+ * Specifies that the horizontal positioning shall be
345
+ * relative to the right margin of the page.
346
+ */
347
+ RightMargin,
348
+ }
349
+ /**
350
+ */
351
+ export enum RelativeFromVType {
352
+ BottomMargin,
353
+ InsideMargin,
354
+ Line,
355
+ Margin,
356
+ OutsizeMargin,
357
+ Page,
358
+ Paragraph,
359
+ TopMargin,
360
+ }
361
+ /**
362
+ */
289
363
  export enum DocGridType {
290
364
  Default,
291
365
  Lines,
@@ -315,6 +389,35 @@ export enum TabValueType {
315
389
  }
316
390
  /**
317
391
  */
392
+ export enum TextDirectionType {
393
+ Lr,
394
+ LrV,
395
+ Rl,
396
+ RlV,
397
+ Tb,
398
+ TbV,
399
+ TbRlV,
400
+ TbRl,
401
+ BtLr,
402
+ LrTbV,
403
+ }
404
+ /**
405
+ */
406
+ export enum BreakType {
407
+ Page,
408
+ Column,
409
+ TextWrapping,
410
+ Unsupported,
411
+ }
412
+ /**
413
+ */
414
+ export enum LineSpacingType {
415
+ Auto,
416
+ AtLeast,
417
+ Exact,
418
+ }
419
+ /**
420
+ */
318
421
  export enum ShdType {
319
422
  Nil,
320
423
  Clear,
@@ -357,35 +460,14 @@ export enum ShdType {
357
460
  }
358
461
  /**
359
462
  */
360
- export enum TextDirectionType {
361
- Lr,
362
- LrV,
363
- Rl,
364
- RlV,
365
- Tb,
366
- TbV,
367
- TbRlV,
368
- TbRl,
369
- BtLr,
370
- LrTbV,
371
- }
372
- /**
373
- */
374
- export enum BreakType {
375
- Page,
376
- Column,
377
- TextWrapping,
463
+ export enum VAlignType {
464
+ Top,
465
+ Center,
466
+ Bottom,
378
467
  Unsupported,
379
468
  }
380
469
  /**
381
470
  */
382
- export enum LineSpacingType {
383
- Auto,
384
- AtLeast,
385
- Exact,
386
- }
387
- /**
388
- */
389
471
  export enum VertAlignType {
390
472
  Baseline,
391
473
  SuperScript,
@@ -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
  /**