docx-wasm 0.4.18-rc27 → 0.4.18-rc28

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.
@@ -90,5 +90,5 @@ export declare class ParagraphPropertyChange {
90
90
  numbering(id: number, level: number): this;
91
91
  }
92
92
  export declare const buildLineSpacing: (p: ParagraphProperty) => wasm.LineSpacing | null;
93
- export declare const setParagraphProperty: <T extends wasm.Style | wasm.Paragraph>(target: T, property: ParagraphProperty) => T;
93
+ export declare const setParagraphProperty: <T extends wasm.Paragraph | wasm.Style>(target: T, property: ParagraphProperty) => T;
94
94
  export declare const createParagraphProperty: (property: ParagraphProperty) => wasm.ParagraphProperty;
@@ -6,54 +6,49 @@
6
6
  */
7
7
  export function createPic(buf: Uint8Array): Pic;
8
8
  /**
9
- * @param {number} id
10
- * @returns {Comment}
11
- */
12
- export function createComment(id: number): Comment;
13
- /**
14
- * @param {number} alignment
15
- * @param {number} relative_to
16
- * @param {number} leader
17
- * @returns {PositionalTab}
9
+ * @returns {Docx}
18
10
  */
19
- export function createPositionalTab(alignment: number, relative_to: number, leader: number): PositionalTab;
11
+ export function createDocx(): Docx;
20
12
  /**
21
- * @param {string} style_id
22
- * @param {number} style_type
23
- * @returns {Style}
13
+ * @returns {LineSpacing}
24
14
  */
25
- export function createStyle(style_id: string, style_type: number): Style;
15
+ export function createLineSpacing(): LineSpacing;
26
16
  /**
27
- * @returns {NumPages}
17
+ * @returns {FrameProperty}
28
18
  */
29
- export function createNumPages(): NumPages;
19
+ export function createFrameProperty(): FrameProperty;
30
20
  /**
31
- * @returns {ParagraphPropertyChange}
21
+ * @param {number} id
22
+ * @param {number} start
23
+ * @param {string} format
24
+ * @param {string} text
25
+ * @param {string} jc
26
+ * @returns {Level}
32
27
  */
33
- export function createParagraphPropertyChange(): ParagraphPropertyChange;
28
+ export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
34
29
  /**
35
- * @returns {ParagraphProperty}
30
+ * @param {number} level
31
+ * @returns {LevelOverride}
36
32
  */
37
- export function createParagraphProperty(): ParagraphProperty;
33
+ export function createLevelOverride(level: number): LevelOverride;
38
34
  /**
39
- * @returns {TableCell}
35
+ * @returns {RunFonts}
40
36
  */
41
- export function createTableCell(): TableCell;
37
+ export function createRunFonts(): RunFonts;
42
38
  /**
43
- * @param {number} position
44
- * @returns {TableCellBorder}
39
+ * @returns {TablePositionProperty}
45
40
  */
46
- export function createTableCellBorder(position: number): TableCellBorder;
41
+ export function createTablePosition(): TablePositionProperty;
47
42
  /**
48
- * @returns {PageMargin}
43
+ * @param {string} v
44
+ * @param {number} t
45
+ * @returns {Hyperlink}
49
46
  */
50
- export function createPageMargin(): PageMargin;
47
+ export function createHyperlink(v: string, t: number): Hyperlink;
51
48
  /**
52
- * @param {number} id
53
- * @param {number} abstract_num_id
54
- * @returns {Numbering}
49
+ * @returns {NumPages}
55
50
  */
56
- export function createNumbering(id: number, abstract_num_id: number): Numbering;
51
+ export function createNumPages(): NumPages;
57
52
  /**
58
53
  * @param {number | undefined} start
59
54
  * @param {string | undefined} chap_style
@@ -65,6 +60,22 @@ export function createPageNumType(start?: number, chap_style?: string): PageNumT
65
60
  */
66
61
  export function createParagraph(): Paragraph;
