@silurus/ooxml 0.69.0 → 0.70.1

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.
@@ -206,166 +206,397 @@ export declare interface ChartAnchor {
206
206
  toColOff: number;
207
207
  toRow: number;
208
208
  toRowOff: number;
209
- chart: ChartData;
209
+ /** The chart payload, already in the canonical {@link ChartModel} shape the
210
+ * Rust parser emits. The parser adapts its internal parse structure into
211
+ * `ChartModel` (formerly the TS `adaptChartData`); this is passed straight
212
+ * to `renderChart`. */
213
+ chart: ChartModel;
214
+ }
215
+
216
+ export declare interface ChartDataLabelOverride {
217
+ idx: number;
218
+ /** Empty string = label deleted (skip drawing). */
219
+ text: string;
220
+ /** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit". undefined = inherit. */
221
+ position?: string;
222
+ fontColor?: string;
223
+ fontSizeHpt?: number;
224
+ /** `<a:defRPr b="1">` inside the per-idx rich text. */
225
+ fontBold?: boolean;
226
+ }
227
+
228
+ export declare interface ChartDataPointOverride {
229
+ idx: number;
230
+ /** Resolved fill hex (no `#`). */
231
+ color?: string;
232
+ markerSymbol?: string;
233
+ markerSize?: number;
234
+ markerFill?: string;
235
+ markerLine?: string;
236
+ }
237
+
238
+ export declare interface ChartErrBars {
239
+ /** "x" | "y". */
240
+ dir: string;
241
+ /** "plus" | "minus" | "both". */
242
+ barType: string;
243
+ plus: (number | null)[];
244
+ minus: (number | null)[];
245
+ noEndCap: boolean;
246
+ /** Resolved hex (no `#`). */
247
+ color?: string;
248
+ lineWidthEmu?: number;
249
+ /** "solid"|"dash"|"dot"|"dashDot"|... */
250
+ dash?: string;
210
251
  }
211
252
 
212
253
  /**
213
- * XLSX parser's raw chart output. Retains parser-native `barDir` + `grouping`
214
- * which the renderer combines into a canonical `ChartModel.chartType` (e.g.
215
- * `clusteredBarH`, `stackedBarPct`) at render time.
254
+ * `<c:manualLayout>` block. Fractions are of the chart-space rect.
255
+ * `xMode`/`yMode`: "edge" = absolute fraction from top-left, "factor" =
256
+ * fraction offset from default position.
216
257
  */
