@silurus/ooxml 0.64.3 → 0.66.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.
@@ -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': columns are sized by the per-column
186
- * max preferred width (cell `widthPt`), tblGrid only as fallback. 'fixed'
187
- * uses tblGrid widths verbatim (scaled to fit). */
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. Drives
210
- * autofit column sizing: each grid column's width is the max `widthPt` over
211
- * the cells anchored in it. */
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;
@@ -516,6 +658,22 @@ export declare interface ImageRun {
516
658
  * image. Its MIME is always `image/svg+xml` and is owned by the SVG decoder.
517
659
  */
518
660
  svgImagePath?: string;
661
+ /**
662
+ * ECMA-376 §20.1.8.55 `<a:srcRect>` — the source-rectangle crop applied to
663
+ * the decoded bitmap before it is drawn into the display box. The four values
664
+ * are inset FRACTIONS 0..1 of the source bitmap measured inward from each
665
+ * edge (`l`/`t` from left/top, `r`/`b` from right/bottom); the visible source
666
+ * region is `[l, t, 1−r, 1−b]`. The parser converts the raw ST_Percentage
667
+ * (1000ths of a percent) to fractions, so the renderer crops in bitmap pixels
668
+ * (`sx = l*w`, `sy = t*h`, `sw = (1−l−r)*w`, `sh = (1−t−b)*h`) without unit
669
+ * knowledge. Absent / null when there is no crop (the full bitmap is drawn).
670
+ */
671
+ srcRect?: {
672
+ l: number;
673
+ t: number;
674
+ r: number;
675
+ b: number;
676
+ } | null;
519
677
  widthPt: number;
520
678
  heightPt: number;
521
679
  /** true = wp:anchor (absolute positioned), false/undefined = wp:inline (flows with text) */
@@ -563,6 +721,29 @@ export declare interface ImageRun {
563
721
  * reposition the object to prevent any overlap.
564
722
  */
565
723
  allowOverlap?: boolean;
724
+ /** ECMA-376 §20.4.3.1 wp:align horizontal: "left" | "center" | "right" |
725
+ * "inside" | "outside". When set the renderer aligns the image inside the
726
+ * container indicated by `anchorXFromMargin` and ignores `anchorXPt`.
727
+ * Mirrors {@link ShapeRun.anchorXAlign}. Absent for inline images and
728
+ * offset-based anchors. */
729
+ anchorXAlign?: string | null;
730
+ /** Vertical equivalent of anchorXAlign: "top" | "center" | "bottom". */
731
+ anchorYAlign?: string | null;
732
+ /**
733
+ * ECMA-376 §20.4.3.2 `<wp:positionH/@relativeFrom>` / §20.4.3.5
734
+ * `<wp:positionV/@relativeFrom>` — names the container the offset / align /
735
+ * pctPos is measured against. Raw spec string: `"page"`, `"margin"`,
736
+ * `"paragraph"`, `"line"`, `"leftMargin"`, `"rightMargin"`, `"topMargin"`,
737
+ * `"bottomMargin"`, `"insideMargin"`, `"outsideMargin"`, `"column"`,
738
+ * `"character"`. Mirrors {@link ShapeRun.anchorXRelativeFrom} /
739
+ * {@link ShapeRun.anchorYRelativeFrom}. When present, supersedes the legacy
740
+ * coarse boolean hints (`anchorXFromMargin` / `anchorYFromPara`) for the
741
+ * align and pctPos paths so e.g. `relativeFrom="margin"` + `align="top"`
742
+ * pins the image to the top content margin rather than the page top. Absent
743
+ * for inline images and for anchors that omitted `<wp:positionH/V>`.
744
+ */
745
+ anchorXRelativeFrom?: string | null;
746
+ anchorYRelativeFrom?: string | null;
566
747
  }
567
748
 
568
749
  /** DrawingML line-end (arrow head). ECMA-376 §20.1.8.3 CT_LineEndProperties.
@@ -803,6 +984,33 @@ export declare interface NumberingInfo {
803
984
  /** ECMA-376 §17.9.28 `<w:suff>` — "tab" (default) | "space" | "nothing".
804
985
  * Where body text starts after the marker on the first line. */
805
986
  suff: string;
987
+ /** ECMA-376 §17.9.8 `<w:lvlJc>` — marker justification: "left" (default) |
988
+ * "right" (period-aligned numerals: marker RIGHT edge at the hanging-indent
989
+ * position) | "center". The renderer offsets the marker draw accordingly.
990
+ * Always emitted by the parser; optional here so hand-built fixtures may omit
991
+ * it (the renderer treats absent as "left"). */
992
+ jc?: string;
993
+ /** ECMA-376 §17.3.2.26 ascii axis for the marker glyph, resolved through the
994
+ * level's `rPr` (§17.9.6) merged over the paragraph's run formatting. The
995
+ * renderer draws Latin marker chars (e.g. a decimal "1") with this family, so
996
+ * a heading whose ascii=Times renders its auto-number in Times (serif) even
997
+ * when eastAsia=Gothic. Absent ⇒ the renderer falls back to its default. */
998
+ fontFamily?: string | null;
999
+ /** ECMA-376 §17.3.2.26 eastAsia axis for the marker glyph (same resolution as
1000
+ * {@link NumberingInfo.fontFamily}). The renderer draws CJK marker chars with
1001
+ * this family. Absent ⇒ the renderer falls back to
1002
+ * {@link NumberingInfo.fontFamily}. */
1003
+ fontFamilyEastAsia?: string | null;
1004
+ /** ECMA-376 §17.9.9/§17.9.20 — when the level uses a `<w:lvlPicBulletId>`,
1005
+ * the marker is this image (zip path, e.g. `word/media/image1.gif`), drawn in
1006
+ * place of {@link NumberingInfo.text}. Absent ⇒ ordinary text/glyph marker. */
1007
+ picBulletImagePath?: string;
1008
+ /** MIME type of {@link NumberingInfo.picBulletImagePath} (e.g. `image/gif`). */
1009
+ picBulletMimeType?: string;
1010
+ /** Picture-bullet marker width in pt (from the `<v:shape style="width">`). */
1011
+ picBulletWidthPt?: number;
1012
+ /** Picture-bullet marker height in pt (from the `<v:shape style="height">`). */
1013
+ picBulletHeightPt?: number;
806
1014
  }
