@silurus/ooxml 0.56.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/docx-BWAno6Ct.js +1661 -0
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/pptx-5Y2LWU2Z.js +1614 -0
- package/dist/pptx.mjs +2 -2
- package/dist/src-BM-QyfQO.js +29312 -0
- package/dist/types/docx.d.ts +21 -21
- package/dist/types/index.d.ts +465 -11
- package/dist/types/pptx.d.ts +351 -24
- package/dist/types/xlsx.d.ts +83 -38
- package/dist/xlsx-qDuC11Rx.js +3502 -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.
|
|
@@ -319,14 +517,14 @@ declare interface EquationRun {
|
|
|
319
517
|
export declare type Fill = SolidFill | NoFill | GradientFill | PatternFill;
|
|
320
518
|
|
|
321
519
|
/** ECMA-376 §20.1.8.17 (CT_GlowEffect) — coloured halo with blur radius. */
|
|
322
|
-
declare interface Glow {
|
|
520
|
+
export declare interface Glow {
|
|
323
521
|
color: string;
|
|
324
522
|
alpha: number;
|
|
325
523
|
/** Blur radius in EMU. */
|
|
326
524
|
radius: number;
|
|
327
525
|
}
|
|
328
526
|
|
|
329
|
-
declare interface GradientFill {
|
|
527
|
+
export declare interface GradientFill {
|
|
330
528
|
fillType: 'gradient';
|
|
331
529
|
stops: GradientStop[];
|
|
332
530
|
/** degrees: 0 = left→right, 90 = top→bottom */
|
|
@@ -335,11 +533,36 @@ declare interface GradientFill {
|
|
|
335
533
|
gradType: string;
|
|
336
534
|
}
|
|
337
535
|
|
|
338
|
-
declare interface GradientStop {
|
|
536
|
+
export declare interface GradientStop {
|
|
339
537
|
position: number;
|
|
340
538
|
color: string;
|
|
341
539
|
}
|
|
342
540
|
|
|
541
|
+
declare interface LegendManualLayout {
|
|
542
|
+
/** `"edge"` = `x`/`y` are fractions from top-left of chart space;
|
|
543
|
+
* `"factor"` = fractions offset from the default position. */
|
|
544
|
+
xMode: string;
|
|
545
|
+
yMode: string;
|
|
546
|
+
/** Fractions of chart space width/height. */
|
|
547
|
+
x: number;
|
|
548
|
+
y: number;
|
|
549
|
+
w: number;
|
|
550
|
+
h: number;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* `<a:lightRig>` — ECMA-376 §20.1.5.9 (`CT_LightRig`). Parsed for Phase B
|
|
555
|
+
* (lighting/bevel shading); the Phase A camera renderer ignores it.
|
|
556
|
+
*/
|
|
557
|
+
export declare interface LightRig {
|
|
558
|
+
/** Light-rig preset (`ST_LightRigType`), e.g. "threePt". */
|
|
559
|
+
rig: string;
|
|
560
|
+
/** Light direction (`ST_LightRigDirection`): tl/t/tr/l/r/bl/b/br. */
|
|
561
|
+
dir: string;
|
|
562
|
+
/** Optional rotation override of the rig. */
|
|
563
|
+
rot?: Rot3d;
|
|
564
|
+
}
|
|
565
|
+
|
|
343
566
|
export declare interface LineBreak {
|
|
344
567
|
type: 'break';
|
|
345
568
|
}
|
|
@@ -521,7 +744,7 @@ declare interface MathSvg {
|
|
|
521
744
|
descentEm: number;
|
|
522
745
|
}
|
|
523
746
|
|
|
524
|
-
declare interface MediaElement {
|
|
747
|
+
export declare interface MediaElement {
|
|
525
748
|
type: 'media';
|
|
526
749
|
x: number;
|
|
527
750
|
y: number;
|
|
@@ -574,7 +797,7 @@ export declare interface Paragraph {
|
|
|
574
797
|
runs: TextRun[];
|
|
575
798
|
}
|
|
576
799
|
|
|
577
|
-
declare type PathCmd = {
|
|
800
|
+
export declare type PathCmd = {
|
|
578
801
|
cmd: 'moveTo';
|
|
579
802
|
x: number;
|
|
580
803
|
y: number;
|
|
@@ -625,8 +848,29 @@ export declare interface PictureElement {
|
|
|
625
848
|
flipV: boolean;
|
|
626
849
|
/** Data URL, e.g. "data:image/png;base64,..." */
|
|
627
850
|
dataUrl: string;
|
|
628
|
-
/**
|
|
629
|
-
|
|
851
|
+
/**
|
|
852
|
+
* Border line from `<p:pic><p:spPr><a:ln>` (ECMA-376 §20.1.2.2.24). A
|
|
853
|
+
* `p:pic`'s spPr is `CT_ShapeProperties` (§19.3.1.37), so a picture carries
|
|
854
|
+
* the same line model as a shape. `null` when there is no `<a:ln>` or it
|
|
855
|
+
* resolves to `<a:noFill/>` (border explicitly suppressed). The border is
|
|
856
|
+
* stroked along the picture's clip silhouette (roundRect / custGeom / rect).
|
|
857
|
+
*/
|
|
858
|
+
stroke: Stroke | null;
|
|
859
|
+
/**
|
|
860
|
+
* `<p:spPr><a:prstGeom prst="…">` preset name (e.g. `"roundRect"`,
|
|
861
|
+
* `"ellipse"`). ECMA-376 §20.1.9.18: a picture's preset geometry is its clip
|
|
862
|
+
* silhouette and the path its border / contour hug. Undefined / omitted = a
|
|
863
|
+
* plain rectangle (`prst="rect"` or no prstGeom). When set, the renderer
|
|
864
|
+
* builds the silhouette via the shared preset-geometry engine (any of the 186
|
|
865
|
+
* presets). `custGeom` takes priority when both are present.
|
|
866
|
+
*/
|
|
867
|
+
prstGeom?: string;
|
|
868
|
+
/**
|
|
869
|
+
* Adjust guides from the prstGeom `<a:avLst>` (1/1000-of-a-percent OOXML
|
|
870
|
+
* units), in `gd@name` declaration order (index 0 = adj/adj1, 1 = adj2, …).
|
|
871
|
+
* Omitted when avLst is empty — the preset's own declared defaults then apply.
|
|
872
|
+
*/
|
|
873
|
+
prstAdjust?: number[];
|
|
630
874
|
/**
|
|
631
875
|
* ECMA-376 a:srcRect — source image crop as fractions (0..1) of the source
|
|
632
876
|
* width/height. Omitted when the image is not cropped.
|
|
@@ -647,6 +891,27 @@ export declare interface PictureElement {
|
|
|
647
891
|
* trimmed to the laptop / device silhouette declared in the file.
|
|
648
892
|
*/
|
|
649
893
|
custGeom?: PathCmd[][] | null;
|
|
894
|
+
/**
|
|
895
|
+
* Drop shadow from `spPr > effectLst > outerShdw`. A `p:pic`'s `spPr` is
|
|
896
|
+
* `CT_ShapeProperties` (ECMA-376 §19.3.1.37), so the same effects shapes
|
|
897
|
+
* carry apply to images. ECMA-376 §20.1.8.45 (CT_OuterShadowEffect).
|
|
898
|
+
*/
|
|
899
|
+
shadow?: Shadow;
|
|
900
|
+
/** Inner (inset) shadow from effectLst > innerShdw. ECMA-376 §20.1.8.40. */
|
|
901
|
+
innerShadow?: Shadow;
|
|
902
|
+
/** Coloured glow halo from effectLst > glow. ECMA-376 §20.1.8.32. */
|
|
903
|
+
glow?: Glow;
|
|
904
|
+
/** Soft (feathered) edge from effectLst > softEdge. ECMA-376 §20.1.8.53. */
|
|
905
|
+
softEdge?: SoftEdge;
|
|
906
|
+
/** Mirrored reflection from effectLst > reflection. ECMA-376 §20.1.8.50. */
|
|
907
|
+
reflection?: Reflection;
|
|
908
|
+
/** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). A `p:pic`'s spPr is
|
|
909
|
+
* `CT_ShapeProperties`, so 3D scenes apply to images. When non-identity the
|
|
910
|
+
* renderer projects the picture through the camera homography (Phase A). */
|
|
911
|
+
scene3d?: Scene3d;
|
|
912
|
+
/** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
|
|
913
|
+
* rendered in Phase A. */
|
|
914
|
+
sp3d?: Sp3d;
|
|
650
915
|
}
|
|
651
916
|
|
|
652
917
|
/**
|
|
@@ -696,9 +961,9 @@ export declare class PptxPresentation {
|
|
|
696
961
|
private _findMimeTypeForPath;
|
|
697
962
|
/**
|
|
698
963
|
* 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.
|
|
964
|
+
* embedded audio/video. Returns a {@link PresentationHandle} that owns the
|
|
965
|
+
* RAF loop, media elements, and object URLs. Unlike {@link renderSlide}, this
|
|
966
|
+
* method is stateful — always call `handle.destroy()` when leaving the slide.
|
|
702
967
|
*/
|
|
703
968
|
presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: RenderSlideOptions): Promise<PresentationHandle>;
|
|
704
969
|
/** Terminate the worker and release all resources. */
|
|
@@ -814,16 +1079,22 @@ export declare interface Presentation {
|
|
|
814
1079
|
folHlinkColor?: string;
|
|
815
1080
|
}
|
|
816
1081
|
|
|
817
|
-
declare interface PresentationHandle {
|
|
1082
|
+
export declare interface PresentationHandle {
|
|
818
1083
|
play(mediaPath?: string): void;
|
|
819
1084
|
pause(mediaPath?: string): void;
|
|
820
|
-
|
|
1085
|
+
/**
|
|
1086
|
+
* Stop the playback RAF loop, detach pointer listeners and release every
|
|
1087
|
+
* media blob URL. Named `destroy()` to match the teardown method on the
|
|
1088
|
+
* viewers/documents (`PptxViewer.destroy()`, `XlsxWorkbook.destroy()`, …)
|
|
1089
|
+
* so the public API uses one consistent teardown verb.
|
|
1090
|
+
*/
|
|
1091
|
+
destroy(): void;
|
|
821
1092
|
}
|
|
822
1093
|
|
|
823
1094
|
/** ECMA-376 §20.1.8.27 (CT_ReflectionEffect) — mirrored copy below the
|
|
824
1095
|
* shape with a linear alpha gradient. Carries the spec attributes whose
|
|
825
1096
|
* defaults the renderer needs to interpret correctly. */
|
|
826
|
-
declare interface Reflection {
|
|
1097
|
+
export declare interface Reflection {
|
|
827
1098
|
blur: number;
|
|
828
1099
|
dist: number;
|
|
829
1100
|
/** Direction in degrees, clockwise from East. */
|
|
@@ -887,7 +1158,31 @@ export declare interface RenderSlideOptions {
|
|
|
887
1158
|
skipMediaControls?: boolean;
|
|
888
1159
|
}
|
|
889
1160
|
|
|
890
|
-
|
|
1161
|
+
/**
|
|
1162
|
+
* 3D rotation in sphere coordinates — ECMA-376 §20.1.5.11 (`CT_SphereCoords`).
|
|
1163
|
+
* Angles are in **degrees** (the XML carries 60000ths of a degree; the parser
|
|
1164
|
+
* divides once). Per the spec, `lat`/`lon` are latitude/longitude and `rev` is
|
|
1165
|
+
* the revolution about the resulting view axis.
|
|
1166
|
+
*/
|
|
1167
|
+
export declare interface Rot3d {
|
|
1168
|
+
/** Latitude — rotation about the horizontal (X) axis, degrees. */
|
|
1169
|
+
lat: number;
|
|
1170
|
+
/** Longitude — rotation about the vertical (Y) axis, degrees. */
|
|
1171
|
+
lon: number;
|
|
1172
|
+
/** Revolution — in-plane rotation about the view (Z) axis, degrees. */
|
|
1173
|
+
rev: number;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* `<a:scene3d>` — ECMA-376 §20.1.4.1.41 (`CT_Scene3D`). Camera + light rig for
|
|
1178
|
+
* a shape's 3D scene.
|
|
1179
|
+
*/
|
|
1180
|
+
export declare interface Scene3d {
|
|
1181
|
+
camera: Camera3d;
|
|
1182
|
+
lightRig?: LightRig;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
export declare interface Shadow {
|
|
891
1186
|
color: string;
|
|
892
1187
|
alpha: number;
|
|
893
1188
|
blur: number;
|
|
@@ -945,6 +1240,13 @@ export declare interface ShapeElement {
|
|
|
945
1240
|
* same space as x/y/width/height). When present the renderer lays text out in
|
|
946
1241
|
* this rectangle instead of the preset/ellipse-derived text rectangle. */
|
|
947
1242
|
textRect?: TextRect;
|
|
1243
|
+
/** `<a:scene3d>` 3D camera scene (ECMA-376 §20.1.5.5). When the camera is
|
|
1244
|
+
* non-identity the renderer projects the shape through the camera
|
|
1245
|
+
* homography (Phase A). */
|
|
1246
|
+
scene3d?: Scene3d;
|
|
1247
|
+
/** `<a:sp3d>` 3D shape properties (ECMA-376 §20.1.5.12). Parsed but not
|
|
1248
|
+
* rendered in Phase A. */
|
|
1249
|
+
sp3d?: Sp3d;
|
|
948
1250
|
}
|
|
949
1251
|
|
|
950
1252
|
export declare interface Slide {
|
|
@@ -968,7 +1270,7 @@ declare type SlideRenderOptions = RenderOptions & {
|
|
|
968
1270
|
};
|
|
969
1271
|
|
|
970
1272
|
/** ECMA-376 §20.1.8.31 (CT_SoftEdgesEffect) — feather radius in EMU. */
|
|
971
|
-
declare interface SoftEdge {
|
|
1273
|
+
export declare interface SoftEdge {
|
|
972
1274
|
radius: number;
|
|
973
1275
|
}
|
|
974
1276
|
|
|
@@ -977,7 +1279,32 @@ export declare interface SolidFill {
|
|
|
977
1279
|
color: string;
|
|
978
1280
|
}
|
|
979
1281
|
|
|
980
|
-
|
|
1282
|
+
/**
|
|
1283
|
+
* `<a:sp3d>` — ECMA-376 §20.1.5.12 (`CT_Shape3D`). Parsed in full but **not
|
|
1284
|
+
* rendered in Phase A** (camera-only). bevel/contour/extrusion are Phase B.
|
|
1285
|
+
* Numeric fields are omitted from JSON when zero.
|
|
1286
|
+
*/
|
|
1287
|
+
export declare interface Sp3d {
|
|
1288
|
+
/** Z position of the front face in EMU (default 0). */
|
|
1289
|
+
z?: number;
|
|
1290
|
+
/** Extrusion (depth) height in EMU (default 0). */
|
|
1291
|
+
extrusionH?: number;
|
|
1292
|
+
/** Contour (outline) width in EMU (default 0). */
|
|
1293
|
+
contourW?: number;
|
|
1294
|
+
/** Contour colour (`<a:contourClr>`, ECMA-376 §20.1.5.12) as a hex string
|
|
1295
|
+
* (e.g. "969696"). Omitted when absent. The renderer draws a flat
|
|
1296
|
+
* approximation of the 3D contour edge (uniform-width outline, no bevel
|
|
1297
|
+
* shading) when both `contourW` and `contourClr` are present. */
|
|
1298
|
+
contourClr?: string;
|
|
1299
|
+
/** Preset surface material (`ST_PresetMaterialType`), default "warmMatte". */
|
|
1300
|
+
prstMaterial: string;
|
|
1301
|
+
/** Top bevel. */
|
|
1302
|
+
bevelT?: Bevel3d;
|
|
1303
|
+
/** Bottom bevel. */
|
|
1304
|
+
bevelB?: Bevel3d;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export declare type SpaceLine = {
|
|
981
1308
|
type: 'pct';
|
|
982
1309
|
val: number;
|
|
983
1310
|
} | {
|
|
@@ -1002,7 +1329,7 @@ export declare interface Stroke {
|
|
|
1002
1329
|
cmpd?: string;
|
|
1003
1330
|
}
|
|
1004
1331
|
|
|
1005
|
-
declare interface TableCell {
|
|
1332
|
+
export declare interface TableCell {
|
|
1006
1333
|
textBody: TextBody | null;
|
|
1007
1334
|
fill: Fill | null;
|
|
1008
1335
|
/** Default run text colour inherited from the table style (`<a:tcTxStyle>`); hex, no `#`. */
|
|
@@ -1025,7 +1352,7 @@ declare interface TableCell {
|
|
|
1025
1352
|
vMerge: boolean;
|
|
1026
1353
|
}
|
|
1027
1354
|
|
|
1028
|
-
declare interface TableElement {
|
|
1355
|
+
export declare interface TableElement {
|
|
1029
1356
|
type: 'table';
|
|
1030
1357
|
x: number;
|
|
1031
1358
|
y: number;
|
|
@@ -1038,13 +1365,13 @@ declare interface TableElement {
|
|
|
1038
1365
|
rtl?: boolean;
|
|
1039
1366
|
}
|
|
1040
1367
|
|
|
1041
|
-
declare interface TableRow {
|
|
1368
|
+
export declare interface TableRow {
|
|
1042
1369
|
/** Row height in EMU */
|
|
1043
1370
|
height: number;
|
|
1044
1371
|
cells: TableCell[];
|
|
1045
1372
|
}
|
|
1046
1373
|
|
|
1047
|
-
declare interface TabStop {
|
|
1374
|
+
export declare interface TabStop {
|
|
1048
1375
|
/** Position in EMU from the left edge of the text area (after lIns) */
|
|
1049
1376
|
pos: number;
|
|
1050
1377
|
/** Alignment: "l" | "r" | "ctr" | "dec" */
|
|
@@ -1115,7 +1442,7 @@ declare interface TextOutline {
|
|
|
1115
1442
|
}
|
|
1116
1443
|
|
|
1117
1444
|
/** Absolute text-frame rectangle in EMU (from SmartArt `<dsp:txXfrm>`). */
|
|
1118
|
-
declare interface TextRect {
|
|
1445
|
+
export declare interface TextRect {
|
|
1119
1446
|
x: number;
|
|
1120
1447
|
y: number;
|
|
1121
1448
|
width: number;
|