@s8fy/pptx-parser 1.0.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.
@@ -0,0 +1,1212 @@
1
+ export interface Shadow {
2
+ h: number
3
+ v: number
4
+ blur: number
5
+ color: string
6
+ sx?: number
7
+ sy?: number
8
+ }
9
+
10
+ export interface Glow {
11
+ rad: number
12
+ color: string
13
+ }
14
+
15
+ export interface ColorFill {
16
+ type: 'color'
17
+ value: string
18
+ }
19
+
20
+ export type PictureFillMode = 'stretch' | 'tile'
21
+ export type PictureFillAlignment = 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br'
22
+ export type PictureFillFlip = 'none' | 'x' | 'y' | 'xy'
23
+
24
+ export interface PictureFillRect {
25
+ /** Fraction of the source/target width from the left edge; 0.25 means 25%. */
26
+ l: number
27
+ /** Fraction of the source/target height from the top edge. */
28
+ t: number
29
+ /** Fraction of the source/target width from the right edge. */
30
+ r: number
31
+ /** Fraction of the source/target height from the bottom edge. */
32
+ b: number
33
+ }
34
+
35
+ export interface PictureFillTile {
36
+ /** Horizontal scale ratio; 1 means 100% of the image's natural display width. */
37
+ scaleX: number
38
+ /** Vertical scale ratio; 1 means 100% of the image's natural display height. */
39
+ scaleY: number
40
+ /** Horizontal tile offset in parser px. */
41
+ offsetX: number
42
+ /** Vertical tile offset in parser px. */
43
+ offsetY: number
44
+ align: PictureFillAlignment
45
+ flip: PictureFillFlip
46
+ }
47
+
48
+ interface PictureFillValueBase {
49
+ picBase64: string
50
+ opacity: number
51
+ sourceRect?: PictureFillRect
52
+ rotateWithShape: boolean
53
+ /** Positive DrawingML DPI override; omitted means use embedded image density. */
54
+ dpi?: number
55
+ duotone?: [string, string]
56
+ }
57
+
58
+ export interface StretchPictureFillValue extends PictureFillValueBase {
59
+ mode: 'stretch'
60
+ fillRect?: PictureFillRect
61
+ tile?: never
62
+ }
63
+
64
+ export interface TilePictureFillValue extends PictureFillValueBase {
65
+ mode: 'tile'
66
+ fillRect?: never
67
+ tile: PictureFillTile
68
+ }
69
+
70
+ export type PictureFillValue = StretchPictureFillValue | TilePictureFillValue
71
+
72
+ export interface ImageFill {
73
+ type: 'image'
74
+ value: PictureFillValue
75
+ }
76
+
77
+ export interface GradientFill {
78
+ type: 'gradient'
79
+ value: {
80
+ path: 'line' | 'circle' | 'rect' | 'shape'
81
+ rot: number
82
+ colors: {
83
+ pos: string
84
+ color: string
85
+ }[]
86
+ }
87
+ }
88
+
89
+ export interface PatternFill {
90
+ type: 'pattern'
91
+ value: {
92
+ type: string
93
+ foregroundColor: string
94
+ backgroundColor: string
95
+ }
96
+ }
97
+
98
+ export type Fill = ColorFill | ImageFill | GradientFill | PatternFill
99
+
100
+ // --- Structured text types ---
101
+
102
+ export type TextColor = string | { colors: { color: string; pos: string }[]; rot: number }
103
+
104
+ export interface TextRun {
105
+ text: string
106
+ fieldType?: string
107
+ color?: TextColor
108
+ fontSize?: string
109
+ fontFamily?: string
110
+ fontWeight?: string
111
+ fontStyle?: string
112
+ textDecoration?: string
113
+ textDecorationLine?: string
114
+ letterSpacing?: string
115
+ verticalAlign?: string
116
+ textShadow?: string
117
+ highlightColor?: string
118
+ }
119
+
120
+ export interface TextMathRun {
121
+ type: 'math'
122
+ latex: string
123
+ displayMode?: boolean
124
+ color?: TextColor
125
+ fontSize?: string
126
+ fontFamily?: string
127
+ fontWeight?: string
128
+ fontStyle?: string
129
+ textDecoration?: string
130
+ textDecorationLine?: string
131
+ letterSpacing?: string
132
+ verticalAlign?: string
133
+ textShadow?: string
134
+ highlightColor?: string
135
+ }
136
+
137
+ export interface TextLink extends TextRun {
138
+ linkURL: string
139
+ linkColor?: string
140
+ linkTooltip?: string
141
+ linkAction?: string
142
+ }
143
+
144
+ export interface TextBreak {
145
+ type: 'br'
146
+ }
147
+
148
+ export interface BulletInfo {
149
+ char?: string
150
+ marLPt: number
151
+ indentPt: number
152
+ fontSize?: string
153
+ fontFamily?: string
154
+ color?: string
155
+ autoNumType?: string
156
+ autoNumIndex?: number
157
+ }
158
+
159
+ export interface TextParagraph {
160
+ align: string
161
+ lineHeight?: number
162
+ spaceBefore?: string
163
+ spaceAfter?: string
164
+ marginLeft?: string
165
+ textIndent?: string
166
+ list?: {
167
+ type: 'ul' | 'ol'
168
+ level: number
169
+ bullet?: BulletInfo
170
+ }
171
+ runs: (TextRun | TextLink | TextMathRun | TextBreak)[]
172
+ }
173
+
174
+ export interface Border {
175
+ borderColor: string
176
+ borderWidth: number
177
+ borderType: 'solid' | 'dashed' | 'dotted'
178
+ borderGradient?: GradientFill['value']
179
+ }
180
+
181
+ export interface ArrowEndpoint {
182
+ type: 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow'
183
+ w?: 'sm' | 'med' | 'lg'
184
+ len?: 'sm' | 'med' | 'lg'
185
+ }
186
+
187
+ export interface AutoFit {
188
+ type: 'shape' | 'text'
189
+ fontScale?: number
190
+ }
191
+
192
+ /**
193
+ * Rendering layer metadata used by viewer-side sorting:
194
+ * -2: slide master, -1: slide layout, 0/undefined: current slide.
195
+ */
196
+ export interface LayeredElementMeta {
197
+ _layer?: number
198
+ /** True when this element has an actual OOXML p:ph placeholder node. */
199
+ isPlaceholder?: boolean
200
+ }
201
+
202
+ export interface Shape {
203
+ type: 'shape'
204
+ left: number
205
+ top: number
206
+ width: number
207
+ height: number
208
+ borderColor: string
209
+ borderWidth: number
210
+ borderType: 'solid' | 'dashed' | 'dotted'
211
+ borderStrokeDasharray: string
212
+ borderGradient?: GradientFill['value']
213
+ shadow?: Shadow
214
+ glow?: Glow
215
+ fill: Fill
216
+ content: TextParagraph[]
217
+ isFlipV?: boolean
218
+ isFlipH?: boolean
219
+ rotate?: number
220
+ shapType: string
221
+ vAlign: string
222
+ path?: string
223
+ keypoints?: Record<string, number>
224
+ name: string
225
+ order: number
226
+ autoFit?: AutoFit
227
+ textOverflow?: 'overflow' | 'clip' | 'ellipsis'
228
+ spcFirstLastPara?: boolean
229
+ headEnd?: ArrowEndpoint
230
+ tailEnd?: ArrowEndpoint
231
+ }
232
+
233
+ export interface SlideText {
234
+ type: 'text'
235
+ left: number
236
+ top: number
237
+ width: number
238
+ height: number
239
+ borderColor: string
240
+ borderWidth: number
241
+ borderType: 'solid' | 'dashed' | 'dotted'
242
+ borderStrokeDasharray: string
243
+ borderGradient?: GradientFill['value']
244
+ shadow?: Shadow
245
+ glow?: Glow
246
+ fill: Fill
247
+ isFlipV?: boolean
248
+ isFlipH?: boolean
249
+ isVertical?: boolean
250
+ rotate?: number
251
+ content: TextParagraph[]
252
+ /** Optional backing geometry for filled/bordered text boxes. */
253
+ shapType?: string
254
+ /** SVG path for the backing geometry when present. */
255
+ path?: string
256
+ vAlign: string
257
+ name: string
258
+ order: number
259
+ autoFit?: AutoFit
260
+ textOverflow?: 'overflow' | 'clip' | 'ellipsis'
261
+ spcFirstLastPara?: boolean
262
+ headEnd?: ArrowEndpoint
263
+ tailEnd?: ArrowEndpoint
264
+ }
265
+
266
+ export interface SlideImage {
267
+ type: 'image'
268
+ left: number
269
+ top: number
270
+ width: number
271
+ height: number
272
+ src: string
273
+ /** Semantic image description from OOXML cNvPr descr, falling back to cNvPr name. */
274
+ name?: string
275
+ rotate?: number
276
+ isFlipH?: boolean
277
+ isFlipV?: boolean
278
+ order: number
279
+ /** Black/white threshold effect from OOXML <a:biLevel>, normalized to 0..1. */
280
+ biLevel?: number
281
+ rect?: {
282
+ t?: number
283
+ b?: number
284
+ l?: number
285
+ r?: number
286
+ }
287
+ geom: string
288
+ clipPathData?: string
289
+ keypoints?: Record<string, number>
290
+ borderColor: string
291
+ borderWidth: number
292
+ borderType: 'solid' | 'dashed' | 'dotted'
293
+ borderStrokeDasharray: string
294
+ borderGradient?: GradientFill['value']
295
+ /** Duotone recolor extracted from OOXML <a:duotone>. */
296
+ duotone?: [string, string]
297
+ filters?: {
298
+ sharpen?: number
299
+ colorTemperature?: number
300
+ saturation?: number
301
+ brightness?: number
302
+ contrast?: number
303
+ }
304
+ }
305
+
306
+ export interface TableCell {
307
+ text: TextParagraph[]
308
+ rowSpan?: number
309
+ colSpan?: number
310
+ vMerge?: number
311
+ hMerge?: number
312
+ fillColor?: string
313
+ fontColor?: string
314
+ fontBold?: boolean
315
+ vAlign?: 'up' | 'mid' | 'down'
316
+ padding?: {
317
+ left: number
318
+ top: number
319
+ right: number
320
+ bottom: number
321
+ }
322
+ borders: {
323
+ top?: Border
324
+ bottom?: Border
325
+ left?: Border
326
+ right?: Border
327
+ }
328
+ spcFirstLastPara?: boolean
329
+ }
330
+ export interface Table {
331
+ type: 'table'
332
+ left: number
333
+ top: number
334
+ width: number
335
+ height: number
336
+ data: TableCell[][]
337
+ borders: {
338
+ top?: Border
339
+ bottom?: Border
340
+ left?: Border
341
+ right?: Border
342
+ }
343
+ order: number
344
+ rowHeights: number[]
345
+ colWidths: number[]
346
+ }
347
+
348
+ export type OoxmlChartType =
349
+ | 'lineChart'
350
+ | 'line3DChart'
351
+ | 'barChart'
352
+ | 'bar3DChart'
353
+ | 'pieChart'
354
+ | 'pie3DChart'
355
+ | 'doughnutChart'
356
+ | 'areaChart'
357
+ | 'area3DChart'
358
+ | 'scatterChart'
359
+ | 'bubbleChart'
360
+ | 'radarChart'
361
+ | 'surfaceChart'
362
+ | 'surface3DChart'
363
+ | 'stockChart'
364
+ | 'waterfall'
365
+ | 'sunburst'
366
+ | 'treemap'
367
+ | 'histogram'
368
+ | 'boxWhisker'
369
+ | 'funnel'
370
+
371
+ export type ChartType =
372
+ | 'bar'
373
+ | 'column'
374
+ | 'line'
375
+ | 'pie'
376
+ | 'ring'
377
+ | 'area'
378
+ | 'radar'
379
+ | 'scatter'
380
+ | 'bubble'
381
+ | 'stock'
382
+ | 'surface'
383
+ | 'waterfall'
384
+ | 'sunburst'
385
+ | 'treemap'
386
+ | 'histogram'
387
+ | 'boxWhisker'
388
+ | 'funnel'
389
+
390
+ export interface ChartValue {
391
+ x: string
392
+ y: number
393
+ size?: number
394
+ }
395
+ export interface ChartXLabel {
396
+ [key: string]: string
397
+ }
398
+ export interface ChartItem {
399
+ key: string
400
+ values: ChartValue[]
401
+ xlabels?: ChartXLabel
402
+ smooth?: boolean
403
+ }
404
+ export interface ChartOutline {
405
+ color?: string
406
+ width?: number
407
+ style?: 'solid' | 'dashed' | 'dotted'
408
+ strokeDasharray?: string
409
+ }
410
+ export interface ChartSeriesStyle {
411
+ outline?: ChartOutline
412
+ fill?: string | GradientFill['value']
413
+ marker?: string
414
+ markerSize?: number
415
+ markerFill?: string | GradientFill['value']
416
+ markerOutline?: ChartOutline
417
+ smooth?: boolean
418
+ dataLabels?: ChartDataLabels
419
+ /**
420
+ * Per-series `c:shape` override of a 3D bar chart (`CT_BarSer/c:shape`),
421
+ * alongside the chart-group level `barShape`. Transcribed for fidelity; the
422
+ * bundled renderers degrade every shape to `box`.
423
+ */
424
+ shape?: ChartBarShape
425
+ }
426
+ /** A sparse `c:bandFmt` override, keyed by its required explicit `c:idx`. */
427
+ export interface ChartBandFormat {
428
+ index: number
429
+ fill?: string | GradientFill['value']
430
+ outline?: ChartOutline
431
+ }
432
+ /** `ST_Shape` — the bar geometry of a 3D bar chart. */
433
+ export type ChartBarShape = 'box' | 'cone' | 'coneToMax' | 'cylinder' | 'pyramid' | 'pyramidToMax'
434
+ /**
435
+ * The fixed 3D camera of a legacy chart (`c:view3D`, `CT_View3D`).
436
+ *
437
+ * Every field is present only when the file declares it; the parser never
438
+ * substitutes the ECMA-376 attribute default, so `omitted` stays
439
+ * distinguishable from `explicit`. Renderers apply the defaults themselves
440
+ * (`rotX` 0, `rotY` 0, `rightAngleAxes` true, `perspective` 30,
441
+ * `depthPercent` 100, `heightPercent` 100). Values outside the schema ranges
442
+ * are transcribed faithfully rather than clamped.
443
+ */
444
+ export interface ChartView3D {
445
+ /** `c:rotX`, degrees, schema range -90..90. */
446
+ rotX?: number
447
+ /** `c:rotY`, degrees, schema range 0..360. */
448
+ rotY?: number
449
+ /** `c:rAngAx`. Perspective has no visible effect while this is true. */
450
+ rightAngleAxes?: boolean
451
+ /** `c:perspective`, schema range 0..240. Only meaningful when `rightAngleAxes` is false. */
452
+ perspective?: number
453
+ /** `c:depthPercent`, chart depth as a percentage of width, schema range 20..2000. */
454
+ depthPercent?: number
455
+ /** `c:hPercent`, chart height as a percentage of width, schema range 5..500. */
456
+ heightPercent?: number
457
+ }
458
+ /**
459
+ * One face of the 3D plot cube: `c:floor`, `c:backWall` or `c:sideWall`
460
+ * (all `CT_Surface`).
461
+ *
462
+ * `CT_Surface` also allows `c:pictureOptions`; picture-filled walls are out of
463
+ * scope and are neither parsed nor rendered.
464
+ */
465
+ export interface ChartSurface {
466
+ /** `c:thickness` as a percentage. */
467
+ thickness?: number
468
+ fill?: string | GradientFill['value']
469
+ outline?: ChartOutline
470
+ }
471
+ /** The three `CT_Surface` faces of a 3D chart, as authored on `c:chart`. */
472
+ export interface ChartWalls {
473
+ floor?: ChartSurface
474
+ backWall?: ChartSurface
475
+ sideWall?: ChartSurface
476
+ }
477
+ export interface ChartDataTable {
478
+ showHorizontalBorder?: boolean
479
+ showVerticalBorder?: boolean
480
+ showOutline?: boolean
481
+ showKeys?: boolean
482
+ outline?: ChartOutline
483
+ textStyle?: ChartTextStyle
484
+ }
485
+ export interface ChartTrendlineLabel {
486
+ layout?: ChartLayout
487
+ numberFormat?: string
488
+ textStyle?: ChartTextStyle
489
+ }
490
+ export interface ChartTrendline {
491
+ name?: string
492
+ trendlineType: string
493
+ order?: number
494
+ period?: number
495
+ forward?: number
496
+ backward?: number
497
+ intercept?: number
498
+ displayEquation?: boolean
499
+ displayRSquared?: boolean
500
+ outline?: ChartOutline
501
+ label?: ChartTrendlineLabel
502
+ }
503
+ export interface ChartErrorBars {
504
+ direction?: string
505
+ barType: string
506
+ valueType: string
507
+ noEndCap?: boolean
508
+ value?: number
509
+ plusValues?: number[]
510
+ minusValues?: number[]
511
+ outline?: ChartOutline
512
+ }
513
+ export interface ChartSeriesDecorations {
514
+ trendlines: ChartTrendline[]
515
+ errorBars: ChartErrorBars[]
516
+ }
517
+ export interface ChartStockUpDownBars {
518
+ gapWidth?: number
519
+ upBars?: ChartSeriesStyle
520
+ downBars?: ChartSeriesStyle
521
+ }
522
+ export interface ChartTextStyle {
523
+ fontSize?: number
524
+ color?: string
525
+ bold?: boolean
526
+ fontFamily?: string
527
+ rotation?: number
528
+ textTransform?: 'uppercase' | 'lowercase'
529
+ }
530
+ export interface ChartGridLines {
531
+ visible: boolean
532
+ outline?: ChartOutline
533
+ }
534
+ export interface ChartDisplayUnitsLabel {
535
+ text?: string
536
+ textStyle?: ChartTextStyle
537
+ }
538
+ export interface ChartDisplayUnits {
539
+ builtInUnit?: string
540
+ customUnit?: number
541
+ label?: ChartDisplayUnitsLabel
542
+ }
543
+ export interface ChartDateAxis {
544
+ baseTimeUnit?: 'days' | 'months' | 'years'
545
+ majorTimeUnit?: 'days' | 'months' | 'years'
546
+ minorTimeUnit?: 'days' | 'months' | 'years'
547
+ }
548
+ export interface ChartAxis {
549
+ visible: boolean
550
+ position?: 'l' | 'r' | 't' | 'b'
551
+ orientation?: 'minMax' | 'maxMin'
552
+ tickLabelPosition?: string
553
+ /**
554
+ * `c:majorTickMark` / `c:minorTickMark`, verbatim (`cross` | `in` | `out` |
555
+ * `none`). Absent means the element was not written; renderers apply the
556
+ * schema default, which is `cross`.
557
+ */
558
+ majorTickMark?: string
559
+ minorTickMark?: string
560
+ numberFormat?: string
561
+ axisLine?: ChartOutline
562
+ title?: ChartTitle
563
+ majorGridLines?: ChartGridLines
564
+ minorGridLines?: ChartGridLines
565
+ textStyle?: ChartTextStyle
566
+ minorUnit?: number
567
+ displayUnits?: ChartDisplayUnits
568
+ }
569
+ export interface ChartCategoryAxis extends ChartAxis {
570
+ labels?: string[]
571
+ min?: number
572
+ max?: number
573
+ majorUnit?: number
574
+ dateAxis?: ChartDateAxis
575
+ crossBetween?: string
576
+ gapWidthRatio?: number
577
+ }
578
+ export interface ChartValueAxis extends ChartAxis {
579
+ min?: number
580
+ max?: number
581
+ majorUnit?: number
582
+ minorUnit?: number
583
+ crossBetween?: string
584
+ majorGridLines?: ChartGridLines
585
+ minorGridLines?: ChartGridLines
586
+ displayUnits?: ChartDisplayUnits
587
+ }
588
+ export interface ChartAxes {
589
+ category?: ChartCategoryAxis
590
+ value?: ChartValueAxis
591
+ /**
592
+ * The depth axis of a 3D chart (`c:serAx`). `CT_SerAx` is a proper subset of
593
+ * `CT_CatAx`, so it reuses the shared axis shape; its labels are the series
594
+ * names.
595
+ */
596
+ series?: ChartAxis
597
+ }
598
+ export interface ChartLegendItem {
599
+ label: string
600
+ color?: string
601
+ index?: number
602
+ }
603
+ export interface ChartLegend {
604
+ visible: boolean
605
+ position?: 'l' | 'r' | 't' | 'b'
606
+ overlay?: boolean
607
+ layout?: ChartLayout
608
+ items?: ChartLegendItem[]
609
+ textStyle?: ChartTextStyle
610
+ }
611
+ export interface ChartTitle {
612
+ text: string
613
+ overlay?: boolean
614
+ textStyle?: ChartTextStyle
615
+ }
616
+ export interface ChartDataLabels {
617
+ text?: string
618
+ layout?: ChartLayout
619
+ position?: string
620
+ showValue?: boolean
621
+ showCategoryName?: boolean
622
+ showSeriesName?: boolean
623
+ showPercent?: boolean
624
+ showLegendKey?: boolean
625
+ showBubbleSize?: boolean
626
+ showLeaderLines?: boolean
627
+ leaderLineOutline?: ChartOutline
628
+ separator?: string
629
+ /** ChartEx-only zero-based indexes whose data labels are hidden. */
630
+ hiddenPoints?: number[]
631
+ textStyle?: ChartTextStyle
632
+ }
633
+ export interface ChartLayout {
634
+ x?: number
635
+ y?: number
636
+ w?: number
637
+ h?: number
638
+ }
639
+ export interface ChartExPoint {
640
+ label: string
641
+ value: number
642
+ subtotal?: boolean
643
+ }
644
+ export interface ChartExHierarchyNode {
645
+ path: string[]
646
+ value: number
647
+ }
648
+ export interface ChartExBoxWhiskerSeries {
649
+ name: string
650
+ categories: string[]
651
+ values: number[]
652
+ visibility?: Record<string, string>
653
+ quartileMethod?: string
654
+ }
655
+ export type ChartExData =
656
+ | { type: 'waterfall'; points: ChartExPoint[]; connectorLines?: ChartOutline }
657
+ | { type: 'funnel'; points: ChartExPoint[]; autoContrastInsideLabels?: boolean }
658
+ | { type: 'sunburst' | 'treemap'; hierarchy: ChartExHierarchyNode[]; parentLabelLayout?: string }
659
+ | { type: 'histogram'; values: number[]; binning?: { intervalClosed?: string } }
660
+ | { type: 'boxWhisker'; series: ChartExBoxWhiskerSeries[] }
661
+ export type ScatterChartData = [number[], number[]] | ChartItem[]
662
+ export type BubbleChartData = ChartItem[]
663
+ export interface CommonChart {
664
+ type: 'chart'
665
+ left: number
666
+ top: number
667
+ width: number
668
+ height: number
669
+ fill?: string
670
+ backgroundImage?: { src: string; opacity?: number }
671
+ data: ChartItem[]
672
+ colors: Array<string | null | undefined>
673
+ themeColors?: string[]
674
+ outline?: ChartOutline
675
+ roundedCorners?: boolean
676
+ layout?: ChartLayout
677
+ axes?: ChartAxes
678
+ title?: ChartTitle
679
+ legend?: ChartLegend
680
+ dataLabels?: ChartDataLabels
681
+ seriesStyles?: ChartSeriesStyle[]
682
+ /** Per-series, per-data-point styles for cartesian bar/column charts. */
683
+ seriesPointStyles?: ChartSeriesStyle[][]
684
+ pointStyles?: ChartSeriesStyle[]
685
+ dataTable?: ChartDataTable
686
+ seriesDecorations?: ChartSeriesDecorations[]
687
+ stockUpDownBars?: ChartStockUpDownBars
688
+ chartEx?: ChartExData
689
+ chartType: Exclude<ChartType, 'scatter' | 'bubble'>
690
+ rawChartType: Exclude<OoxmlChartType, 'scatterChart' | 'bubbleChart'>
691
+ barDir?: 'bar' | 'col'
692
+ marker?: boolean
693
+ holeSize?: number
694
+ pieExplosion?: number
695
+ firstSliceAngle?: number
696
+ grouping?: string
697
+ gapWidth?: number
698
+ overlap?: number
699
+ /**
700
+ * The legacy 3D scene. Present only when the chart declares `<c:view3D>`;
701
+ * renderers key off this rather than the chart kind, because `c:view3D` is
702
+ * schema-legal on 2D charts too.
703
+ */
704
+ view3D?: ChartView3D
705
+ /** Chart-group level `c:shape` of a 3D bar chart. */
706
+ barShape?: ChartBarShape
707
+ /** `c:gapDepth` — spacing between series along the depth axis, as a percentage. */
708
+ gapDepth?: number
709
+ /**
710
+ * `c:wireframe` of a surface chart group: draw the mesh as lines instead of
711
+ * filled value bands. Absent on every other chart group.
712
+ */
713
+ wireframe?: boolean
714
+ /** Sparse surface value-band styles from `c:bandFmts`; indexes are not re-numbered. */
715
+ bandFormats?: ChartBandFormat[]
716
+ /** `c:floor` / `c:backWall` / `c:sideWall` styling. */
717
+ walls?: ChartWalls
718
+ style?: string
719
+ order: number
720
+ }
721
+ export interface ScatterChart {
722
+ type: 'chart'
723
+ left: number
724
+ top: number
725
+ width: number
726
+ height: number
727
+ fill?: string
728
+ backgroundImage?: { src: string; opacity?: number }
729
+ data: ScatterChartData
730
+ colors: Array<string | null | undefined>
731
+ themeColors?: string[]
732
+ outline?: ChartOutline
733
+ roundedCorners?: boolean
734
+ layout?: ChartLayout
735
+ axes?: ChartAxes
736
+ title?: ChartTitle
737
+ legend?: ChartLegend
738
+ dataLabels?: ChartDataLabels
739
+ seriesStyles?: ChartSeriesStyle[]
740
+ dataTable?: ChartDataTable
741
+ seriesDecorations?: ChartSeriesDecorations[]
742
+ style?: string
743
+ chartType: 'scatter'
744
+ rawChartType: 'scatterChart'
745
+ order: number
746
+ }
747
+ export interface BubbleChart {
748
+ type: 'chart'
749
+ left: number
750
+ top: number
751
+ width: number
752
+ height: number
753
+ fill?: string
754
+ backgroundImage?: { src: string; opacity?: number }
755
+ data: BubbleChartData
756
+ colors: Array<string | null | undefined>
757
+ themeColors?: string[]
758
+ outline?: ChartOutline
759
+ roundedCorners?: boolean
760
+ layout?: ChartLayout
761
+ axes?: ChartAxes
762
+ title?: ChartTitle
763
+ legend?: ChartLegend
764
+ dataLabels?: ChartDataLabels
765
+ seriesStyles?: ChartSeriesStyle[]
766
+ dataTable?: ChartDataTable
767
+ seriesDecorations?: ChartSeriesDecorations[]
768
+ bubbleScale?: number
769
+ chartType: 'bubble'
770
+ rawChartType: 'bubbleChart'
771
+ order: number
772
+ }
773
+ export type Chart = CommonChart | ScatterChart | BubbleChart
774
+
775
+ export interface SlideVideo {
776
+ type: 'video'
777
+ left: number
778
+ top: number
779
+ width: number
780
+ height: number
781
+ rotate: number
782
+ blob?: string
783
+ src?: string
784
+ poster?: string
785
+ ext?: string
786
+ order: number
787
+ }
788
+
789
+ export interface SlideAudio {
790
+ type: 'audio'
791
+ left: number
792
+ top: number
793
+ width: number
794
+ height: number
795
+ rotate: number
796
+ blob?: string
797
+ ext?: string
798
+ order: number
799
+ }
800
+
801
+ export interface Diagram {
802
+ type: 'diagram'
803
+ left: number
804
+ top: number
805
+ width: number
806
+ height: number
807
+ rotate?: number
808
+ isFlipV?: boolean
809
+ isFlipH?: boolean
810
+ name?: string
811
+ elements: (Shape | SlideText)[]
812
+ textList: TextParagraph[][]
813
+ points?: SmartArtPoint[]
814
+ connections?: SmartArtConnection[]
815
+ layoutType?: string
816
+ order: number
817
+ }
818
+
819
+ export interface SmartArtPoint {
820
+ modelId?: string
821
+ type?: string
822
+ cxnId?: string
823
+ text?: TextParagraph[]
824
+ }
825
+
826
+ export interface SmartArtConnection {
827
+ modelId?: string
828
+ /** Normalized to `parOf` when the OOXML connection omits its defaulted type. */
829
+ type: string
830
+ srcId?: string
831
+ destId?: string
832
+ srcOrd?: number
833
+ destOrd?: number
834
+ parTransId?: string
835
+ sibTransId?: string
836
+ presId?: string
837
+ }
838
+
839
+ export interface SlideMath {
840
+ type: 'math'
841
+ left: number
842
+ top: number
843
+ width: number
844
+ height: number
845
+ /** Inherited shape geometry retains its local transform and identity. */
846
+ rotate?: number
847
+ isFlipH?: boolean
848
+ isFlipV?: boolean
849
+ name?: string
850
+ shapeId?: string
851
+ phType?: string
852
+ isPlaceholder?: boolean
853
+ latex: string
854
+ picBase64: string
855
+ order: number
856
+ text?: TextParagraph[]
857
+ }
858
+
859
+ export type BaseElement = (
860
+ | Shape
861
+ | SlideText
862
+ | SlideImage
863
+ | Table
864
+ | Chart
865
+ | SlideVideo
866
+ | SlideAudio
867
+ | Diagram
868
+ | SlideMath
869
+ ) &
870
+ LayeredElementMeta
871
+
872
+ export interface Group extends LayeredElementMeta {
873
+ type: 'group'
874
+ left: number
875
+ top: number
876
+ width: number
877
+ height: number
878
+ rotate?: number
879
+ elements: BaseElement[]
880
+ order: number
881
+ isFlipH?: boolean
882
+ isFlipV?: boolean
883
+ }
884
+ export type SlideElement = BaseElement | Group
885
+
886
+ export interface ParsedAnimationRaw {
887
+ tag: string
888
+ attrs?: Record<string, string>
889
+ }
890
+
891
+ export interface ParsedSlideTiming {
892
+ root: ParsedTimingNode | null
893
+ buildList?: ParsedBuildListItem[]
894
+ unsupported: ParsedAnimationUnsupported[]
895
+ degraded?: ParsedAnimationDegraded[]
896
+ }
897
+
898
+ export interface ParsedBuildListItem {
899
+ targetShapeId: string
900
+ kind: 'paragraph' | 'diagram' | 'chart' | 'ole' | 'unknown'
901
+ buildMode?: 'all-at-once' | 'by-paragraph' | 'by-level' | 'by-series' | 'by-category'
902
+ level?: number
903
+ raw?: ParsedAnimationRaw
904
+ }
905
+
906
+ export interface ParsedAnimationUnsupported {
907
+ stepId?: string
908
+ targetShapeId?: string
909
+ code?: string
910
+ reason: string
911
+ raw?: ParsedAnimationRaw
912
+ }
913
+
914
+ export interface ParsedAnimationDegraded {
915
+ stepId?: string
916
+ targetShapeId?: string
917
+ code?: string
918
+ fromGranularity: 'word' | 'character' | 'unknown'
919
+ toGranularity: 'run' | 'paragraph' | 'shape'
920
+ reason: string
921
+ raw?: ParsedAnimationRaw
922
+ }
923
+
924
+ export interface ParsedTextTarget {
925
+ paragraphIndex?: number
926
+ runIndex?: number
927
+ granularity: 'paragraph' | 'run' | 'word' | 'character' | 'unknown'
928
+ }
929
+
930
+ export interface ParsedTimingEasing {
931
+ type: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'unknown'
932
+ accelerate?: number
933
+ decelerate?: number
934
+ }
935
+
936
+ export type ParsedTimingNodeType =
937
+ | 'root'
938
+ | 'parallel'
939
+ | 'sequence'
940
+ | 'effect'
941
+ | 'motion'
942
+ | 'scale'
943
+ | 'rotate'
944
+ | 'set'
945
+ | 'property'
946
+ | 'command'
947
+ | 'unknown'
948
+
949
+ export interface ParsedTimingNode {
950
+ id?: string
951
+ type: ParsedTimingNodeType
952
+ presetClass?: string
953
+ presetId?: string
954
+ presetSubtype?: string
955
+ nodeType?: string
956
+ targetShapeId?: string
957
+ targetTextRange?: ParsedTextTarget
958
+ trigger: ParsedTrigger
959
+ durationMs?: number
960
+ delayMs?: number
961
+ repeatCount?: number | 'indefinite'
962
+ repeatDurationMs?: number
963
+ autoReverse?: boolean
964
+ restart?: 'always' | 'when-not-active' | 'never' | 'unknown'
965
+ fill?: 'hold' | 'remove' | 'transition' | 'freeze' | 'unknown'
966
+ easing?: ParsedTimingEasing
967
+ effect?: ParsedEffectPayload
968
+ children?: ParsedTimingNode[]
969
+ raw?: ParsedAnimationRaw
970
+ }
971
+
972
+ export type ParsedTriggerKind =
973
+ | 'on-click'
974
+ | 'with-previous'
975
+ | 'after-previous'
976
+ | 'auto'
977
+ | 'interactive'
978
+ | 'unknown'
979
+
980
+ export interface ParsedTrigger {
981
+ kind: ParsedTriggerKind
982
+ delayMs?: number
983
+ event?: string
984
+ sourceShapeId?: string
985
+ }
986
+
987
+ export interface ParsedEffectPayload {
988
+ kind:
989
+ | 'appear'
990
+ | 'fade'
991
+ | 'fly'
992
+ | 'wipe'
993
+ | 'split'
994
+ | 'zoom'
995
+ | 'grow-shrink'
996
+ | 'spin'
997
+ | 'motion-path'
998
+ | 'color'
999
+ | 'opacity'
1000
+ | 'visibility'
1001
+ | 'unknown'
1002
+ direction?: 'left' | 'right' | 'up' | 'down' | 'in' | 'out' | 'horizontal' | 'vertical'
1003
+ transition?: 'in' | 'out' | 'none'
1004
+ filter?: string
1005
+ by?: {
1006
+ x?: number
1007
+ y?: number
1008
+ rotation?: number
1009
+ rotationDeg?: number
1010
+ scaleX?: number
1011
+ scaleY?: number
1012
+ opacity?: number
1013
+ }
1014
+ from?: Record<string, number | string>
1015
+ to?: Record<string, number | string>
1016
+ path?: string
1017
+ origin?: string
1018
+ pathEditMode?: string
1019
+ autoRotate?: boolean
1020
+ }
1021
+
1022
+ export interface SlideTransition {
1023
+ type: string
1024
+ duration: number
1025
+ direction: string | null
1026
+ autoNextAfter?: number
1027
+ }
1028
+
1029
+ export interface SlideComment {
1030
+ x: number
1031
+ y: number
1032
+ left: number
1033
+ top: number
1034
+ text: string
1035
+ authorId?: string
1036
+ dt?: string
1037
+ idx?: string
1038
+ }
1039
+
1040
+ export interface Slide {
1041
+ fill: Fill
1042
+ elements: SlideElement[]
1043
+ layoutElements: SlideElement[]
1044
+ note: string
1045
+ comments?: SlideComment[]
1046
+ transition?: SlideTransition | null
1047
+ animations?: ParsedSlideTiming
1048
+ }
1049
+
1050
+ export interface ParseOptions {
1051
+ /** Cancel this request without terminating work owned by other callers. */
1052
+ signal?: AbortSignal
1053
+ /** Whether to extract embedded font binary data. Defaults to false. */
1054
+ extractFonts?: boolean
1055
+ /** Which parser engine to use. Defaults to 'js'. */
1056
+ parser?: 'js' | 'wasm'
1057
+ /** Which unzip engine to use (only applies when parser is 'wasm'). Defaults to 'wasm'. */
1058
+ unzipMode?: 'js' | 'wasm'
1059
+ /** Override the package-relative parser WASM URL. */
1060
+ wasmUrl?: string | URL
1061
+ /** Collect per-phase parser timing in the returned result. Defaults to false. */
1062
+ timing?: boolean
1063
+ }
1064
+
1065
+ export interface EmbeddedFontStyle {
1066
+ path: string
1067
+ data: ArrayBuffer
1068
+ }
1069
+
1070
+ export interface EmbeddedFont {
1071
+ typeface: string
1072
+ styles: {
1073
+ regular?: EmbeddedFontStyle
1074
+ bold?: EmbeddedFontStyle
1075
+ italic?: EmbeddedFontStyle
1076
+ boldItalic?: EmbeddedFontStyle
1077
+ }
1078
+ }
1079
+
1080
+ export interface ParseTiming {
1081
+ unzip: number
1082
+ xmlParse: number
1083
+ ooxml: number
1084
+ total: number
1085
+ }
1086
+
1087
+ export interface ParseResult {
1088
+ slides: Slide[]
1089
+ themeColors: string[]
1090
+ hlinkColor: string | null
1091
+ fonts: EmbeddedFont[]
1092
+ size: {
1093
+ width: number
1094
+ height: number
1095
+ }
1096
+ _timing?: ParseTiming
1097
+ }
1098
+
1099
+ export interface ResourceViolationDetails {
1100
+ reason: string
1101
+ stage: string
1102
+ subject: string
1103
+ limit: number
1104
+ observed: number
1105
+ unit: string
1106
+ policyVersion: string
1107
+ commercialUpgradeApplicable: false
1108
+ }
1109
+
1110
+ export class ResourcePolicyError extends Error {
1111
+ readonly details: ResourceViolationDetails
1112
+ constructor(details: ResourceViolationDetails)
1113
+ }
1114
+
1115
+ export const RESOURCE_POLICY_CONTRACT: {
1116
+ readonly schemaVersion: 'xdoc-resource-policy-registry/v1'
1117
+ readonly policyVersion: string
1118
+ readonly profiles: readonly object[]
1119
+ readonly stableReasons: readonly string[]
1120
+ readonly configurationBoundary: string
1121
+ readonly hostEnforcementResponsibilities: readonly [
1122
+ 'process-memory',
1123
+ 'cpu-quota',
1124
+ 'process-count',
1125
+ ]
1126
+ readonly precedence: readonly string[]
1127
+ }
1128
+
1129
+ export interface PptxToPdfOptions {
1130
+ /** Cancel only this request; a shared Worker remains available to other callers. */
1131
+ signal?: AbortSignal
1132
+ wasmBytes?: ArrayBuffer | Uint8Array
1133
+ wasmUrl?: string | URL
1134
+ /** Browser PDF Worker URL; ESM builds resolve it automatically. */
1135
+ workerUrl?: string | URL
1136
+ watermarks?: Array<{
1137
+ kind: 'demo' | 'dynamic'
1138
+ text: string
1139
+ opacity: number
1140
+ color: string
1141
+ fontSize: number
1142
+ rotate: number
1143
+ }>
1144
+ license?: unknown
1145
+ licenseRuntime?: {
1146
+ now?: number
1147
+ origin?: string
1148
+ hostname?: string
1149
+ deploymentId?: string
1150
+ sdkVersion?: string
1151
+ inputBytes?: number
1152
+ restrictionPolicySnapshot?: string
1153
+ }
1154
+ regularFonts?: Array<{
1155
+ typeface: string
1156
+ style?: 'regular' | 'bold' | 'italic' | 'boldItalic'
1157
+ path?: string
1158
+ data: ArrayBuffer | Uint8Array
1159
+ }>
1160
+ unicodeFallbackFont?: {
1161
+ path?: string
1162
+ url?: string | URL
1163
+ data?: ArrayBuffer | Uint8Array
1164
+ }
1165
+ /**
1166
+ * TrueType or WOFF2 emoji font used by browser PDF export for emoji-only
1167
+ * icon/text runs. Native conversion resolves this automatically from system
1168
+ * fonts; browser callers can provide a cached Apple/Segoe/Noto emoji font.
1169
+ */
1170
+ emojiFallbackFont?: {
1171
+ path?: string
1172
+ url?: string | URL
1173
+ data?: ArrayBuffer | Uint8Array
1174
+ }
1175
+ /**
1176
+ * Browser-only fallback that rasterizes the PPTX's used emoji glyphs through
1177
+ * the current canvas/system emoji font stack and passes only those PNG images
1178
+ * to the PDF converter. Enabled by default when a DOM canvas is available.
1179
+ */
1180
+ emojiBitmapFallback?:
1181
+ | boolean
1182
+ | {
1183
+ fontFamily?: string
1184
+ pixelSize?: number
1185
+ }
1186
+ /**
1187
+ * TrueType or WOFF2 font that the math typesetter (`moon-tex`) consults when a
1188
+ * math character lies outside the bundled KaTeX outline data. Typically a
1189
+ * CJK-capable font (PingFang / Microsoft YaHei / Noto Sans CJK). When
1190
+ * omitted, `unicodeFallbackFont` is reused (the same font usually covers
1191
+ * both PDF body text and math content). Set `family` to the human-
1192
+ * readable family name; it is used only as a key inside the renderer.
1193
+ */
1194
+ mathFallbackFont?: {
1195
+ family?: string
1196
+ data?: ArrayBuffer | Uint8Array
1197
+ url?: string | URL
1198
+ }
1199
+ /**
1200
+ * Use Office local fallback metrics for missing non-embedded fonts instead of
1201
+ * resolving browser/cache copies of referenced fonts.
1202
+ */
1203
+ officeFontFallbacks?: boolean
1204
+ }
1205
+
1206
+ export const parsePptx: (file: ArrayBuffer, options?: ParseOptions) => Promise<ParseResult>
1207
+
1208
+ export function revokeBlobUrls(data: object): void
1209
+ /** Move owned Blob URL cleanup from a parser result to an adapted model; no byte copy. */
1210
+ export function transferBlobUrls(source: object, target: object): void
1211
+ export function pptxToPdf(file: ArrayBuffer, options?: PptxToPdfOptions): Promise<Uint8Array>
1212
+ export function pptxToPdfBlob(file: ArrayBuffer, options?: PptxToPdfOptions): Promise<Blob>