@silurus/ooxml 0.56.0 → 0.57.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.
@@ -32,6 +32,19 @@ declare interface AutoResizeOptions {
32
32
  pauseWhenHidden?: boolean;
33
33
  }
34
34
 
35
+ /**
36
+ * `<a:bevel>` — ECMA-376 §20.1.5.3 (`CT_Bevel`). Lengths in EMU; `w`/`h`
37
+ * default to 76200 EMU and `prst` to "circle".
38
+ */
39
+ declare interface Bevel3d {
40
+ /** Bevel width in EMU. */
41
+ w: number;
42
+ /** Bevel height in EMU. */
43
+ h: number;
44
+ /** Bevel preset name (`ST_BevelPresetType`). */
45
+ prst: string;
46
+ }
47
+
35
48
  declare type BodyElement = {
36
49
  type: 'paragraph';
37
50
  } & DocParagraph | {
@@ -83,6 +96,21 @@ declare type Bullet = {
83
96
  startAt: number | null;
84
97
  };
85
98
 
99
+ /**
100
+ * `<a:camera>` — ECMA-376 §20.1.5.5 (`CT_Camera`). `prst` selects one of the
101
+ * 62 preset cameras (§20.1.10.47); `fov`/`zoom`/`rot` optionally override it.
102
+ */
103
+ declare interface Camera3d {
104
+ /** Preset camera name (`ST_PresetCameraType`), e.g. "perspectiveRelaxed". */
105
+ prst: string;
106
+ /** Field-of-view override in degrees. Omitted = preset default. */
107
+ fov?: number;
108
+ /** Zoom factor as a unit ratio (1.0 = 100%). Omitted = 1.0. */
109
+ zoom?: number;
110
+ /** Camera rotation override. Omitted = preset base orientation. */
111
+ rot?: Rot3d;
112
+ }
113
+
86
114
  declare interface Cell {
87
115
  col: number;
88
116
  row: number;
@@ -305,7 +333,7 @@ declare interface ChartData {
305
333
  * adapter tell "spec said noFill → transparent" from "no spPr → default". */
306
334
  hasChartSpPr?: boolean;
307
335
  /** `<c:legend><c:manualLayout>` fractions of chart space (§21.2.2.31). */
308
- legendManualLayout?: LegendManualLayout | null;
336
+ legendManualLayout?: LegendManualLayout_2 | null;
309
337
  /** `<c:catAx><c:delete val="1"/>` — hide the category axis (§21.2.2.40). */
310
338
  catAxisHidden?: boolean;
311
339
  /** `<c:valAx><c:delete val="1"/>` — hide the value axis (§21.2.2.40). */
@@ -512,6 +540,169 @@ declare interface ChartManualLayout {
512
540
  h?: number;
513
541
  }
514
542
 
543
+ declare interface ChartModel {
544
+ chartType: ChartType;
545
+ title: string | null;
546
+ categories: string[];
547
+ series: ChartSeries[];
548
+ /** Show data labels on bars / points / slices. */
549
+ showDataLabels: boolean;
550
+ /** Explicit Y-axis minimum (OOXML `<c:valAx><c:min>`). */
551
+ valMin: number | null;
552
+ /** Explicit Y-axis maximum (OOXML `<c:valAx><c:max>`). */
553
+ valMax: number | null;
554
+ catAxisTitle: string | null;
555
+ valAxisTitle: string | null;
556
+ /** `<c:catAx><c:delete val="1"/>`. */
557
+ catAxisHidden: boolean;
558
+ /** `<c:valAx><c:delete val="1"/>`. */
559
+ valAxisHidden: boolean;
560
+ /** `<c:catAx><c:spPr><a:ln><a:noFill>` — hide just the axis LINE; labels
561
+ * and tick marks still render. Distinct from `catAxisHidden` (which
562
+ * removes everything via `<c:delete val="1"/>`). */
563
+ catAxisLineHidden: boolean;
564
+ /** `<c:valAx><c:spPr><a:ln><a:noFill>` — hide just the axis LINE; labels
565
+ * and tick marks still render. */
566
+ valAxisLineHidden: boolean;
567
+ /** Hex without '#'. From `<c:plotArea><c:spPr><a:solidFill>`. */
568
+ plotAreaBg: string | null;
569
+ /** Outer chartSpace background (hex without '#'). null when noFill/absent. */
570
+ chartBg: string | null;
571
+ /** True when `<c:legend>` is declared in the chart XML. False = no legend. */
572
+ showLegend: boolean;
573
+ /** `<c:legend><c:legendPos val>` — "r"|"l"|"t"|"b"|"tr". null = default (r). */
574
+ legendPos: 'r' | 'l' | 't' | 'b' | 'tr' | null;
575
+ /** `<c:catAx><c:crossBetween val="..."/>`. "between" inserts 0.5-step padding
576
+ * on each end of the category axis; "midCat" anchors endpoints to the axes. */
577
+ catAxisCrossBetween: 'between' | 'midCat' | string;
578
+ /** `<c:valAx><c:majorTickMark>`. ECMA-376 default is "cross". */
579
+ valAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
580
+ /** `<c:catAx><c:majorTickMark>`. */
581
+ catAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
582
+ /** `<c:valAx | catAx><c:minorTickMark>`. ECMA-376 default is "none". */
583
+ valAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
584
+ catAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
585
+ /** Title font size in OOXML hundredths of a point (1600 = 16pt). null = default. */
586
+ titleFontSizeHpt: number | null;
587
+ /** Title font color as a hex string without '#' (e.g. "1B4332"). null = default. */
588
+ titleFontColor: string | null;
589
+ /** Title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). null = default. */
590
+ titleFontFace: string | null;
591
+ /** `<c:catAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
592
+ catAxisFontSizeHpt: number | null;
593
+ /** `<c:valAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
594
+ valAxisFontSizeHpt: number | null;
595
+ /** `<c:catAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#').
596
+ * null = renderer default. Lets templates color category labels gray. */
597
+ catAxisFontColor?: string | null;
598
+ /** `<c:valAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
599
+ valAxisFontColor?: string | null;
600
+ /** `<c:dLbls><c:txPr>` font size (hpt) for data-point value labels. */
601
+ dataLabelFontSizeHpt: number | null;
602
+ /** Waterfall subtotal category indices. */
603
+ subtotalIndices: number[];
604
+ /** `<c:legend><c:manualLayout>` absolute placement fractions of the chart
605
+ * space (ECMA-376 §21.2.2.31). Overrides the default side-based legend
606
+ * rectangle while still letting `legendPos` decide which side of the plot
607
+ * gets the reserved band. null = use default layout. */
608
+ legendManualLayout?: LegendManualLayout | null;
609
+ /**
610
+ * `<c:valAx><c:numFmt@formatCode>` — format code applied to value-axis tick
611
+ * labels (ECMA-376 §21.2.2.21). null = plain numeric formatting.
612
+ */
613
+ valAxisFormatCode?: string | null;
614
+ /**
615
+ * `<c:barChart><c:gapWidth>` — space between category groups as a
616
+ * percentage of bar width (ECMA-376 §21.2.2.13). Default per spec is 150.
617
+ * null = renderer default.
618
+ */
619
+ barGapWidth?: number | null;
620
+ /**
621
+ * `<c:barChart><c:overlap>` — signed percentage overlap between bars in the
622
+ * same category cluster (ECMA-376 §21.2.2.25). Negative = gap, positive =
623
+ * overlap, 0 = flush. Range [-100, 100]. null = renderer default (0).
624
+ */
625
+ barOverlap?: number | null;
626
+ /**
627
+ * `<c:dLbls><c:dLblPos>` — data label position (ECMA-376 §21.2.2.16).
628
+ * "ctr"|"inBase"|"inEnd"|"outEnd"|"l"|"r"|"t"|"b"|"bestFit" etc.
629
+ */
630
+ dataLabelPosition?: string | null;
631
+ /** Hex (no `#`) for data label text, resolved from `<c:dLbls><c:txPr>`. */
632
+ dataLabelFontColor?: string | null;
633
+ /**
634
+ * `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
635
+ * number format (ECMA-376 §21.2.2.35). When absent, `valFormatCode` on each
636
+ * series is used.
637
+ */
638
+ dataLabelFormatCode?: string | null;
639
+ /** `<c:title>...defRPr@b>` chart title bold flag. */
640
+ titleFontBold?: boolean | null;
641
+ /** `<c:catAx><c:txPr>...defRPr@b>` X-axis tick label bold flag. */
642
+ catAxisFontBold?: boolean | null;
643
+ /** `<c:valAx><c:txPr>...defRPr@b>` Y-axis tick label bold flag. */
644
+ valAxisFontBold?: boolean | null;
645
+ /**
646
+ * `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives the Y
647
+ * coordinate where the X axis is drawn. Default `autoZero` puts the X
648
+ * axis at y=0 — that's how Excel "Project Timeline" templates split
649
+ * milestones (positive Y) above and tasks (negative Y) below the axis.
650
+ */
651
+ catAxisCrosses?: string | null;
652
+ /** `<c:catAx><c:crossesAt val>` — explicit numeric override for the
653
+ * crossing point. Takes precedence over `catAxisCrosses`. */
654
+ catAxisCrossesAt?: number | null;
655
+ valAxisCrosses?: string | null;
656
+ valAxisCrossesAt?: number | null;
657
+ /** Axis line color (hex without `#`) and width in EMU from
658
+ * `<c:catAx|valAx><c:spPr><a:ln>`. */
659
+ catAxisLineColor?: string | null;
660
+ catAxisLineWidthEmu?: number | null;
661
+ valAxisLineColor?: string | null;
662
+ valAxisLineWidthEmu?: number | null;
663
+ /**
664
+ * `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). When set,
665
+ * the renderer formats X-axis tick labels with this code (e.g. dates).
666
+ */
667
+ catAxisFormatCode?: string | null;
668
+ /**
669
+ * `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. Used by
670
+ * scatter / bubble charts whose X axis is numeric. null = derive from
671
+ * data extents.
672
+ */
673
+ catAxisMin?: number | null;
674
+ catAxisMax?: number | null;
675
+ /**
676
+ * `<c:title><c:layout><c:manualLayout>` (ECMA-376 §21.2.2.27) absolute
677
+ * placement for the chart title.
678
+ */
679
+ titleManualLayout?: ChartManualLayout | null;
680
+ /**
681
+ * `<c:plotArea><c:layout><c:manualLayout>` absolute placement for the
682
+ * plot area. `layoutTarget="inner"` (default) describes the inner plot
683
+ * rect (no axes / labels); `outer` describes the outer rect (axes
684
+ * included).
685
+ */
686
+ plotAreaManualLayout?: ChartManualLayout | null;
687
+ /**
688
+ * `<c:scatterChart><c:scatterStyle val>` (ECMA-376 §21.2.2.42). Drives
689
+ * whether scatter charts connect points with lines and whether those
690
+ * lines are smoothed. Values: "marker" (markers only — Excel default
691
+ * "Scatter"), "line" / "lineMarker" (straight segments), "smooth" /
692
+ * "smoothMarker" (cubic Bézier through points), "lineNoMarker",
693
+ * "smoothNoMarker". null = renderer default ("marker"). Only consulted
694
+ * for `chartType === "scatter"`; bubble ignores it.
695
+ */
696
+ scatterStyle?: string | null;
697
+ /**
698
+ * `<c:radarChart><c:radarStyle val>` (ECMA-376 §21.2.3.10). Controls
699
+ * whether radar series render as line + markers ("standard" / "marker")
700
+ * or as a closed polygon with area fill ("filled"). null = default
701
+ * ("standard" — line, no fill). Only consulted for `chartType === "radar"`.
702
+ */
703
+ radarStyle?: string | null;
704
+ }
705
+
515
706
  declare interface ChartSeries {
516
707
  name: string;
517
708
  /** Hex without '#'. null = fall back to palette. */
@@ -626,6 +817,13 @@ declare interface ChartSeriesDataLabels {
626
817
  fontSizeHpt?: number;
627
818
  }
628
819
 
820
+ /**
821
+ * Canonical chart type vocabulary. Embeds direction (`H` = horizontal) and
822
+ * grouping (`Pct` = percent-stacked) so renderers do not need to inspect
823
+ * separate `barDir`/`grouping` fields.
824
+ */
825
+ declare type ChartType = 'line' | 'stackedLine' | 'stackedLinePct' | 'clusteredBar' | 'clusteredBarH' | 'stackedBar' | 'stackedBarH' | 'stackedBarPct' | 'stackedBarHPct' | 'area' | 'stackedArea' | 'stackedAreaPct' | 'pie' | 'doughnut' | 'scatter' | 'bubble' | 'radar' | 'waterfall' | string;
826
+
629
827
  declare interface ConditionalFormat {
630
828
  sqref: CellRange[];
631
829
  rules: CfRule[];
@@ -822,17 +1020,38 @@ export declare namespace docx {
822
1020
  autoResize,
823
1021
  AutoResizeOptions,
824
1022
  DocxDocumentModel,
1023
+ DocSettings,
825
1024
  SectionProps,
1025
+ HeadersFooters,
1026
+ HeaderFooter,
1027
+ NumberingInfo,
826
1028
  BodyElement,
827
1029
  DocParagraph,
828
1030
  DocRun,
829
1031
  DocxTextRun,
1032
+ FieldRun,
830
1033
  ImageRun,
1034
+ ShapeRun,
1035
+ ShapeText_2 as ShapeText,
1036
+ RubyAnnotation,
831
1037
  RenderPageOptions,
832
1038
  RunRevision,
833
1039
  DocRevision,
834
1040
  DocComment,
835
1041
  DocNote,
1042
+ LineSpacing,
1043
+ TabStop_2 as TabStop,
1044
+ ParagraphBorders,
1045
+ ParaBorderEdge,
1046
+ DocTable,
1047
+ DocTableRow,
1048
+ DocTableCell,
1049
+ CellElement,
1050
+ TableBorders,
1051
+ CellBorders,
1052
+ BorderSpec,
1053
+ PathCmd_3 as PathCmd,
1054
+ GradientStop_2 as GradientStop,
836
1055
  DocxTextRunInfo
837
1056
  }
838
1057
  }
@@ -1195,6 +1414,18 @@ declare interface ImageRun {
1195
1414
  }
1196
1415
 
1197
1416
  declare interface LegendManualLayout {
1417
+ /** `"edge"` = `x`/`y` are fractions from top-left of chart space;
1418
+ * `"factor"` = fractions offset from the default position. */
1419
+ xMode: string;
1420
+ yMode: string;
1421
+ /** Fractions of chart space width/height. */
1422
+ x: number;
1423
+ y: number;
1424
+ w: number;
1425
+ h: number;
1426
+ }
1427
+
1428
+ declare interface LegendManualLayout_2 {
1198
1429
  xMode: string;
1199
1430
  yMode: string;
1200
1431
  x: number;
@@ -1203,6 +1434,19 @@ declare interface LegendManualLayout {
1203
1434
  h: number;
1204
1435
  }
1205
1436
 
1437
+ /**
1438
+ * `<a:lightRig>` — ECMA-376 §20.1.5.9 (`CT_LightRig`). Parsed for Phase B
1439
+ * (lighting/bevel shading); the Phase A camera renderer ignores it.
1440
+ */
1441
+ declare interface LightRig {
1442
+ /** Light-rig preset (`ST_LightRigType`), e.g. "threePt". */
1443
+ rig: string;
1444
+ /** Light direction (`ST_LightRigDirection`): tl/t/tr/l/r/bl/b/br. */
1445
+ dir: string;
1446
+ /** Optional rotation override of the rig. */
1447
+ rot?: Rot3d;
1448
+ }
1449
+
1206
1450
  declare interface LineBreak {
1207
1451
  type: 'break';
1208
1452
  }
@@ -1635,8 +1879,29 @@ declare interface PictureElement {
1635
1879
  flipV: boolean;
1636
1880
  /** Data URL, e.g. "data:image/png;base64,..." */
1637
1881
  dataUrl: string;
1638
- /** OOXML adj value (0–100000) for roundRect clip, null = plain rectangle */
1639
- clipAdjust: number | null;
1882
+ /**
1883
+ * Border line from `<p:pic><p:spPr><a:ln>` (ECMA-376 §20.1.2.2.24). A
1884
+ * `p:pic`'s spPr is `CT_ShapeProperties` (§19.3.1.37), so a picture carries
1885
+ * the same line model as a shape. `null` when there is no `<a:ln>` or it
1886
+ * resolves to `<a:noFill/>` (border explicitly suppressed). The border is
1887
+ * stroked along the picture's clip silhouette (roundRect / custGeom / rect).
1888
+ */
1889
+ stroke: Stroke | null;
1890
+ /**
1891
+ * `<p:spPr><a:prstGeom prst="…">` preset name (e.g. `"roundRect"`,
1892
+ * `"ellipse"`). ECMA-376 §20.1.9.18: a picture's preset geometry is its clip
1893
+ * silhouette and the path its border / contour hug. Undefined / omitted = a
1894
+ * plain rectangle (`prst="rect"` or no prstGeom). When set, the renderer
1895
+ * builds the silhouette via the shared preset-geometry engine (any of the 186
1896
+ * presets). `custGeom` takes priority when both are present.
1897
+ */
1898
+ prstGeom?: string;
1899
+ /**
1900
+ * Adjust guides from the prstGeom `<a:avLst>` (1/1000-of-a-percent OOXML
1901
+ * units), in `gd@name` declaration order (index 0 = adj/adj1, 1 = adj2, …).
1902
+ * Omitted when avLst is empty — the preset's own declared defaults then apply.
1903
+ */
1904
+ prstAdjust?: number[];
1640
1905
  /**
1641
1906
  * ECMA-376 a:srcRect — source image crop as fractions (0..1) of the source
1642
1907
  * width/height. Omitted when the image is not cropped.
@@ -1657,6 +1922,27 @@ declare interface PictureElement {
1657
1922
  * trimmed to the laptop / device silhouette declared in the file.
1658
1923
  */
1659
1924
  custGeom?: PathCmd[][] | null;
1925
+ /**
1926
+ * Drop shadow from `spPr > effectLst > outerShdw`. A `p:pic`'s `spPr` is
1927
+ * `CT_ShapeProperties` (ECMA-376 §19.3.1.37), so the same effects shapes
1928
+ * carry apply to images. ECMA-376 §20.1.8.45 (CT_OuterShadowEffect).
1929
+ */
1930
+ shadow?: Shadow;
1931
+ /** Inner (inset) shadow from effectLst > innerShdw. ECMA-376 §20.1.8.40. */
1932
+ innerShadow?: Shadow;
1933
+ /** Coloured glow halo from effectLst > glow. ECMA-376 §20.1.8.32. */
1934
+ glow?: Glow;
1935
+ /** Soft (feathered) edge from effectLst > softEdge. ECMA-376 §20.1.8.53. */
1936
+ softEdge?: SoftEdge;
1937
+ /** Mirrored reflection from effectLst > reflection. ECMA-376 §20.1.8.50. */
1938
+ reflection?: Reflection;
1939
+ /** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). A `p:pic`'s spPr is
1940
+ * `CT_ShapeProperties`, so 3D scenes apply to images. When non-identity the
1941
+ * renderer projects the picture through the camera homography (Phase A). */
1942
+ scene3d?: Scene3d;
1943
+ /** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
1944
+ * rendered in Phase A. */
1945
+ sp3d?: Sp3d;
1660
1946
  }
1661
1947
 
1662
1948
  export declare namespace pptx {
@@ -1670,6 +1956,7 @@ export declare namespace pptx {
1670
1956
  RenderOptions,
1671
1957
  PptxTextRunInfo,
1672
1958
  TextRunCallback,
1959
+ PresentationHandle,
1673
1960
  autoResize,
1674
1961
  AutoResizeOptions,
1675
1962
  Presentation,
@@ -1677,15 +1964,39 @@ export declare namespace pptx {
1677
1964
  SlideElement,
1678
1965
  ShapeElement,
1679
1966
  PictureElement,
1967
+ TableElement,
1968
+ TableRow,
1969
+ TableCell,
1970
+ ChartElement,
1971
+ MediaElement,
1972
+ TextRect,
1973
+ Scene3d,
1974
+ Camera3d,
1975
+ Rot3d,
1976
+ LightRig,
1977
+ Sp3d,
1978
+ Bevel3d,
1680
1979
  Fill,
1681
1980
  SolidFill,
1682
1981
  NoFill,
1982
+ GradientFill,
1983
+ GradientStop,
1683
1984
  Stroke,
1985
+ Shadow,
1986
+ Glow,
1987
+ SoftEdge,
1988
+ Reflection,
1989
+ PathCmd,
1990
+ Bullet,
1991
+ SpaceLine,
1992
+ TabStop,
1684
1993
  TextBody,
1685
1994
  Paragraph,
1686
1995
  TextRun,
1687
1996
  TextRunData,
1688
- LineBreak
1997
+ LineBreak,
1998
+ ChartModel,
1999
+ ChartSeries
1689
2000
  }
1690
2001
  }
1691
2002
 
@@ -1736,9 +2047,9 @@ declare class PptxPresentation {
1736
2047
  private _findMimeTypeForPath;
1737
2048
  /**
1738
2049
  * Render a slide and attach canvas-native playback controls for any
1739
- * embedded audio/video. Returns a disposable handle that owns the RAF loop,
1740
- * media elements, and object URLs. Unlike {@link renderSlide}, this method
1741
- * is stateful — always call `handle.dispose()` when leaving the slide.
2050
+ * embedded audio/video. Returns a {@link PresentationHandle} that owns the
2051
+ * RAF loop, media elements, and object URLs. Unlike {@link renderSlide}, this
2052
+ * method is stateful — always call `handle.destroy()` when leaving the slide.
1742
2053
  */
1743
2054
  presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: RenderSlideOptions): Promise<PresentationHandle>;
1744
2055
  /** Terminate the worker and release all resources. */
@@ -1857,7 +2168,13 @@ declare interface Presentation {
1857
2168
  declare interface PresentationHandle {
1858
2169
  play(mediaPath?: string): void;
1859
2170
  pause(mediaPath?: string): void;
1860
- dispose(): void;
2171
+ /**
2172
+ * Stop the playback RAF loop, detach pointer listeners and release every
2173
+ * media blob URL. Named `destroy()` to match the teardown method on the
2174
+ * viewers/documents (`PptxViewer.destroy()`, `XlsxWorkbook.destroy()`, …)
2175
+ * so the public API uses one consistent teardown verb.
2176
+ */
2177
+ destroy(): void;
1861
2178
  }
1862
2179
 
1863
2180
  /** ECMA-376 §20.1.8.27 (CT_ReflectionEffect) — mirrored copy below the
@@ -1980,6 +2297,21 @@ declare interface RenderViewportOptions {
1980
2297
  } | null;
1981
2298
  }
1982
2299
 
2300
+ /**
2301
+ * 3D rotation in sphere coordinates — ECMA-376 §20.1.5.11 (`CT_SphereCoords`).
2302
+ * Angles are in **degrees** (the XML carries 60000ths of a degree; the parser
2303
+ * divides once). Per the spec, `lat`/`lon` are latitude/longitude and `rev` is
2304
+ * the revolution about the resulting view axis.
2305
+ */
2306
+ declare interface Rot3d {
2307
+ /** Latitude — rotation about the horizontal (X) axis, degrees. */
2308
+ lat: number;
2309
+ /** Longitude — rotation about the vertical (Y) axis, degrees. */
2310
+ lon: number;
2311
+ /** Revolution — in-plane rotation about the view (Z) axis, degrees. */
2312
+ rev: number;
2313
+ }
2314
+
1983
2315
  declare interface Row {
1984
2316
  index: number;
1985
2317
  height: number | null;
@@ -2027,6 +2359,15 @@ declare interface RunRevision {
2027
2359
  date?: string;
2028
2360
  }
2029
2361
 
2362
+ /**
2363
+ * `<a:scene3d>` — ECMA-376 §20.1.4.1.41 (`CT_Scene3D`). Camera + light rig for
2364
+ * a shape's 3D scene.
2365
+ */
2366
+ declare interface Scene3d {
2367
+ camera: Camera3d;
2368
+ lightRig?: LightRig;
2369
+ }
2370
+
2030
2371
  declare interface SectionProps {
2031
2372
  pageWidth: number;
2032
2373
  pageHeight: number;
@@ -2139,6 +2480,13 @@ declare interface ShapeElement {
2139
2480
  * same space as x/y/width/height). When present the renderer lays text out in
2140
2481
  * this rectangle instead of the preset/ellipse-derived text rectangle. */
2141
2482
  textRect?: TextRect;
2483
+ /** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). When the camera is
2484
+ * non-identity the renderer projects the shape through the camera
2485
+ * homography (Phase A). */
2486
+ scene3d?: Scene3d;
2487
+ /** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
2488
+ * rendered in Phase A. */
2489
+ sp3d?: Sp3d;
2142
2490
  }
2143
2491
 
2144
2492
  declare type ShapeFill = {
@@ -2154,6 +2502,11 @@ declare type ShapeFill = {
2154
2502
  declare type ShapeGeom = {
2155
2503
  type: 'preset';
2156
2504
  name: string;
2505
+ /** Adjust handles from `<a:avLst><a:gd>` in `adj1..adj8` order
2506
+ * (ECMA-376 §19.5.31.3 / §20.1.9.5). `null` entries mean "use the
2507
+ * preset's declared default". Omitted entirely when the shape has no
2508
+ * `<a:avLst>`. Consumed by the shared `renderPresetShape` engine. */
2509
+ adj?: (number | null)[];
2157
2510
  } | {
2158
2511
  type: 'custom';
2159
2512
  paths: PathInfo[];
@@ -2369,6 +2722,31 @@ declare interface SolidFill {
2369
2722
  color: string;
2370
2723
  }
2371
2724
 
2725
+ /**
2726
+ * `<a:sp3d>` — ECMA-376 §20.1.5.12 (`CT_Shape3D`). Parsed in full but **not
2727
+ * rendered in Phase A** (camera-only). bevel/contour/extrusion are Phase B.
2728
+ * Numeric fields are omitted from JSON when zero.
2729
+ */
2730
+ declare interface Sp3d {
2731
+ /** Z position of the front face in EMU (default 0). */
2732
+ z?: number;
2733
+ /** Extrusion (depth) height in EMU (default 0). */
2734
+ extrusionH?: number;
2735
+ /** Contour (outline) width in EMU (default 0). */
2736
+ contourW?: number;
2737
+ /** Contour colour (`<a:contourClr>`, ECMA-376 §20.1.5.12) as a hex string
2738
+ * (e.g. "969696"). Omitted when absent. The renderer draws a flat
2739
+ * approximation of the 3D contour edge (uniform-width outline, no bevel
2740
+ * shading) when both `contourW` and `contourClr` are present. */
2741
+ contourClr?: string;
2742
+ /** Preset surface material (`ST_PresetMaterialType`), default "warmMatte". */
2743
+ prstMaterial: string;
2744
+ /** Top bevel. */
2745
+ bevelT?: Bevel3d;
2746
+ /** Bottom bevel. */
2747
+ bevelB?: Bevel3d;
2748
+ }
2749
+
2372
2750
  declare type SpaceLine = {
2373
2751
  type: 'pct';
2374
2752
  val: number;
@@ -2513,13 +2891,29 @@ declare interface TableInfo {
2513
2891
  /** Accent color resolved by the parser from the built-in style name against
2514
2892
  * the file's theme accents (e.g. `TableStyleLight18` → accent3). */
2515
2893
  accentColor: string;
2894
+ /** `true` when `styleName` is defined in the file's `<tableStyles>` block,
2895
+ * i.e. a *custom* style (ECMA-376 §18.5.1.2). The renderer draws such tables
2896
+ * strictly from their declared element dxfs and must NOT apply the accent
2897
+ * approximation (banding / synthesized rules / header) reserved for built-in
2898
+ * style names whose definitions are absent from the file. */
2899
+ isCustom?: boolean;
2516
2900
  /** Dxf index for the `wholeTable` element of a custom `<tableStyle>`
2517
- * (ECMA-376 §18.8.40). When set, its border/fill apply to every cell of
2901
+ * (ECMA-376 §18.8.83). When set, its border/fill apply to every cell of
2518
2902
  * the table as a base layer. Undefined for built-in style names. */
2519
2903
  wholeTableDxf?: number;
2520
2904
  /** Dxf index for the `headerRow` element of a custom `<tableStyle>` —
2521
2905
  * provides header background, font color/weight, and vertical separators. */
2522
2906
  headerRowDxf?: number;
2907
+ /** Dxf index for the `totalRow` element (ECMA-376 §18.18.93). */
2908
+ totalRowDxf?: number;
2909
+ /** Dxf index for the `firstColumn` element. */
2910
+ firstColumnDxf?: number;
2911
+ /** Dxf index for the `lastColumn` element. */
2912
+ lastColumnDxf?: number;
2913
+ /** Dxf index for `firstRowStripe` (band1 horizontal) — odd banded-row stripe. */
2914
+ band1HorizontalDxf?: number;
2915
+ /** Dxf index for `secondRowStripe` (band2 horizontal) — even banded-row stripe. */
2916
+ band2HorizontalDxf?: number;
2523
2917
  /** Per-column DXF references (ECMA-376 §18.5.1.3 `tableColumn`). Index by
2524
2918
  * `cellCol - range.left`. The renderer can use these to apply column-level
2525
2919
  * overlays for named-style tables; for files where Excel pre-bakes the
@@ -2798,7 +3192,43 @@ export declare namespace xlsx {
2798
3192
  ParsedWorkbook,
2799
3193
  ViewportRange,
2800
3194
  RenderViewportOptions,
2801
- XlsxTextRunInfo
3195
+ XlsxTextRunInfo,
3196
+ Run,
3197
+ RunFont,
3198
+ SharedString,
3199
+ Dxf,
3200
+ GradientFillSpec,
3201
+ ConditionalFormat,
3202
+ CfRule,
3203
+ CfValue,
3204
+ CfStop,
3205
+ CfIcon,
3206
+ DefinedName,
3207
+ Hyperlink,
3208
+ TableInfo,
3209
+ TableColumnInfo,
3210
+ SlicerAnchor,
3211
+ SlicerItem,
3212
+ SparklineGroup,
3213
+ Sparkline,
3214
+ ImageAnchor,
3215
+ ChartAnchor,
3216
+ ShapeAnchor,
3217
+ ShapeInfo,
3218
+ ShapeGeom,
3219
+ ShapeText,
3220
+ ShapeParagraph,
3221
+ ShapeTextRun,
3222
+ PathInfo,
3223
+ PathCmd_2 as PathCmd,
3224
+ ChartData,
3225
+ XlsxChartSeries,
3226
+ SeriesDataLabels,
3227
+ DataLabelOverride,
3228
+ DataPointOverride,
3229
+ ErrBars,
3230
+ ManualLayout,
3231
+ LegendManualLayout_2 as LegendManualLayout
2802
3232
  }
2803
3233
  }
2804
3234
 
@@ -2884,6 +3314,17 @@ declare class XlsxViewer {
2884
3314
  private currentWorksheet;
2885
3315
  private opts;
2886
3316
  private resizeObserver;
3317
+ /**
3318
+ * Start-anchored horizontal scroll position (the {@link effectiveScrollLeft}
3319
+ * value last produced by a real user scroll or a programmatic reset), kept
3320
+ * as the source of truth across container size changes. The native
3321
+ * `scrollLeft` cannot serve that role for RTL sheets (ECMA-376 §18.3.1.87):
3322
+ * it is the *inverse* of the start-anchored offset, and the browser clamps
3323
+ * any assignment to 0 while the host is unlaid-out (`display:none` mount —
3324
+ * e.g. a host revealed only after `load()` resolves), which would otherwise
3325
+ * strand the view at the sheet's far end once the host gains its real size.
3326
+ */
3327
+ private effectiveH;
2887
3328
  private anchorCell;
2888
3329
  private activeCell;
2889
3330
  private selectionMode;
@@ -2937,6 +3378,11 @@ declare class XlsxViewer {
2937
3378
  /** Park the scrollbar at the sheet's natural start: scrollLeft=0 for LTR,
2938
3379
  * the right end for RTL (so col A shows first). */
2939
3380
  private resetHorizontalScroll;
3381
+ /** Re-derive the native scrollLeft from the tracked start-anchored
3382
+ * position after the scroll host's size changes. Only RTL needs this:
3383
+ * for LTR the native scrollLeft *is* start-anchored and the browser
3384
+ * already clamps it sensibly on resize. */
3385
+ private reanchorHorizontalScroll;
2940
3386
  /** 0-based index of the currently displayed sheet. */
2941
3387
  get sheetIndex(): number;
2942
3388
  /** Total number of sheets in the loaded workbook. */
@@ -3010,7 +3456,15 @@ declare interface XlsxViewerOptions {
3010
3456
  zoomMin?: number;
3011
3457
  zoomMax?: number;
3012
3458
  onReady?: (sheetNames: string[]) => void;
3013
- onSheetChange?: (index: number, name: string) => void;
3459
+ /**
3460
+ * Called when the active sheet changes, with the new sheet's zero-based
3461
+ * `index` and the `total` number of sheets in the workbook. This mirrors the
3462
+ * docx `onPageChange` and pptx `onSlideChange` contracts so all three viewers
3463
+ * share one callback shape. To get the sheet *name*, look it up by index from
3464
+ * `viewer.sheetNames[index]` (or the `sheetNames` array delivered to
3465
+ * `onReady`).
3466
+ */
3467
+ onSheetChange?: (index: number, total: number) => void;
3014
3468
  onError?: (err: Error) => void;
3015
3469
  /** Called when the selected cell range changes. null means no selection. */
3016
3470
  onSelectionChange?: (selection: CellRange_2 | null) => void;