217
- export declare interface ChartData {
218
- /** Primary chart type: "bar"|"line"|"area"|"pie"|"doughnut"|"radar"|"scatter" */
219
- chartType: string;
220
- /** "col" (vertical bars) | "row" (horizontal bars) */
221
- barDir: string;
222
- /** "clustered"|"stacked"|"standard"|"percentStacked" */
223
- grouping: string;
258
+ export declare interface ChartManualLayout {
259
+ xMode: string;
260
+ yMode: string;
261
+ layoutTarget?: string;
262
+ x: number;
263
+ y: number;
264
+ w?: number;
265
+ h?: number;
266
+ }
267
+
268
+ export declare interface ChartModel {
269
+ chartType: ChartType;
224
270
  title: string | null;
225
271
  categories: string[];
226
- series: XlsxChartSeries[];
227
- /** Whether data labels are enabled (c:dLbls showVal/showPercent). */
228
- showDataLabels?: boolean;
229
- /** Category axis title (c:catAx/c:title). */
230
- catAxisTitle?: string | null;
231
- /** Value axis title (c:valAx/c:title). */
232
- valAxisTitle?: string | null;
233
- /** `<c:catAx><c:title>` run-prop font size (hpt), from the parser's
234
- * catAxisTitleSize. Distinct from `catAxisFontSizeHpt` (tick labels). */
235
- catAxisTitleSize?: number | null;
236
- /** `<c:catAx><c:title>` run-prop bold flag. */
237
- catAxisTitleBold?: boolean | null;
238
- /** `<c:catAx><c:title>` run-prop color (hex without '#'). */
239
- catAxisTitleColor?: string | null;
240
- /** `<c:valAx><c:title>` run-prop font size (hpt). */
241
- valAxisTitleSize?: number | null;
242
- /** `<c:valAx><c:title>` run-prop bold flag. */
243
- valAxisTitleBold?: boolean | null;
244
- /** `<c:valAx><c:title>` run-prop color (hex without '#'). */
245
- valAxisTitleColor?: string | null;
246
- /** True when <c:legend> is present. Absence means the legend is hidden. */
247
- showLegend?: boolean;
248
- /** `<c:legendPos val>` "r"|"l"|"t"|"b"|"tr". null/undefined = default ("r"). */
249
- legendPos?: 'r' | 'l' | 't' | 'b' | 'tr' | null;
250
- /** Chart title font size in OOXML hundredths of a point (e.g. 1400 = 14pt). */
251
- titleFontSizeHpt?: number | null;
252
- /** Chart title font color as a hex string without '#' (srgbClr only). */
253
- titleFontColor?: string | null;
254
- /** Chart title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). */
255
- titleFontFace?: string | null;
256
- /** Category axis tick-label font size in hpt (ECMA-376 §21.2.2.17 c:txPr). */
257
- catAxisFontSizeHpt?: number | null;
258
- /** Value axis tick-label font size in hpt. */
259
- valAxisFontSizeHpt?: number | null;
260
- /** Outer chartSpace background (ECMA-376 §21.2.2.5 `<c:spPr>`). Hex without
261
- * '#' for a solid fill, undefined for `<a:noFill/>` or an absent spPr.
262
- * Combine with `hasChartSpPr` to distinguish explicit-transparent from
263
- * default-opaque-white. */
264
- chartBg?: string | null;
265
- /** True when the parser saw a `<c:chartSpace><c:spPr>` element. Lets the
266
- * adapter tell "spec said noFill transparent" from "no spPr default". */
267
- hasChartSpPr?: boolean;
268
- /** `<c:legend><c:manualLayout>` fractions of chart space21.2.2.31). */
272
+ series: ChartSeries[];
273
+ /** Show data labels on bars / points / slices. */
274
+ showDataLabels: boolean;
275
+ /** Explicit Y-axis minimum (OOXML `<c:valAx><c:min>`). */
276
+ valMin: number | null;
277
+ /** Explicit Y-axis maximum (OOXML `<c:valAx><c:max>`). */
278
+ valMax: number | null;
279
+ catAxisTitle: string | null;
280
+ valAxisTitle: string | null;
281
+ /** `<c:catAx><c:delete val="1"/>`. */
282
+ catAxisHidden: boolean;
283
+ /** `<c:valAx><c:delete val="1"/>`. */
284
+ valAxisHidden: boolean;
285
+ /** `<c:catAx><c:spPr><a:ln><a:noFill>` hide just the axis LINE; labels
286
+ * and tick marks still render. Distinct from `catAxisHidden` (which
287
+ * removes everything via `<c:delete val="1"/>`). */
288
+ catAxisLineHidden: boolean;
289
+ /** `<c:valAx><c:spPr><a:ln><a:noFill>` hide just the axis LINE; labels
290
+ * and tick marks still render. */
291
+ valAxisLineHidden: boolean;
292
+ /** Hex without '#'. From `<c:plotArea><c:spPr><a:solidFill>`. */
293
+ plotAreaBg: string | null;
294
+ /** Outer chartSpace background (hex without '#'). null when noFill/absent. */
295
+ chartBg: string | null;
296
+ /** True when `<c:legend>` is declared in the chart XML. False = no legend. */
297
+ showLegend: boolean;
298
+ /** `<c:legend><c:legendPos val>` "r"|"l"|"t"|"b"|"tr". null = default (r). */
299
+ legendPos: 'r' | 'l' | 't' | 'b' | 'tr' | null;
300
+ /** `<c:catAx><c:crossBetween val="..."/>`. "between" inserts 0.5-step padding
301
+ * on each end of the category axis; "midCat" anchors endpoints to the axes. */
302
+ catAxisCrossBetween: 'between' | 'midCat' | string;
303
+ /** `<c:valAx><c:majorTickMark>`. ECMA-376 default is "cross". */
304
+ valAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
305
+ /** `<c:catAx><c:majorTickMark>`. */
306
+ catAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
307
+ /** `<c:valAx | catAx><c:minorTickMark>`. ECMA-376 default is "none". */
308
+ valAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
309
+ catAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
310
+ /** Title font size in OOXML hundredths of a point (1600 = 16pt). null = default. */
311
+ titleFontSizeHpt: number | null;
312
+ /** Title font color as a hex string without '#' (e.g. "1B4332"). null = default. */
313
+ titleFontColor: string | null;
314
+ /** Title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). null = default. */
315
+ titleFontFace: string | null;
316
+ /** `<c:catAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
317
+ catAxisFontSizeHpt: number | null;
318
+ /** `<c:valAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
319
+ valAxisFontSizeHpt: number | null;
320
+ /** `<c:catAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#').
321
+ * null = renderer default. Lets templates color category labels gray. */
322
+ catAxisFontColor?: string | null;
323
+ /** `<c:valAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
324
+ valAxisFontColor?: string | null;
325
+ /** `<c:dLbls><c:txPr>` font size (hpt) for data-point value labels. */
326
+ dataLabelFontSizeHpt: number | null;
327
+ /** Waterfall subtotal category indices. */
328
+ subtotalIndices: number[];
329
+ /** `<c:legend><c:manualLayout>` absolute placement fractions of the chart
330
+ * space (ECMA-376 §21.2.2.31). Overrides the default side-based legend
331
+ * rectangle while still letting `legendPos` decide which side of the plot
332
+ * gets the reserved band. null = use default layout. */
269
333
  legendManualLayout?: LegendManualLayout | null;
270
- /** `<c:catAx><c:delete val="1"/>` — hide the category axis (§21.2.2.40). */
271
- catAxisHidden?: boolean;
272
- /** `<c:valAx><c:delete val="1"/>` — hide the value axis (§21.2.2.40). */
273
- valAxisHidden?: boolean;
274
- /** `<c:catAx><c:spPr><a:ln><a:noFill>` — line-only hide (labels stay). */
275
- catAxisLineHidden?: boolean;
276
- /** `<c:valAx><c:spPr><a:ln><a:noFill>` — line-only hide (labels stay). */
277
- valAxisLineHidden?: boolean;
278
- /** `<c:radarChart><c:radarStyle val>` — "standard" (line only, default),
279
- * "marker" (line + markers), "filled" (closed polygon with area fill).
280
- * Sample-1 "Biodiversity Index" uses "marker" — Excel renders no area
281
- * fill, but our renderer was filling at 25 % opacity regardless. */
282
- radarStyle?: string | null;
283
- /** `<c:valAx><c:numFmt@formatCode>` — number format for value-axis tick
284
- * labels (ECMA-376 §21.2.2.21). */
334
+ /**
335
+ * `<c:valAx><c:numFmt@formatCode>` — format code applied to value-axis tick
336
+ * labels (ECMA-376 §21.2.2.21). null = plain numeric formatting.
337
+ */
285
338
  valAxisFormatCode?: string | null;
286
- /** `<c:barChart><c:gapWidth>` — space between category groups as a percent
287
- * of bar width (§21.2.2.13). */
339
+ /**
340
+ * `<c:barChart><c:gapWidth>` space between category groups as a
341
+ * percentage of bar width (ECMA-376 §21.2.2.13). Default per spec is 150.
342
+ * null = renderer default.
343
+ */
288
344
  barGapWidth?: number | null;
289
- /** `<c:barChart><c:overlap>` — signed percent overlap between bars in a
290
- * cluster (§21.2.2.25). Negative = gap. */
345
+ /**
346
+ * `<c:barChart><c:overlap>` signed percentage overlap between bars in the
347
+ * same category cluster (ECMA-376 §21.2.2.25). Negative = gap, positive =
348
+ * overlap, 0 = flush. Range [-100, 100]. null = renderer default (0).
349
+ */
291
350
  barOverlap?: number | null;
292
- /** `<c:dLbls><c:dLblPos>` — data label position (§21.2.2.16). */
351
+ /**
352
+ * `<c:dLbls><c:dLblPos>` — data label position (ECMA-376 §21.2.2.16).
353
+ * "ctr"|"inBase"|"inEnd"|"outEnd"|"l"|"r"|"t"|"b"|"bestFit" etc.
354
+ */
293
355
  dataLabelPosition?: string | null;
294
- /** Hex (no `#`) for data label text color, resolved from `<c:dLbls><c:txPr>`. */
356
+ /** Hex (no `#`) for data label text, resolved from `<c:dLbls><c:txPr>`. */
295
357
  dataLabelFontColor?: string | null;
296
- /** `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
297
- * number format (§21.2.2.35). */
358
+ /**
359
+ * `<c:dLbls><c:numFmt@formatCode>` chart-level override for data label
360
+ * number format (ECMA-376 §21.2.2.35). When absent, `valFormatCode` on each
361
+ * series is used.
362
+ */
298
363
  dataLabelFormatCode?: string | null;
299
364
  /** `<c:title>...defRPr@b>` chart title bold flag. */
300
- titleFontBold?: boolean;
365
+ titleFontBold?: boolean | null;
301
366
  /** `<c:catAx><c:txPr>...defRPr@b>` X-axis tick label bold flag. */
302
- catAxisFontBold?: boolean;
367
+ catAxisFontBold?: boolean | null;
303
368
  /** `<c:valAx><c:txPr>...defRPr@b>` Y-axis tick label bold flag. */
304
- valAxisFontBold?: boolean;
305
- /** `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives where
306
- * the X axis sits along the Y axis. Default `autoZero`. */
307
- catAxisCrosses?: string;
308
- /** `<c:catAx><c:crossesAt val>` explicit numeric crossing. */
309
- catAxisCrossesAt?: number;
310
- valAxisCrosses?: string;
311
- valAxisCrossesAt?: number;
312
- /** Axis line color (hex without `#`) and width in EMU, from
313
- * `<c:catAx|valAx><c:spPr><a:ln>`. */
314
- catAxisLineColor?: string;
315
- catAxisLineWidthEmu?: number;
316
- valAxisLineColor?: string;
317
- valAxisLineWidthEmu?: number;
369
+ valAxisFontBold?: boolean | null;
370
+ /** `<c:catAx><c:title>` run-prop font size (hpt). Distinct from
371
+ * `catAxisFontSizeHpt` (tick labels). null = renderer default. */
372
+ catAxisTitleFontSizeHpt?: number | null;
373
+ /** `<c:catAx><c:title>` run-prop bold flag. null = not bold. */
374
+ catAxisTitleFontBold?: boolean | null;
375
+ /** `<c:catAx><c:title>` run-prop color (hex without '#'). null = default. */
376
+ catAxisTitleFontColor?: string | null;
377
+ /** `<c:valAx><c:title>` run-prop font size (hpt). null = renderer default. */
378
+ valAxisTitleFontSizeHpt?: number | null;
379
+ /** `<c:valAx><c:title>` run-prop bold flag. null = not bold. */
380
+ valAxisTitleFontBold?: boolean | null;
381
+ /** `<c:valAx><c:title>` run-prop color (hex without '#'). null = default. */
382
+ valAxisTitleFontColor?: string | null;
318
383
  /** Explicit chart border color (hex without '#') from
319
384
  * `<c:chartSpace><c:spPr><a:ln><a:solidFill><a:srgbClr>`. Only set when the
320
- * XML explicitly declares a paintable line (no default border). */
385
+ * XML explicitly declares a paintable line; null otherwise (no default
386
+ * border is drawn). */
321
387
  chartBorderColor?: string | null;
322
- /** `<c:chartSpace><c:spPr><a:ln@w>` border width in EMU. */
388
+ /** `<c:chartSpace><c:spPr><a:ln@w>` border width in EMU. null = 1px hairline
389
+ * when a color is present. */
323
390
  chartBorderWidthEmu?: number | null;
324
- /** `<c:catAx | valAx><c:majorTickMark val>` / `<c:minorTickMark val>` —
325
- * one of `none`/`out`/`in`/`cross` (ECMA-376 §21.2.2.49). */
326
- catAxisMajorTickMark?: string;
327
- catAxisMinorTickMark?: string;
328
- valAxisMajorTickMark?: string;
329
- valAxisMinorTickMark?: string;
330
- /** `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). */
331
- catAxisFormatCode?: string;
332
- /** `<c:catAx><c:scaling><c:min/max>` explicit X-axis range. */
333
- catAxisMin?: number;
334
- catAxisMax?: number;
335
- /** `<c:valAx><c:scaling><c:min/max>` explicit Y-axis range. */
336
- valAxisMin?: number;
337
- valAxisMax?: number;
338
- /** `<c:title><c:layout><c:manualLayout>` (§21.2.2.27) absolute placement. */
339
- titleManualLayout?: ManualLayout;
340
- /** `<c:plotArea><c:layout><c:manualLayout>` `layoutTarget=inner` /
341
- * `outer` controls whether axes are inside the rect or outside. */
342
- plotAreaManualLayout?: ManualLayout;
391
+ /**
392
+ * `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives the Y
393
+ * coordinate where the X axis is drawn. Default `autoZero` puts the X
394
+ * axis at y=0 — that's how Excel "Project Timeline" templates split
395
+ * milestones (positive Y) above and tasks (negative Y) below the axis.
396
+ */
397
+ catAxisCrosses?: string | null;
398
+ /** `<c:catAx><c:crossesAt val>` — explicit numeric override for the
399
+ * crossing point. Takes precedence over `catAxisCrosses`. */
400
+ catAxisCrossesAt?: number | null;
401
+ valAxisCrosses?: string | null;
402
+ valAxisCrossesAt?: number | null;
403
+ /** Axis line color (hex without `#`) and width in EMU from
404
+ * `<c:catAx|valAx><c:spPr><a:ln>`. */
405
+ catAxisLineColor?: string | null;
406
+ catAxisLineWidthEmu?: number | null;
407
+ valAxisLineColor?: string | null;
408
+ valAxisLineWidthEmu?: number | null;
409
+ /**
410
+ * `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). When set,
411
+ * the renderer formats X-axis tick labels with this code (e.g. dates).
412
+ */
413
+ catAxisFormatCode?: string | null;
414
+ /**
415
+ * `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. Used by
416
+ * scatter / bubble charts whose X axis is numeric. null = derive from
417
+ * data extents.
418
+ */
419
+ catAxisMin?: number | null;
420
+ catAxisMax?: number | null;
421
+ /**
422
+ * `<c:title><c:layout><c:manualLayout>` (ECMA-376 §21.2.2.27) absolute
423
+ * placement for the chart title.
424
+ */
425
+ titleManualLayout?: ChartManualLayout | null;
426
+ /**
427
+ * `<c:plotArea><c:layout><c:manualLayout>` absolute placement for the
428
+ * plot area. `layoutTarget="inner"` (default) describes the inner plot
429
+ * rect (no axes / labels); `outer` describes the outer rect (axes
430
+ * included).
431
+ */
432
+ plotAreaManualLayout?: ChartManualLayout | null;
433
+ /**
434
+ * `<c:scatterChart><c:scatterStyle val>` (ECMA-376 §21.2.2.42). Drives
435
+ * whether scatter charts connect points with lines and whether those
436
+ * lines are smoothed. Values: "marker" (markers only — Excel default
437
+ * "Scatter"), "line" / "lineMarker" (straight segments), "smooth" /
438
+ * "smoothMarker" (cubic Bézier through points), "lineNoMarker",
439
+ * "smoothNoMarker". null = renderer default ("marker"). Only consulted
440
+ * for `chartType === "scatter"`; bubble ignores it.
441
+ */
442
+ scatterStyle?: string | null;
443
+ /**
444
+ * `<c:radarChart><c:radarStyle val>` (ECMA-376 §21.2.3.10). Controls
445
+ * whether radar series render as line + markers ("standard" / "marker")
446
+ * or as a closed polygon with area fill ("filled"). null = default
447
+ * ("standard" — line, no fill). Only consulted for `chartType === "radar"`.
448
+ */
449
+ radarStyle?: string | null;
450
+ /**
451
+ * Secondary value axis for combo charts (bar + line). When present, series
452
+ * with `useSecondaryAxis` are plotted against this axis's independent scale
453
+ * and the axis is drawn on the right edge of the plot. null/absent = single
454
+ * value axis (the common case). See {@link SecondaryValueAxis}.
455
+ */
456
+ secondaryValAxis?: SecondaryValueAxis | null;
343
457
  }
344
458
 
345
- export declare interface ConditionalFormat {
346
- sqref: CellRange_2[];
347
- rules: CfRule[];
459
+ export declare interface ChartSeries {
460
+ name: string;
461
+ /** Hex without '#'. null = fall back to palette. */
462
+ color: string | null;
463
+ /** Numeric values; null = missing data point. */
464
+ values: (number | null)[];
465
+ /**
466
+ * Per-data-point colors (pie / doughnut). Hex without '#'. null inside the
467
+ * array = use palette for that slice. Omit entirely for non-pie series.
468
+ */
469
+ dataPointColors?: (string | null)[] | null;
470
+ /**
471
+ * Per-data-point data-label text colors. Used by chartEx (`<cx:dataLabel idx>`)
472
+ * to override label colour per bar — sample-2's waterfall paints negative
473
+ * △ values in red while positive values stay black. Null inside the array =
474
+ * fall back to the chart-level `dataLabelFontColor`.
475
+ */
476
+ dataLabelColors?: (string | null)[] | null;
477
+ /**
478
+ * Series-level data-label text colour (`<c:ser><c:dLbls><c:txPr>…solidFill`,
479
+ * ECMA-376 §21.2.2.216). Hex without '#'. Stacked-bar charts colour each
480
+ * segment's label independently (e.g. white on the dark segment, black on
481
+ * the light one), which a single chart-level `dataLabelFontColor` can't
482
+ * express. Takes precedence over `dataLabelFontColor`; null = no override.
483
+ */
484
+ labelColor?: string | null;
485
+ /**
486
+ * Mixed chart: per-series chart type override. Currently only "line" (XLSX
487
+ * and PPTX combo charts) is honoured; other values are treated as the
488
+ * chart's primary type.
489
+ */
490
+ seriesType?: string | null;
491
+ /**
492
+ * Combo chart: this series is plotted against the SECONDARY value axis
493
+ * (`ChartModel.secondaryValAxis`) — the `<c:valAx>` with `axPos="r"` /
494
+ * `<c:crosses val="max">`. When false/absent the series uses the primary
495
+ * (left) value-axis scale. PowerPoint's "Revenue vs. gross margin" combo
496
+ * (sample-14 slide-8) puts the margin line on a 0–100% secondary axis.
497
+ */
498
+ useSecondaryAxis?: boolean | null;
499
+ /**
500
+ * Scatter-only X values (as strings). When null the series uses
501
+ * `ChartModel.categories` as X.
502
+ */
503
+ categories?: string[] | null;
504
+ /**
505
+ * Resolved marker visibility for line/scatter series. ECMA-376 §21.2.2.32
506
+ * `<c:marker><c:symbol>` defaults to "none" for line charts unless the
507
+ * chart-level `<c:marker val="1"/>` or a per-series symbol opts in. When
508
+ * undefined/null the renderer uses its own default (visible) so callers
509
+ * that don't parse markers (e.g. pptx today) keep their existing behavior.
510
+ */
511
+ showMarker?: boolean | null;
512
+ /**
513
+ * Excel number-format code for this series' values (ECMA-376 §21.2.2.37,
514
+ * `<c:val>/<c:numRef>/<c:formatCode>`). Used to format data labels when the
515
+ * chart-level `<c:dLbls><c:numFmt>` is not set. null = no series-level code.
516
+ */
517
+ valFormatCode?: string | null;
518
+ /**
519
+ * `<c:marker><c:symbol val>` (ECMA-376 §21.2.2.32) — point marker shape.
520
+ * One of "circle"|"square"|"diamond"|"triangle"|"x"|"plus"|"star"|
521
+ * "dot"|"dash"|"picture"|"none". null = renderer default (circle when
522
+ * showMarker is true).
523
+ */
524
+ markerSymbol?: string | null;
525
+ /**
526
+ * `<c:marker><c:size val>` (ECMA-376 §21.2.2.34) — marker side length in
527
+ * points. null = renderer default (~5 pt).
528
+ */
529
+ markerSize?: number | null;
530
+ /** `<c:marker><c:spPr><a:solidFill>` resolved hex (no `#`). */
531
+ markerFill?: string | null;
532
+ /** `<c:marker><c:spPr><a:ln><a:solidFill>` resolved hex (no `#`). */
533
+ markerLine?: string | null;
534
+ /**
535
+ * Per-data-point overrides (ECMA-376 §21.2.2.39 `<c:dPt>`). Keyed by point
536
+ * index. Any unset field falls back to the series-level value.
537
+ */
538
+ dataPointOverrides?: ChartDataPointOverride[] | null;
539
+ /**
540
+ * Per-data-point custom labels (ECMA-376 §21.2.2.45 `<c:dLbl idx>`).
541
+ * `text` is the resolved plain string — `<a:fld type="CELLRANGE">`
542
+ * placeholders are already substituted at parse time. An empty string
543
+ * means the point's label was deleted with `<c:delete val="1"/>` and
544
+ * the renderer should skip it.
545
+ */
546
+ dataLabelOverrides?: ChartDataLabelOverride[] | null;
547
+ /**
548
+ * Series-level `<c:dLbls>` block (showVal / showSerName / position).
549
+ * Applied to every point lacking its own `<c:dLbl>` override.
550
+ */
551
+ seriesDataLabels?: ChartSeriesDataLabels | null;
552
+ /**
553
+ * `<c:errBars>` per-series error bars (ECMA-376 §21.2.2.20). Up to two
554
+ * (one per direction). Plus / minus deltas are absolute per-point values
555
+ * regardless of `errValType`.
556
+ */
557
+ errBars?: ChartErrBars[] | null;
558
+ /**
559
+ * `<c:bubbleSize>` per-point sizes for bubble charts (ECMA-376 §21.2.2.4).
560
+ * Drives marker radius — renderer treats the values as areas (radius
561
+ * scales by sqrt) so visual area is proportional to value, matching
562
+ * Excel. null / empty array = uniform marker size. Ignored for non-bubble
563
+ * series.
564
+ */
565
+ bubbleSizes?: (number | null)[] | null;
348
566
  }
349
567
 
350
- export declare interface DataLabelOverride {
351
- idx: number;
352
- text: string;
353
- /** "l"|"r"|"t"|"b"|"ctr"|"outEnd"|"bestFit" or undefined → inherit. */
568
+ export declare interface ChartSeriesDataLabels {
569
+ showVal: boolean;
570
+ showCatName: boolean;
571
+ showSerName: boolean;
572
+ showPercent: boolean;
354
573
  position?: string;
355
574
  fontColor?: string;
356
- fontSizeHpt?: number;
575
+ formatCode?: string;
576
+ /** Series-level bold default for data labels. */
357
577
  fontBold?: boolean;
578
+ /** Series-level font size for data labels (OOXML hundredths of a point). */
579
+ fontSizeHpt?: number;
358
580
  }
359
581
 
360
- export declare interface DataPointOverride {
361
- idx: number;
362
- color?: string;
363
- markerSymbol?: string;
364
- markerSize?: number;
365
- markerFill?: string;
366
- markerLine?: string;
582
+ /**
583
+ * Canonical chart type vocabulary. Embeds direction (`H` = horizontal) and
584
+ * grouping (`Pct` = percent-stacked) so renderers do not need to inspect
585
+ * separate `barDir`/`grouping` fields.
586
+ */
587
+ declare type ChartType = 'line' | 'stackedLine' | 'stackedLinePct' | 'clusteredBar' | 'clusteredBarH' | 'stackedBar' | 'stackedBarH' | 'stackedBarPct' | 'stackedBarHPct' | 'area' | 'stackedArea' | 'stackedAreaPct' | 'pie' | 'doughnut' | 'scatter' | 'bubble' | 'radar' | 'waterfall' | string;
588
+
589
+ export declare interface ConditionalFormat {
590
+ sqref: CellRange_2[];
591
+ rules: CfRule[];
367
592
  }
368
593
 
594
+ /** @deprecated Use `ChartDataLabelOverride` from @silurus/ooxml-core. */
595
+ export declare type DataLabelOverride = ChartDataLabelOverride;
596
+
597
+ /** @deprecated Use `ChartDataPointOverride` from @silurus/ooxml-core. */
598
+ export declare type DataPointOverride = ChartDataPointOverride;
599
+
369
600
  /** One `<dataValidation>` rule (ECMA-376 §18.3.1.33). `type` is the constraint
370
601
  * class (`list` | `whole` | `decimal` | `date` | `time` | `textLength` |
371
602
  * `custom`); `operator` qualifies it (`between` | `notBetween` | `equal` | …).
@@ -404,19 +635,8 @@ export declare interface Dxf {
404
635
  numFmt?: NumFmt | null;
405
636
  }
406
637
 
407
- export declare interface ErrBars {
408
- /** "x" | "y". */
409
- dir: string;
410
- /** "plus" | "minus" | "both". */
411
- barType: string;
412
- plus: (number | null)[];
413
- minus: (number | null)[];
414
- noEndCap: boolean;
415
- /** Resolved RGB hex (no `#`). */
416
- color?: string;
417
- lineWidthEmu?: number;
418
- dash?: string;
419
- }
638
+ /** @deprecated Use `ChartErrBars` from @silurus/ooxml-core. */
639
+ export declare type ErrBars = ChartErrBars;
420
640
 
421
641
  export declare interface GradientFillSpec {
422
642
  /** "linear" (default) or "path". */
@@ -434,6 +654,9 @@ export declare interface GradientFillSpec {
434
654
  }[];
435
655
  }
436
656
 
657
+ /** How {@link XlsxViewer} presents hidden sheets (`<sheet state>`, §18.2.19). */
658
+ export declare type HiddenSheetMode = 'show' | 'skip' | 'dim';
659
+
437
660
  export declare interface Hyperlink {
438
661
  col: number;
439
662
  row: number;
@@ -491,8 +714,11 @@ export declare interface ImageAnchor {
491
714
  }
492
715
 
493
716
  export declare interface LegendManualLayout {
717
+ /** `"edge"` = `x`/`y` are fractions from top-left of chart space;
718
+ * `"factor"` = fractions offset from the default position. */
494
719
  xMode: string;
495
720
  yMode: string;
721
+ /** Fractions of chart space width/height. */
496
722
  x: number;
497
723
  y: number;
498
724
  w: number;
@@ -534,6 +760,21 @@ declare interface LoadOptions_2 {
534
760
  * via `@font-face` in your application CSS.
535
761
  */
536
762
  useGoogleFonts?: boolean;
763
+ /**
764
+ * Override the URL the parser worker fetches the WebAssembly module from.
765
+ *
766
+ * By default each format resolves the `.wasm` asset that ships next to its
767
+ * bundle (relative to the module URL), so no configuration is needed. Set
768
+ * this to serve the parser WASM from a CDN or a self-hosted path instead — a
769
+ * relative value is resolved against the current document URL. The same
770
+ * dependency-injection contract across docx / pptx / xlsx.
771
+ *
772
+ * The referenced file must be the matching format's `*_parser_bg.wasm`
773
+ * artifact (the one wasm-bindgen emitted for that parser); pointing it at a
774
+ * mismatched or missing file makes `load()` reject when the worker
775
+ * instantiates it.
776
+ */
777
+ wasmUrl?: string | URL;
537
778
  /**
538
779
  * Override the per-entry ZIP decompression cap (bytes) used by the zip-bomb
539
780
  * guard in the Rust parser. Defaults to 512 MiB. Raise it to load documents
@@ -541,6 +782,16 @@ declare interface LoadOptions_2 {
541
782
  * untrusted input. Zero / negative values fall back to the default.
542
783
  */
543
784
  maxZipEntryBytes?: number;
785
+ /**
786
+ * Reject the parse request if the parser worker does not answer within this
787
+ * many milliseconds. Opt-in safety net for a wedged or crashed worker that
788
+ * would otherwise leave `load()` pending forever. **Default: unlimited** —
789
+ * parsing a large document with heavy embedded media can legitimately take
790
+ * tens of seconds, so no timeout is imposed unless you set one. A worker that
791
+ * throws or fails to load already rejects immediately regardless of this
792
+ * value; this bound only covers the "silent, never-responds" case.
793
+ */
794
+ workerTimeoutMs?: number;
544
795
  /**
545
796
  * Opt-in OMML equation engine (MathJax + STIX Two Math, ~3 MB). Inject it
546
797
  * **once** here and every render of this document / presentation / workbook
@@ -553,15 +804,8 @@ declare interface LoadOptions_2 {
553
804
  math?: MathRenderer;
554
805
  }
555
806
 
556
- export declare interface ManualLayout {
557
- xMode: string;
558
- yMode: string;
559
- layoutTarget?: string;
560
- x: number;
561
- y: number;
562
- w?: number;
563
- h?: number;
564
- }
807
+ /** @deprecated Use `ChartManualLayout` from @silurus/ooxml-core. */
808
+ export declare type ManualLayout = ChartManualLayout;
565
809
 
566
810
  /** Accent (`m:acc`), e.g. hat, bar, vector arrow over the base. */
567
811
  declare interface MathAccent {
@@ -840,20 +1084,48 @@ export declare interface RunFont {
840
1084
  vertAlign?: 'superscript' | 'subscript';
841
1085
  }
842
1086
 
1087
+ /**
1088
+ * A secondary value axis (combo charts). Mirrors the primary value-axis
1089
+ * properties but lives in its own object so the flat primary-axis fields stay
1090
+ * untouched. Parsed from the right-hand `<c:valAx>` (`axPos="r"`,
1091
+ * `<c:crosses val="max">`).
1092
+ */
1093
+ declare interface SecondaryValueAxis {
1094
+ /** `<c:scaling><c:min val>`. null = derive from the series data. */
1095
+ min: number | null;
1096
+ /** `<c:scaling><c:max val>`. null = derive from the series data. */
1097
+ max: number | null;
1098
+ /** `<c:title>` plain text. null = no title. */
1099
+ title: string | null;
1100
+ /** `<c:delete val="1"/>` — hide labels/ticks entirely. */
1101
+ hidden: boolean;
1102
+ /** `<c:numFmt formatCode>` for tick labels. */
1103
+ formatCode?: string | null;
1104
+ /** `<c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
1105
+ fontColor?: string | null;
1106
+ /** `<c:txPr>` tick-label font size (hpt). */
1107
+ fontSizeHpt?: number | null;
1108
+ /** `<c:spPr><a:ln><a:solidFill>` axis-line color (hex without '#'). */
1109
+ lineColor?: string | null;
1110
+ /** `<c:spPr><a:ln w>` axis-line width in EMU. */
1111
+ lineWidthEmu?: number | null;
1112
+ /** `<c:spPr><a:ln><a:noFill>` — hide just the axis rule. */
1113
+ lineHidden: boolean;
1114
+ /** `<c:majorTickMark>` — "cross" (default) | "out" | "in" | "none". */
1115
+ majorTickMark: string;
1116
+ /** `<c:title>` run-prop font size (hpt). */
1117
+ titleFontSizeHpt?: number | null;
1118
+ /** `<c:title>` run-prop bold flag. */
1119
+ titleFontBold?: boolean | null;
1120
+ /** `<c:title>` run-prop color (hex without '#'). */
1121
+ titleFontColor?: string | null;
1122
+ }
1123
+
843
1124
  declare type SelectionMode_2 = 'cells' | 'rows' | 'cols' | 'all';
844
1125
  export { SelectionMode_2 as SelectionMode }
845
1126
 
846
- export declare interface SeriesDataLabels {
847
- showVal: boolean;
848
- showCatName: boolean;
849
- showSerName: boolean;
850
- showPercent: boolean;
851
- position?: string;
852
- fontColor?: string;
853
- formatCode?: string;
854
- fontBold?: boolean;
855
- fontSizeHpt?: number;
856
- }
1127
+ /** @deprecated Use `ChartSeriesDataLabels` from @silurus/ooxml-core. */
1128
+ export declare type SeriesDataLabels = ChartSeriesDataLabels;
857
1129
 
858
1130
  export declare interface ShapeAnchor {
859
1131
  fromCol: number;
@@ -950,6 +1222,9 @@ export declare interface ShapeParagraph {
950
1222
  /** `<a:pPr@indent>` — first-line indent in EMU (negative = hanging),
951
1223
  * ECMA-376 §21.1.2.2.7. Omitted (undefined) when unset. */
952
1224
  indent?: number;
1225
+ /** `<a:pPr>/<a:lnSpc>` line spacing (ECMA-376 §21.1.2.2.5). Direct-only;
1226
+ * omitted when unset. */
1227
+ spaceLine?: SpaceLine | null;
953
1228
  runs: ShapeTextRun[];
954
1229
  }
955
1230
 
@@ -959,6 +1234,27 @@ export declare interface ShapeText {
959
1234
  anchor: string;
960
1235
  /** `<a:bodyPr@wrap>` — `square` (wrap to width) | `none`. */
961
1236
  wrap: string;
1237
+ /** `<a:bodyPr>` autofit child — `'sp'` (`spAutoFit`), `'norm'` (`normAutofit`),
1238
+ * or `'none'` (`noAutofit`/absent). ECMA-376 §21.1.2.1.1-.3. Always present
1239
+ * (default `'none'`), mirroring the core `TextBody.autoFit`. */
1240
+ autoFit?: string;
1241
+ /** `<a:normAutofit@fontScale>` — stored font-shrink fraction (e.g. 0.625 for
1242
+ * `fontScale="62500"`). Null/absent when unset. Modeled for parity with
1243
+ * pptx; the xlsx renderer does not currently apply it. */
1244
+ fontScale?: number | null;
1245
+ /** `<a:normAutofit@lnSpcReduction>` — stored line-spacing reduction fraction
1246
+ * (e.g. 0.20 for `lnSpcReduction="20000"`). Null/absent when unset. */
1247
+ lnSpcReduction?: number | null;
1248
+ /** `<a:bodyPr@lIns>` — left text inset in EMU (ECMA-376 §21.1.2.1.1). Always
1249
+ * present; the spec default 91440 EMU (7.2 pt) when the attribute is absent.
1250
+ * Same EMU convention as `ShapeParagraph.marL`. */
1251
+ lIns: number;
1252
+ /** `<a:bodyPr@tIns>` — top text inset in EMU. Default 45720 (3.6 pt). */
1253
+ tIns: number;
1254
+ /** `<a:bodyPr@rIns>` — right text inset in EMU. Default 91440 (7.2 pt). */
1255
+ rIns: number;
1256
+ /** `<a:bodyPr@bIns>` — bottom text inset in EMU. Default 45720 (3.6 pt). */
1257
+ bIns: number;
962
1258
  paragraphs: ShapeParagraph[];
963
1259
  }
964
1260
 
@@ -976,6 +1272,18 @@ export declare type ShapeTextRun = {
976
1272
  size: number;
977
1273
  color?: string;
978
1274
  fontFace?: string;
1275
+ /** East-Asian typeface (`<a:ea@typeface>`, ECMA-376 §21.1.2.3.1). The
1276
+ * common Japanese encoding sets Meiryo here while leaving `<a:latin>`
1277
+ * default; the renderer floors the line box by this face's design line
1278
+ * too (see `drawShapeText`). Undefined when the run declares no `<a:ea>`. */
1279
+ fontFaceEa?: string;
1280
+ /** Complex-script typeface (`<a:cs@typeface>`, ECMA-376 §21.1.2.3.1).
1281
+ * Parsed/modeled but NOT used in the line-box floor: the cs face renders
1282
+ * only complex-script glyphs (Arabic/Hebrew/Thai), so flooring the whole
1283
+ * line box by it would over-grow Latin/CJK runs (deferred to per-glyph
1284
+ * handling — see `drawShapeText`). Undefined when the run declares no
1285
+ * `<a:cs>`. */
1286
+ fontFaceCs?: string;
979
1287
  } | {
980
1288
  type: 'break';
981
1289
  } | {
@@ -1002,8 +1310,16 @@ export declare interface SheetMeta {
1002
1310
  * `#RRGGBB`. Surfaced at workbook-list time so tabs can be painted up front.
1003
1311
  * Absent when the sheet declares no tab color. */
1004
1312
  tabColor?: string | null;
1313
+ /** Sheet visibility (`<sheet state>`, ECMA-376 §18.2.19 `ST_SheetState`).
1314
+ * Absent ⇒ visible. `'veryHidden'` sheets are revealable only
1315
+ * programmatically in Excel. Read via `XlsxWorkbook.isHidden` /
1316
+ * `XlsxWorkbook.sheetVisibility`. */
1317
+ visibility?: 'hidden' | 'veryHidden';
1005
1318
  }
1006
1319
 
1320
+ /** Sheet visibility (`<sheet state>`, ECMA-376 §18.2.19 `ST_SheetState`). */
1321
+ export declare type SheetVisibility = 'visible' | 'hidden' | 'veryHidden';
1322
+
1007
1323
  export declare interface SlicerAnchor {
1008
1324
  fromCol: number;
1009
1325
  fromColOff: number;
@@ -1022,6 +1338,14 @@ export declare interface SlicerItem {
1022
1338
  selected: boolean;
1023
1339
  }
1024
1340
 
1341
+ declare type SpaceLine = {
1342
+ type: 'pct';
1343
+ val: number;
1344
+ } | {
1345
+ type: 'pts';
1346
+ val: number;
1347
+ };
1348
+
1025
1349
  export declare interface Sparkline {
1026
1350
  /** 1-based row of the destination cell (`<xm:sqref>`). */
1027
1351
  row: number;
@@ -1216,51 +1540,10 @@ export declare interface Worksheet {
1216
1540
  }
1217
1541
 
1218
1542
  /**
1219
- * XLSX parser's raw chart series (includes XLSX-only `seriesType` for mixed
1220
- * charts). Adapted to `ChartSeries` from @silurus/ooxml-core before rendering.
1543
+ * @deprecated Chart series are now the core {@link ChartModel}'s `ChartSeries`.
1544
+ * Kept as an alias for backward-compatible imports.
1221
1545
  */
1222
- export declare interface XlsxChartSeries {
1223
- name: string;
1224
- /** Chart sub-type for this series (allows mixed charts). */
1225
- seriesType: string;
1226
- categories: string[];
1227
- values: (number | null)[];
1228
- /** Explicit fill color hex (from c:spPr). Undefined = use palette. */
1229
- color?: string | null;
1230
- /** Marker visibility resolved from `<c:marker>`/chart-level default
1231
- * (ECMA-376 §21.2.2.32). */
1232
- showMarker?: boolean;
1233
- /** `<c:val>/<c:numRef>/<c:formatCode>` — Excel number format for series
1234
- * values (ECMA-376 §21.2.2.37). */
1235
- valFormatCode?: string | null;
1236
- /** `<c:ser><c:dLbls><c:txPr>…solidFill` — per-series data-label text color
1237
- * (ECMA-376 §21.2.2.216). Takes precedence over the chart-level color so
1238
- * each series can color its labels independently. */
1239
- labelColor?: string | null;
1240
- /** `<c:ser><c:order>` — stacking/legend display order (§21.2.2.28). */
1241
- order?: number;
1242
- /** `<c:marker><c:symbol val>` — point marker shape (ECMA-376 §21.2.2.32). */
1243
- markerSymbol?: string;
1244
- /** `<c:marker><c:size val>` — point marker side length in pt (§21.2.2.34). */
1245
- markerSize?: number;
1246
- /** `<c:marker><c:spPr>` resolved fill (no `#`). */
1247
- markerFill?: string;
1248
- /** `<c:marker><c:spPr><a:ln>` resolved stroke (no `#`). */
1249
- markerLine?: string;
1250
- /** `<c:dPt>` per-data-point overrides (§21.2.2.39). */
1251
- dataPointOverrides?: DataPointOverride[];
1252
- /** Per-idx custom data labels (`<c:dLbl idx>`, §21.2.2.45). Custom rich
1253
- * text is flattened to plain string at parse time; CELLRANGE field
1254
- * placeholders are resolved against the series' `<c15:datalabelsRange>`
1255
- * cache. */
1256
- dataLabelOverrides?: DataLabelOverride[];
1257
- /** Series-level `<c:dLbls>` defaults applied to every point lacking its
1258
- * own override. */
1259
- seriesDataLabels?: SeriesDataLabels;
1260
- /** `<c:errBars>` (§21.2.2.20). At parse time, plus / minus deltas are
1261
- * resolved into absolute per-point values regardless of `errValType`. */
1262
- errBars?: ErrBars[];
1263
- }
1546
+ export declare type XlsxChartSeries = ChartSeries;
1264
1547
 
1265
1548
  /** One cell comment. Sourced from the classic notes file `xl/commentsN.xml`
1266
1549
  * (ECMA-376 §18.7) when present, otherwise from the Office-365 threaded
@@ -1297,6 +1580,10 @@ export declare interface XlsxTextRunInfo {
1297
1580
 
1298
1581
  export declare class XlsxViewer {
1299
1582
  private wb;
1583
+ /** The single subtree root the constructor appended to the caller's
1584
+ * container. destroy() removes it to return the container to its original
1585
+ * (empty) state. */
1586
+ private wrapper;
1300
1587
  private canvas;
1301
1588
  private canvasArea;
1302
1589
  private scrollHost;
@@ -1312,6 +1599,7 @@ export declare class XlsxViewer {
1312
1599
  private zoomSlider;
1313
1600
  private zoomLabel;
1314
1601
  private currentSheet;
1602
+ private _hiddenSheetMode;
1315
1603
  private currentWorksheet;
1316
1604
  private opts;
1317
1605
  /** 'main' renders on this thread; 'worker' paints worker-produced bitmaps. */
@@ -1321,6 +1609,32 @@ export declare class XlsxViewer {
1321
1609
  * main-mode 2d render path is never used on the same canvas. */
1322
1610
  private _bitmapCtx;
1323
1611
  private resizeObserver;
1612
+ /**
1613
+ * Pending `requestAnimationFrame` handle for a coalesced re-render, or `null`
1614
+ * when none is scheduled. High-frequency event-driven repaints (scroll, live
1615
+ * resize drag, selection drag, container resize) route through
1616
+ * {@link scheduleRender} so at most one render runs per animation frame: a
1617
+ * burst of scroll events within a single frame collapses to one draw at the
1618
+ * frame's latest scroll position (`renderCurrentSheet` reads the live scroll
1619
+ * offset, so "latest wins" needs no stored position). Explicit API calls
1620
+ * (`showSheet`/`goToSheet`, `select`, `setScale`) stay synchronous — they must
1621
+ * paint immediately, not a frame later. `destroy()` cancels any pending frame.
1622
+ */
1623
+ private _rafId;
1624
+ /**
1625
+ * Monotonic render-request counter for worker-mode stale-frame dropping.
1626
+ * Every {@link renderCurrentSheet} bumps it and captures the value before it
1627
+ * awaits the worker's bitmap; on resolution a captured value below the current
1628
+ * one means a newer render was requested meanwhile (scroll moved on, the sheet
1629
+ * switched, a zoom changed), so that bitmap is stale and must be closed and
1630
+ * dropped instead of painted over the fresher frame. The WorkerBridge already
1631
+ * correlates each request↔response by id, but requests overlap — a slow bitmap
1632
+ * for an old scroll position can resolve after a newer one — so the viewer
1633
+ * needs this generation guard, the single-canvas analogue of the pptx
1634
+ * scroll-viewer's per-slot render epoch (PR #663). The main-thread path renders
1635
+ * synchronously and cannot interleave, so it needs no guard.
1636
+ */
1637
+ private _renderSeq;
1324
1638
  /**
1325
1639
  * Start-anchored horizontal scroll position (the {@link effectiveScrollLeft}
1326
1640
  * value last produced by a real user scroll or a programmatic reset), kept
@@ -1429,6 +1743,10 @@ export declare class XlsxViewer {
1429
1743
  goToSheet(index: number): Promise<void>;
1430
1744
  nextSheet(): Promise<void>;
1431
1745
  prevSheet(): Promise<void>;
1746
+ /** Next sheet index for sequential nav: skip mode jumps over hidden sheets. */
1747
+ private _stepSheet;
1748
+ /** Initial sheet for load() / entering skip mode: land on a visible sheet. */
1749
+ private _initialSheet;
1432
1750
  /** Returns the cell at canvas-client coordinates, or null if outside the cell grid. */
1433
1751
  getCellAt(clientX: number, clientY: number): CellAddress | null;
1434
1752
  /** Returns the CSS-pixel rect of a cell within canvasArea, or null if not
@@ -1480,6 +1798,15 @@ export declare class XlsxViewer {
1480
1798
  * immediately.
1481
1799
  */
1482
1800
  setSelectionColor(color: string): void;
1801
+ /**
1802
+ * Switch the hidden-sheet mode at runtime: restyle the tabs and re-render.
1803
+ * Entering `'skip'` while on a hidden sheet advances to the nearest visible.
1804
+ */
1805
+ setHiddenSheetMode(mode: HiddenSheetMode): Promise<void>;
1806
+ /** The current hidden-sheet mode. */
1807
+ get hiddenSheetMode(): HiddenSheetMode;
1808
+ /** Number of non-hidden sheets (absolute `sheetCount` is unchanged). */
1809
+ get visibleSheetCount(): number;
1483
1810
  /** Copy the selected cell range as tab-separated text to the clipboard. */
1484
1811
  private copySelection;
1485
1812
  private updateSelectionOverlay;
@@ -1535,6 +1862,13 @@ export declare class XlsxViewer {
1535
1862
  private updateNavButtons;
1536
1863
  private updateTabActive;
1537
1864
  private tabStyle;
1865
+ /**
1866
+ * Full inline style for the tab of sheet `i`, honoring the hidden-sheet mode:
1867
+ * `'skip'` hides the tab of a hidden/veryHidden sheet (`display:none`); `'dim'`
1868
+ * greys it but leaves it clickable; `'show'` styles every tab normally. Used
1869
+ * by both buildTabs and updateTabActive so navigation never wipes the styling.
1870
+ */
1871
+ private tabCss;
1538
1872
  /** Excel-style zoom control pinned to the right end of the tab bar:
1539
1873
  * `− [────slider────] + 100%`. Live-updates the cell scale on input. */
1540
1874
  private buildZoomControl;
@@ -1548,11 +1882,39 @@ export declare class XlsxViewer {
1548
1882
  * aligned tab-nav width in sync. */
1549
1883
  setScale(scale: number): void;
1550
1884
  private updateSpacerSize;
1885
+ /**
1886
+ * Coalesce a re-render into the next animation frame. Called from the
1887
+ * high-frequency event-driven paths (scroll, live column/row resize, drag-
1888
+ * selection, container resize); a burst of these within one frame schedules a
1889
+ * single {@link renderCurrentSheet}, avoiding the previous behavior where every
1890
+ * scroll event forced its own synchronous full redraw. Already-scheduled frames
1891
+ * are not re-scheduled — the one pending render reads the live scroll/scale
1892
+ * state when it runs, so the most recent position always wins without threading
1893
+ * a coordinate through. Falls back to a synchronous render when
1894
+ * `requestAnimationFrame` is unavailable (e.g. a non-DOM host), preserving the
1895
+ * old semantics there.
1896
+ */
1897
+ private scheduleRender;
1551
1898
  private renderCurrentSheet;
1552
1899
  private computeHeaderHighlight;
1553
1900
  get sheetNames(): string[];
1554
1901
  /** The underlying <canvas> element the grid is drawn on. */
1555
1902
  get canvasElement(): HTMLCanvasElement;
1903
+ /**
1904
+ * Tear down the viewer and release resources.
1905
+ *
1906
+ * The caller's container is returned to the state it had before construction
1907
+ * (empty): the entire wrapper subtree the constructor appended is removed.
1908
+ * All document-level listeners are detached — the keydown handler here, and
1909
+ * the validation-panel outside-click handler via {@link hideValidationPanel}.
1910
+ * Listeners on elements inside the wrapper (scrollHost, tabs, …) need no
1911
+ * explicit removal: removing the subtree makes them unreachable and eligible
1912
+ * for GC. Safe to call more than once.
1913
+ *
1914
+ * NOTE: the shared `<style>` in `document.head` is intentionally NOT removed —
1915
+ * it is a class constant that any still-live viewer may depend on, and one
1916
+ * leftover sheet is a bounded, harmless cost (see {@link ensureViewerStyleInjected}).
1917
+ */
1556
1918
  destroy(): void;
1557
1919
  }
1558
1920
 
@@ -1605,6 +1967,19 @@ export declare interface XlsxViewerOptions extends LoadOptions_2 {
1605
1967
  * require `'main'` (the math engine cannot cross the worker boundary).
1606
1968
  */
1607
1969
  mode?: 'main' | 'worker';
1970
+ /**
1971
+ * How hidden / veryHidden sheets (`<sheet state>`, ECMA-376 §18.2.19) are
1972
+ * presented:
1973
+ * - `'show'` (default): every sheet gets a tab — current behavior.
1974
+ * - `'skip'`: hidden/veryHidden sheets get no tab and are jumped over by
1975
+ * `nextSheet`/`prevSheet` and initial load; absolute indices are unchanged,
1976
+ * and an explicit `goToSheet(i)` to a hidden sheet is still honored.
1977
+ * - `'dim'`: hidden/veryHidden tabs are shown greyed but stay selectable.
1978
+ *
1979
+ * Named to match the {@link XlsxViewer.hiddenSheetMode} getter and
1980
+ * {@link XlsxViewer.setHiddenSheetMode} setter. Mirrors pptx `hiddenSlideMode`.
1981
+ */
1982
+ hiddenSheetMode?: HiddenSheetMode;
1608
1983
  }
1609
1984
 
1610
1985
  export declare class XlsxWorkbook {
@@ -1641,6 +2016,21 @@ export declare class XlsxWorkbook {
1641
2016
  /** Per-sheet tab colors (`#RRGGBB`) parallel to {@link sheetNames}.
1642
2017
  * `null` for sheets that declare no tab color. */
1643
2018
  get tabColors(): (string | null)[];
2019
+ /**
2020
+ * Full visibility fact for the sheet at `sheetIndex` (0-based):
2021
+ * `'visible'` | `'hidden'` | `'veryHidden'` (`<sheet state>`, ECMA-376
2022
+ * §18.2.19). NOT clamped — out-of-range / non-integer ⇒ `'visible'`. This is a
2023
+ * *fact*; deciding what to do with a hidden sheet (hide/skip/dim its tab) is
2024
+ * {@link XlsxViewer}'s policy. `'veryHidden'` is revealable only
2025
+ * programmatically in Excel; it is surfaced distinctly here.
2026
+ */
2027
+ sheetVisibility(sheetIndex: number): SheetVisibility;
2028
+ /**
2029
+ * Whether the sheet at `sheetIndex` is hidden or veryHidden. Convenience over
2030
+ * {@link sheetVisibility}; mirrors {@link PptxPresentation.isHidden} (non-
2031
+ * clamped: out-of-range / non-integer ⇒ `false`).
2032
+ */
2033
+ isHidden(sheetIndex: number): boolean;
1644
2034
  getWorksheet(sheetIndex: number): Promise<Worksheet>;
1645
2035
  /**
1646
2036
  * Fetch an embedded image's bytes by zip path (e.g. `xl/media/image1.png`),