docx-wasm 0.4.18-rc30 → 0.4.18-rc31

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.Paragraph | wasm.Style>(target: T, property: ParagraphProperty) => T;
93
+ export declare const setParagraphProperty: <T extends wasm.Style | wasm.Paragraph>(target: T, property: ParagraphProperty) => T;
94
94
  export declare const createParagraphProperty: (property: ParagraphProperty) => wasm.ParagraphProperty;
@@ -6,56 +6,21 @@
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 {Run} run
15
- * @returns {Delete}
16
- */
17
- export function createDelete(run: Run): Delete;
18
- /**
19
- * @returns {FrameProperty}
20
- */
21
- export function createFrameProperty(): FrameProperty;
22
- /**
23
- * @param {number} id
24
- * @param {number} start
25
- * @param {string} format
26
- * @param {string} text
27
- * @param {string} jc
28
- * @returns {Level}
29
- */
30
- export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
31
- /**
32
- * @param {number} level
33
- * @returns {LevelOverride}
34
- */
35
- export function createLevelOverride(level: number): LevelOverride;
36
- /**
37
- * @returns {Table}
38
- */
39
- export function createTable(): Table;
40
- /**
41
- * @param {number | undefined} start
42
- * @param {string | undefined} chap_style
43
- * @returns {PageNumType}
9
+ * @returns {Header}
44
10
  */
45
- export function createPageNumType(start?: number, chap_style?: string): PageNumType;
11
+ export function createHeader(): Header;
46
12
  /**
47
- * @param {Uint8Array} buf
48
- * @returns {string}
13
+ * @returns {PageNum}
49
14
  */
50
- export function readDocx(buf: Uint8Array): string;
15
+ export function createPageNum(): PageNum;
51
16
  /**
52
- * @returns {NumPages}
17
+ * @returns {ParagraphPropertyChange}
53
18
  */
54
- export function createNumPages(): NumPages;
19
+ export function createParagraphPropertyChange(): ParagraphPropertyChange;
55
20
  /**
56
- * @returns {Paragraph}
21
+ * @returns {ParagraphProperty}
57
22
  */
58
- export function createParagraph(): Paragraph;
23
+ export function createParagraphProperty(): ParagraphProperty;
59
24
  /**
60
25
  * @param {number} alignment
61
26
  * @param {number} relative_to
@@ -64,84 +29,101 @@ export function createParagraph(): Paragraph;
64
29
  */
65
30
  export function createPositionalTab(alignment: number, relative_to: number, leader: number): PositionalTab;
66
31
  /**
67
- * @param {string} id
68
- * @param {string} reference_id
69
- * @param {string} version
70
- * @param {string} store
71
- * @param {string} store_type
72
- * @returns {WebExtension}
32
+ * @returns {TableCell}
73
33
  */
74
- export function createWebExtension(id: string, reference_id: string, version: string, store: string, store_type: string): WebExtension;
34
+ export function createTableCell(): TableCell;
75
35
  /**
76
36
  * @param {Run} run
77
37
  * @returns {Insert}
78
38
  */
79
39
  export function createInsert(run: Run): Insert;
80
40
  /**
81
- * @returns {PageMargin}
41
+ * @param {number} id
42
+ * @param {number} abstract_num_id
43
+ * @returns {Numbering}
82
44
  */
83
- export function createPageMargin(): PageMargin;
45
+ export function createNumbering(id: number, abstract_num_id: number): Numbering;
84
46
  /**
85
- * @returns {Run}
47
+ * @param {string} style_id
48
+ * @param {number} style_type
49
+ * @returns {Style}
86
50
  */
87
- export function createRun(): Run;
51
+ export function createStyle(style_id: string, style_type: number): Style;
88
52
  /**
89
- * @returns {RunProperty}
53
+ * @returns {FrameProperty}
90
54
  */
91
- export function createRunProperty(): RunProperty;
55
+ export function createFrameProperty(): FrameProperty;
92
56
  /**
93
- * @returns {TablePositionProperty}
57
+ * @param {string} v
58
+ * @param {number} t
59
+ * @returns {Hyperlink}
94
60
  */
95
- export function createTablePosition(): TablePositionProperty;
61
+ export function createHyperlink(v: string, t: number): Hyperlink;
96
62
  /**
97
63
  * @param {number} id
98
- * @param {number} abstract_num_id
99
- * @returns {Numbering}
64
+ * @param {number} start
65
+ * @param {string} format
66
+ * @param {string} text
67
+ * @param {string} jc
68
+ * @returns {Level}
100
69
  */
