@silurus/ooxml 0.66.2 → 0.67.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.
@@ -46,11 +46,20 @@ export declare type BodyElement = {
46
46
  * "continuous" (same page), "nextPage" (default; page break), "oddPage" /
47
47
  * "evenPage" (page break + parity padding). The paginator switches its active
48
48
  * newspaper-column geometry per section at each marker — fixing the regression
49
- * where every section inherited the body-level section's columns. */
49
+ * where every section inherited the body-level section's columns.
50
+ *
51
+ * `headers`/`footers` carry the ENDING section's resolved (§17.10.1-inherited)
52
+ * header/footer set, and `titlePage` its own `<w:titlePg>` flag, so the renderer
53
+ * can pick the active section's header/footer per page (mirroring how `columns`
54
+ * drives per-section column geometry). The body-level (final) section's sets
55
+ * live on {@link DocxDocumentModel.section}/`.headers`/`.footers` instead. */
50
56
  | {
51
57
  type: 'sectionBreak';
52
58
  kind: 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | string;
53
59
  columns?: ColumnsSpec | null;
60
+ headers?: HeadersFooters;
61
+ footers?: HeadersFooters;
62
+ titlePage?: boolean;
54
63
  };
55
64
 
56
65
  export declare interface BorderSpec {
@@ -1242,6 +1251,12 @@ export declare interface ShapeText {
1242
1251
  * paragraphs. */
1243
1252
  runs?: ShapeTextRun[];
1244
1253
  alignment: string;
1254
+ /** ECMA-376 §17.3.1.33 `<w:spacing w:before>` of this text-box paragraph, in
1255
+ * pt — reserved ABOVE the paragraph inside the box. Absent/0 ⇒ no offset. */
1256
+ spaceBefore?: number;
1257
+ /** ECMA-376 §17.3.1.33 `<w:spacing w:after>` of this text-box paragraph, in
1258
+ * pt — reserved BELOW the paragraph. Absent/0 ⇒ no offset. */
1259
+ spaceAfter?: number;
1245
1260
  /** Zip path of an inline image inside this text-box paragraph
1246
1261
  * (`<w:drawing><wp:inline><a:blip r:embed>`), e.g. `word/media/image1.emf`.
1247
1262
  * Absent for a text-only paragraph. */
@@ -91,11 +91,20 @@ declare type BodyElement = {
91
91
  * "continuous" (same page), "nextPage" (default; page break), "oddPage" /
92
92
  * "evenPage" (page break + parity padding). The paginator switches its active
93
93
  * newspaper-column geometry per section at each marker — fixing the regression
94
- * where every section inherited the body-level section's columns. */
94
+ * where every section inherited the body-level section's columns.
95
+ *
96
+ * `headers`/`footers` carry the ENDING section's resolved (§17.10.1-inherited)
97
+ * header/footer set, and `titlePage` its own `<w:titlePg>` flag, so the renderer
98
+ * can pick the active section's header/footer per page (mirroring how `columns`
99
+ * drives per-section column geometry). The body-level (final) section's sets
100
+ * live on {@link DocxDocumentModel.section}/`.headers`/`.footers` instead. */
95
101
  | {
96
102
  type: 'sectionBreak';
97
103
  kind: 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | string;
98
104
  columns?: ColumnsSpec | null;
105
+ headers?: HeadersFooters;
106
+ footers?: HeadersFooters;
107
+ titlePage?: boolean;
99
108
  };
100
109
 
101
110
  declare interface Border {
@@ -1779,6 +1788,18 @@ declare interface ImageAnchor {
1779
1788
  * svgBlip extension. Its MIME is always `image/svg+xml` and is owned by the
1780
1789
  * SVG decoder. */
1781
1790
  svgImagePath?: string;
1791
+ /** ECMA-376 §20.1.8.55 `<a:srcRect>` source-image crop. Each edge inset is a
1792
+ * fraction `0..1` of the source bitmap, measured inward, so the visible
1793
+ * source region is `[l, t, 1-r, 1-b]`. Absent (the common case) ⇒ the whole
1794
+ * blip fills the anchor rect; when present, the renderer draws only the
1795
+ * cropped sub-rectangle (raster only — a metafile is rasterized to the
1796
+ * display box, so its crop can't be honored faithfully and is skipped). */
1797
+ srcRect?: {
1798
+ l: number;
1799
+ t: number;
1800
+ r: number;
1801
+ b: number;
1802
+ };
1782
1803
  }
1783
1804
 
1784
1805
  /**
@@ -2539,14 +2560,16 @@ declare interface PictureElement {
2539
2560
  */
2540
2561
  prstAdjust?: number[];
2541
2562
  /**
2542
- * ECMA-376 a:srcRect — source image crop as fractions (0..1) of the source
2543
- * width/height. Omitted when the image is not cropped.
2563
+ * ECMA-376 §20.1.8.55 a:srcRect — source image crop as fractions (0..1) of the
2564
+ * source width/height, measured inward from each edge. Omitted when the image
2565
+ * is not cropped; when present the parser emits all four edges (absent edges
2566
+ * default to 0), so the renderer reads them without a fallback.
2544
2567
  */
2545
2568
  srcRect?: {
2546
- l?: number;
2547
- t?: number;
2548
- r?: number;
2549
- b?: number;
2569
+ l: number;
2570
+ t: number;
2571
+ r: number;
2572
+ b: number;
2550
2573
  };
2551
2574
  /** a:blip > a:alphaModFix@amt as 0..1. Undefined = fully opaque. */
2552
2575
  alpha?: number;
@@ -3332,6 +3355,16 @@ declare type ShapeGeom = {
3332
3355
  * when the picture carries no svgBlip extension. Its MIME is always
3333
3356
  * `image/svg+xml` and is owned by the SVG decoder. */
3334
3357
  svgImagePath?: string;
3358
+ /** ECMA-376 §20.1.8.55 `<a:srcRect>` source-image crop on the leaf pic
3359
+ * (fractions `0..1` inward from each edge; visible region `[l, t, 1-r,
3360
+ * 1-b]`). Absent ⇒ the whole blip fills the leaf rect. Honored identically
3361
+ * to the top-level {@link ImageAnchor.srcRect} (raster only). */
3362
+ srcRect?: {
3363
+ l: number;
3364
+ t: number;
3365
+ r: number;
3366
+ b: number;
3367
+ };
3335
3368
  };
3336
3369
 
3337
3370
  declare interface ShapeInfo {
@@ -3472,6 +3505,12 @@ declare interface ShapeText_2 {
3472
3505
  * paragraphs. */
3473
3506
  runs?: ShapeTextRun_2[];
3474
3507
  alignment: string;
3508
+ /** ECMA-376 §17.3.1.33 `<w:spacing w:before>` of this text-box paragraph, in
3509
+ * pt — reserved ABOVE the paragraph inside the box. Absent/0 ⇒ no offset. */
3510
+ spaceBefore?: number;
3511
+ /** ECMA-376 §17.3.1.33 `<w:spacing w:after>` of this text-box paragraph, in
3512
+ * pt — reserved BELOW the paragraph. Absent/0 ⇒ no offset. */
3513
+ spaceAfter?: number;
3475
3514
  /** Zip path of an inline image inside this text-box paragraph
3476
3515
  * (`<w:drawing><wp:inline><a:blip r:embed>`), e.g. `word/media/image1.emf`.
3477
3516
  * Absent for a text-only paragraph. */
@@ -1077,14 +1077,16 @@ export declare interface PictureElement {
1077
1077
  */
1078
1078
  prstAdjust?: number[];
1079
1079
  /**
1080
- * ECMA-376 a:srcRect — source image crop as fractions (0..1) of the source
1081
- * width/height. Omitted when the image is not cropped.
1080
+ * ECMA-376 §20.1.8.55 a:srcRect — source image crop as fractions (0..1) of the
1081
+ * source width/height, measured inward from each edge. Omitted when the image
1082
+ * is not cropped; when present the parser emits all four edges (absent edges
1083
+ * default to 0), so the renderer reads them without a fallback.
1082
1084
  */
1083
1085
  srcRect?: {
1084
- l?: number;
1085
- t?: number;
1086
- r?: number;
1087
- b?: number;
1086
+ l: number;
1087
+ t: number;
1088
+ r: number;
1089
+ b: number;
1088
1090
  };
1089
1091
  /** a:blip > a:alphaModFix@amt as 0..1. Undefined = fully opaque. */
1090
1092
  alpha?: number;
@@ -476,6 +476,18 @@ export declare interface ImageAnchor {
476
476
  * svgBlip extension. Its MIME is always `image/svg+xml` and is owned by the
477
477
  * SVG decoder. */
478
478
  svgImagePath?: string;
479
+ /** ECMA-376 §20.1.8.55 `<a:srcRect>` source-image crop. Each edge inset is a
480
+ * fraction `0..1` of the source bitmap, measured inward, so the visible
481
+ * source region is `[l, t, 1-r, 1-b]`. Absent (the common case) ⇒ the whole
482
+ * blip fills the anchor rect; when present, the renderer draws only the
483
+ * cropped sub-rectangle (raster only — a metafile is rasterized to the
484
+ * display box, so its crop can't be honored faithfully and is skipped). */
485
+ srcRect?: {
486
+ l: number;
487
+ t: number;
488
+ r: number;
489
+ b: number;
490
+ };
479
491
  }
480
492
 
481
493
  export declare interface LegendManualLayout {
@@ -892,6 +904,16 @@ export declare type ShapeGeom = {
892
904
  * when the picture carries no svgBlip extension. Its MIME is always
893
905
  * `image/svg+xml` and is owned by the SVG decoder. */
894
906
  svgImagePath?: string;
907
+ /** ECMA-376 §20.1.8.55 `<a:srcRect>` source-image crop on the leaf pic
908
+ * (fractions `0..1` inward from each edge; visible region `[l, t, 1-r,
909
+ * 1-b]`). Absent ⇒ the whole blip fills the leaf rect. Honored identically
910
+ * to the top-level {@link ImageAnchor.srcRect} (raster only). */
911
+ srcRect?: {
912
+ l: number;
913
+ t: number;
914
+ r: number;
915
+ b: number;
916
+ };
895
917
  };
896
918
 
897
919
  export declare interface ShapeInfo {