@silurus/ooxml 0.4.0 → 0.6.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.
@@ -219,6 +219,14 @@ declare interface ChartData {
219
219
  catAxisTitle?: string | null;
220
220
  /** Value axis title (c:valAx/c:title). */
221
221
  valAxisTitle?: string | null;
222
+ /** True when <c:legend> is present. Absence means the legend is hidden. */
223
+ showLegend?: boolean;
224
+ /** Chart title font size in OOXML hundredths of a point (e.g. 1400 = 14pt). */
225
+ titleFontSizeHpt?: number | null;
226
+ /** Chart title font color as a hex string without '#' (srgbClr only). */
227
+ titleFontColor?: string | null;
228
+ /** Chart title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). */
229
+ titleFontFace?: string | null;
222
230
  }
223
231
 
224
232
  /**
@@ -255,6 +263,10 @@ declare interface ChartElement {
255
263
  catAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
256
264
  /** Title font size in OOXML hundredths of a point (1600 = 16pt). null = default. */
257
265
  titleFontSizeHpt: number | null;
266
+ /** Title font color as a hex string without '#'. null = default/theme. */
267
+ titleFontColor?: string | null;
268
+ /** Title font family (`<a:latin typeface>`). null = default/theme. */
269
+ titleFontFace?: string | null;
258
270
  /** `<c:catAx><c:txPr>` font size (hpt). null = proportional default. */
259
271
  catAxisFontSizeHpt: number | null;
260
272
  /** `<c:valAx><c:txPr>` font size (hpt). null = proportional default. */
@@ -454,6 +466,8 @@ declare interface Fill_2 {
454
466
  patternType: string;
455
467
  fgColor: string | null;
456
468
  bgColor: string | null;
469
+ /** Set when the style's `<fill>` was a `<gradientFill>`; patternType stays "none". */
470
+ gradient?: GradientFillSpec | null;
457
471
  }
458
472
 