101
- export function createNumbering(id: number, abstract_num_id: number): Numbering;
70
+ export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
102
71
  /**
103
- * @returns {ParagraphPropertyChange}
72
+ * @param {number} level
73
+ * @returns {LevelOverride}
104
74
  */
105
- export function createParagraphPropertyChange(): ParagraphPropertyChange;
75
+ export function createLevelOverride(level: number): LevelOverride;
106
76
  /**
107
- * @returns {ParagraphProperty}
77
+ * @returns {RunFonts}
108
78
  */
109
- export function createParagraphProperty(): ParagraphProperty;
79
+ export function createRunFonts(): RunFonts;
110
80
  /**
111
- * @returns {TableCell}
81
+ * @returns {LineSpacing}
112
82
  */
113
- export function createTableCell(): TableCell;
83
+ export function createLineSpacing(): LineSpacing;
84
+ /**
85
+ * @returns {Run}
86
+ */
87
+ export function createRun(): Run;
114
88
  /**
115
89
  * @param {number} position
116
90
  * @returns {TableCellBorder}
117
91
  */
118
92
  export function createTableCellBorder(position: number): TableCellBorder;
119
93
  /**
120
- * @returns {LineSpacing}
121
- */
122
- export function createLineSpacing(): LineSpacing;
123
- /**
124
- * @returns {RunFonts}
94
+ * @returns {TablePositionProperty}
125
95
  */
126
- export function createRunFonts(): RunFonts;
96
+ export function createTablePosition(): TablePositionProperty;
127
97
  /**
128
- * @param {string} style_id
129
- * @param {number} style_type
130
- * @returns {Style}
98
+ * @returns {TableRow}
131
99
  */
132
- export function createStyle(style_id: string, style_type: number): Style;
100
+ export function createTableRow(): TableRow;
133
101
  /**
134
102
  * @returns {Docx}
135
103
  */
136
104
  export function createDocx(): Docx;
137
105
  /**
138
- * @returns {Header}
106
+ * @param {Run} run
107
+ * @returns {Delete}
139
108
  */
140
- export function createHeader(): Header;
109
+ export function createDelete(run: Run): Delete;
141
110
  /**
142
- * @returns {PageNum}
111
+ * @returns {PageMargin}
143
112
  */
144
- export function createPageNum(): PageNum;
113
+ export function createPageMargin(): PageMargin;
114
+ /**
115
+ * @returns {RunProperty}
116
+ */
117
+ export function createRunProperty(): RunProperty;
118
+ /**
119
+ * @param {Uint8Array} buf
120
+ * @returns {string}
121
+ */
122
+ export function readDocx(buf: Uint8Array): string;
123
+ /**
124
+ * @returns {NumPages}
125
+ */
126
+ export function createNumPages(): NumPages;
145
127
  /**
146
128
  * @param {number} id
147
129
  * @returns {AbstractNumbering}
@@ -152,11 +134,15 @@ export function createAbstractNumbering(id: number): AbstractNumbering;
152
134
  */
153
135
  export function createFooter(): Footer;
154
136
  /**
155
- * @param {string} v
156
- * @param {number} t
157
- * @returns {Hyperlink}
137
+ * @param {number | undefined} start
138
+ * @param {string | undefined} chap_style
139
+ * @returns {PageNumType}
158
140
  */
159
- export function createHyperlink(v: string, t: number): Hyperlink;
141
+ export function createPageNumType(start?: number, chap_style?: string): PageNumType;
142
+ /**
143
+ * @returns {Table}
144
+ */
145
+ export function createTable(): Table;
160
146
  /**
161
147
  * @returns {TableOfContents}
162
148
  */
@@ -171,90 +157,92 @@ export function createTableOfContentsWithInstrText(s: string): TableOfContents;
171
157
  */
172
158
  export function createTableOfContentsItem(): TableOfContentsItem;
173
159
  /**
174
- * @returns {TableRow}
160
+ * @param {number} id
161
+ * @returns {Comment}
175
162
  */
176
- export function createTableRow(): TableRow;
163
+ export function createComment(id: number): Comment;
177
164
  /**
165
+ * @returns {Paragraph}
178
166
  */
179
- export enum TextDirectionType {
180
- Lr,
181
- LrV,
182
- Rl,
183
- RlV,
184
- Tb,
185
- TbV,
186
- TbRlV,
187
- TbRl,
188
- BtLr,
189
- LrTbV,
190
- }
167
+ export function createParagraph(): Paragraph;
191
168
  /**
169
+ * @param {string} id
170
+ * @param {string} reference_id
171
+ * @param {string} version
172
+ * @param {string} store
173
+ * @param {string} store_type
174
+ * @returns {WebExtension}
192
175
  */