67
62
  /**
63
+ * @returns {Footer}
64
+ */
65
+ export function createFooter(): Footer;
66
+ /**
67
+ * @returns {ParagraphPropertyChange}
68
+ */
69
+ export function createParagraphPropertyChange(): ParagraphPropertyChange;
70
+ /**
71
+ * @returns {ParagraphProperty}
72
+ */
73
+ export function createParagraphProperty(): ParagraphProperty;
74
+ /**
75
+ * @returns {TableCell}
76
+ */
77
+ export function createTableCell(): TableCell;
78
+ /**
68
79
  * @param {string} id
69
80
  * @param {string} reference_id
70
81
  * @param {string} version
@@ -79,145 +90,121 @@ export function createWebExtension(id: string, reference_id: string, version: st
79
90
  */
80
91
  export function createAbstractNumbering(id: number): AbstractNumbering;
81
92
  /**
82
- * @returns {PageNum}
83
- */
84
- export function createPageNum(): PageNum;
85
- /**
86
- * @param {Uint8Array} buf
87
- * @returns {string}
88
- */
89
- export function readDocx(buf: Uint8Array): string;
90
- /**
91
- * @param {string} v
92
- * @param {number} t
93
- * @returns {Hyperlink}
94
- */
95
- export function createHyperlink(v: string, t: number): Hyperlink;
96
- /**
97
- * @param {Run} run
98
- * @returns {Insert}
99
- */
100
- export function createInsert(run: Run): Insert;
101
- /**
102
- * @returns {LineSpacing}
93
+ * @param {number} id
94
+ * @param {number} abstract_num_id
95
+ * @returns {Numbering}
103
96
  */
104
- export function createLineSpacing(): LineSpacing;
97
+ export function createNumbering(id: number, abstract_num_id: number): Numbering;
105
98
  /**
106
- * @returns {TableOfContents}
99
+ * @returns {Run}
107
100
  */
108
- export function createTableOfContents(): TableOfContents;
101
+ export function createRun(): Run;
109
102
  /**
110
- * @param {string} s
111
- * @returns {TableOfContents}
103
+ * @returns {Table}
112
104
  */
113
- export function createTableOfContentsWithInstrText(s: string): TableOfContents;
105
+ export function createTable(): Table;
114
106
  /**
115
- * @returns {TableOfContentsItem}
107
+ * @param {number} position
108
+ * @returns {TableCellBorder}
116
109
  */
117
- export function createTableOfContentsItem(): TableOfContentsItem;
110
+ export function createTableCellBorder(position: number): TableCellBorder;
118
111
  /**
119
112
  * @returns {TableRow}
120
113
  */
121
114
  export function createTableRow(): TableRow;
122
115
  /**
123
- * @param {Run} run
124
- * @returns {Delete}
125
- */
126
- export function createDelete(run: Run): Delete;
127
- /**
128
- * @returns {FrameProperty}
129
- */
130
- export function createFrameProperty(): FrameProperty;
131
- /**
132
116
  * @returns {Header}
133
117
  */
134
118
  export function createHeader(): Header;
135
119
  /**
136
- * @param {number} id
137
- * @param {number} start
138
- * @param {string} format
139
- * @param {string} text
140
- * @param {string} jc
141
- * @returns {Level}
120
+ * @returns {PageNum}
142
121
  */
143
- export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
122
+ export function createPageNum(): PageNum;
144
123
  /**
145
- * @param {number} level
146
- * @returns {LevelOverride}
124
+ * @param {number} alignment
125
+ * @param {number} relative_to
126
+ * @param {number} leader
127
+ * @returns {PositionalTab}
147
128
  */
148
- export function createLevelOverride(level: number): LevelOverride;
129
+ export function createPositionalTab(alignment: number, relative_to: number, leader: number): PositionalTab;
149
130
  /**
150
- * @returns {Table}
131
+ * @param {string} style_id
132
+ * @param {number} style_type
133
+ * @returns {Style}
151
134
  */
