docx-wasm 0.4.18-rc42 → 0.4.18-rc44

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.
@@ -1,6 +1,6 @@
1
1
  import { DrawingJSON } from "./drawing";
2
2
  import { ShapeJSON } from "./shape";
3
- import { CommentRangeStartJSON, CommentRangeEndJSON, InsertJSONData, DeleteJSONData } from "..";
3
+ import { CommentRangeStartJSON, CommentRangeEndJSON, InsertJSONData, DeleteJSONData, ShadingJSON } from "..";
4
4
  import { BorderType } from "../border";
5
5
  import { VertAlignType } from "../run-property";
6
6
  import { FieldChar } from "./bindings/FieldChar";
@@ -48,6 +48,7 @@ export type RunPropertyJSON = {
48
48
  del?: DeleteJSONData | null;
49
49
  strike?: boolean;
50
50
  dstrike?: boolean;
51
+ shading?: ShadingJSON | null;
51
52
  };
52
53
  export type RunChildJSON = TextJSON | SymJSON | DeleteTextJSON | TabJSON | BreakJSON | DrawingJSON | PtabJSON | ShapeJSON | CommentRangeStartJSON | CommentRangeEndJSON | FieldCharJSON | InstrTextStringJSON;
53
54
  export type TextJSON = {
@@ -91,5 +91,5 @@ export declare class ParagraphPropertyChange {
91
91
  numbering(id: number, level: number): this;
92
92
  }
93
93
  export declare const buildLineSpacing: (p: ParagraphProperty) => wasm.LineSpacing | null;
94
- export declare const setParagraphProperty: <T extends wasm.Style | wasm.Paragraph>(target: T, property: ParagraphProperty) => T;
94
+ export declare const setParagraphProperty: <T extends wasm.Paragraph | wasm.Style>(target: T, property: ParagraphProperty) => T;
95
95
  export declare const createParagraphProperty: (property: ParagraphProperty) => wasm.ParagraphProperty;
@@ -1,18 +1,38 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {Uint8Array} buf
5
- * @returns {Pic}
4
+ * @param {string} v
5
+ * @param {number} t
6
+ * @returns {Hyperlink}
6
7
  */
7
- export function createPic(buf: Uint8Array): Pic;
8
+ export function createHyperlink(v: string, t: number): Hyperlink;
8
9
  /**
9
- * @returns {Footer}
10
+ * @param {Run} run
11
+ * @returns {Insert}
10
12
  */
11
- export function createFooter(): Footer;
13
+ export function createInsert(run: Run): Insert;
12
14
  /**
13
- * @returns {PageNum}
15
+ * @returns {PageMargin}
14
16
  */
15
- export function createPageNum(): PageNum;
17
+ export function createPageMargin(): PageMargin;
18
+ /**
19
+ * @returns {Paragraph}
20
+ */
21
+ export function createParagraph(): Paragraph;
22
+ /**
23
+ * @param {number} id
24
+ * @returns {Comment}
25
+ */
26
+ export function createComment(id: number): Comment;
27
+ /**
28
+ * @returns {FrameProperty}
29
+ */
30
+ export function createFrameProperty(): FrameProperty;
31
+ /**
32
+ * @param {number} level
33
+ * @returns {LevelOverride}
34
+ */
35
+ export function createLevelOverride(level: number): LevelOverride;
16
36
  /**
17
37
  * @returns {ParagraphPropertyChange}
18
38
  */
@@ -22,10 +42,6 @@ export function createParagraphPropertyChange(): ParagraphPropertyChange;
22
42
  */
23
43
  export function createParagraphProperty(): ParagraphProperty;
24
44
  /**
25
- * @returns {TableCell}
26
- */
27
- export function createTableCell(): TableCell;
28
- /**
29
45
  * @param {string} id
30
46
  * @param {string} reference_id
31
47
  * @param {string} version
@@ -35,71 +51,79 @@ export function createTableCell(): TableCell;
35
51
  */
36
52
  export function createWebExtension(id: string, reference_id: string, version: string, store: string, store_type: string): WebExtension;
37
53
  /**
38
- * @param {number} id
39
- * @returns {AbstractNumbering}
54
+ * @param {Uint8Array} buf
55
+ * @returns {Pic}
40
56
  */
41
- export function createAbstractNumbering(id: number): AbstractNumbering;
57
+ export function createPic(buf: Uint8Array): Pic;
42
58
  /**
43
- * @returns {NumPages}
59
+ * @param {Uint8Array} buf
60
+ * @returns {string}
44
61
  */
45
- export function createNumPages(): NumPages;
62
+ export function readDocx(buf: Uint8Array): string;
63
+ /**
64
+ * @param {Run} run
65
+ * @returns {Delete}
66
+ */
67
+ export function createDelete(run: Run): Delete;
68
+ /**
69
+ * @returns {LineSpacing}
70
+ */
71
+ export function createLineSpacing(): LineSpacing;
46
72
  /**
47
73
  * @returns {Run}
48
74
  */
49
75
  export function createRun(): Run;
50
76
  /**
51
- * @returns {Table}
77
+ * @returns {TableCell}
52
78
  */
53
- export function createTable(): Table;
79
+ export function createTableCell(): TableCell;
54
80
  /**
55
81
  * @param {number} position
56
82
  * @returns {TableCellBorder}
57
83
  */
58
84
  export function createTableCellBorder(position: number): TableCellBorder;
59
85
  /**
60
- * @returns {TableRow}
86
+ * @returns {RunFonts}
61
87
  */
62
- export function createTableRow(): TableRow;
88
+ export function createRunFonts(): RunFonts;
63
89
  /**
64
- * @param {Run} run
65
- * @returns {Insert}
90
+ * @returns {Docx}
66
91
  */
67
- export function createInsert(run: Run): Insert;
92
+ export function createDocx(): Docx;
68
93
  /**
69
- * @param {Uint8Array} buf
70
- * @returns {string}
94
+ * @returns {Footer}
71
95
  */
72
- export function readDocx(buf: Uint8Array): string;
96
+ export function createFooter(): Footer;
73
97
  /**
74
- * @returns {PageMargin}
98
+ * @returns {PageNum}
75
99
  */
76
- export function createPageMargin(): PageMargin;
100
+ export function createPageNum(): PageNum;
77
101
  /**
78
- * @returns {RunFonts}
102
+ * @param {number} id
103
+ * @param {number} abstract_num_id
104
+ * @returns {Numbering}
79
105
  */
80
- export function createRunFonts(): RunFonts;
106
+ export function createNumbering(id: number, abstract_num_id: number): Numbering;
81
107
  /**
82
- * @param {string} style_id
83
- * @param {number} style_type
84
- * @returns {Style}
108
+ * @returns {RunProperty}
85
109
  */
86
- export function createStyle(style_id: string, style_type: number): Style;
110
+ export function createRunProperty(): RunProperty;
87
111
  /**
88
- * @param {string} v
89
- * @param {number} t
90
- * @returns {Hyperlink}
112
+ * @returns {Table}
91
113
  */
92
- export function createHyperlink(v: string, t: number): Hyperlink;
114
+ export function createTable(): Table;
93
115
  /**
94
- * @param {number} id
95
- * @param {number} abstract_num_id
96
- * @returns {Numbering}
116
+ * @returns {TablePositionProperty}
97
117
  */
98
- export function createNumbering(id: number, abstract_num_id: number): Numbering;
118
+ export function createTablePosition(): TablePositionProperty;
99
119
  /**
100
- * @returns {Paragraph}
120
+ * @returns {TableRow}
101
121
  */
102
- export function createParagraph(): Paragraph;
122
+ export function createTableRow(): TableRow;
123
+ /**
124
+ * @returns {Header}
125
+ */
126
+ export function createHeader(): Header;
103
127
  /**
104
128
  * @param {number} alignment
105
129
  * @param {number} relative_to
@@ -108,9 +132,29 @@ export function createParagraph(): Paragraph;
108
132
  */
109
133
  export function createPositionalTab(alignment: number, relative_to: number, leader: number): PositionalTab;
110
134
  /**
111
- * @returns {LineSpacing}
135
+ * @param {string} style_id
136
+ * @param {number} style_type
137
+ * @returns {Style}
112
138
  */
113
- export function createLineSpacing(): LineSpacing;
139
+ export function createStyle(style_id: string, style_type: number): Style;
140
+ /**
141
+ * @param {number} id
142
+ * @returns {AbstractNumbering}
143
+ */
144
+ export function createAbstractNumbering(id: number): AbstractNumbering;
145
+ /**
146
+ * @param {number} id
147
+ * @param {number} start
148
+ * @param {string} format
149
+ * @param {string} text
150
+ * @param {string} jc
151
+ * @returns {Level}
152
+ */
153
+ export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
154
+ /**
155
+ * @returns {NumPages}
156
+ */
157
+ export function createNumPages(): NumPages;
114
158
  /**
115
159
  * @param {number | undefined} start
116
160
  * @param {string | undefined} chap_style
@@ -118,10 +162,6 @@ export function createLineSpacing(): LineSpacing;
118
162
  */
119
163
  export function createPageNumType(start?: number, chap_style?: string): PageNumType;
120
164
  /**
121
- * @returns {RunProperty}
122
- */
123
- export function createRunProperty(): RunProperty;
124
- /**
125
165
  * @returns {TableOfContents}
126
166
  */
127
167
  export function createTableOfContents(): TableOfContents;
@@ -135,46 +175,6 @@ export function createTableOfContentsWithInstrText(s: string): TableOfContents;
135
175
  */
136
176
  export function createTableOfContentsItem(): TableOfContentsItem;
137
177
  /**
138
- * @param {number} id
139
- * @returns {Comment}
140
- */
141
- export function createComment(id: number): Comment;
142
- /**
143
- * @returns {Docx}
144
- */
145
- export function createDocx(): Docx;
146
- /**
147
- * @param {Run} run
148
- * @returns {Delete}
149
- */
150
- export function createDelete(run: Run): Delete;
151
- /**
152
- * @returns {FrameProperty}
153
- */
154
- export function createFrameProperty(): FrameProperty;
155
- /**
156
- * @returns {Header}
157
- */
158
- export function createHeader(): Header;
159
- /**
160
- * @param {number} id
161
- * @param {number} start
162
- * @param {string} format
163
- * @param {string} text
164
- * @param {string} jc
165
- * @returns {Level}
166
- */
167
- export function createLevel(id: number, start: number, format: string, text: string, jc: string): Level;
168
- /**
169
- * @param {number} level
170
- * @returns {LevelOverride}
171
- */
172
- export function createLevelOverride(level: number): LevelOverride;
173
- /**
174
- * @returns {TablePositionProperty}
175
- */
176
- export function createTablePosition(): TablePositionProperty;
177
- /**
178
178
  */
179
179
  export enum BorderType {
180
180
  Nil,
@@ -331,68 +331,43 @@ export enum WidthType {
331
331
  }
332
332
  /**
333
333
  */
334
- export enum TableBorderPosition {
335
- Left,
336
- Right,
337
- Top,
338
- Bottom,
339
- InsideH,
340
- InsideV,
341
- }
342
- /**
343
- */
344
- export enum TableCellBorderPosition {
345
- Left,
346
- Right,
347
- Top,
348
- Bottom,
349
- InsideH,
350
- InsideV,
351
- Tl2br,
352
- Tr2bl,
334
+ export enum FontPitchType {
335
+ Default,
336
+ Fixed,
337
+ Variable,
353
338
  }
354
339
  /**
355
340
  */
356
- export enum ParagraphBorderPosition {
341
+ export enum AlignmentType {
342
+ Both,
343
+ Center,
344
+ Distribute,
345
+ Start,
346
+ End,
357
347
  Left,
358
348
  Right,
359
- Top,
360
- Bottom,
361
- Between,
362
- Bar,
349
+ Justified,
363
350
  }
364
351
  /**
365
352
  */
366
- export enum FontPitchType {
367
- Default,
368
- Fixed,
369
- Variable,
353
+ export enum FieldCharType {
354
+ Begin,
355
+ Separate,
356
+ End,
357
+ Unsupported,
370
358
  }
371
359
  /**
372
360
  */
373
- export enum TabLeaderType {
374
- Dot,
375
- Heavy,
376
- Hyphen,
377
- MiddleDot,
378
- None,
379
- Underscore,
361
+ export enum SpecialIndentKind {
362
+ FirstLine,
363
+ Hanging,
380
364
  }
381
365
  /**
382
366
  */
383
- export enum VAlignType {
384
- Top,
367
+ export enum TableAlignmentType {
385
368
  Center,
386
- Bottom,
387
- Unsupported,
388
- }
389
- /**
390
- */
391
- export enum VertAlignType {
392
- Baseline,
393
- SuperScript,
394
- SubScript,
395
- Unsupported,
369
+ Left,
370
+ Right,
396
371
  }
397
372
  /**
398
373
  */
@@ -481,49 +456,25 @@ export enum TextDirectionType {
481
456
  }
482
457
  /**
483
458
  */
484
- export enum BreakType {
485
- Page,
486
- Column,
487
- TextWrapping,
459
+ export enum VMergeType {
460
+ Continue,
461
+ Restart,
488
462
  Unsupported,
489
463
  }
490
464
  /**
491
465
  */
492
- export enum AlignmentType {
493
- Both,
494
- Center,
495
- Distribute,
496
- Start,
497
- End,
498
- Left,
499
- Right,
500
- Justified,
501
- }
502
- /**
503
- */
504
- export enum FieldCharType {
505
- Begin,
506
- Separate,
507
- End,
466
+ export enum VertAlignType {
467
+ Baseline,
468
+ SuperScript,
469
+ SubScript,
508
470
  Unsupported,
509
471
  }
510
472
  /**
511
473
  */
512
- export enum SpecialIndentKind {
513
- FirstLine,
514
- Hanging,
515
- }
516
- /**
517
- */
518
- export enum TableLayoutType {
519
- Fixed,
520
- Autofit,
521
- }
522
- /**
523
- */
524
- export enum VMergeType {
525
- Continue,
526
- Restart,
474
+ export enum BreakType {
475
+ Page,
476
+ Column,
477
+ TextWrapping,
527
478
  Unsupported,
528
479
  }
529
480
  /**
@@ -565,10 +516,59 @@ export enum StyleType {
565
516
  }
566
517
  /**
567
518
  */
568
- export enum TableAlignmentType {
519
+ export enum VAlignType {
520
+ Top,
569
521
  Center,
522
+ Bottom,
523
+ Unsupported,
524
+ }
525
+ /**
526
+ */
527
+ export enum TableBorderPosition {
570
528
  Left,
571
529
  Right,
530
+ Top,
531
+ Bottom,
532
+ InsideH,
533
+ InsideV,
534
+ }
535
+ /**
536
+ */
537
+ export enum TableCellBorderPosition {
538
+ Left,
539
+ Right,
540
+ Top,
541
+ Bottom,
542
+ InsideH,
543
+ InsideV,
544
+ Tl2br,
545
+ Tr2bl,
546
+ }
547
+ /**
548
+ */
549
+ export enum ParagraphBorderPosition {
550
+ Left,
551
+ Right,
552
+ Top,
553
+ Bottom,
554
+ Between,
555
+ Bar,
556
+ }
557
+ /**
558
+ */
559
+ export enum TabLeaderType {
560
+ Dot,
561
+ Heavy,
562
+ Hyphen,
563
+ MiddleDot,
564
+ None,
565
+ Underscore,
566
+ }
567
+ /**
568
+ */
569
+ export enum TableLayoutType {
570
+ Fixed,
571
+ Autofit,
572
572
  }
573
573
  /**
574
574
  */
@@ -1699,6 +1699,13 @@ export class Run {
1699
1699
  */
1700
1700
  vert_align(a: number): Run;
1701
1701
  /**
1702
+ * @param {string} t
1703
+ * @param {string} color
1704
+ * @param {string} fill
1705
+ * @returns {Run}
1706
+ */
1707
+ shading(t: string, color: string, fill: string): Run;
1708
+ /**
1702
1709
  * @param {number} border_type
1703
1710
  * @param {number} size
1704
1711
  * @param {number} space
@@ -1861,6 +1868,13 @@ export class RunProperty {
1861
1868
  * @returns {RunProperty}
1862
1869
  */
1863
1870
  text_border(border_type: number, size: number, space: number, color: string): RunProperty;
1871
+ /**
1872
+ * @param {string} t
1873
+ * @param {string} color
1874
+ * @param {string} fill
1875
+ * @returns {RunProperty}
1876
+ */
1877
+ shading(t: string, color: string, fill: string): RunProperty;
1864
1878
  }
1865
1879
  /**
1866
1880
  */
@@ -1913,6 +1927,13 @@ export class Style {
1913
1927
  */
1914
1928
  underline(line_type: string): Style;
1915
1929
  /**
1930
+ * @param {string} t
1931
+ * @param {string} color
1932
+ * @param {string} fill
1933
+ * @returns {Style}
1934
+ */
1935
+ shading(t: string, color: string, fill: string): Style;
1936
+ /**
1916
1937
  * @param {string} link
1917
1938
  * @returns {Style}
1918
1939
  */