@silurus/ooxml 0.56.0 → 0.58.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.
- package/README.md +24 -18
- package/dist/docx-BBTq20zc.js +1811 -0
- package/dist/docx.mjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/pptx-B6H-We19.js +1760 -0
- package/dist/pptx.mjs +2 -2
- package/dist/src-B06n2_Dm.js +29675 -0
- package/dist/types/docx.d.ts +89 -28
- package/dist/types/index.d.ts +816 -19
- package/dist/types/pptx.d.ts +465 -25
- package/dist/types/xlsx.d.ts +243 -38
- package/dist/xlsx-DWmV5sAA.js +3818 -0
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
- package/dist/docx-g-cBdnSQ.js +0 -1661
- package/dist/pptx-DkKGg5bQ.js +0 -23667
- package/dist/src-CFPOemuW.js +0 -6810
- package/dist/xlsx-Bx216pgL.js +0 -3483
package/dist/types/pptx.d.ts
CHANGED
|
@@ -32,7 +32,20 @@ export declare interface AutoResizeOptions {
|
|
|
32
32
|
pauseWhenHidden?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
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
|
+
export 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
|
+
|
|
48
|
+
export declare type Bullet = {
|
|
36
49
|
type: 'none';
|
|
37
50
|
} | {
|
|
38
51
|
type: 'inherit';
|
|
@@ -48,6 +61,21 @@ declare type Bullet = {
|
|
|
48
61
|
startAt: number | null;
|
|
49
62
|
};
|
|
50
63
|
|
|
64
|
+
/**
|
|
65
|
+
* `<a:camera>` — ECMA-376 §20.1.5.5 (`CT_Camera`). `prst` selects one of the
|
|
66
|
+
* 62 preset cameras (§20.1.10.47); `fov`/`zoom`/`rot` optionally override it.
|
|
67
|
+
*/
|
|
68
|
+
export declare interface Camera3d {
|
|
69
|
+
/** Preset camera name (`ST_PresetCameraType`), e.g. "perspectiveRelaxed". */
|
|
70
|
+
prst: string;
|
|
71
|
+
/** Field-of-view override in degrees. Omitted = preset default. */
|
|
72
|
+
fov?: number;
|
|
73
|
+
/** Zoom factor as a unit ratio (1.0 = 100%). Omitted = 1.0. */
|
|
74
|
+
zoom?: number;
|
|
75
|
+
/** Camera rotation override. Omitted = preset base orientation. */
|
|
76
|
+
rot?: Rot3d;
|
|
77
|
+
}
|
|
78
|
+
|
|
51
79
|
declare interface ChartDataLabelOverride {
|
|
52
80
|
idx: number;
|
|
53
81
|
/** Empty string = label deleted (skip drawing). */
|
|
@@ -75,7 +103,7 @@ declare interface ChartDataPointOverride {
|
|
|
75
103
|
* top level, alongside the element position (x/y/width/height in EMU).
|
|
76
104
|
* Pass this straight to `renderChart` from `@silurus/ooxml-core`.
|
|
77
105
|
*/
|
|
78
|
-
declare interface ChartElement {
|
|
106
|
+
export declare interface ChartElement {
|
|
79
107
|
type: 'chart';
|
|
80
108
|
x: number;
|
|
81
109
|
y: number;
|
|
@@ -185,7 +213,170 @@ declare interface ChartManualLayout {
|
|
|
185
213
|
h?: number;
|
|
186
214
|
}
|
|
187
215
|
|
|
188
|
-
declare interface
|
|
216
|
+
export declare interface ChartModel {
|
|
217
|
+
chartType: ChartType;
|
|
218
|
+
title: string | null;
|
|
219
|
+
categories: string[];
|
|
220
|
+
series: ChartSeries[];
|
|
221
|
+
/** Show data labels on bars / points / slices. */
|
|
222
|
+
showDataLabels: boolean;
|
|
223
|
+
/** Explicit Y-axis minimum (OOXML `<c:valAx><c:min>`). */
|
|
224
|
+
valMin: number | null;
|
|
225
|
+
/** Explicit Y-axis maximum (OOXML `<c:valAx><c:max>`). */
|
|
226
|
+
valMax: number | null;
|
|
227
|
+
catAxisTitle: string | null;
|
|
228
|
+
valAxisTitle: string | null;
|
|
229
|
+
/** `<c:catAx><c:delete val="1"/>`. */
|
|
230
|
+
catAxisHidden: boolean;
|
|
231
|
+
/** `<c:valAx><c:delete val="1"/>`. */
|
|
232
|
+
valAxisHidden: boolean;
|
|
233
|
+
/** `<c:catAx><c:spPr><a:ln><a:noFill>` — hide just the axis LINE; labels
|
|
234
|
+
* and tick marks still render. Distinct from `catAxisHidden` (which
|
|
235
|
+
* removes everything via `<c:delete val="1"/>`). */
|
|
236
|
+
catAxisLineHidden: boolean;
|
|
237
|
+
/** `<c:valAx><c:spPr><a:ln><a:noFill>` — hide just the axis LINE; labels
|
|
238
|
+
* and tick marks still render. */
|
|
239
|
+
valAxisLineHidden: boolean;
|
|
240
|
+
/** Hex without '#'. From `<c:plotArea><c:spPr><a:solidFill>`. */
|
|
241
|
+
plotAreaBg: string | null;
|
|
242
|
+
/** Outer chartSpace background (hex without '#'). null when noFill/absent. */
|
|
243
|
+
chartBg: string | null;
|
|
244
|
+
/** True when `<c:legend>` is declared in the chart XML. False = no legend. */
|
|
245
|
+
showLegend: boolean;
|
|
246
|
+
/** `<c:legend><c:legendPos val>` — "r"|"l"|"t"|"b"|"tr". null = default (r). */
|
|
247
|
+
legendPos: 'r' | 'l' | 't' | 'b' | 'tr' | null;
|
|
248
|
+
/** `<c:catAx><c:crossBetween val="..."/>`. "between" inserts 0.5-step padding
|
|
249
|
+
* on each end of the category axis; "midCat" anchors endpoints to the axes. */
|
|
250
|
+
catAxisCrossBetween: 'between' | 'midCat' | string;
|
|
251
|
+
/** `<c:valAx><c:majorTickMark>`. ECMA-376 default is "cross". */
|
|
252
|
+
valAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
|
|
253
|
+
/** `<c:catAx><c:majorTickMark>`. */
|
|
254
|
+
catAxisMajorTickMark: 'cross' | 'out' | 'in' | 'none' | string;
|
|
255
|
+
/** `<c:valAx | catAx><c:minorTickMark>`. ECMA-376 default is "none". */
|
|
256
|
+
valAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
|
|
257
|
+
catAxisMinorTickMark?: 'cross' | 'out' | 'in' | 'none' | string | null;
|
|
258
|
+
/** Title font size in OOXML hundredths of a point (1600 = 16pt). null = default. */
|
|
259
|
+
titleFontSizeHpt: number | null;
|
|
260
|
+
/** Title font color as a hex string without '#' (e.g. "1B4332"). null = default. */
|
|
261
|
+
titleFontColor: string | null;
|
|
262
|
+
/** Title font family from `<a:latin typeface>` (ECMA-376 §20.1.4.2.24). null = default. */
|
|
263
|
+
titleFontFace: string | null;
|
|
264
|
+
/** `<c:catAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
|
|
265
|
+
catAxisFontSizeHpt: number | null;
|
|
266
|
+
/** `<c:valAx><c:txPr>` font size (hpt). null = fall back to proportional default. */
|
|
267
|
+
valAxisFontSizeHpt: number | null;
|
|
268
|
+
/** `<c:catAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#').
|
|
269
|
+
* null = renderer default. Lets templates color category labels gray. */
|
|
270
|
+
catAxisFontColor?: string | null;
|
|
271
|
+
/** `<c:valAx><c:txPr>…<a:solidFill>` tick-label color (hex without '#'). */
|
|
272
|
+
valAxisFontColor?: string | null;
|
|
273
|
+
/** `<c:dLbls><c:txPr>` font size (hpt) for data-point value labels. */
|
|
274
|
+
dataLabelFontSizeHpt: number | null;
|
|
275
|
+
/** Waterfall subtotal category indices. */
|
|
276
|
+
subtotalIndices: number[];
|
|
277
|
+
/** `<c:legend><c:manualLayout>` absolute placement fractions of the chart
|
|
278
|
+
* space (ECMA-376 §21.2.2.31). Overrides the default side-based legend
|
|
279
|
+
* rectangle while still letting `legendPos` decide which side of the plot
|
|
280
|
+
* gets the reserved band. null = use default layout. */
|
|
281
|
+
legendManualLayout?: LegendManualLayout | null;
|
|
282
|
+
/**
|
|
283
|
+
* `<c:valAx><c:numFmt@formatCode>` — format code applied to value-axis tick
|
|
284
|
+
* labels (ECMA-376 §21.2.2.21). null = plain numeric formatting.
|
|
285
|
+
*/
|
|
286
|
+
valAxisFormatCode?: string | null;
|
|
287
|
+
/**
|
|
288
|
+
* `<c:barChart><c:gapWidth>` — space between category groups as a
|
|
289
|
+
* percentage of bar width (ECMA-376 §21.2.2.13). Default per spec is 150.
|
|
290
|
+
* null = renderer default.
|
|
291
|
+
*/
|
|
292
|
+
barGapWidth?: number | null;
|
|
293
|
+
/**
|
|
294
|
+
* `<c:barChart><c:overlap>` — signed percentage overlap between bars in the
|
|
295
|
+
* same category cluster (ECMA-376 §21.2.2.25). Negative = gap, positive =
|
|
296
|
+
* overlap, 0 = flush. Range [-100, 100]. null = renderer default (0).
|
|
297
|
+
*/
|
|
298
|
+
barOverlap?: number | null;
|
|
299
|
+
/**
|
|
300
|
+
* `<c:dLbls><c:dLblPos>` — data label position (ECMA-376 §21.2.2.16).
|
|
301
|
+
* "ctr"|"inBase"|"inEnd"|"outEnd"|"l"|"r"|"t"|"b"|"bestFit" etc.
|
|
302
|
+
*/
|
|
303
|
+
dataLabelPosition?: string | null;
|
|
304
|
+
/** Hex (no `#`) for data label text, resolved from `<c:dLbls><c:txPr>`. */
|
|
305
|
+
dataLabelFontColor?: string | null;
|
|
306
|
+
/**
|
|
307
|
+
* `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
|
|
308
|
+
* number format (ECMA-376 §21.2.2.35). When absent, `valFormatCode` on each
|
|
309
|
+
* series is used.
|
|
310
|
+
*/
|
|
311
|
+
dataLabelFormatCode?: string | null;
|
|
312
|
+
/** `<c:title>...defRPr@b>` chart title bold flag. */
|
|
313
|
+
titleFontBold?: boolean | null;
|
|
314
|
+
/** `<c:catAx><c:txPr>...defRPr@b>` X-axis tick label bold flag. */
|
|
315
|
+
catAxisFontBold?: boolean | null;
|
|
316
|
+
/** `<c:valAx><c:txPr>...defRPr@b>` Y-axis tick label bold flag. */
|
|
317
|
+
valAxisFontBold?: boolean | null;
|
|
318
|
+
/**
|
|
319
|
+
* `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives the Y
|
|
320
|
+
* coordinate where the X axis is drawn. Default `autoZero` puts the X
|
|
321
|
+
* axis at y=0 — that's how Excel "Project Timeline" templates split
|
|
322
|
+
* milestones (positive Y) above and tasks (negative Y) below the axis.
|
|
323
|
+
*/
|
|
324
|
+
catAxisCrosses?: string | null;
|
|
325
|
+
/** `<c:catAx><c:crossesAt val>` — explicit numeric override for the
|
|
326
|
+
* crossing point. Takes precedence over `catAxisCrosses`. */
|
|
327
|
+
catAxisCrossesAt?: number | null;
|
|
328
|
+
valAxisCrosses?: string | null;
|
|
329
|
+
valAxisCrossesAt?: number | null;
|
|
330
|
+
/** Axis line color (hex without `#`) and width in EMU from
|
|
331
|
+
* `<c:catAx|valAx><c:spPr><a:ln>`. */
|
|
332
|
+
catAxisLineColor?: string | null;
|
|
333
|
+
catAxisLineWidthEmu?: number | null;
|
|
334
|
+
valAxisLineColor?: string | null;
|
|
335
|
+
valAxisLineWidthEmu?: number | null;
|
|
336
|
+
/**
|
|
337
|
+
* `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). When set,
|
|
338
|
+
* the renderer formats X-axis tick labels with this code (e.g. dates).
|
|
339
|
+
*/
|
|
340
|
+
catAxisFormatCode?: string | null;
|
|
341
|
+
/**
|
|
342
|
+
* `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. Used by
|
|
343
|
+
* scatter / bubble charts whose X axis is numeric. null = derive from
|
|
344
|
+
* data extents.
|
|
345
|
+
*/
|
|
346
|
+
catAxisMin?: number | null;
|
|
347
|
+
catAxisMax?: number | null;
|
|
348
|
+
/**
|
|
349
|
+
* `<c:title><c:layout><c:manualLayout>` (ECMA-376 §21.2.2.27) absolute
|
|
350
|
+
* placement for the chart title.
|
|
351
|
+
*/
|
|
352
|
+
titleManualLayout?: ChartManualLayout | null;
|
|
353
|
+
/**
|
|
354
|
+
* `<c:plotArea><c:layout><c:manualLayout>` absolute placement for the
|
|
355
|
+
* plot area. `layoutTarget="inner"` (default) describes the inner plot
|
|
356
|
+
* rect (no axes / labels); `outer` describes the outer rect (axes
|
|
357
|
+
* included).
|
|
358
|
+
*/
|
|
359
|
+
plotAreaManualLayout?: ChartManualLayout | null;
|
|
360
|
+
/**
|
|
361
|
+
* `<c:scatterChart><c:scatterStyle val>` (ECMA-376 §21.2.2.42). Drives
|
|
362
|
+
* whether scatter charts connect points with lines and whether those
|
|
363
|
+
* lines are smoothed. Values: "marker" (markers only — Excel default
|
|
364
|
+
* "Scatter"), "line" / "lineMarker" (straight segments), "smooth" /
|
|
365
|
+
* "smoothMarker" (cubic Bézier through points), "lineNoMarker",
|
|
366
|
+
* "smoothNoMarker". null = renderer default ("marker"). Only consulted
|
|
367
|
+
* for `chartType === "scatter"`; bubble ignores it.
|
|
368
|
+
*/
|
|
369
|
+
scatterStyle?: string | null;
|
|
370
|
+
/**
|
|
371
|
+
* `<c:radarChart><c:radarStyle val>` (ECMA-376 §21.2.3.10). Controls
|
|
372
|
+
* whether radar series render as line + markers ("standard" / "marker")
|
|
373
|
+
* or as a closed polygon with area fill ("filled"). null = default
|
|
374
|
+
* ("standard" — line, no fill). Only consulted for `chartType === "radar"`.
|
|
375
|
+
*/
|
|
376
|
+
radarStyle?: string | null;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare interface ChartSeries {
|
|
189
380
|
name: string;
|
|
190
381
|
/** Hex without '#'. null = fall back to palette. */
|
|
191
382
|
color: string | null;
|
|
@@ -299,6 +490,13 @@ declare interface ChartSeriesDataLabels {
|
|
|
299
490
|
fontSizeHpt?: number;
|
|
300
491
|
}
|
|
301
492
|
|
|
493
|
+
/**
|
|
494
|
+
* Canonical chart type vocabulary. Embeds direction (`H` = horizontal) and
|
|
495
|
+
* grouping (`Pct` = percent-stacked) so renderers do not need to inspect
|
|
496
|
+
* separate `barDir`/`grouping` fields.
|
|
497
|
+
*/
|
|
498
|
+
declare type ChartType = 'line' | 'stackedLine' | 'stackedLinePct' | 'clusteredBar' | 'clusteredBarH' | 'stackedBar' | 'stackedBarH' | 'stackedBarPct' | 'stackedBarHPct' | 'area' | 'stackedArea' | 'stackedAreaPct' | 'pie' | 'doughnut' | 'scatter' | 'bubble' | 'radar' | 'waterfall' | string;
|
|
499
|
+
|
|
302
500
|
/**
|
|
303
501
|
* An OMML equation embedded in a paragraph (ECMA-376 §22.1). Parsed into the
|
|
304
502
|
* shared math AST and rendered by `@silurus/ooxml-core`'s math engine.
|
|
@@ -316,17 +514,30 @@ declare interface EquationRun {
|
|
|
316
514
|
color?: string | null;
|
|
317
515
|
}
|
|
318
516
|
|
|
319
|
-
export declare type Fill = SolidFill | NoFill | GradientFill | PatternFill;
|
|
517
|
+
export declare type Fill = SolidFill | NoFill | GradientFill | PatternFill | ImageFill;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* ECMA-376 §20.1.8.30 (CT_RelativeRect) — the destination rectangle a stretched
|
|
521
|
+
* blip is mapped into, as edge insets relative to the fill region. Values are
|
|
522
|
+
* fractions (ST_Percentage / 100000); **negative values let the image bleed
|
|
523
|
+
* past the box (overscan)**. Absent edges default to 0.
|
|
524
|
+
*/
|
|
525
|
+
export declare interface FillRect {
|
|
526
|
+
l?: number;
|
|
527
|
+
t?: number;
|
|
528
|
+
r?: number;
|
|
529
|
+
b?: number;
|
|
530
|
+
}
|
|
320
531
|
|
|
321
532
|
/** ECMA-376 §20.1.8.17 (CT_GlowEffect) — coloured halo with blur radius. */
|
|
322
|
-
declare interface Glow {
|
|
533
|
+
export declare interface Glow {
|
|
323
534
|
color: string;
|
|
324
535
|
alpha: number;
|
|
325
536
|
/** Blur radius in EMU. */
|
|
326
537
|
radius: number;
|
|
327
538
|
}
|
|
328
539
|
|
|
329
|
-
declare interface GradientFill {
|
|
540
|
+
export declare interface GradientFill {
|
|
330
541
|
fillType: 'gradient';
|
|
331
542
|
stops: GradientStop[];
|
|
332
543
|
/** degrees: 0 = left→right, 90 = top→bottom */
|
|
@@ -335,11 +546,60 @@ declare interface GradientFill {
|
|
|
335
546
|
gradType: string;
|
|
336
547
|
}
|
|
337
548
|
|
|
338
|
-
declare interface GradientStop {
|
|
549
|
+
export declare interface GradientStop {
|
|
339
550
|
position: number;
|
|
340
551
|
color: string;
|
|
341
552
|
}
|
|
342
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Image fill — ECMA-376 §20.1.8.14 (CT_BlipFillProperties). The embedded blip
|
|
556
|
+
* is resolved to a base64 data URL at parse time. Both fill-modes are modelled
|
|
557
|
+
* and mutually exclusive: `stretch` (§20.1.8.56) carries {@link ImageFill.fillRect};
|
|
558
|
+
* `tile` (§20.1.8.58) carries {@link ImageFill.tile}.
|
|
559
|
+
*/
|
|
560
|
+
export declare interface ImageFill {
|
|
561
|
+
fillType: 'image';
|
|
562
|
+
/** `data:<mime>;base64,…` of the embedded blip. */
|
|
563
|
+
dataUrl: string;
|
|
564
|
+
/**
|
|
565
|
+
* `<a:stretch><a:fillRect>` insets. Absent → fills the whole box (or the
|
|
566
|
+
* fill is tiled — see {@link ImageFill.tile}).
|
|
567
|
+
*/
|
|
568
|
+
fillRect?: FillRect;
|
|
569
|
+
/**
|
|
570
|
+
* `<a:tile>` descriptor. Present only when the blipFill is tiled; mutually
|
|
571
|
+
* exclusive with {@link ImageFill.fillRect}.
|
|
572
|
+
*/
|
|
573
|
+
tile?: TileInfo;
|
|
574
|
+
/** `a:blip > a:alphaModFix@amt` as a fraction (0.0–1.0). Absent = opaque. */
|
|
575
|
+
alpha?: number;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
declare interface LegendManualLayout {
|
|
579
|
+
/** `"edge"` = `x`/`y` are fractions from top-left of chart space;
|
|
580
|
+
* `"factor"` = fractions offset from the default position. */
|
|
581
|
+
xMode: string;
|
|
582
|
+
yMode: string;
|
|
583
|
+
/** Fractions of chart space width/height. */
|
|
584
|
+
x: number;
|
|
585
|
+
y: number;
|
|
586
|
+
w: number;
|
|
587
|
+
h: number;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* `<a:lightRig>` — ECMA-376 §20.1.5.9 (`CT_LightRig`). Drives the bevel-lip
|
|
592
|
+
* lighting (Phase B): `dir` selects the key-light octant.
|
|
593
|
+
*/
|
|
594
|
+
export declare interface LightRig {
|
|
595
|
+
/** Light-rig preset (`ST_LightRigType`), e.g. "threePt". */
|
|
596
|
+
rig: string;
|
|
597
|
+
/** Light direction (`ST_LightRigDirection`): tl/t/tr/l/r/bl/b/br. */
|
|
598
|
+
dir: string;
|
|
599
|
+
/** Optional rotation override of the rig. */
|
|
600
|
+
rot?: Rot3d;
|
|
601
|
+
}
|
|
602
|
+
|
|
343
603
|
export declare interface LineBreak {
|
|
344
604
|
type: 'break';
|
|
345
605
|
}
|
|
@@ -521,7 +781,7 @@ declare interface MathSvg {
|
|
|
521
781
|
descentEm: number;
|
|
522
782
|
}
|
|
523
783
|
|
|
524
|
-
declare interface MediaElement {
|
|
784
|
+
export declare interface MediaElement {
|
|
525
785
|
type: 'media';
|
|
526
786
|
x: number;
|
|
527
787
|
y: number;
|
|
@@ -574,7 +834,7 @@ export declare interface Paragraph {
|
|
|
574
834
|
runs: TextRun[];
|
|
575
835
|
}
|
|
576
836
|
|
|
577
|
-
declare type PathCmd = {
|
|
837
|
+
export declare type PathCmd = {
|
|
578
838
|
cmd: 'moveTo';
|
|
579
839
|
x: number;
|
|
580
840
|
y: number;
|
|
@@ -625,8 +885,29 @@ export declare interface PictureElement {
|
|
|
625
885
|
flipV: boolean;
|
|
626
886
|
/** Data URL, e.g. "data:image/png;base64,..." */
|
|
627
887
|
dataUrl: string;
|
|
628
|
-
/**
|
|
629
|
-
|
|
888
|
+
/**
|
|
889
|
+
* Border line from `<p:pic><p:spPr><a:ln>` (ECMA-376 §20.1.2.2.24). A
|
|
890
|
+
* `p:pic`'s spPr is `CT_ShapeProperties` (§19.3.1.37), so a picture carries
|
|
891
|
+
* the same line model as a shape. `null` when there is no `<a:ln>` or it
|
|
892
|
+
* resolves to `<a:noFill/>` (border explicitly suppressed). The border is
|
|
893
|
+
* stroked along the picture's clip silhouette (roundRect / custGeom / rect).
|
|
894
|
+
*/
|
|
895
|
+
stroke: Stroke | null;
|
|
896
|
+
/**
|
|
897
|
+
* `<p:spPr><a:prstGeom prst="…">` preset name (e.g. `"roundRect"`,
|
|
898
|
+
* `"ellipse"`). ECMA-376 §20.1.9.18: a picture's preset geometry is its clip
|
|
899
|
+
* silhouette and the path its border / contour hug. Undefined / omitted = a
|
|
900
|
+
* plain rectangle (`prst="rect"` or no prstGeom). When set, the renderer
|
|
901
|
+
* builds the silhouette via the shared preset-geometry engine (any of the 186
|
|
902
|
+
* presets). `custGeom` takes priority when both are present.
|
|
903
|
+
*/
|
|
904
|
+
prstGeom?: string;
|
|
905
|
+
/**
|
|
906
|
+
* Adjust guides from the prstGeom `<a:avLst>` (1/1000-of-a-percent OOXML
|
|
907
|
+
* units), in `gd@name` declaration order (index 0 = adj/adj1, 1 = adj2, …).
|
|
908
|
+
* Omitted when avLst is empty — the preset's own declared defaults then apply.
|
|
909
|
+
*/
|
|
910
|
+
prstAdjust?: number[];
|
|
630
911
|
/**
|
|
631
912
|
* ECMA-376 a:srcRect — source image crop as fractions (0..1) of the source
|
|
632
913
|
* width/height. Omitted when the image is not cropped.
|
|
@@ -647,6 +928,38 @@ export declare interface PictureElement {
|
|
|
647
928
|
* trimmed to the laptop / device silhouette declared in the file.
|
|
648
929
|
*/
|
|
649
930
|
custGeom?: PathCmd[][] | null;
|
|
931
|
+
/**
|
|
932
|
+
* Drop shadow from `spPr > effectLst > outerShdw`. A `p:pic`'s `spPr` is
|
|
933
|
+
* `CT_ShapeProperties` (ECMA-376 §19.3.1.37), so the same effects shapes
|
|
934
|
+
* carry apply to images. ECMA-376 §20.1.8.45 (CT_OuterShadowEffect).
|
|
935
|
+
*/
|
|
936
|
+
shadow?: Shadow;
|
|
937
|
+
/** Inner (inset) shadow from effectLst > innerShdw. ECMA-376 §20.1.8.40. */
|
|
938
|
+
innerShadow?: Shadow;
|
|
939
|
+
/** Coloured glow halo from effectLst > glow. ECMA-376 §20.1.8.32. */
|
|
940
|
+
glow?: Glow;
|
|
941
|
+
/** Soft (feathered) edge from effectLst > softEdge. ECMA-376 §20.1.8.53. */
|
|
942
|
+
softEdge?: SoftEdge;
|
|
943
|
+
/** Mirrored reflection from effectLst > reflection. ECMA-376 §20.1.8.50. */
|
|
944
|
+
reflection?: Reflection;
|
|
945
|
+
/** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). A `p:pic`'s spPr is
|
|
946
|
+
* `CT_ShapeProperties`, so 3D scenes apply to images. When non-identity the
|
|
947
|
+
* renderer projects the picture through the camera homography (Phase A). */
|
|
948
|
+
scene3d?: Scene3d;
|
|
949
|
+
/** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
|
|
950
|
+
* rendered in Phase A. */
|
|
951
|
+
sp3d?: Sp3d;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/** A single legacy slide comment (`<p:cm>` in `ppt/comments/commentN.xml`). */
|
|
955
|
+
export declare interface PptxComment {
|
|
956
|
+
/** Resolved author name from `ppt/commentAuthors.xml`. Absent when the
|
|
957
|
+
* authors file is missing or the `authorId` is out of range. */
|
|
958
|
+
author?: string;
|
|
959
|
+
/** `<p:cm @dt>` — ISO-8601 timestamp the comment was authored. */
|
|
960
|
+
date?: string;
|
|
961
|
+
/** Plain-text comment body (`<p:text>`). */
|
|
962
|
+
text: string;
|
|
650
963
|
}
|
|
651
964
|
|
|
652
965
|
/**
|
|
@@ -686,6 +999,26 @@ export declare class PptxPresentation {
|
|
|
686
999
|
get slideWidth(): number;
|
|
687
1000
|
/** Slide height in EMU. */
|
|
688
1001
|
get slideHeight(): number;
|
|
1002
|
+
/**
|
|
1003
|
+
* Speaker-notes text for a slide (`ppt/notesSlides/notesSlideN.xml`,
|
|
1004
|
+
* ECMA-376 §13.3.5 — Notes Slide). Returns the notes-body text as a single
|
|
1005
|
+
* string (paragraphs joined with `\n`), or `null` when the slide has no
|
|
1006
|
+
* notes part. The notes are parsed at {@link load} time, so this is a
|
|
1007
|
+
* synchronous lookup.
|
|
1008
|
+
*
|
|
1009
|
+
* `slideIndex` is 0-based. Unlike navigation methods it is *not* clamped:
|
|
1010
|
+
* an out-of-range or non-integer index returns `null` rather than the notes
|
|
1011
|
+
* of the nearest slide (so a tool iterating by index gets an honest "no
|
|
1012
|
+
* notes" instead of a duplicated neighbour).
|
|
1013
|
+
*
|
|
1014
|
+
* @example
|
|
1015
|
+
* const pres = await PptxPresentation.load(buffer);
|
|
1016
|
+
* for (let i = 0; i < pres.slideCount; i++) {
|
|
1017
|
+
* const notes = pres.getNotes(i);
|
|
1018
|
+
* if (notes) console.log(`Slide ${i + 1} notes:`, notes);
|
|
1019
|
+
* }
|
|
1020
|
+
*/
|
|
1021
|
+
getNotes(slideIndex: number): string | null;
|
|
689
1022
|
/** Render a slide onto the given canvas. */
|
|
690
1023
|
renderSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: RenderSlideOptions): Promise<void>;
|
|
691
1024
|
/**
|
|
@@ -696,9 +1029,9 @@ export declare class PptxPresentation {
|
|
|
696
1029
|
private _findMimeTypeForPath;
|
|
697
1030
|
/**
|
|
698
1031
|
* Render a slide and attach canvas-native playback controls for any
|
|
699
|
-
* embedded audio/video. Returns a
|
|
700
|
-
* media elements, and object URLs. Unlike {@link renderSlide}, this
|
|
701
|
-
* is stateful — always call `handle.
|
|
1032
|
+
* embedded audio/video. Returns a {@link PresentationHandle} that owns the
|
|
1033
|
+
* RAF loop, media elements, and object URLs. Unlike {@link renderSlide}, this
|
|
1034
|
+
* method is stateful — always call `handle.destroy()` when leaving the slide.
|
|
702
1035
|
*/
|
|
703
1036
|
presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: RenderSlideOptions): Promise<PresentationHandle>;
|
|
704
1037
|
/** Terminate the worker and release all resources. */
|
|
@@ -770,6 +1103,13 @@ export declare class PptxViewer {
|
|
|
770
1103
|
prevSlide(): Promise<void>;
|
|
771
1104
|
get slideIndex(): number;
|
|
772
1105
|
get slideCount(): number;
|
|
1106
|
+
/**
|
|
1107
|
+
* Speaker-notes text for a slide (`ppt/notesSlides/notesSlideN.xml`,
|
|
1108
|
+
* ECMA-376 §13.3.5). Passthrough to {@link PptxPresentation.getNotes}:
|
|
1109
|
+
* 0-based index, returns `null` when the slide has no notes part, the index
|
|
1110
|
+
* is out of range, or nothing is loaded yet.
|
|
1111
|
+
*/
|
|
1112
|
+
getNotes(slideIndex: number): string | null;
|
|
773
1113
|
/** The underlying <canvas> element. */
|
|
774
1114
|
get canvasElement(): HTMLCanvasElement;
|
|
775
1115
|
private renderCurrentSlide;
|
|
@@ -814,16 +1154,22 @@ export declare interface Presentation {
|
|
|
814
1154
|
folHlinkColor?: string;
|
|
815
1155
|
}
|
|
816
1156
|
|
|
817
|
-
declare interface PresentationHandle {
|
|
1157
|
+
export declare interface PresentationHandle {
|
|
818
1158
|
play(mediaPath?: string): void;
|
|
819
1159
|
pause(mediaPath?: string): void;
|
|
820
|
-
|
|
1160
|
+
/**
|
|
1161
|
+
* Stop the playback RAF loop, detach pointer listeners and release every
|
|
1162
|
+
* media blob URL. Named `destroy()` to match the teardown method on the
|
|
1163
|
+
* viewers/documents (`PptxViewer.destroy()`, `XlsxWorkbook.destroy()`, …)
|
|
1164
|
+
* so the public API uses one consistent teardown verb.
|
|
1165
|
+
*/
|
|
1166
|
+
destroy(): void;
|
|
821
1167
|
}
|
|
822
1168
|
|
|
823
1169
|
/** ECMA-376 §20.1.8.27 (CT_ReflectionEffect) — mirrored copy below the
|
|
824
1170
|
* shape with a linear alpha gradient. Carries the spec attributes whose
|
|
825
1171
|
* defaults the renderer needs to interpret correctly. */
|
|
826
|
-
declare interface Reflection {
|
|
1172
|
+
export declare interface Reflection {
|
|
827
1173
|
blur: number;
|
|
828
1174
|
dist: number;
|
|
829
1175
|
/** Direction in degrees, clockwise from East. */
|
|
@@ -887,7 +1233,31 @@ export declare interface RenderSlideOptions {
|
|
|
887
1233
|
skipMediaControls?: boolean;
|
|
888
1234
|
}
|
|
889
1235
|
|
|
890
|
-
|
|
1236
|
+
/**
|
|
1237
|
+
* 3D rotation in sphere coordinates — ECMA-376 §20.1.5.11 (`CT_SphereCoords`).
|
|
1238
|
+
* Angles are in **degrees** (the XML carries 60000ths of a degree; the parser
|
|
1239
|
+
* divides once). Per the spec, `lat`/`lon` are latitude/longitude and `rev` is
|
|
1240
|
+
* the revolution about the resulting view axis.
|
|
1241
|
+
*/
|
|
1242
|
+
export declare interface Rot3d {
|
|
1243
|
+
/** Latitude — rotation about the horizontal (X) axis, degrees. */
|
|
1244
|
+
lat: number;
|
|
1245
|
+
/** Longitude — rotation about the vertical (Y) axis, degrees. */
|
|
1246
|
+
lon: number;
|
|
1247
|
+
/** Revolution — in-plane rotation about the view (Z) axis, degrees. */
|
|
1248
|
+
rev: number;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* `<a:scene3d>` — ECMA-376 §20.1.4.1.41 (`CT_Scene3D`). Camera + light rig for
|
|
1253
|
+
* a shape's 3D scene.
|
|
1254
|
+
*/
|
|
1255
|
+
export declare interface Scene3d {
|
|
1256
|
+
camera: Camera3d;
|
|
1257
|
+
lightRig?: LightRig;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
export declare interface Shadow {
|
|
891
1261
|
color: string;
|
|
892
1262
|
alpha: number;
|
|
893
1263
|
blur: number;
|
|
@@ -945,6 +1315,13 @@ export declare interface ShapeElement {
|
|
|
945
1315
|
* same space as x/y/width/height). When present the renderer lays text out in
|
|
946
1316
|
* this rectangle instead of the preset/ellipse-derived text rectangle. */
|
|
947
1317
|
textRect?: TextRect;
|
|
1318
|
+
/** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). When the camera is
|
|
1319
|
+
* non-identity the renderer projects the shape through the camera
|
|
1320
|
+
* homography (Phase A). */
|
|
1321
|
+
scene3d?: Scene3d;
|
|
1322
|
+
/** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
|
|
1323
|
+
* rendered in Phase A. */
|
|
1324
|
+
sp3d?: Sp3d;
|
|
948
1325
|
}
|
|
949
1326
|
|
|
950
1327
|
export declare interface Slide {
|
|
@@ -953,6 +1330,20 @@ export declare interface Slide {
|
|
|
953
1330
|
slideNumber: number;
|
|
954
1331
|
background: Fill | null;
|
|
955
1332
|
elements: SlideElement[];
|
|
1333
|
+
/**
|
|
1334
|
+
* Speaker-notes pane text from `ppt/notesSlides/notesSlideN.xml`
|
|
1335
|
+
* (ECMA-376 §13.3.5 — Notes Slide). The full notes-body text as a single
|
|
1336
|
+
* string, paragraphs joined with `\n`. Absent (`undefined`) when the slide
|
|
1337
|
+
* has no notes part. The renderer ignores this — it is surfaced for tools;
|
|
1338
|
+
* read it via {@link PptxPresentation.getNotes}.
|
|
1339
|
+
*/
|
|
1340
|
+
notes?: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* Legacy slide comments (`ppt/comments/commentN.xml`, ECMA-376 §13.3.4).
|
|
1343
|
+
* Modern Office 365 threaded comments are not parsed. Omitted from the JSON
|
|
1344
|
+
* when the slide has no comments.
|
|
1345
|
+
*/
|
|
1346
|
+
comments?: PptxComment[];
|
|
956
1347
|
}
|
|
957
1348
|
|
|
958
1349
|
export declare type SlideElement = ShapeElement | PictureElement | TableElement | ChartElement | MediaElement;
|
|
@@ -968,7 +1359,7 @@ declare type SlideRenderOptions = RenderOptions & {
|
|
|
968
1359
|
};
|
|
969
1360
|
|
|
970
1361
|
/** ECMA-376 §20.1.8.31 (CT_SoftEdgesEffect) — feather radius in EMU. */
|
|
971
|
-
declare interface SoftEdge {
|
|
1362
|
+
export declare interface SoftEdge {
|
|
972
1363
|
radius: number;
|
|
973
1364
|
}
|
|
974
1365
|
|
|
@@ -977,7 +1368,33 @@ export declare interface SolidFill {
|
|
|
977
1368
|
color: string;
|
|
978
1369
|
}
|
|
979
1370
|
|
|
980
|
-
|
|
1371
|
+
/**
|
|
1372
|
+
* `<a:sp3d>` — ECMA-376 §20.1.5.12 (`CT_Shape3D`). Rendered in Phase B: bevelT/
|
|
1373
|
+
* bevelB are shaded as a lit lip (distance-field + lightRig), extrusionH as a
|
|
1374
|
+
* swept side wall, and contour as a flat outline approximation. Numeric fields
|
|
1375
|
+
* are omitted from JSON when zero.
|
|
1376
|
+
*/
|
|
1377
|
+
export declare interface Sp3d {
|
|
1378
|
+
/** Z position of the front face in EMU (default 0). */
|
|
1379
|
+
z?: number;
|
|
1380
|
+
/** Extrusion (depth) height in EMU (default 0). */
|
|
1381
|
+
extrusionH?: number;
|
|
1382
|
+
/** Contour (outline) width in EMU (default 0). */
|
|
1383
|
+
contourW?: number;
|
|
1384
|
+
/** Contour colour (`<a:contourClr>`, ECMA-376 §20.1.5.12) as a hex string
|
|
1385
|
+
* (e.g. "969696"). Omitted when absent. The renderer draws a flat
|
|
1386
|
+
* approximation of the 3D contour edge (uniform-width outline, no bevel
|
|
1387
|
+
* shading) when both `contourW` and `contourClr` are present. */
|
|
1388
|
+
contourClr?: string;
|
|
1389
|
+
/** Preset surface material (`ST_PresetMaterialType`), default "warmMatte". */
|
|
1390
|
+
prstMaterial: string;
|
|
1391
|
+
/** Top bevel. */
|
|
1392
|
+
bevelT?: Bevel3d;
|
|
1393
|
+
/** Bottom bevel. */
|
|
1394
|
+
bevelB?: Bevel3d;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export declare type SpaceLine = {
|
|
981
1398
|
type: 'pct';
|
|
982
1399
|
val: number;
|
|
983
1400
|
} | {
|
|
@@ -1002,7 +1419,7 @@ export declare interface Stroke {
|
|
|
1002
1419
|
cmpd?: string;
|
|
1003
1420
|
}
|
|
1004
1421
|
|
|
1005
|
-
declare interface TableCell {
|
|
1422
|
+
export declare interface TableCell {
|
|
1006
1423
|
textBody: TextBody | null;
|
|
1007
1424
|
fill: Fill | null;
|
|
1008
1425
|
/** Default run text colour inherited from the table style (`<a:tcTxStyle>`); hex, no `#`. */
|
|
@@ -1025,7 +1442,7 @@ declare interface TableCell {
|
|
|
1025
1442
|
vMerge: boolean;
|
|
1026
1443
|
}
|
|
1027
1444
|
|
|
1028
|
-
declare interface TableElement {
|
|
1445
|
+
export declare interface TableElement {
|
|
1029
1446
|
type: 'table';
|
|
1030
1447
|
x: number;
|
|
1031
1448
|
y: number;
|
|
@@ -1038,13 +1455,13 @@ declare interface TableElement {
|
|
|
1038
1455
|
rtl?: boolean;
|
|
1039
1456
|
}
|
|
1040
1457
|
|
|
1041
|
-
declare interface TableRow {
|
|
1458
|
+
export declare interface TableRow {
|
|
1042
1459
|
/** Row height in EMU */
|
|
1043
1460
|
height: number;
|
|
1044
1461
|
cells: TableCell[];
|
|
1045
1462
|
}
|
|
1046
1463
|
|
|
1047
|
-
declare interface TabStop {
|
|
1464
|
+
export declare interface TabStop {
|
|
1048
1465
|
/** Position in EMU from the left edge of the text area (after lIns) */
|
|
1049
1466
|
pos: number;
|
|
1050
1467
|
/** Alignment: "l" | "r" | "ctr" | "dec" */
|
|
@@ -1115,7 +1532,7 @@ declare interface TextOutline {
|
|
|
1115
1532
|
}
|
|
1116
1533
|
|
|
1117
1534
|
/** Absolute text-frame rectangle in EMU (from SmartArt `<dsp:txXfrm>`). */
|
|
1118
|
-
declare interface TextRect {
|
|
1535
|
+
export declare interface TextRect {
|
|
1119
1536
|
x: number;
|
|
1120
1537
|
y: number;
|
|
1121
1538
|
width: number;
|
|
@@ -1201,4 +1618,27 @@ export declare interface TextRunData {
|
|
|
1201
1618
|
outline?: TextOutline;
|
|
1202
1619
|
}
|
|
1203
1620
|
|
|
1621
|
+
/**
|
|
1622
|
+
* ECMA-376 §20.1.8.58 (CT_TileInfoProperties) — tiled blip-fill placement.
|
|
1623
|
+
* The blip repeats at its native size (scaled by sx/sy) across the fill box.
|
|
1624
|
+
* Mutually exclusive with {@link ImageFill.fillRect} (the `stretch` mode).
|
|
1625
|
+
*/
|
|
1626
|
+
export declare interface TileInfo {
|
|
1627
|
+
/** Horizontal offset of the first tile, in EMU (`tx`). Default 0. */
|
|
1628
|
+
tx: number;
|
|
1629
|
+
/** Vertical offset of the first tile, in EMU (`ty`). Default 0. */
|
|
1630
|
+
ty: number;
|
|
1631
|
+
/** Horizontal tile scale as a fraction (`sx` / 100000). Default 1.0. */
|
|
1632
|
+
sx: number;
|
|
1633
|
+
/** Vertical tile scale as a fraction (`sy` / 100000). Default 1.0. */
|
|
1634
|
+
sy: number;
|
|
1635
|
+
/** Mirror mode: `'none' | 'x' | 'y' | 'xy'` (`flip`). Default `'none'`. */
|
|
1636
|
+
flip: string;
|
|
1637
|
+
/**
|
|
1638
|
+
* Anchor corner the tile grid registers against:
|
|
1639
|
+
* `tl|t|tr|l|ctr|r|bl|b|br` (`algn`). Default `'tl'`.
|
|
1640
|
+
*/
|
|
1641
|
+
algn: string;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1204
1644
|
export { }
|