152
- export function createTable(): Table;
135
+ export function createStyle(style_id: string, style_type: number): Style;
153
136
  /**
154
- * @returns {Run}
137
+ * @param {number} id
138
+ * @returns {Comment}
155
139
  */
156
- export function createRun(): Run;
140
+ export function createComment(id: number): Comment;
157
141
  /**
158
- * @returns {RunFonts}
142
+ * @param {Run} run
143
+ * @returns {Delete}
159
144
  */
160
- export function createRunFonts(): RunFonts;
145
+ export function createDelete(run: Run): Delete;
161
146
  /**
162
147
  * @returns {RunProperty}
163
148
  */
164
149
  export function createRunProperty(): RunProperty;
165
150
  /**
166
- * @returns {TablePositionProperty}
151
+ * @returns {TableOfContents}
167
152
  */
168
- export function createTablePosition(): TablePositionProperty;
153
+ export function createTableOfContents(): TableOfContents;
169
154
  /**
170
- * @returns {Docx}
155
+ * @param {string} s
156
+ * @returns {TableOfContents}
171
157
  */
172
- export function createDocx(): Docx;
158
+ export function createTableOfContentsWithInstrText(s: string): TableOfContents;
173
159
  /**
174
- * @returns {Footer}
160
+ * @returns {TableOfContentsItem}
175
161
  */
176
- export function createFooter(): Footer;
162
+ export function createTableOfContentsItem(): TableOfContentsItem;
177
163
  /**
164
+ * @param {Run} run
165
+ * @returns {Insert}
178
166
  */
179
- export enum AlignmentType {
180
- Both,
181
- Center,
182
- Distribute,
183
- Start,
184
- End,
185
- Left,
186
- Right,
187
- Justified,
188
- }
167
+ export function createInsert(run: Run): Insert;
189
168
  /**
169
+ * @param {Uint8Array} buf
170
+ * @returns {string}
190
171
  */
191
- export enum PageOrientationType {
192
- Landscape,
193
- Portrait,
194
- }
172
+ export function readDocx(buf: Uint8Array): string;
195
173
  /**
174
+ * @returns {PageMargin}
196
175
  */
