@silurus/ooxml 0.64.2 → 0.65.0
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.
- package/README.md +6 -4
- package/dist/docx-B8_OFVgL.js +2901 -0
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/math.mjs +1 -1
- package/dist/pptx-9D6TfXnD.js +2051 -0
- package/dist/pptx.mjs +2 -2
- package/dist/render-worker-host-BnJxDb1v.js +27 -0
- package/dist/render-worker-host-CVCsSH1k.js +27 -0
- package/dist/render-worker-host-DpvAEegl.js +27 -0
- package/dist/{src-Bq0uxZNP.js → src-BsVzeDyL.js} +1283 -702
- package/dist/types/docx.d.ts +293 -7
- package/dist/types/index.d.ts +398 -11
- package/dist/types/pptx.d.ts +98 -4
- package/dist/types/xlsx.d.ts +1 -1
- package/dist/xlsx-ClPv4Yee.js +4008 -0
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
- package/dist/docx-CjF9O42U.js +0 -2192
- package/dist/pptx-C0W9FWYJ.js +0 -2025
- package/dist/render-worker-host-2MxRtN0b.js +0 -27
- package/dist/render-worker-host-4w5qj_dW.js +0 -27
- package/dist/render-worker-host-DxJeyoZe.js +0 -27
- package/dist/xlsx-B3V3lX6Z.js +0 -3987
- /package/dist/{mathjax-CNh-4Cw1.js → mathjax-Q1s8_eMq.js} +0 -0
package/dist/types/docx.d.ts
CHANGED
|
@@ -30,6 +30,27 @@ export declare type BodyElement = {
|
|
|
30
30
|
} & DocTable | {
|
|
31
31
|
type: 'pageBreak';
|
|
32
32
|
parity?: 'odd' | 'even';
|
|
33
|
+
}
|
|
34
|
+
/** ECMA-376 §17.3.1.20 `<w:br w:type="column"/>` — force the following content
|
|
35
|
+
* into the next newspaper column (or the next page's first column when
|
|
36
|
+
* already in the last column). Hoisted to the body level by the parser. */
|
|
37
|
+
| {
|
|
38
|
+
type: 'columnBreak';
|
|
39
|
+
}
|
|
40
|
+
/** ECMA-376 §17.6.x — a section boundary in the body. A `<w:sectPr>` carried in
|
|
41
|
+
* a paragraph's `pPr` (or a loose mid-body one) defines the section that ENDS
|
|
42
|
+
* here; the FINAL section's settings live on {@link DocxDocumentModel.section}.
|
|
43
|
+
* `columns` is the ENDING section's `<w:cols>` (§17.6.4; absent ⇒ single
|
|
44
|
+
* full-width column — the spec default for `@w:num` 1). `kind` is the
|
|
45
|
+
* ST_SectionMark (§17.18.79) controlling how the NEXT section starts:
|
|
46
|
+
* "continuous" (same page), "nextPage" (default; page break), "oddPage" /
|
|
47
|
+
* "evenPage" (page break + parity padding). The paginator switches its active
|
|
48
|
+
* newspaper-column geometry per section at each marker — fixing the regression
|
|
49
|
+
* where every section inherited the body-level section's columns. */
|
|
50
|
+
| {
|
|
51
|
+
type: 'sectionBreak';
|
|
52
|
+
kind: 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | string;
|
|
53
|
+
columns?: ColumnsSpec | null;
|
|
33
54
|
};
|
|
34
55
|
|
|
35
56
|
export declare interface BorderSpec {
|
|
@@ -43,6 +64,14 @@ export declare interface CellBorders {
|
|
|
43
64
|
bottom: BorderSpec | null;
|
|
44
65
|
left: BorderSpec | null;
|
|
45
66
|
right: BorderSpec | null;
|
|
67
|
+
/** ECMA-376 §17.4.34 (tcBorders w:insideH/w:insideV): the interior
|
|
68
|
+
* horizontal/vertical border this cell contributes. Folded from the cell's
|
|
69
|
+
* inline tcBorders OVER the resolved conditional table-style borders (§17.7.6)
|
|
70
|
+
* at parse time. `null` = unset (the renderer falls back to the table-level
|
|
71
|
+
* insideH/insideV); a spec with style "nil"/"none" = an explicit "no interior
|
|
72
|
+
* border" (e.g. banded data rows in Medium List 2 / Medium Shading 2). */
|
|
73
|
+
insideH: BorderSpec | null;
|
|
74
|
+
insideV: BorderSpec | null;
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
/** ECMA-376 §17.4.7: a table cell may contain paragraphs AND nested tables. */
|
|
@@ -52,6 +81,29 @@ export declare type CellElement = {
|
|
|
52
81
|
type: 'table';
|
|
53
82
|
} & DocTable;
|
|
54
83
|
|
|
84
|
+
/** ECMA-376 §17.6.3 `<w:col>` — one column's width and trailing space (pt). */
|
|
85
|
+
export declare interface ColSpec {
|
|
86
|
+
widthPt: number;
|
|
87
|
+
spacePt: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** ECMA-376 §17.6.4 `<w:cols>` — the section's multi-column configuration. */
|
|
91
|
+
export declare interface ColumnsSpec {
|
|
92
|
+
/** `@w:num` — number of columns (>= 2 when emitted). */
|
|
93
|
+
count: number;
|
|
94
|
+
/** `@w:space` in pt — inter-column gap for equal-width columns (default 36pt
|
|
95
|
+
* = 720 twips per the spec). */
|
|
96
|
+
spacePt: number;
|
|
97
|
+
/** `@w:equalWidth` (default true) — all columns share one width + `spacePt`.
|
|
98
|
+
* When false, `cols` carries explicit per-column geometry. */
|
|
99
|
+
equalWidth: boolean;
|
|
100
|
+
/** `@w:sep` — draw vertical separator rules between columns. */
|
|
101
|
+
sep: boolean;
|
|
102
|
+
/** Per-column `<w:col>` entries (width + trailing space, pt). Empty when
|
|
103
|
+
* `equalWidth` is true. */
|
|
104
|
+
cols: ColSpec[];
|
|
105
|
+
}
|
|
106
|
+
|
|
55
107
|
export declare interface DocComment {
|
|
56
108
|
id: string;
|
|
57
109
|
author?: string;
|
|
@@ -124,6 +176,13 @@ export declare interface DocParagraph {
|
|
|
124
176
|
* Text" style, so footnote bodies use compact natural line height.
|
|
125
177
|
*/
|
|
126
178
|
snapToGrid?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* ECMA-376 §17.3.1.11 `<w:framePr>` — text-frame / drop-cap properties.
|
|
181
|
+
* Present ⇒ this paragraph is part of a text frame; the renderer positions it
|
|
182
|
+
* as a frame (drop cap or generic frame) and registers a wrap exclusion so
|
|
183
|
+
* following body text flows around it. Absent ⇒ ordinary in-flow paragraph.
|
|
184
|
+
*/
|
|
185
|
+
framePr?: FramePr;
|
|
127
186
|
}
|
|
128
187
|
|
|
129
188
|
export declare interface DocRevision {
|
|
@@ -182,9 +241,12 @@ export declare interface DocTable {
|
|
|
182
241
|
/** table horizontal alignment on the page: 'left' | 'center' | 'right'. */
|
|
183
242
|
jc: string;
|
|
184
243
|
/** ECMA-376 §17.4.52 `<w:tblLayout w:type>` — 'fixed' | 'autofit'. Absent
|
|
185
|
-
* (undefined) ⇒ spec default 'autofit'
|
|
186
|
-
*
|
|
187
|
-
*
|
|
244
|
+
* (undefined) ⇒ spec default 'autofit'. Both paths size columns from the
|
|
245
|
+
* tblGrid (§17.4.48) scaled to fit: 'fixed' uses the grid verbatim; 'autofit'
|
|
246
|
+
* additionally lets content min-width grow a column. Per-cell `widthPt`/
|
|
247
|
+
* `widthPct` (`<w:tcW>`) is NOT re-applied — Word bakes the resolved widths
|
|
248
|
+
* into the saved grid (see resolveColumnWidths). Only a degenerate all-zero
|
|
249
|
+
* grid falls back to tcW-preference sizing. */
|
|
188
250
|
layout?: string;
|
|
189
251
|
/** ECMA-376 §17.4.63 `<w:tblW>` preferred table width (type="dxa"), pt. */
|
|
190
252
|
widthPt?: number;
|
|
@@ -197,6 +259,13 @@ export declare interface DocTable {
|
|
|
197
259
|
* is placed rightmost, and flips per-cell left/right borders accordingly.
|
|
198
260
|
*/
|
|
199
261
|
bidiVisual?: boolean;
|
|
262
|
+
/** ECMA-376 §17.4.57 `<w:tblpPr>` — when present the table is FLOATING
|
|
263
|
+
* (absolutely positioned, out of the main text flow). Absent ⇒ block table. */
|
|
264
|
+
tblpPr?: TblpPr;
|
|
265
|
+
/** ECMA-376 §17.4.56 `<w:tblOverlap w:val>` — 'never' | 'overlap'. 'never' ⇒
|
|
266
|
+
* the floating table must be repositioned to avoid overlapping other floats.
|
|
267
|
+
* Default 'overlap' (omitted ⇒ overlap allowed). Ignored when not floating. */
|
|
268
|
+
overlap?: string;
|
|
200
269
|
}
|
|
201
270
|
|
|
202
271
|
export declare interface DocTableCell {
|
|
@@ -206,12 +275,15 @@ export declare interface DocTableCell {
|
|
|
206
275
|
borders: CellBorders;
|
|
207
276
|
background: string | null;
|
|
208
277
|
vAlign: 'top' | 'center' | 'bottom';
|
|
209
|
-
/** ECMA-376 §17.4.71 `<w:tcW>` preferred cell width (type="dxa"), pt.
|
|
210
|
-
*
|
|
211
|
-
*
|
|
278
|
+
/** ECMA-376 §17.4.71 `<w:tcW>` preferred cell width (type="dxa"), pt. A
|
|
279
|
+
* PREFERRED width only: autofit column sizing is driven by the tblGrid
|
|
280
|
+
* (§17.4.48), not by re-applying this (Word bakes the resolved widths into
|
|
281
|
+
* the saved grid — see resolveColumnWidths). Consulted only for the
|
|
282
|
+
* degenerate all-zero-grid fallback. */
|
|
212
283
|
widthPt: number | null;
|
|
213
284
|
/** `<w:tcW>` type="pct": 50ths of a percent of available content width.
|
|
214
|
-
* Resolved against the available width at render time.
|
|
285
|
+
* Resolved against the available width at render time. Preferred width only
|
|
286
|
+
* (see `widthPt`). */
|
|
215
287
|
widthPct?: number;
|
|
216
288
|
/** Per-cell margins (pt) from `<w:tcPr><w:tcMar>` (ECMA-376 §17.4.42). Each
|
|
217
289
|
* edge overrides the table-level `cellMargin*` default when set; null/absent
|
|
@@ -339,6 +411,19 @@ export declare interface DocxDocumentModel {
|
|
|
339
411
|
settings?: DocSettings;
|
|
340
412
|
}
|
|
341
413
|
|
|
414
|
+
/** ECMA-376 §17.3.2.4 `<w:bdr>` — a run-level border drawn as a box around the
|
|
415
|
+
* run's text. Parallel to {@link ParaBorderEdge} but applies per run. */
|
|
416
|
+
export declare interface DocxRunBorder {
|
|
417
|
+
/** "single" | "double" | "dashed" | ... (w:bdr/@w:val) */
|
|
418
|
+
style: string;
|
|
419
|
+
/** hex 6-char, or null for automatic (renderer falls back to text color) */
|
|
420
|
+
color?: string | null;
|
|
421
|
+
/** pt (sz / 8) */
|
|
422
|
+
width: number;
|
|
423
|
+
/** pt spacing between the border and the run text (w:space) */
|
|
424
|
+
space: number;
|
|
425
|
+
}
|
|
426
|
+
|
|
342
427
|
export declare interface DocxTextRun {
|
|
343
428
|
text: string;
|
|
344
429
|
bold: boolean;
|
|
@@ -348,8 +433,26 @@ export declare interface DocxTextRun {
|
|
|
348
433
|
fontSize: number;
|
|
349
434
|
color: string | null;
|
|
350
435
|
fontFamily: string | null;
|
|
436
|
+
/** ECMA-376 §17.3.2.26 eastAsia axis (`<w:rFonts w:eastAsia>`), resolved
|
|
437
|
+
* through the style chain + docDefaults. CJK code points in this run render
|
|
438
|
+
* with this family; {@link DocxTextRun.fontFamily} keeps the conflated single-
|
|
439
|
+
* font fallback (ascii → eastAsia) for paths that do not split per character.
|
|
440
|
+
* The renderer routes consecutive CJK code points to this axis (the same per-
|
|
441
|
+
* script rule {@link ShapeTextRun.fontFamilyEastAsia} uses), so a Gothic
|
|
442
|
+
* eastAsia title sits beside a serif ascii number with no name heuristics.
|
|
443
|
+
* Absent ⇒ the renderer falls back to {@link DocxTextRun.fontFamily}. */
|
|
444
|
+
fontFamilyEastAsia?: string | null;
|
|
351
445
|
isLink: boolean;
|
|
352
446
|
background: string | null;
|
|
447
|
+
/** ECMA-376 §17.3.2.6 — `<w:color w:val="auto"/>` was set on this run. When
|
|
448
|
+
* true and {@link DocxTextRun.color} is absent, the renderer resolves the
|
|
449
|
+
* glyph color from the effective background (an implementation-defined
|
|
450
|
+
* black/white contrast pick; ECMA-376 gives no normative algorithm) instead
|
|
451
|
+
* of the default text color. */
|
|
452
|
+
colorAuto?: boolean | null;
|
|
453
|
+
/** ECMA-376 §17.3.2.4 `<w:bdr>` — a run-level border (box) drawn around the
|
|
454
|
+
* run text. Absent when the run has no border. */
|
|
455
|
+
border?: DocxRunBorder | null;
|
|
353
456
|
vertAlign: 'super' | 'sub' | null;
|
|
354
457
|
/** Target URL for hyperlinks (resolved from relationships.xml) */
|
|
355
458
|
hyperlink: string | null;
|
|
@@ -481,6 +584,45 @@ export declare interface FieldRun {
|
|
|
481
584
|
highlight?: string | null;
|
|
482
585
|
}
|
|
483
586
|
|
|
587
|
+
/**
|
|
588
|
+
* ECMA-376 §17.3.1.11 `<w:framePr>` — text-frame / drop-cap properties.
|
|
589
|
+
*
|
|
590
|
+
* Lengths are pt (parser converts from twips). Per the spec, `x`/`y` are
|
|
591
|
+
* ignored when `xAlign`/`yAlign` are set, and for a drop cap `y`/`yAlign` are
|
|
592
|
+
* ignored entirely while `lines` drives the height. `w`/`h`/`x`/`y` are
|
|
593
|
+
* `undefined` when the attribute was absent (distinct from an explicit 0).
|
|
594
|
+
*/
|
|
595
|
+
export declare interface FramePr {
|
|
596
|
+
/** ST_DropCap (§17.18.20): 'none' | 'drop' | 'margin'. Default 'none'. */
|
|
597
|
+
dropCap: 'none' | 'drop' | 'margin' | string;
|
|
598
|
+
/** §17.3.1.11 `lines` — drop-cap vertical height in anchor lines. Default 1. */
|
|
599
|
+
lines: number;
|
|
600
|
+
/** ST_Wrap (§17.18.104): 'around'|'auto'|'none'|'notBeside'|'through'|'tight'. Default 'around'. */
|
|
601
|
+
wrap: 'around' | 'auto' | 'none' | 'notBeside' | 'through' | 'tight' | string;
|
|
602
|
+
/** ST_HAnchor (§17.18.35): 'text'(=column) | 'margin' | 'page'. Default 'page'. */
|
|
603
|
+
hAnchor: 'text' | 'margin' | 'page' | string;
|
|
604
|
+
/** ST_VAnchor (§17.18.100): 'text' | 'margin' | 'page'. Default 'page'. */
|
|
605
|
+
vAnchor: 'text' | 'margin' | 'page' | string;
|
|
606
|
+
/** ST_HeightRule (§17.18.37): 'auto' | 'atLeast' | 'exact'. Default 'auto'. */
|
|
607
|
+
hRule: 'auto' | 'atLeast' | 'exact' | string;
|
|
608
|
+
/** hSpace — min wrap padding L/R when wrap='around' (pt). Default 0. */
|
|
609
|
+
hSpace: number;
|
|
610
|
+
/** vSpace — min wrap padding top/bottom (pt). Default 0. */
|
|
611
|
+
vSpace: number;
|
|
612
|
+
/** w — exact frame width (pt). Absent ⇒ auto (max content line width). */
|
|
613
|
+
w?: number;
|
|
614
|
+
/** h — frame height (pt). Meaning gated by hRule. Absent ⇒ auto. */
|
|
615
|
+
h?: number;
|
|
616
|
+
/** x — absolute horizontal offset from hAnchor (pt). Ignored when xAlign set. */
|
|
617
|
+
x?: number;
|
|
618
|
+
/** y — absolute vertical offset from vAnchor (pt). Ignored when yAlign set / drop cap. */
|
|
619
|
+
y?: number;
|
|
620
|
+
/** ST_XAlign (§22.9.2.18): 'left'|'center'|'right'|'inside'|'outside'. Supersedes x. */
|
|
621
|
+
xAlign?: 'left' | 'center' | 'right' | 'inside' | 'outside' | string;
|
|
622
|
+
/** ST_YAlign (§22.9.2.20): 'inline'|'top'|'center'|'bottom'|'inside'|'outside'. Supersedes y. */
|
|
623
|
+
yAlign?: 'inline' | 'top' | 'center' | 'bottom' | 'inside' | 'outside' | string;
|
|
624
|
+
}
|
|
625
|
+
|
|
484
626
|
export declare interface GradientStop {
|
|
485
627
|
/** 0.0–1.0 */
|
|
486
628
|
position: number;
|
|
@@ -563,6 +705,29 @@ export declare interface ImageRun {
|
|
|
563
705
|
* reposition the object to prevent any overlap.
|
|
564
706
|
*/
|
|
565
707
|
allowOverlap?: boolean;
|
|
708
|
+
/** ECMA-376 §20.4.3.1 wp:align horizontal: "left" | "center" | "right" |
|
|
709
|
+
* "inside" | "outside". When set the renderer aligns the image inside the
|
|
710
|
+
* container indicated by `anchorXFromMargin` and ignores `anchorXPt`.
|
|
711
|
+
* Mirrors {@link ShapeRun.anchorXAlign}. Absent for inline images and
|
|
712
|
+
* offset-based anchors. */
|
|
713
|
+
anchorXAlign?: string | null;
|
|
714
|
+
/** Vertical equivalent of anchorXAlign: "top" | "center" | "bottom". */
|
|
715
|
+
anchorYAlign?: string | null;
|
|
716
|
+
/**
|
|
717
|
+
* ECMA-376 §20.4.3.2 `<wp:positionH/@relativeFrom>` / §20.4.3.5
|
|
718
|
+
* `<wp:positionV/@relativeFrom>` — names the container the offset / align /
|
|
719
|
+
* pctPos is measured against. Raw spec string: `"page"`, `"margin"`,
|
|
720
|
+
* `"paragraph"`, `"line"`, `"leftMargin"`, `"rightMargin"`, `"topMargin"`,
|
|
721
|
+
* `"bottomMargin"`, `"insideMargin"`, `"outsideMargin"`, `"column"`,
|
|
722
|
+
* `"character"`. Mirrors {@link ShapeRun.anchorXRelativeFrom} /
|
|
723
|
+
* {@link ShapeRun.anchorYRelativeFrom}. When present, supersedes the legacy
|
|
724
|
+
* coarse boolean hints (`anchorXFromMargin` / `anchorYFromPara`) for the
|
|
725
|
+
* align and pctPos paths so e.g. `relativeFrom="margin"` + `align="top"`
|
|
726
|
+
* pins the image to the top content margin rather than the page top. Absent
|
|
727
|
+
* for inline images and for anchors that omitted `<wp:positionH/V>`.
|
|
728
|
+
*/
|
|
729
|
+
anchorXRelativeFrom?: string | null;
|
|
730
|
+
anchorYRelativeFrom?: string | null;
|
|
566
731
|
}
|
|
567
732
|
|
|
568
733
|
/** DrawingML line-end (arrow head). ECMA-376 §20.1.8.3 CT_LineEndProperties.
|
|
@@ -803,6 +968,33 @@ export declare interface NumberingInfo {
|
|
|
803
968
|
/** ECMA-376 §17.9.28 `<w:suff>` — "tab" (default) | "space" | "nothing".
|
|
804
969
|
* Where body text starts after the marker on the first line. */
|
|
805
970
|
suff: string;
|
|
971
|
+
/** ECMA-376 §17.9.8 `<w:lvlJc>` — marker justification: "left" (default) |
|
|
972
|
+
* "right" (period-aligned numerals: marker RIGHT edge at the hanging-indent
|
|
973
|
+
* position) | "center". The renderer offsets the marker draw accordingly.
|
|
974
|
+
* Always emitted by the parser; optional here so hand-built fixtures may omit
|
|
975
|
+
* it (the renderer treats absent as "left"). */
|
|
976
|
+
jc?: string;
|
|
977
|
+
/** ECMA-376 §17.3.2.26 ascii axis for the marker glyph, resolved through the
|
|
978
|
+
* level's `rPr` (§17.9.6) merged over the paragraph's run formatting. The
|
|
979
|
+
* renderer draws Latin marker chars (e.g. a decimal "1") with this family, so
|
|
980
|
+
* a heading whose ascii=Times renders its auto-number in Times (serif) even
|
|
981
|
+
* when eastAsia=Gothic. Absent ⇒ the renderer falls back to its default. */
|
|
982
|
+
fontFamily?: string | null;
|
|
983
|
+
/** ECMA-376 §17.3.2.26 eastAsia axis for the marker glyph (same resolution as
|
|
984
|
+
* {@link NumberingInfo.fontFamily}). The renderer draws CJK marker chars with
|
|
985
|
+
* this family. Absent ⇒ the renderer falls back to
|
|
986
|
+
* {@link NumberingInfo.fontFamily}. */
|
|
987
|
+
fontFamilyEastAsia?: string | null;
|
|
988
|
+
/** ECMA-376 §17.9.9/§17.9.20 — when the level uses a `<w:lvlPicBulletId>`,
|
|
989
|
+
* the marker is this image (zip path, e.g. `word/media/image1.gif`), drawn in
|
|
990
|
+
* place of {@link NumberingInfo.text}. Absent ⇒ ordinary text/glyph marker. */
|
|
991
|
+
picBulletImagePath?: string;
|
|
992
|
+
/** MIME type of {@link NumberingInfo.picBulletImagePath} (e.g. `image/gif`). */
|
|
993
|
+
picBulletMimeType?: string;
|
|
994
|
+
/** Picture-bullet marker width in pt (from the `<v:shape style="width">`). */
|
|
995
|
+
picBulletWidthPt?: number;
|
|
996
|
+
/** Picture-bullet marker height in pt (from the `<v:shape style="height">`). */
|
|
997
|
+
picBulletHeightPt?: number;
|
|
806
998
|
}
|
|
807
999
|
|
|
808
1000
|
export declare interface ParaBorderEdge {
|
|
@@ -901,6 +1093,18 @@ export declare interface SectionProps {
|
|
|
901
1093
|
* "linesAndChars", auto line spacing multiplies against this pitch instead of
|
|
902
1094
|
* the font's natural line height. */
|
|
903
1095
|
docGridLinePitch?: number | null;
|
|
1096
|
+
/** ECMA-376 §17.6.5 w:docGrid/@w:charSpace (ST_DecimalNumber, signed). The
|
|
1097
|
+
* raw character-grid spacing in 1/4096ths of an em (NOT twips). When
|
|
1098
|
+
* docGridType is "linesAndChars" or "snapToChars", every full-width East-
|
|
1099
|
+
* Asian glyph occupies a fixed cell of width `fontSizePt + charSpace/4096` pt
|
|
1100
|
+
* (negative = tighter). Absent ⇒ East-Asian glyphs keep their natural em
|
|
1101
|
+
* advance. */
|
|
1102
|
+
docGridCharSpace?: number | null;
|
|
1103
|
+
/** ECMA-376 §17.6.4 `<w:cols>` — newspaper-style multi-column layout. `null`
|
|
1104
|
+
* (or absent) ⇒ single full-width column (unchanged behavior). When present,
|
|
1105
|
+
* body text flows top-to-bottom through `count` columns (newspaper fill);
|
|
1106
|
+
* see {@link computeColumns}. */
|
|
1107
|
+
columns?: ColumnsSpec | null;
|
|
904
1108
|
}
|
|
905
1109
|
|
|
906
1110
|
declare type ShapeFill = {
|
|
@@ -980,6 +1184,17 @@ export declare interface ShapeRun {
|
|
|
980
1184
|
/** `<a:xfrm flipV>` (§20.1.7.6) — mirror about the horizontal centre line. */
|
|
981
1185
|
flipV?: boolean;
|
|
982
1186
|
wrapMode?: string | null;
|
|
1187
|
+
/** Padding top (pt). Anchor-only. Mirrors {@link ImageRun.distTop}; an anchored
|
|
1188
|
+
* wrap-shape uses these to size its float-exclusion band (ECMA-376 §20.4.2.x). */
|
|
1189
|
+
distTop?: number;
|
|
1190
|
+
/** Padding bottom (pt). Anchor-only. */
|
|
1191
|
+
distBottom?: number;
|
|
1192
|
+
/** Padding left (pt). Anchor-only. */
|
|
1193
|
+
distLeft?: number;
|
|
1194
|
+
/** Padding right (pt). Anchor-only. */
|
|
1195
|
+
distRight?: number;
|
|
1196
|
+
/** wrapText attribute: "bothSides" | "left" | "right" | "largest". */
|
|
1197
|
+
wrapSide?: string | null;
|
|
983
1198
|
/** Text rendered INSIDE the shape's bounding box (`<wps:txbx><w:txbxContent>`). */
|
|
984
1199
|
textBlocks?: ShapeText[];
|
|
985
1200
|
/** "t" | "ctr" | "b" — vertical anchor for the shape's text body (`<wps:bodyPr @anchor>`). */
|
|
@@ -997,7 +1212,45 @@ export declare interface ShapeText {
|
|
|
997
1212
|
fontFamily?: string | null;
|
|
998
1213
|
bold?: boolean;
|
|
999
1214
|
italic?: boolean;
|
|
1215
|
+
/** Per-run formatting for this paragraph (one entry per `<w:r>` with text).
|
|
1216
|
+
* When non-empty the renderer draws the block as rich text (each run's
|
|
1217
|
+
* font); otherwise it uses the single block-level format fields above
|
|
1218
|
+
* (image blocks / legacy single-format paragraphs). Absent for image-only
|
|
1219
|
+
* paragraphs. */
|
|
1220
|
+
runs?: ShapeTextRun[];
|
|
1000
1221
|
alignment: string;
|
|
1222
|
+
/** Zip path of an inline image inside this text-box paragraph
|
|
1223
|
+
* (`<w:drawing><wp:inline><a:blip r:embed>`), e.g. `word/media/image1.emf`.
|
|
1224
|
+
* Absent for a text-only paragraph. */
|
|
1225
|
+
imagePath?: string;
|
|
1226
|
+
/** MIME type of the blip at {@link ShapeText.imagePath}. */
|
|
1227
|
+
mimeType?: string;
|
|
1228
|
+
/** Zip path of the vector original (`asvg:svgBlip` extension), preferred over
|
|
1229
|
+
* `imagePath` when present. */
|
|
1230
|
+
svgImagePath?: string;
|
|
1231
|
+
/** Inline image natural width in pt (from `<wp:extent cx>`). */
|
|
1232
|
+
imageWidthPt?: number;
|
|
1233
|
+
/** Inline image natural height in pt (from `<wp:extent cy>`). */
|
|
1234
|
+
imageHeightPt?: number;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
/** One formatting run (`<w:r>`) inside a shape-text paragraph. Mirrors the
|
|
1238
|
+
* character-formatting fields of {@link ShapeText}; the renderer lays a
|
|
1239
|
+
* paragraph's {@link ShapeText.runs} out as rich text so mixed bold/non-bold
|
|
1240
|
+
* runs each keep their own font. */
|
|
1241
|
+
export declare interface ShapeTextRun {
|
|
1242
|
+
text: string;
|
|
1243
|
+
fontSizePt: number;
|
|
1244
|
+
color?: string | null;
|
|
1245
|
+
/** ECMA-376 §17.3.2.26 ascii axis (`<w:rFonts w:ascii>`), resolved through
|
|
1246
|
+
* docDefaults. Latin letters/digits in this run render with this family. */
|
|
1247
|
+
fontFamily?: string | null;
|
|
1248
|
+
/** ECMA-376 §17.3.2.26 eastAsia axis (`<w:rFonts w:eastAsia>`), resolved
|
|
1249
|
+
* through docDefaults. CJK characters in this run render with this family;
|
|
1250
|
+
* the renderer falls back to {@link ShapeTextRun.fontFamily} when absent. */
|
|
1251
|
+
fontFamilyEastAsia?: string | null;
|
|
1252
|
+
bold?: boolean;
|
|
1253
|
+
italic?: boolean;
|
|
1001
1254
|
}
|
|
1002
1255
|
|
|
1003
1256
|
export declare interface TableBorders {
|
|
@@ -1016,6 +1269,39 @@ export declare interface TabStop {
|
|
|
1016
1269
|
leader: 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
|
|
1017
1270
|
}
|
|
1018
1271
|
|
|
1272
|
+
/**
|
|
1273
|
+
* ECMA-376 §17.4.57 `<w:tblpPr>` — floating-table positioning. Present in
|
|
1274
|
+
* `<w:tblPr>` ⇒ the table FLOATS (out of the main text flow, absolutely
|
|
1275
|
+
* positioned by its top-left corner). All fields are optional in the source.
|
|
1276
|
+
*/
|
|
1277
|
+
export declare interface TblpPr {
|
|
1278
|
+
/** §17.4.57 minimum distance to wrapping text (dist padding), pt. Default 0. */
|
|
1279
|
+
leftFromText: number;
|
|
1280
|
+
rightFromText: number;
|
|
1281
|
+
topFromText: number;
|
|
1282
|
+
bottomFromText: number;
|
|
1283
|
+
/** §17.4.57 ST_HAnchor {text,margin,page}. Default 'page'. */
|
|
1284
|
+
horzAnchor: 'text' | 'margin' | 'page' | string;
|
|
1285
|
+
/** True iff the source `<w:tblpPr>` carried ANY horizontal positioning hint
|
|
1286
|
+
* (horzAnchor, tblpX, or tblpXSpec). When false, no horizontal position was
|
|
1287
|
+
* given: ECMA-376's literal default is the page edge, but Word places such a
|
|
1288
|
+
* table at the anchor paragraph's text/column left. computeFloatTableBox uses
|
|
1289
|
+
* this flag to apply that Word-runtime placement. */
|
|
1290
|
+
horzSpecified: boolean;
|
|
1291
|
+
/** §17.4.57 ST_VAnchor {text,margin,page}. Default 'page'. */
|
|
1292
|
+
vertAnchor: 'text' | 'margin' | 'page' | string;
|
|
1293
|
+
/** §17.4.57 absolute signed offset from the horz/vert anchor edge, pt.
|
|
1294
|
+
* Default 0. Ignored when the matching `*Spec` is present. */
|
|
1295
|
+
tblpX: number;
|
|
1296
|
+
tblpY: number;
|
|
1297
|
+
/** §17.4.57 ST_XAlign {left,center,right,inside,outside}. Supersedes tblpX. */
|
|
1298
|
+
tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside' | string;
|
|
1299
|
+
/** §17.4.57 ST_YAlign {inline,top,center,bottom,inside,outside}. Supersedes
|
|
1300
|
+
* tblpY, UNLESS vertAnchor='text' (relative vertical positioning is not
|
|
1301
|
+
* allowed there ⇒ tblpYSpec is ignored, fall back to tblpY). */
|
|
1302
|
+
tblpYSpec?: 'inline' | 'top' | 'center' | 'bottom' | 'inside' | 'outside' | string;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1019
1305
|
/** Serializable subset of RenderPageOptions (callbacks cannot cross the wire). */
|
|
1020
1306
|
export declare type WireRenderPageOptions = Omit<RenderPageOptions, 'onTextRun'>;
|
|
1021
1307
|
|