193
- export enum PositionalTabAlignmentType {
194
- Center,
195
- Left,
196
- Right,
176
+ export function createWebExtension(id: string, reference_id: string, version: string, store: string, store_type: string): WebExtension;
177
+ /**
178
+ */
179
+ export enum CharacterSpacingValues {
180
+ DoNotCompress,
181
+ CompressPunctuation,
182
+ CompressPunctuationAndJapaneseKana,
183
+ Unsupported,
197
184
  }
198
185
  /**
199
186
  */
200
- export enum TabLeaderType {
201
- Dot,
202
- Heavy,
203
- Hyphen,
204
- MiddleDot,
205
- None,
206
- Underscore,
187
+ export enum DocGridType {
188
+ Default,
189
+ Lines,
190
+ LinesAndChars,
191
+ SnapToChars,
207
192
  }
208
193
  /**
209
194
  */
210
- export enum TableBorderPosition {
211
- Left,
212
- Right,
213
- Top,
214
- Bottom,
215
- InsideH,
216
- InsideV,
195
+ export enum LevelSuffixType {
196
+ Nothing,
197
+ Space,
198
+ Tab,
217
199
  }
218
200
  /**
219
201
  */
220
- export enum TableCellBorderPosition {
221
- Left,
222
- Right,
223
- Top,
224
- Bottom,
225
- InsideH,
226
- InsideV,
227
- Tl2br,
228
- Tr2bl,
202
+ export enum LineSpacingType {
203
+ Auto,
204
+ AtLeast,
205
+ Exact,
229
206
  }
230
207
  /**
231
208
  */
232
- export enum ParagraphBorderPosition {
233
- Left,
234
- Right,
235
- Top,
236
- Bottom,
237
- Between,
238
- Bar,
209
+ export enum SectionType {
210
+ NextPage,
211
+ NextColumn,
212
+ Continuous,
213
+ EvenPage,
214
+ OddPage,
239
215
  }
240
216
  /**
241
217
  */
242
- export enum HeightRule {
243
- Auto,
244
- AtLeast,
245
- Exact,
218
+ export enum StyleType {
219
+ Paragraph,
220
+ Character,
221
+ Numbering,
222
+ Table,
223
+ Unsupported,
246
224
  }
247
225
  /**
248
226
  */
249
- export enum PageOrientationType {
250
- Landscape,
251
- Portrait,
227
+ export enum TabValueType {
228
+ Bar,
229
+ Center,
230
+ Clear,
231
+ Decimal,
232
+ End,
233
+ Right,
234
+ Num,
235
+ Start,
236
+ Left,
252
237
  }
253
238
  /**
254
239
  */
255
- export enum PositionalTabRelativeTo {
256
- Indent,
257
- Margin,
240
+ export enum TextAlignmentType {
241
+ Auto,
242
+ Baseline,
243
+ Bottom,
244
+ Center,
245
+ Top,
258
246
  }
259
247
  /**
260
248
  */
@@ -265,10 +253,18 @@ export enum VMergeType {
265
253
  }
266
254
  /**
267
255
  */
268
- export enum TableAlignmentType {
269
- Center,
270
- Left,
271
- Right,
256
+ export enum WidthType {
257
+ Dxa,
258
+ Auto,
259
+ Pct,
260
+ Nil,
261
+ Unsupported,
262
+ }
263
+ /**
264
+ */
265
+ export enum SpecialIndentKind {
266
+ FirstLine,
267
+ Hanging,
272
268
  }
273
269
  /**
274
270
  */
@@ -280,18 +276,43 @@ export enum BreakType {
280
276
  }
281
277
  /**
282
278
  */
283
- export enum SpecialIndentKind {
284
- FirstLine,
285
- Hanging,
286
- }
287
- /**
288
- */
289
279
  export enum TableLayoutType {
290
280
  Fixed,
291
281
  Autofit,
292
282
  }
293
283
  /**
294
284
  */
285
+ export enum PositionalTabAlignmentType {
286
+ Center,
287
+ Left,
288
+ Right,
289
+ }
290
+ /**
291
+ */
292
+ export enum TabLeaderType {
293
+ Dot,
294
+ Heavy,
295
+ Hyphen,
296
+ MiddleDot,
297
+ None,
298
+ Underscore,
299
+ }
300
+ /**
301
+ */
302
+ export enum TextDirectionType {
303
+ Lr,
304
+ LrV,
305
+ Rl,
306
+ RlV,
307
+ Tb,
308
+ TbV,
309
+ TbRlV,
310
+ TbRl,
311
+ BtLr,
312
+ LrTbV,
313
+ }
314
+ /**
315
+ */
295
316
  export enum BorderType {
296
317
  Nil,
297
318
  None,
@@ -466,92 +487,80 @@ export enum VertAlignType {
466
487
  }
467
488
  /**
468
489
  */
469
- export enum AlignmentType {
470
- Both,
490
+ export enum TableAlignmentType {
471
491
  Center,
472
- Distribute,
473
- Start,
474
- End,
475
492
  Left,
476
493
  Right,
477
- Justified,
478
494
  }
479
495
  /**
480
496
  */
481
- export enum CharacterSpacingValues {
482
- DoNotCompress,
483
- CompressPunctuation,
484
- CompressPunctuationAndJapaneseKana,
485
- Unsupported,
486
- }
487
- /**
488
- */
489
- export enum DocGridType {
490
- Default,
491
- Lines,
492
- LinesAndChars,
493
- SnapToChars,
497
+ export enum TableBorderPosition {
498
+ Left,
499
+ Right,
500
+ Top,
501
+ Bottom,
502
+ InsideH,
503
+ InsideV,
494
504
  }
495
505
  /**
496
506
  */
497
- export enum FontPitchType {
498
- Default,
499
- Fixed,
500
- Variable,
507
+ export enum TableCellBorderPosition {
508
+ Left,
509
+ Right,
510
+ Top,
511
+ Bottom,
512
+ InsideH,
513
+ InsideV,
514
+ Tl2br,
515
+ Tr2bl,
501
516
  }
502
517
  /**
503
518
  */
504
- export enum LevelSuffixType {
505
- Nothing,
506
- Space,
507
- Tab,
519
+ export enum ParagraphBorderPosition {
520
+ Left,
521
+ Right,
522
+ Top,
523
+ Bottom,
524
+ Between,
525
+ Bar,
508
526
  }
509
527
  /**
510
528
  */
511
- export enum LineSpacingType {
529
+ export enum HeightRule {
512
530
  Auto,
513
531
  AtLeast,
514
532
  Exact,
515
533
  }
516
534
  /**
517
535
  */
518
- export enum SectionType {
519
- NextPage,
520
- NextColumn,
521
- Continuous,
522
- EvenPage,
523
- OddPage,
536
+ export enum PageOrientationType {
537
+ Landscape,
538
+ Portrait,
524
539
  }
525
540
  /**
526
541
  */
527
- export enum StyleType {
528
- Paragraph,
529
- Character,
530
- Numbering,
531
- Table,
532
- Unsupported,
542
+ export enum PositionalTabRelativeTo {
543
+ Indent,
544
+ Margin,
533
545
  }
534
546
  /**
535
547
  */
536
- export enum TabValueType {
537
- Bar,
548
+ export enum AlignmentType {
549
+ Both,
538
550
  Center,
539
- Clear,
540
- Decimal,
541
- End,
542
- Right,
543
- Num,
551
+ Distribute,
544
552
  Start,
553
+ End,
545
554
  Left,
555
+ Right,
556
+ Justified,
546
557
  }
547
558
  /**
548
559
  */
549
- export enum TextAlignmentType {
550
- Auto,
551
- Baseline,
552
- Bottom,
553
- Center,
554
- Top,
560
+ export enum FontPitchType {
561
+ Default,
562
+ Fixed,
563
+ Variable,
555
564
  }
556
565
  /**
557
566
  */
@@ -563,15 +572,6 @@ export enum VAlignType {
563
572
  }
564
573
  /**
565
574
  */
566
- export enum WidthType {
567
- Dxa,
568
- Auto,
569
- Pct,
570
- Nil,
571
- Unsupported,
572
- }
573
- /**
574
- */
575
575
  export class AbstractNumbering {
576
576
  free(): void;
577
577
  /**
@@ -1610,9 +1610,10 @@ export class Run {
1610
1610
  * @param {string} text
1611
1611
  * @param {boolean} omits_page_number
1612
1612
  * @param {number | undefined} level
1613
+ * @param {string | undefined} id
1613
1614
  * @returns {Run}
1614
1615
  */
1615
- add_tc(text: string, omits_page_number: boolean, level?: number): Run;
1616
+ add_tc(text: string, omits_page_number: boolean, level?: number, id?: string): Run;
1616
1617
  /**
1617
1618
  * @param {string} style
1618
1619
  * @returns {Run}