197
- export enum PositionalTabAlignmentType {
198
- Center,
176
+ export function createPageMargin(): PageMargin;
177
+ /**
178
+ */
179
+ export enum TableBorderPosition {
199
180
  Left,
200
181
  Right,
182
+ Top,
183
+ Bottom,
184
+ InsideH,
185
+ InsideV,
201
186
  }
202
187
  /**
203
188
  */
204
- export enum TabValueType {
205
- Bar,
206
- Center,
207
- Clear,
208
- Decimal,
209
- End,
210
- Right,
211
- Num,
212
- Start,
189
+ export enum TableCellBorderPosition {
213
190
  Left,
191
+ Right,
192
+ Top,
193
+ Bottom,
194
+ InsideH,
195
+ InsideV,
196
+ Tl2br,
197
+ Tr2bl,
214
198
  }
215
199
  /**
216
200
  */
217
- export enum VMergeType {
218
- Continue,
219
- Restart,
220
- Unsupported,
201
+ export enum ParagraphBorderPosition {
202
+ Left,
203
+ Right,
204
+ Top,
205
+ Bottom,
206
+ Between,
207
+ Bar,
221
208
  }
222
209
  /**
223
210
  */
@@ -229,9 +216,24 @@ export enum CharacterSpacingValues {
229
216
  }
230
217
  /**
231
218
  */
232
- export enum PositionalTabRelativeTo {
233
- Indent,
234
- Margin,
219
+ export enum HeightRule {
220
+ Auto,
221
+ AtLeast,
222
+ Exact,
223
+ }
224
+ /**
225
+ */
226
+ export enum LevelSuffixType {
227
+ Nothing,
228
+ Space,
229
+ Tab,
230
+ }
231
+ /**
232
+ */
233
+ export enum LineSpacingType {
234
+ Auto,
235
+ AtLeast,
236
+ Exact,
235
237
  }
236
238
  /**
237
239
  */
@@ -295,12 +297,6 @@ export enum RelativeFromVType {
295
297
  }
296
298
  /**
297
299
  */
298
- export enum SpecialIndentKind {
299
- FirstLine,
300
- Hanging,
301
- }
302
- /**
303
- */
304
300
  export enum StyleType {
305
301
  Paragraph,
306
302
  Character,
@@ -310,22 +306,6 @@ export enum StyleType {
310
306
  }
311
307
  /**
312
308
  */
313
- export enum WidthType {
314
- Dxa,
315
- Auto,
316
- Pct,
317
- Nil,
318
- Unsupported,
319
- }
320
- /**
321
- */
322
- export enum LevelSuffixType {
323
- Nothing,
324
- Space,
325
- Tab,
326
- }
327
- /**
328
- */
329
309
  export enum TableAlignmentType {
330
310
  Center,
331
311
  Left,
@@ -333,31 +313,12 @@ export enum TableAlignmentType {
333
313
  }
334
314
  /**
335
315
  */
336
- export enum HeightRule {
337
- Auto,
338
- AtLeast,
339
- Exact,
340
- }
341
- /**
342
- */
343
- export enum LineSpacingType {
316
+ export enum TextAlignmentType {
344
317
  Auto,
345
- AtLeast,
346
- Exact,
347
- }
348
- /**
349
- */
350
- export enum TextDirectionType {
351
- Lr,
352
- LrV,
353
- Rl,
354
- RlV,
355
- Tb,
356
- TbV,
357
- TbRlV,
358
- TbRl,
359
- BtLr,
360
- LrTbV,
318
+ Baseline,
319
+ Bottom,
320
+ Center,
321
+ Top,
361
322
  }
362
323
  /**
363
324
  */
@@ -369,42 +330,23 @@ export enum VertAlignType {
369
330
  }
370
331
  /**
371
332
  */
372
- export enum TableBorderPosition {
373
- Left,
374
- Right,
375
- Top,
376
- Bottom,
377
- InsideH,
378
- InsideV,
379
- }
380
- /**
381
- */
382
- export enum TableCellBorderPosition {
383
- Left,
384
- Right,
385
- Top,
386
- Bottom,
387
- InsideH,
388
- InsideV,
389
- Tl2br,
390
- Tr2bl,
333
+ export enum DocGridType {
334
+ Default,
335
+ Lines,
336
+ LinesAndChars,
337
+ SnapToChars,
391
338
  }
392
339
  /**
393
340
  */
394
- export enum ParagraphBorderPosition {
395
- Left,
396
- Right,
397
- Top,
398
- Bottom,
399
- Between,
400
- Bar,
341
+ export enum PageOrientationType {
342
+ Landscape,
343
+ Portrait,
401
344
  }
402
345
  /**
403
346
  */
404
- export enum FontPitchType {
405
- Default,
406
- Fixed,
407
- Variable,
347
+ export enum PositionalTabRelativeTo {
348
+ Indent,
349
+ Margin,
408
350
  }
409
351
  /**
410
352
  */
@@ -417,66 +359,61 @@ export enum SectionType {
417
359
  }
418
360
  /**
419
361
  */
420
- export enum TabLeaderType {
421
- Dot,
422
- Heavy,
423
- Hyphen,
424
- MiddleDot,
425
- None,
426
- Underscore,
427
- }
428
- /**
429
- */
430
- export enum TextAlignmentType {
431
- Auto,
432
- Baseline,
433
- Bottom,
434
- Center,
362
+ export enum VAlignType {
435
363
  Top,
364
+ Center,
365
+ Bottom,
366
+ Unsupported,
436
367
  }
437
368
  /**
438
369
  */
439
- export enum BreakType {
440
- Page,
441
- Column,
442
- TextWrapping,
370
+ export enum WidthType {
371
+ Dxa,
372
+ Auto,
373
+ Pct,
374
+ Nil,
443
375
  Unsupported,
444
376
  }
445
377
  /**
446
378
  */
447
- export enum DocGridType {
448
- Default,
449
- Lines,
450
- LinesAndChars,
451
- SnapToChars,
379
+ export enum HyperlinkType {
380
+ Anchor,
381
+ External,
452
382
  }
453
383
  /**
454
384
  */
455
- export enum TableLayoutType {
456
- Fixed,
457
- Autofit,
385
+ export enum PositionalTabAlignmentType {
386
+ Center,
387
+ Left,
388
+ Right,
458
389
  }
459
390
  /**
460
391
  */
461
- export enum VAlignType {
462
- Top,
463
- Center,
464
- Bottom,
465
- Unsupported,
392
+ export enum TabLeaderType {
393
+ Dot,
394
+ Heavy,
395
+ Hyphen,
396
+ MiddleDot,
397
+ None,
398
+ Underscore,
466
399
  }
467
400
  /**
468
401
  */
469
- export enum FieldCharType {
470
- Begin,
471
- Separate,
472
- End,
473
- Unsupported,
402
+ export enum SpecialIndentKind {
403
+ FirstLine,
404
+ Hanging,
474
405
  }
475
406
  /**
476
407
  */
477
- export enum HyperlinkType {
478
- Anchor,
479
- External,
408
+ export enum AlignmentType {
409
+ Both,
410
+ Center,
411
+ Distribute,
412
+ Start,
413
+ End,
414
+ Left,
415
+ Right,
416
+ Justified,
480
417
  }
481
418
  /**
482
419
  */
@@ -572,6 +509,69 @@ export enum ShdType {
572
509
  }
573
510
  /**
574
511
  */
512
+ export enum TableLayoutType {
513
+ Fixed,
514
+ Autofit,
515
+ }
516
+ /**
517
+ */
518
+ export enum FontPitchType {
519
+ Default,
520
+ Fixed,
521
+ Variable,
522
+ }
523
+ /**
524
+ */
525
+ export enum BreakType {
526
+ Page,
527
+ Column,
528
+ TextWrapping,
529
+ Unsupported,
530
+ }
531
+ /**
532
+ */
533
+ export enum FieldCharType {
534
+ Begin,
535
+ Separate,
536
+ End,
537
+ Unsupported,
538
+ }
539
+ /**
540
+ */
541
+ export enum TabValueType {
542
+ Bar,
543
+ Center,
544
+ Clear,
545
+ Decimal,
546
+ End,
547
+ Right,
548
+ Num,
549
+ Start,
550
+ Left,
551
+ }
552
+ /**
553
+ */
554
+ export enum TextDirectionType {
555
+ Lr,
556
+ LrV,
557
+ Rl,
558
+ RlV,
559
+ Tb,
560
+ TbV,
561
+ TbRlV,
562
+ TbRl,
563
+ BtLr,
564
+ LrTbV,
565
+ }
566
+ /**
567
+ */
568
+ export enum VMergeType {
569
+ Continue,
570
+ Restart,
571
+ Unsupported,
572
+ }
573
+ /**
574
+ */
575
575
  export class AbstractNumbering {
576
576
  free(): void;
577
577
  /**
@@ -1607,6 +1607,13 @@ export class Run {
1607
1607
  */
1608
1608
  add_break(break_type: number): Run;
1609
1609
  /**
1610
+ * @param {string} text
1611
+ * @param {boolean} omits_page_number
1612
+ * @param {number | undefined} level
1613
+ * @returns {Run}
1614
+ */
1615
+ add_tc(text: string, omits_page_number: boolean, level?: number): Run;
1616
+ /**
1610
1617
  * @param {string} style
1611
1618
  * @returns {Run}
1612
1619
  */