459
473
  declare interface Font {
@@ -475,6 +489,22 @@ declare interface GradientFill {
475
489
  gradType: string;
476
490
  }
477
491
 
492
+ declare interface GradientFillSpec {
493
+ /** "linear" (default) or "path". */
494
+ gradientType: string;
495
+ /** Rotation in degrees for linear gradients (0 = left→right). */
496
+ degree: number;
497
+ /** Path-gradient bounding box (0..1) — unused for linear. */
498
+ left: number;
499
+ right: number;
500
+ top: number;
501
+ bottom: number;
502
+ stops: {
503
+ position: number;
504
+ color: string;
505
+ }[];
506
+ }
507
+
478
508
  declare interface GradientStop {
479
509
  position: number;
480
510
  color: string;
@@ -571,6 +601,11 @@ declare interface LineBreak {
571
601
  declare interface LineSpacing {
572
602
  value: number;
573
603
  rule: 'auto' | 'exact' | 'atLeast';
604
+ /** True when `w:spacing/@w:line` was set on the paragraph's own pPr or on a
605
+ * named style (not inherited solely from docDefault). Per ECMA-376 §17.6.5,
606
+ * an inherited-only paragraph in a docGrid section snaps to one grid pitch
607
+ * per line, ignoring the multiplier. Defaults to false on JSON parse. */
608
+ explicit?: boolean;
574
609
  }
575
610
 
576
611
  /** Options for {@link PptxPresentation.load}. */
@@ -852,6 +887,7 @@ declare class PptxViewer {
852
887
  private engine;
853
888
  private readonly opts;
854
889
  private currentSlide;
890
+ private handle;
855
891
  constructor(container: HTMLElement, opts?: PptxViewerOptions);
856
892
  /** Load a PPTX from URL or ArrayBuffer and render the first slide. */
857
893
  load(source: string | ArrayBuffer): Promise<void>;
@@ -878,6 +914,14 @@ declare interface PptxViewerOptions extends RenderOptions {
878
914
  * default — see {@link PptxPresentation.load} for privacy implications.
879
915
  */
880
916
  useGoogleFonts?: boolean;
917
+ /**
918
+ * Enable interactive audio/video playback. When true, slides are rendered
919
+ * via {@link PptxPresentation.presentSlide} so media elements become
920
+ * clickable and the viewer draws its own play/pause chrome. When false
921
+ * (default) the viewer renders a static slide with a non-interactive play
922
+ * badge over media posters.
923
+ */
924
+ enableMediaPlayback?: boolean;
881
925
  }
882
926
 
883
927
  declare interface Presentation {
@@ -994,6 +1038,12 @@ declare interface SectionProps {
994
1038
  footerDistance: number;
995
1039
  titlePage: boolean;
996
1040
  evenAndOddHeaders: boolean;
1041
+ /** ECMA-376 §17.6.5 w:docGrid/@w:type — "default" | "lines" | "linesAndChars" | "snapToChars". */
1042
+ docGridType?: string | null;
1043
+ /** ECMA-376 §17.6.5 w:docGrid/@w:linePitch in pt. When docGridType is "lines" or
1044
+ * "linesAndChars", auto line spacing multiplies against this pitch instead of
1045
+ * the font's natural line height. */
1046
+ docGridLinePitch?: number | null;
997
1047
  }
998
1048
 
999
1049
  declare interface Shadow {
@@ -1284,6 +1334,9 @@ declare interface Worksheet {
1284
1334
  autoFilter?: CellRange | null;
1285
1335
  /** Hyperlinks in this worksheet (ECMA-376 §18.3.1.47). */
1286
1336
  hyperlinks?: Hyperlink[];
1337
+ /** A1-style cell refs of commented cells (ECMA-376 §18.7.3). Rendered as a
1338
+ * small red triangle in each cell's top-right corner. */
1339
+ commentRefs?: string[];
1287
1340
  }
1288
1341
 
1289
1342
  export declare namespace xlsx {
@@ -82,6 +82,10 @@ declare interface ChartElement {
82
82
  catAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
83
83
  /** Title font size in OOXML hundredths of a point (1600 = 16pt). null = default. */
84
84
  titleFontSizeHpt: number | null;
85
+ /** Title font color as a hex string without '#'. null = default/theme. */
86
+ titleFontColor?: string | null;
87
+ /** Title font family (`<a:latin typeface>`). null = default/theme. */
88
+ titleFontFace?: string | null;
85
89
  /** `<c:catAx><c:txPr>` font size (hpt). null = proportional default. */
86
90
  catAxisFontSizeHpt: number | null;
87
91
  /** `<c:valAx><c:txPr>` font size (hpt). null = proportional default. */
@@ -314,6 +318,7 @@ export declare class PptxViewer {
314
318
  private engine;
315
319
  private readonly opts;
316
320
  private currentSlide;
321
+ private handle;
317
322
  constructor(container: HTMLElement, opts?: PptxViewerOptions);
318
323
  /** Load a PPTX from URL or ArrayBuffer and render the first slide. */
319
324
  load(source: string | ArrayBuffer): Promise<void>;
@@ -340,6 +345,14 @@ export declare interface PptxViewerOptions extends RenderOptions {
340
345
  * default — see {@link PptxPresentation.load} for privacy implications.
341
346
  */
342
347
  useGoogleFonts?: boolean;
348
+ /**
349
+ * Enable interactive audio/video playback. When true, slides are rendered
350
+ * via {@link PptxPresentation.presentSlide} so media elements become
351
+ * clickable and the viewer draws its own play/pause chrome. When false
352
+ * (default) the viewer renders a static slide with a non-interactive play
353
+ * badge over media posters.
354
+ */
355
+ enableMediaPlayback?: boolean;
343
356
  }
344
357
 
345
358
  export declare interface Presentation {
@@ -173,6 +173,14 @@ declare interface ChartData {
173
173
  catAxisTitle?: string | null;
174
174
  /** Value axis title (c:valAx/c:title). */
175
175
  valAxisTitle?: string | null;
176
+ /** True when <c:legend> is present. Absence means the legend is hidden. */
177
+ showLegend?: boolean;
178
+ /** Chart title font size in OOXML hundredths of a point (e.g. 1400 = 14pt). */
179
+ titleFontSizeHpt?: number | null;
180
+ /** Chart title font color as a hex string without '#' (srgbClr only). */
181
+ titleFontColor?: string | null;
182
+ /** Chart title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). */
183
+ titleFontFace?: string | null;
176
184
  }
177
185
 
178
186
  declare interface ConditionalFormat {
@@ -190,6 +198,8 @@ export declare interface Fill {
190
198
  patternType: string;
191
199
  fgColor: string | null;
192
200
  bgColor: string | null;
201
+ /** Set when the style's `<fill>` was a `<gradientFill>`; patternType stays "none". */
202
+ gradient?: GradientFillSpec | null;
193
203
  }
194
204
 
195
205
  export declare interface Font {
@@ -202,6 +212,22 @@ export declare interface Font {
202
212
  name: string | null;
203
213
  }
204
214
 
215
+ declare interface GradientFillSpec {
216
+ /** "linear" (default) or "path". */
217
+ gradientType: string;
218
+ /** Rotation in degrees for linear gradients (0 = left→right). */
219
+ degree: number;
220
+ /** Path-gradient bounding box (0..1) — unused for linear. */
221
+ left: number;
222
+ right: number;
223
+ top: number;
224
+ bottom: number;
225
+ stops: {
226
+ position: number;
227
+ color: string;
228
+ }[];
229
+ }
230
+
205
231
  declare interface Hyperlink {
206
232
  col: number;
207
233
  row: number;
@@ -332,6 +358,9 @@ export declare interface Worksheet {
332
358
  autoFilter?: CellRange | null;
333
359
  /** Hyperlinks in this worksheet (ECMA-376 §18.3.1.47). */
334
360
  hyperlinks?: Hyperlink[];
361
+ /** A1-style cell refs of commented cells (ECMA-376 §18.7.3). Rendered as a
362
+ * small red triangle in each cell's top-right corner. */
363
+ commentRefs?: string[];
335
364
  }
336
365
 
337
366
  /**