807
1015
 
808
1016
  export declare interface ParaBorderEdge {
@@ -895,12 +1103,31 @@ export declare interface SectionProps {
895
1103
  footerDistance: number;
896
1104
  titlePage: boolean;
897
1105
  evenAndOddHeaders: boolean;
1106
+ /** ECMA-376 §17.6.22 ST_SectionMark — the body (final) section's `<w:type>`
1107
+ * start type ("continuous" | "nextPage" | "oddPage" | "evenPage"). Governs
1108
+ * how the last section begins relative to the previous one; consumed by the
1109
+ * paginator at the boundary INTO the final section. Absent ⇒ "nextPage" (the
1110
+ * spec default). Non-final sections carry their start type on their own
1111
+ * SectionBreak marker. */
1112
+ sectionStart?: string | null;
898
1113
  /** ECMA-376 §17.6.5 w:docGrid/@w:type — "default" | "lines" | "linesAndChars" | "snapToChars". */
899
1114
  docGridType?: string | null;
900
1115
  /** ECMA-376 §17.6.5 w:docGrid/@w:linePitch in pt. When docGridType is "lines" or
901
1116
  * "linesAndChars", auto line spacing multiplies against this pitch instead of
902
1117
  * the font's natural line height. */
903
1118
  docGridLinePitch?: number | null;
1119
+ /** ECMA-376 §17.6.5 w:docGrid/@w:charSpace (ST_DecimalNumber, signed). The
1120
+ * raw character-grid spacing in 1/4096ths of an em (NOT twips). When
1121
+ * docGridType is "linesAndChars" or "snapToChars", every full-width East-
1122
+ * Asian glyph occupies a fixed cell of width `fontSizePt + charSpace/4096` pt
1123
+ * (negative = tighter). Absent ⇒ East-Asian glyphs keep their natural em
1124
+ * advance. */
1125
+ docGridCharSpace?: number | null;
1126
+ /** ECMA-376 §17.6.4 `<w:cols>` — newspaper-style multi-column layout. `null`
1127
+ * (or absent) ⇒ single full-width column (unchanged behavior). When present,
1128
+ * body text flows top-to-bottom through `count` columns (newspaper fill);
1129
+ * see {@link computeColumns}. */
1130
+ columns?: ColumnsSpec | null;
904
1131
  }
905
1132
 
906
1133
  declare type ShapeFill = {
@@ -980,6 +1207,17 @@ export declare interface ShapeRun {
980
1207
  /** `<a:xfrm flipV>` (§20.1.7.6) — mirror about the horizontal centre line. */
981
1208
  flipV?: boolean;
982
1209
  wrapMode?: string | null;
1210
+ /** Padding top (pt). Anchor-only. Mirrors {@link ImageRun.distTop}; an anchored
1211
+ * wrap-shape uses these to size its float-exclusion band (ECMA-376 §20.4.2.x). */
1212
+ distTop?: number;
1213
+ /** Padding bottom (pt). Anchor-only. */
1214
+ distBottom?: number;
1215
+ /** Padding left (pt). Anchor-only. */
1216
+ distLeft?: number;
1217
+ /** Padding right (pt). Anchor-only. */
1218
+ distRight?: number;
1219
+ /** wrapText attribute: "bothSides" | "left" | "right" | "largest". */
1220
+ wrapSide?: string | null;
983
1221
  /** Text rendered INSIDE the shape's bounding box (`<wps:txbx><w:txbxContent>`). */
984
1222
  textBlocks?: ShapeText[];
985
1223
  /** "t" | "ctr" | "b" — vertical anchor for the shape's text body (`<wps:bodyPr @anchor>`). */
@@ -997,7 +1235,45 @@ export declare interface ShapeText {
997
1235
  fontFamily?: string | null;
998
1236
  bold?: boolean;
999
1237
  italic?: boolean;
1238
+ /** Per-run formatting for this paragraph (one entry per `<w:r>` with text).
1239
+ * When non-empty the renderer draws the block as rich text (each run's
1240
+ * font); otherwise it uses the single block-level format fields above
1241
+ * (image blocks / legacy single-format paragraphs). Absent for image-only
1242
+ * paragraphs. */
1243
+ runs?: ShapeTextRun[];
1000
1244
  alignment: string;
1245
+ /** Zip path of an inline image inside this text-box paragraph
1246
+ * (`<w:drawing><wp:inline><a:blip r:embed>`), e.g. `word/media/image1.emf`.
1247
+ * Absent for a text-only paragraph. */
1248
+ imagePath?: string;
1249
+ /** MIME type of the blip at {@link ShapeText.imagePath}. */
1250
+ mimeType?: string;
1251
+ /** Zip path of the vector original (`asvg:svgBlip` extension), preferred over
1252
+ * `imagePath` when present. */
1253
+ svgImagePath?: string;
1254
+ /** Inline image natural width in pt (from `<wp:extent cx>`). */
1255
+ imageWidthPt?: number;
1256
+ /** Inline image natural height in pt (from `<wp:extent cy>`). */
1257
+ imageHeightPt?: number;
1258
+ }
1259
+
1260
+ /** One formatting run (`<w:r>`) inside a shape-text paragraph. Mirrors the
1261
+ * character-formatting fields of {@link ShapeText}; the renderer lays a
1262
+ * paragraph's {@link ShapeText.runs} out as rich text so mixed bold/non-bold
1263
+ * runs each keep their own font. */
1264
+ export declare interface ShapeTextRun {
1265
+ text: string;
1266
+ fontSizePt: number;
1267
+ color?: string | null;
1268
+ /** ECMA-376 §17.3.2.26 ascii axis (`<w:rFonts w:ascii>`), resolved through
1269
+ * docDefaults. Latin letters/digits in this run render with this family. */
1270
+ fontFamily?: string | null;
1271
+ /** ECMA-376 §17.3.2.26 eastAsia axis (`<w:rFonts w:eastAsia>`), resolved
1272
+ * through docDefaults. CJK characters in this run render with this family;
1273
+ * the renderer falls back to {@link ShapeTextRun.fontFamily} when absent. */
1274
+ fontFamilyEastAsia?: string | null;
1275
+ bold?: boolean;
1276
+ italic?: boolean;
1001
1277
  }
1002
1278
 
1003
1279
  export declare interface TableBorders {
@@ -1016,6 +1292,39 @@ export declare interface TabStop {
1016
1292
  leader: 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
1017
1293
  }
1018
1294
 
1295
+ /**
1296
+ * ECMA-376 §17.4.57 `<w:tblpPr>` — floating-table positioning. Present in
1297
+ * `<w:tblPr>` ⇒ the table FLOATS (out of the main text flow, absolutely
1298
+ * positioned by its top-left corner). All fields are optional in the source.
1299
+ */
1300
+ export declare interface TblpPr {
1301
+ /** §17.4.57 minimum distance to wrapping text (dist padding), pt. Default 0. */
1302
+ leftFromText: number;
1303
+ rightFromText: number;
1304
+ topFromText: number;
1305
+ bottomFromText: number;
1306
+ /** §17.4.57 ST_HAnchor {text,margin,page}. Default 'page'. */
1307
+ horzAnchor: 'text' | 'margin' | 'page' | string;
1308
+ /** True iff the source `<w:tblpPr>` carried ANY horizontal positioning hint
1309
+ * (horzAnchor, tblpX, or tblpXSpec). When false, no horizontal position was
1310
+ * given: ECMA-376's literal default is the page edge, but Word places such a
1311
+ * table at the anchor paragraph's text/column left. computeFloatTableBox uses
1312
+ * this flag to apply that Word-runtime placement. */
1313
+ horzSpecified: boolean;
1314
+ /** §17.4.57 ST_VAnchor {text,margin,page}. Default 'page'. */
1315
+ vertAnchor: 'text' | 'margin' | 'page' | string;
1316
+ /** §17.4.57 absolute signed offset from the horz/vert anchor edge, pt.
1317
+ * Default 0. Ignored when the matching `*Spec` is present. */
1318
+ tblpX: number;
1319
+ tblpY: number;
1320
+ /** §17.4.57 ST_XAlign {left,center,right,inside,outside}. Supersedes tblpX. */
1321
+ tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside' | string;
1322
+ /** §17.4.57 ST_YAlign {inline,top,center,bottom,inside,outside}. Supersedes
1323
+ * tblpY, UNLESS vertAnchor='text' (relative vertical positioning is not
1324
+ * allowed there ⇒ tblpYSpec is ignored, fall back to tblpY). */
1325
+ tblpYSpec?: 'inline' | 'top' | 'center' | 'bottom' | 'inside' | 'outside' | string;
1326
+ }
1327
+
1019
1328
  /** Serializable subset of RenderPageOptions (callbacks cannot cross the wire). */
1020
1329
  export declare type WireRenderPageOptions = Omit<RenderPageOptions, 'onTextRun'>;
1021
1330