pptx-craft 0.1.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,1795 @@
1
+ /** Measurement in inches. */
2
+ type Inches = number;
3
+ /** Measurement in English Metric Units (914400 EMUs per inch). */
4
+ type Emu = number;
5
+ /** Position and size of an element on a slide, in inches. */
6
+ interface Placement {
7
+ /** Horizontal offset from the left edge of the slide. */
8
+ x: Inches;
9
+ /** Vertical offset from the top edge of the slide. */
10
+ y: Inches;
11
+ /** Width of the element. */
12
+ w: Inches;
13
+ /** Height of the element. */
14
+ h: Inches;
15
+ /** Clockwise rotation in degrees (0–360). */
16
+ rotation?: number;
17
+ }
18
+ /** Color transform modifiers applied as children of any color element. */
19
+ interface ColorTransform {
20
+ tint?: number;
21
+ shade?: number;
22
+ lumMod?: number;
23
+ lumOff?: number;
24
+ alpha?: number;
25
+ alphaOff?: number;
26
+ satMod?: number;
27
+ satOff?: number;
28
+ hueMod?: number;
29
+ hueOff?: number;
30
+ }
31
+ /** Theme color role names (ST_SchemeColorVal). */
32
+ type SchemeColorVal = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'phClr' | 'bg1' | 'bg2' | 'tx1' | 'tx2';
33
+ /** Theme color reference (a:schemeClr). */
34
+ interface SchemeColor {
35
+ scheme: SchemeColorVal;
36
+ transforms?: ColorTransform;
37
+ }
38
+ /** System color reference (a:sysClr). */
39
+ interface SystemColor {
40
+ sys: string;
41
+ lastClr?: string;
42
+ transforms?: ColorTransform;
43
+ }
44
+ /** Preset named color (a:prstClr). */
45
+ interface PresetColor {
46
+ preset: string;
47
+ transforms?: ColorTransform;
48
+ }
49
+ /** HSL color (a:hslClr). */
50
+ interface HslColor {
51
+ hue: number;
52
+ sat: number;
53
+ lum: number;
54
+ transforms?: ColorTransform;
55
+ }
56
+ /** sRGB color with optional transforms. */
57
+ interface SrgbColor {
58
+ hex: string;
59
+ transforms?: ColorTransform;
60
+ }
61
+ /** Color specification: bare hex string, or a structured color object. */
62
+ type Color = string | SrgbColor | SchemeColor | SystemColor | PresetColor | HslColor;
63
+ /** A single color stop in a gradient fill. */
64
+ interface GradientStop {
65
+ /** Position along the gradient path (0–100). */
66
+ position: number;
67
+ /** Color value (hex string or structured color). */
68
+ color: Color;
69
+ /** Opacity percentage (0–100; defaults to 100). */
70
+ alpha?: number;
71
+ }
72
+ /** Direction mode for a gradient fill. */
73
+ type GradientDirection = 'linear' | 'radial' | 'path';
74
+ /** A gradient fill with one or more color stops. */
75
+ interface GradientFill {
76
+ /** Gradient direction mode. */
77
+ type: GradientDirection;
78
+ /** Ordered color stops defining the gradient. */
79
+ stops: GradientStop[];
80
+ /** Angle in degrees for linear gradients. */
81
+ angle?: number;
82
+ }
83
+ /** DrawingML preset pattern type identifiers (ST_PresetPatternVal). */
84
+ type PatternType = 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40' | 'pct50' | 'pct60' | 'pct70' | 'pct75' | 'pct80' | 'pct90' | 'horz' | 'vert' | 'ltHorz' | 'ltVert' | 'dkHorz' | 'dkVert' | 'narHorz' | 'narVert' | 'dashHorz' | 'dashVert' | 'cross' | 'dnDiag' | 'upDiag' | 'ltDnDiag' | 'ltUpDiag' | 'dkDnDiag' | 'dkUpDiag' | 'wdDnDiag' | 'wdUpDiag' | 'dashDnDiag' | 'dashUpDiag' | 'diagCross' | 'smCheck' | 'lgCheck' | 'smGrid' | 'lgGrid' | 'dotGrid' | 'smConfetti' | 'lgConfetti' | 'horzBrick' | 'diagBrick' | 'solidDmnd' | 'openDmnd' | 'dotDmnd' | 'plaid' | 'sphere' | 'weave' | 'divot' | 'shingle' | 'wave' | 'trellis' | 'zigZag';
85
+ /** A patterned fill using a foreground/background color pair. */
86
+ interface PatternFill {
87
+ /** DrawingML preset pattern identifier. */
88
+ pattern: PatternType;
89
+ /** Foreground color. */
90
+ foreground: Color;
91
+ /** Background color. */
92
+ background: Color;
93
+ }
94
+ /** A picture (image) used as a fill. */
95
+ interface PictureFill {
96
+ /** File system path to the image. */
97
+ path?: string;
98
+ /** Raw image bytes (mutually exclusive with `path`). */
99
+ data?: Uint8Array;
100
+ /** MIME type of the image (e.g. `'image/png'`). */
101
+ contentType?: string;
102
+ /** Whether to stretch the image to fill the area (defaults to `true`). */
103
+ stretch?: boolean;
104
+ /** Tile parameters for repeating the image. */
105
+ tile?: {
106
+ sx: number;
107
+ sy: number;
108
+ tx: number;
109
+ ty: number;
110
+ };
111
+ }
112
+ /** Fill definition: a hex color string for solid fill, or an object for gradient/pattern/picture. */
113
+ type Fill = string | GradientFill | PatternFill | PictureFill;
114
+ /** Line dash style (ST_PresetLineDashVal). */
115
+ type LineDash = 'solid' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot' | 'sysDot' | 'dot';
116
+ /** Line end cap style (ST_LineCap). */
117
+ type LineCap = 'flat' | 'round' | 'square';
118
+ /** Line join style at corners. */
119
+ type LineJoin = 'round' | 'bevel' | 'miter';
120
+ /** Arrowhead / line-end shape type. */
121
+ type LineEndType = 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
122
+ /** Arrowhead size category. */
123
+ type LineEndSize = 'sm' | 'med' | 'lg';
124
+ /** Properties for arrowheads or other line-end decorations. */
125
+ interface LineEndProperties {
126
+ /** Shape of the line end. */
127
+ type?: LineEndType;
128
+ /** Width category of the line end. */
129
+ width?: LineEndSize;
130
+ /** Length category of the line end. */
131
+ length?: LineEndSize;
132
+ }
133
+ /** Stroke/outline formatting for lines and borders. */
134
+ interface LineProperties {
135
+ /** Stroke color. */
136
+ color?: Color;
137
+ /** Stroke width in points. */
138
+ width?: number;
139
+ /** Dash pattern. */
140
+ dash?: LineDash;
141
+ /** End cap style. */
142
+ cap?: LineCap;
143
+ /** Corner join style. */
144
+ join?: LineJoin;
145
+ /** Arrowhead at the start of the line. */
146
+ headEnd?: LineEndProperties;
147
+ /** Arrowhead at the end of the line. */
148
+ tailEnd?: LineEndProperties;
149
+ /** Fill for the line stroke (e.g. gradient line). */
150
+ fill?: Fill;
151
+ /** Stroke opacity (0–100). */
152
+ opacity?: number;
153
+ /** Compound line type. */
154
+ compound?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
155
+ /** Pen alignment. */
156
+ alignment?: 'ctr' | 'in';
157
+ /** Custom dash pattern (pairs of dash length and space length in EMUs). */
158
+ customDash?: Array<{
159
+ d: number;
160
+ sp: number;
161
+ }>;
162
+ }
163
+ /** Drop shadow or inner shadow effect. */
164
+ interface ShadowEffect {
165
+ /** Shadow direction relative to the element. */
166
+ type?: 'outer' | 'inner';
167
+ /** Shadow color. */
168
+ color?: Color;
169
+ /** Shadow opacity (0–100). */
170
+ alpha?: number;
171
+ /** Blur radius in points. */
172
+ blur?: number;
173
+ /** Distance from the element in points. */
174
+ offset?: number;
175
+ /** Shadow direction angle in degrees. */
176
+ angle?: number;
177
+ }
178
+ /** Outer glow effect surrounding an element. */
179
+ interface GlowEffect {
180
+ /** Glow color. */
181
+ color?: Color;
182
+ /** Glow opacity (0–100). */
183
+ alpha?: number;
184
+ /** Glow radius in points. */
185
+ radius?: number;
186
+ }
187
+ /** Reflection effect beneath an element. */
188
+ interface ReflectionEffect {
189
+ /** Blur radius of the reflection in points. */
190
+ blur?: number;
191
+ /** Starting opacity of the reflection (0–100). */
192
+ startAlpha?: number;
193
+ /** Ending opacity of the reflection (0–100). */
194
+ endAlpha?: number;
195
+ /** Distance of the reflection from the element in points. */
196
+ distance?: number;
197
+ /** Direction angle in degrees. */
198
+ direction?: number;
199
+ /** Fade direction angle in degrees. */
200
+ fadeDirection?: number;
201
+ }
202
+ /** Soft edge (feathered edge) effect. */
203
+ interface SoftEdgeEffect {
204
+ /** Feather radius in points. */
205
+ radius?: number;
206
+ }
207
+ /** Combined visual effects applicable to an element. */
208
+ interface EffectProperties {
209
+ /** Drop shadow or inner shadow. */
210
+ shadow?: ShadowEffect;
211
+ /** Outer glow effect. */
212
+ glow?: GlowEffect;
213
+ /** Reflection effect. */
214
+ reflection?: ReflectionEffect;
215
+ /** Soft/feathered edge effect. */
216
+ softEdge?: SoftEdgeEffect;
217
+ }
218
+ /** Bevel preset shape. */
219
+ type BevelPreset = 'relaxedInset' | 'circle' | 'slope' | 'cross' | 'angle' | 'softRound' | 'convex' | 'coolSlant' | 'divot' | 'riblet' | 'hardEdge' | 'artDeco';
220
+ /** Bevel (3D edge) properties. */
221
+ interface BevelProperties {
222
+ width?: number;
223
+ height?: number;
224
+ preset?: BevelPreset;
225
+ }
226
+ /** Preset material for 3D rendering. */
227
+ type PresetMaterial = 'matte' | 'warmMatte' | 'plastic' | 'metal' | 'dkEdge' | 'softEdge' | 'flat' | 'softmetal' | 'clear' | 'powder' | 'translucentPowder' | 'legacyMatte' | 'legacyPlastic' | 'legacyMetal' | 'legacyWireframe';
228
+ /** Camera preset for 3D scene. */
229
+ type CameraPreset = 'orthographicFront' | 'isometricTopUp' | 'isometricTopDown' | 'isometricBottomUp' | 'isometricBottomDown' | 'isometricLeftUp' | 'isometricLeftDown' | 'isometricRightUp' | 'isometricRightDown' | 'isometricOffAxis1Left' | 'isometricOffAxis1Right' | 'isometricOffAxis1Top' | 'isometricOffAxis2Left' | 'isometricOffAxis2Right' | 'isometricOffAxis2Top' | 'obliqueTopLeft' | 'obliqueTop' | 'obliqueTopRight' | 'obliqueLeft' | 'obliqueRight' | 'obliqueBottomLeft' | 'obliqueBottom' | 'obliqueBottomRight' | 'perspectiveFront' | 'perspectiveLeft' | 'perspectiveRight' | 'perspectiveAbove' | 'perspectiveBelow' | 'perspectiveAboveLeftFacing' | 'perspectiveAboveRightFacing' | 'perspectiveContrastingLeftFacing' | 'perspectiveContrastingRightFacing' | 'perspectiveHeroicLeftFacing' | 'perspectiveHeroicRightFacing' | 'perspectiveHeroicExtremeLeftFacing' | 'perspectiveHeroicExtremeRightFacing' | 'perspectiveRelaxed' | 'perspectiveRelaxedModerately';
230
+ /** Light rig type for 3D scene. */
231
+ type LightRigType = 'flood' | 'contrasting' | 'morning' | 'sunrise' | 'sunset' | 'chilly' | 'freezing' | 'flat' | 'twoPt' | 'glow' | 'brightRoom' | 'soft' | 'harsh' | 'balanced' | 'legacyFlat1' | 'legacyFlat2' | 'legacyFlat3' | 'legacyFlat4' | 'legacyNormal1' | 'legacyNormal2' | 'legacyNormal3' | 'legacyNormal4' | 'legacyHarsh1' | 'legacyHarsh2' | 'legacyHarsh3' | 'legacyHarsh4' | 'threePt';
232
+ /** Light rig direction. */
233
+ type LightRigDirection = 't' | 'tl' | 'tr' | 'b' | 'bl' | 'br' | 'l' | 'r';
234
+ /** 3D scene properties (camera + lighting). */
235
+ interface Scene3DProperties {
236
+ camera?: {
237
+ preset?: CameraPreset;
238
+ fov?: number;
239
+ };
240
+ lightRig?: {
241
+ type?: LightRigType;
242
+ direction?: LightRigDirection;
243
+ };
244
+ }
245
+ /** 3D shape properties (extrusion, bevels, material). */
246
+ interface Shape3DProperties {
247
+ bevelTop?: BevelProperties;
248
+ bevelBottom?: BevelProperties;
249
+ extrusionHeight?: number;
250
+ contourWidth?: number;
251
+ extrusionColor?: Color;
252
+ contourColor?: Color;
253
+ material?: PresetMaterial;
254
+ }
255
+ /** 2-D transform properties (rotation and flip). */
256
+ interface TransformProperties {
257
+ /** Clockwise rotation in degrees (0–360). */
258
+ rotation?: number;
259
+ /** Mirror horizontally. */
260
+ flipH?: boolean;
261
+ /** Mirror vertically. */
262
+ flipV?: boolean;
263
+ }
264
+ /** Hyperlink target (external URL or internal slide jump). */
265
+ interface HyperlinkProperties {
266
+ /** External URL target. */
267
+ url?: string;
268
+ /** Internal slide number to jump to (1-based). */
269
+ slide?: number;
270
+ /** Hover tooltip text. */
271
+ tooltip?: string;
272
+ /** Email address (generates mailto: link). */
273
+ email?: string;
274
+ /** Local file path link. */
275
+ file?: string;
276
+ /** Action string (e.g. 'ppaction://hlinkshowjump?jump=nextslide'). */
277
+ action?: string;
278
+ }
279
+ /** Theme color scheme mapping the 12 standard DrawingML color roles. */
280
+ interface ColorScheme {
281
+ /** Dark 1 color (typically used for text on light backgrounds). */
282
+ dk1: string;
283
+ /** Light 1 color (typically used for backgrounds). */
284
+ lt1: string;
285
+ /** Dark 2 color. */
286
+ dk2: string;
287
+ /** Light 2 color. */
288
+ lt2: string;
289
+ /** Accent color 1. */
290
+ accent1: string;
291
+ /** Accent color 2. */
292
+ accent2: string;
293
+ /** Accent color 3. */
294
+ accent3: string;
295
+ /** Accent color 4. */
296
+ accent4: string;
297
+ /** Accent color 5. */
298
+ accent5: string;
299
+ /** Accent color 6. */
300
+ accent6: string;
301
+ /** Hyperlink color. */
302
+ hlink: string;
303
+ /** Followed hyperlink color. */
304
+ folHlink: string;
305
+ }
306
+ /** Theme font scheme defining major (heading) and minor (body) typefaces. */
307
+ interface FontScheme {
308
+ /** Typeface for headings. */
309
+ majorFont: string;
310
+ /** Typeface for body text. */
311
+ minorFont: string;
312
+ /** East Asian typeface for headings. */
313
+ majorEastAsian?: string;
314
+ /** Complex script typeface for headings. */
315
+ majorComplexScript?: string;
316
+ /** East Asian typeface for body text. */
317
+ minorEastAsian?: string;
318
+ /** Complex script typeface for body text. */
319
+ minorComplexScript?: string;
320
+ }
321
+ /** Presentation theme defining colors, fonts, and a display name. */
322
+ interface Theme {
323
+ /** Theme display name. */
324
+ name: string;
325
+ /** Color scheme with the 12 standard roles. */
326
+ colors: ColorScheme;
327
+ /** Font scheme for headings and body text. */
328
+ fonts: FontScheme;
329
+ /** Additional color schemes (rendered as `a:extraClrSchemeLst`). */
330
+ extraColorSchemes?: ColorScheme[];
331
+ }
332
+ /** String discriminator identifying an element's kind (e.g. `'text'`, `'shape'`). */
333
+ type ElementType = string;
334
+ /** Base interface implemented by all slide elements. */
335
+ interface IElement {
336
+ /** Element type discriminator. */
337
+ readonly type: ElementType;
338
+ /** Position and size on the slide. */
339
+ placement: Placement;
340
+ /** Optional descriptive name (used in OOXML `nvSpPr`). */
341
+ name?: string;
342
+ }
343
+ /** Context passed to element serializers during OOXML generation. */
344
+ interface SerializationContext {
345
+ /** Registers a relationship and returns its `rId`. */
346
+ addRelationship(type: string, target: string, data?: Uint8Array): string;
347
+ /** The active presentation theme. */
348
+ theme: Theme;
349
+ /** Zero-based index of the slide being serialized. */
350
+ slideIndex: number;
351
+ }
352
+ /** Serializer that converts an element instance to OOXML markup. */
353
+ interface IElementSerializer<E extends IElement = IElement> {
354
+ /** Element type this serializer handles. */
355
+ type: ElementType;
356
+ /** Produces OOXML XML string for the given element. */
357
+ serialize(element: E, ctx: SerializationContext): string;
358
+ }
359
+ /** Plugin that extends serialization capabilities by registering new element types. */
360
+ interface IPlugin {
361
+ /** Unique plugin name. */
362
+ name: string;
363
+ /** Called once to install serializers into the registry. */
364
+ install(registry: IRegistry): void;
365
+ }
366
+ /** Registry for looking up element serializers by type. */
367
+ interface IRegistry {
368
+ /** Registers a serializer for the given element type. */
369
+ registerElement<E extends IElement>(type: ElementType, serializer: IElementSerializer<E>): void;
370
+ /** Returns the serializer for the given element type, or `undefined`. */
371
+ getSerializer(type: ElementType): IElementSerializer | undefined;
372
+ }
373
+ /** Bullet point configuration for paragraph lists. */
374
+ interface BulletOptions {
375
+ /** Bullet kind: `'char'` for a custom character, `'auto'` for automatic. */
376
+ type?: 'char' | 'auto';
377
+ /** Custom bullet character (e.g. `'•'`, `'–'`). */
378
+ char?: string;
379
+ /** Bullet color. */
380
+ color?: Color;
381
+ /** Bullet size as a percentage of the text size. */
382
+ size?: number;
383
+ /** Bullet font face name. */
384
+ font?: string;
385
+ }
386
+ /** Numbered list configuration for paragraph lists. */
387
+ interface NumberingOptions {
388
+ /** Numbering scheme (e.g. `'arabicPeriod'`, `'romanUcPeriod'`). */
389
+ type?: 'arabicPeriod' | 'arabicParenR' | 'romanUcPeriod' | 'romanLcPeriod' | 'alphaUcPeriod' | 'alphaLcPeriod' | 'arabicPlain';
390
+ /** Starting number (defaults to 1). */
391
+ startAt?: number;
392
+ /** Number color. */
393
+ color?: Color;
394
+ /** Number size as a percentage of the text size. */
395
+ size?: number;
396
+ /** Number font face name. */
397
+ font?: string;
398
+ }
399
+ /** A custom tab stop position within a paragraph. */
400
+ interface TabStop {
401
+ /** Tab position in points from the left margin. */
402
+ position: number;
403
+ /** Tab alignment: left, center, right, or decimal. */
404
+ alignment?: 'l' | 'ctr' | 'r' | 'dec';
405
+ }
406
+ /** Character-level formatting options for a text run (a:rPr). */
407
+ interface TextRunOptions {
408
+ /** Bold weight. */
409
+ bold?: boolean;
410
+ /** Italic style. */
411
+ italic?: boolean;
412
+ /** Single underline. */
413
+ underline?: boolean;
414
+ /** Strikethrough style. */
415
+ strikethrough?: boolean | 'single' | 'double';
416
+ /** Font size in points. */
417
+ fontSize?: number;
418
+ /** Font face name (e.g. `'Arial'`). */
419
+ fontFace?: string;
420
+ /** Text color. */
421
+ color?: Color;
422
+ /** Render as subscript. */
423
+ subscript?: boolean;
424
+ /** Render as superscript. */
425
+ superscript?: boolean;
426
+ /** Highlight/background color behind the text. */
427
+ highlight?: Color;
428
+ /** Tracked letter spacing in points. */
429
+ letterSpacing?: number;
430
+ /** Baseline offset percentage for super/subscript positioning. */
431
+ baseline?: number;
432
+ /** Clickable hyperlink attached to this run. */
433
+ hyperlink?: HyperlinkProperties;
434
+ /** Text outline/stroke formatting. */
435
+ outline?: LineProperties;
436
+ /** Text shadow effect. */
437
+ shadow?: ShadowEffect;
438
+ /** Capitalization mode. */
439
+ caps?: 'none' | 'small' | 'all';
440
+ /** Language code (e.g. `'en-US'`). */
441
+ lang?: string;
442
+ /** East Asian font face (a:ea typeface). */
443
+ eastAsianFont?: string;
444
+ /** Complex script font face (a:cs typeface). */
445
+ complexScriptFont?: string;
446
+ /** Alternate language tag (e.g. `'ja-JP'`). */
447
+ altLang?: string;
448
+ }
449
+ /** Paragraph-level formatting options (a:pPr). */
450
+ interface ParagraphOptions {
451
+ /** Horizontal text alignment. */
452
+ align?: 'left' | 'center' | 'right' | 'justify';
453
+ /** Line spacing — number = points, or `{ value, unit }` for explicit unit. */
454
+ lineSpacing?: number | {
455
+ value: number;
456
+ unit: 'pt' | 'pct';
457
+ };
458
+ /** Space before — number = points, or `{ value, unit }` for explicit unit. */
459
+ spaceBefore?: number | {
460
+ value: number;
461
+ unit: 'pt' | 'pct';
462
+ };
463
+ /** Space after — number = points, or `{ value, unit }` for explicit unit. */
464
+ spaceAfter?: number | {
465
+ value: number;
466
+ unit: 'pt' | 'pct';
467
+ };
468
+ /** First-line indent in points (negative = hanging indent). */
469
+ indent?: number;
470
+ /** Left margin/indent in points. */
471
+ marginLeft?: number;
472
+ /** Outline/indent level (0–8). */
473
+ level?: number;
474
+ /** Right-to-left text direction. */
475
+ rtl?: boolean;
476
+ /** Bullet configuration, or `true` for a default bullet. */
477
+ bullet?: BulletOptions | boolean;
478
+ /** Numbered list configuration. */
479
+ numbering?: NumberingOptions;
480
+ /** Custom tab stop positions. */
481
+ tabStops?: TabStop[];
482
+ /** Default run-level formatting applied to all runs in this paragraph (a:defRPr). */
483
+ defaultRunOptions?: TextRunOptions;
484
+ }
485
+ /** Text body formatting options (a:bodyPr). */
486
+ interface TextBodyOptions {
487
+ /** Vertical text anchor within the text box. */
488
+ verticalAlign?: 'top' | 'middle' | 'bottom';
489
+ /** Text flow direction. */
490
+ textDirection?: 'horz' | 'vert' | 'vert270' | 'wordArtVert';
491
+ /** Whether text wraps at the text box boundary. */
492
+ wordWrap?: boolean;
493
+ /** Auto-fit behavior for overflowing text. */
494
+ autoFit?: boolean | 'shrink' | 'none';
495
+ /** Internal text box margins/insets in points. */
496
+ margin?: {
497
+ top?: number;
498
+ right?: number;
499
+ bottom?: number;
500
+ left?: number;
501
+ };
502
+ /** Number of text columns. */
503
+ columns?: number;
504
+ /** Spacing between text columns in points. */
505
+ columnSpacing?: number;
506
+ /** WordArt text-path transform preset. */
507
+ textPath?: {
508
+ preset: string;
509
+ };
510
+ }
511
+ /** Combined options for adding a text element (placement + run + paragraph + body + shape styling). */
512
+ interface TextOptions extends Partial<Placement>, TextRunOptions, ParagraphOptions, TextBodyOptions {
513
+ /** Text box background fill. */
514
+ fill?: Fill;
515
+ /** Text box border/outline. */
516
+ line?: LineProperties;
517
+ /** Visual effects on the text box shape. */
518
+ effects?: EffectProperties;
519
+ /** Rotation and flip for the text box. */
520
+ transform?: TransformProperties;
521
+ /** 3D scene (camera + lighting). */
522
+ scene3d?: Scene3DProperties;
523
+ /** 3D shape (extrusion, bevels, material). */
524
+ shape3d?: Shape3DProperties;
525
+ }
526
+ /** Options for adding an image element to a slide. */
527
+ interface ImageOptions extends Partial<Placement> {
528
+ /** File system path to the image. */
529
+ path?: string;
530
+ /** Raw image bytes (mutually exclusive with `path`). */
531
+ data?: Uint8Array;
532
+ /** MIME type of the image (e.g. `'image/png'`). */
533
+ contentType?: string;
534
+ /** Image border/outline. */
535
+ border?: LineProperties;
536
+ /** Visual effects (shadow, glow, etc.). */
537
+ effects?: EffectProperties;
538
+ /** Rotation and flip. */
539
+ transform?: TransformProperties;
540
+ /** 3D scene (camera + lighting). */
541
+ scene3d?: Scene3DProperties;
542
+ /** 3D shape (extrusion, bevels, material). */
543
+ shape3d?: Shape3DProperties;
544
+ /** Image opacity (0–100). */
545
+ opacity?: number;
546
+ /** Cropping percentages (0–100) from each edge. */
547
+ crop?: {
548
+ top?: number;
549
+ bottom?: number;
550
+ left?: number;
551
+ right?: number;
552
+ };
553
+ /** Clickable hyperlink on the image. */
554
+ hyperlink?: HyperlinkProperties;
555
+ /** How the image fills its bounding box. */
556
+ sizing?: {
557
+ type: 'contain' | 'cover' | 'crop';
558
+ align?: 'tl' | 'tc' | 'tr' | 'ml' | 'mc' | 'mr' | 'bl' | 'bc' | 'br';
559
+ };
560
+ /** Lock the aspect ratio when resizing (defaults to `true`). */
561
+ lockAspectRatio?: boolean;
562
+ /** Brightness adjustment (-100 to 100). */
563
+ brightness?: number;
564
+ /** Contrast adjustment (-100 to 100). */
565
+ contrast?: number;
566
+ /** Color saturation (0 to 200, 100 = normal). */
567
+ saturation?: number;
568
+ /** Duotone recolor using two colors. */
569
+ duotone?: {
570
+ color1: Color;
571
+ color2: Color;
572
+ };
573
+ /** Crop to a preset geometry shape instead of rectangle. */
574
+ cropShape?: PresetGeometry;
575
+ }
576
+ /** DrawingML preset geometry type (ST_ShapeType). */
577
+ type PresetGeometry = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'diamond' | 'line' | 'arrow' | 'star5' | 'heart' | 'accentBorderCallout1' | 'accentBorderCallout2' | 'accentBorderCallout3' | 'accentCallout1' | 'accentCallout2' | 'accentCallout3' | 'actionButtonBackPrevious' | 'actionButtonBeginning' | 'actionButtonBlank' | 'actionButtonDocument' | 'actionButtonEnd' | 'actionButtonForwardNext' | 'actionButtonHelp' | 'actionButtonHome' | 'actionButtonInformation' | 'actionButtonMovie' | 'actionButtonReturn' | 'actionButtonSound' | 'arc' | 'bentArrow' | 'bentUpArrow' | 'bevel' | 'blockArc' | 'borderCallout1' | 'borderCallout2' | 'borderCallout3' | 'bracePair' | 'bracketPair' | 'callout1' | 'callout2' | 'callout3' | 'can' | 'chartPlus' | 'chartStar' | 'chartX' | 'chevron' | 'chord' | 'circularArrow' | 'cloud' | 'cloudCallout' | 'corner' | 'cornerTabs' | 'cross' | 'cube' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5' | 'curvedDownArrow' | 'curvedLeftArrow' | 'curvedRightArrow' | 'curvedUpArrow' | 'decagon' | 'diagStripe' | 'dodecagon' | 'donut' | 'doubleWave' | 'downArrow' | 'downArrowCallout' | 'ellipseRibbon' | 'ellipseRibbon2' | 'flowChartAlternateProcess' | 'flowChartCollate' | 'flowChartConnector' | 'flowChartDecision' | 'flowChartDelay' | 'flowChartDisplay' | 'flowChartDocument' | 'flowChartExtract' | 'flowChartInputOutput' | 'flowChartInternalStorage' | 'flowChartMagneticDisk' | 'flowChartMagneticDrum' | 'flowChartMagneticTape' | 'flowChartManualInput' | 'flowChartManualOperation' | 'flowChartMerge' | 'flowChartMultidocument' | 'flowChartOfflineStorage' | 'flowChartOffpageConnector' | 'flowChartOnlineStorage' | 'flowChartOr' | 'flowChartPredefinedProcess' | 'flowChartPreparation' | 'flowChartProcess' | 'flowChartPunchedCard' | 'flowChartPunchedTape' | 'flowChartSort' | 'flowChartSummingJunction' | 'flowChartTerminator' | 'foldedCorner' | 'frame' | 'funnel' | 'gear6' | 'gear9' | 'halfFrame' | 'heptagon' | 'hexagon' | 'homePlate' | 'horizontalScroll' | 'irregularSeal1' | 'irregularSeal2' | 'leftArrow' | 'leftArrowCallout' | 'leftBrace' | 'leftBracket' | 'leftCircularArrow' | 'leftRightArrow' | 'leftRightArrowCallout' | 'leftRightCircularArrow' | 'leftRightRibbon' | 'leftRightUpArrow' | 'leftUpArrow' | 'lightningBolt' | 'lineInv' | 'mathDivide' | 'mathEqual' | 'mathMinus' | 'mathMultiply' | 'mathNotEqual' | 'mathPlus' | 'moon' | 'noSmoking' | 'nonIsoscelesTrapezoid' | 'notchedRightArrow' | 'octagon' | 'parallelogram' | 'pentagon' | 'pie' | 'pieWedge' | 'plaque' | 'plaqueTabs' | 'plus' | 'quadArrow' | 'quadArrowCallout' | 'ribbon' | 'ribbon2' | 'rightArrow' | 'rightArrowCallout' | 'rightBrace' | 'rightBracket' | 'round1Rect' | 'round2DiagRect' | 'round2SameRect' | 'rtTriangle' | 'smileyFace' | 'snip1Rect' | 'snip2DiagRect' | 'snip2SameRect' | 'snipRoundRect' | 'squareTabs' | 'star10' | 'star12' | 'star16' | 'star24' | 'star32' | 'star4' | 'star6' | 'star7' | 'star8' | 'straightConnector1' | 'stripedRightArrow' | 'sun' | 'swooshArrow' | 'teardrop' | 'trapezoid' | 'upArrow' | 'upArrowCallout' | 'upDownArrow' | 'upDownArrowCallout' | 'uturnArrow' | 'verticalScroll' | 'wave' | 'wedgeEllipseCallout' | 'wedgeRectCallout' | 'wedgeRoundRectCallout';
578
+ /** Text body options when text is placed inside a shape. */
579
+ interface ShapeTextOptions {
580
+ /** Vertical text anchor within the shape. */
581
+ verticalAlign?: 'top' | 'middle' | 'bottom';
582
+ /** Whether text wraps inside the shape. */
583
+ wordWrap?: boolean;
584
+ /** Internal text margins/insets in points. */
585
+ margin?: {
586
+ top?: number;
587
+ right?: number;
588
+ bottom?: number;
589
+ left?: number;
590
+ };
591
+ /** Auto-fit behavior for overflowing text. */
592
+ autoFit?: boolean | 'shrink' | 'none';
593
+ }
594
+ /** Path command for custom geometry. */
595
+ type PathCommand = {
596
+ type: 'moveTo';
597
+ x: number;
598
+ y: number;
599
+ } | {
600
+ type: 'lineTo';
601
+ x: number;
602
+ y: number;
603
+ } | {
604
+ type: 'arcTo';
605
+ wR: number;
606
+ hR: number;
607
+ stAng: number;
608
+ swAng: number;
609
+ } | {
610
+ type: 'cubicBezTo';
611
+ x1: number;
612
+ y1: number;
613
+ x2: number;
614
+ y2: number;
615
+ x: number;
616
+ y: number;
617
+ } | {
618
+ type: 'close';
619
+ };
620
+ /** A custom geometry path. */
621
+ interface CustomGeometryPath {
622
+ w?: number;
623
+ h?: number;
624
+ commands: PathCommand[];
625
+ }
626
+ /** Custom geometry definition. */
627
+ interface CustomGeometry {
628
+ paths: CustomGeometryPath[];
629
+ }
630
+ /** Shape protection locks. */
631
+ interface ShapeLocks {
632
+ noGroup?: boolean;
633
+ noRotation?: boolean;
634
+ noMove?: boolean;
635
+ noResize?: boolean;
636
+ noSelect?: boolean;
637
+ noTextEdit?: boolean;
638
+ }
639
+ /** Options for adding a preset geometry shape to a slide. */
640
+ interface ShapeOptions extends Partial<Placement> {
641
+ /** Shape background fill. */
642
+ fill?: Fill;
643
+ /** Shape outline/border. */
644
+ line?: LineProperties;
645
+ /** Visual effects (shadow, glow, etc.). */
646
+ effects?: EffectProperties;
647
+ /** Rotation and flip. */
648
+ transform?: TransformProperties;
649
+ /** 3D scene (camera + lighting). */
650
+ scene3d?: Scene3DProperties;
651
+ /** 3D shape (extrusion, bevels, material). */
652
+ shape3d?: Shape3DProperties;
653
+ /** Shape opacity (0–100). */
654
+ opacity?: number;
655
+ /** Plain text to display inside the shape. */
656
+ text?: string;
657
+ /** Text body formatting for the shape's inner text. */
658
+ textOptions?: ShapeTextOptions;
659
+ /** Run-level formatting for the shape's inner text. */
660
+ textRunOptions?: TextRunOptions;
661
+ /** Paragraph-level formatting for the shape's inner text. */
662
+ textParagraphOptions?: ParagraphOptions;
663
+ /** Preset geometry adjustment handle values (a:avLst). */
664
+ adjustValues?: Record<string, number>;
665
+ /** Clickable hyperlink on the shape. */
666
+ hyperlink?: HyperlinkProperties;
667
+ /** Custom geometry paths (overrides preset geometry). */
668
+ customGeometry?: CustomGeometry;
669
+ /** Shape protection locks. */
670
+ locks?: ShapeLocks;
671
+ }
672
+ /** Border definition for a single side of a table cell. */
673
+ interface TableCellBorder {
674
+ /** Border color. */
675
+ color?: Color;
676
+ /** Border width in points. */
677
+ width?: number;
678
+ }
679
+ /** A single cell within a table row. */
680
+ interface TableCell {
681
+ /** Plain text content of the cell. */
682
+ text: string;
683
+ /** Cell formatting options (run-level text styling plus cell-specific properties). */
684
+ options?: TextRunOptions & {
685
+ /** Cell background fill. */
686
+ fill?: Fill;
687
+ /** Number of columns this cell spans. */
688
+ colSpan?: number;
689
+ /** Number of rows this cell spans. */
690
+ rowSpan?: number;
691
+ /** Cell internal padding in points. */
692
+ margin?: {
693
+ top?: number;
694
+ right?: number;
695
+ bottom?: number;
696
+ left?: number;
697
+ };
698
+ /** Vertical text alignment within the cell. */
699
+ verticalAlign?: 'top' | 'middle' | 'bottom' | 'distributed';
700
+ /** Text body formatting for the cell. */
701
+ textBody?: TextBodyOptions;
702
+ /** Left border override. */
703
+ borderLeft?: TableCellBorder;
704
+ /** Right border override. */
705
+ borderRight?: TableCellBorder;
706
+ /** Top border override. */
707
+ borderTop?: TableCellBorder;
708
+ /** Bottom border override. */
709
+ borderBottom?: TableCellBorder;
710
+ /** Horizontal text alignment within the cell. */
711
+ align?: 'left' | 'center' | 'right' | 'justify';
712
+ };
713
+ }
714
+ /** An array of table cells forming one row. */
715
+ type TableRow = TableCell[];
716
+ /** Border configuration for the entire table, with optional per-side overrides. */
717
+ interface TableBorderOptions {
718
+ /** Default border color. */
719
+ color?: Color;
720
+ /** Default border width in points. */
721
+ width?: number;
722
+ /** Left edge border override. */
723
+ left?: TableCellBorder;
724
+ /** Right edge border override. */
725
+ right?: TableCellBorder;
726
+ /** Top edge border override. */
727
+ top?: TableCellBorder;
728
+ /** Bottom edge border override. */
729
+ bottom?: TableCellBorder;
730
+ /** Inside horizontal border override. */
731
+ insideH?: TableCellBorder;
732
+ /** Inside vertical border override. */
733
+ insideV?: TableCellBorder;
734
+ }
735
+ /** Options for adding a table element to a slide. */
736
+ interface TableOptions extends Partial<Placement> {
737
+ /** Column widths in inches. */
738
+ colWidths?: number[];
739
+ /** Row heights in inches. */
740
+ rowHeights?: number[];
741
+ /** Table border configuration. */
742
+ border?: TableBorderOptions;
743
+ /** Table background fill. */
744
+ fill?: Fill;
745
+ /** Enable special formatting for the first (header) row. */
746
+ firstRow?: boolean;
747
+ /** Enable special formatting for the last (total) row. */
748
+ lastRow?: boolean;
749
+ /** Enable special formatting for the first column. */
750
+ firstCol?: boolean;
751
+ /** Enable special formatting for the last column. */
752
+ lastCol?: boolean;
753
+ /** Enable alternating row fill banding. */
754
+ bandRow?: boolean;
755
+ /** Enable alternating column fill banding. */
756
+ bandCol?: boolean;
757
+ /** Pair of colors for alternating row fills when `bandRow` is enabled. */
758
+ bandRowColors?: [Color, Color];
759
+ /** Visual effects on the table shape. */
760
+ effects?: EffectProperties;
761
+ /** Rotation and flip. */
762
+ transform?: TransformProperties;
763
+ /** Built-in table style GUID. */
764
+ tableStyleId?: string;
765
+ }
766
+ /** Supported chart type identifiers, including 3-D variants. */
767
+ type ChartType = 'bar' | 'col' | 'line' | 'pie' | 'area' | 'scatter' | 'doughnut' | 'radar' | 'bubble' | 'stock' | 'surface' | 'bar3D' | 'col3D' | 'line3D' | 'pie3D' | 'area3D';
768
+ /** Data point marker options for line/scatter charts. */
769
+ interface ChartMarkerOptions {
770
+ /** Marker shape. */
771
+ type?: 'circle' | 'square' | 'diamond' | 'triangle' | 'star' | 'x' | 'plus' | 'none';
772
+ /** Marker size (2–72). */
773
+ size?: number;
774
+ /** Marker fill color. */
775
+ fill?: Color;
776
+ /** Marker border. */
777
+ border?: {
778
+ color?: Color;
779
+ width?: number;
780
+ };
781
+ }
782
+ /** A single data series within a chart. */
783
+ /** Trendline configuration for a chart series. */
784
+ interface TrendlineOptions {
785
+ type?: 'linear' | 'exp' | 'log' | 'movingAvg' | 'poly' | 'power';
786
+ order?: number;
787
+ period?: number;
788
+ forward?: number;
789
+ backward?: number;
790
+ intercept?: number;
791
+ displayEquation?: boolean;
792
+ displayRSquared?: boolean;
793
+ color?: Color;
794
+ width?: number;
795
+ dash?: LineDash;
796
+ }
797
+ /** Error bar configuration for a chart series. */
798
+ interface ErrorBarOptions {
799
+ direction?: 'x' | 'y';
800
+ type?: 'both' | 'plus' | 'minus';
801
+ valueType?: 'fixedVal' | 'percentage' | 'stdDev' | 'stdErr' | 'cust';
802
+ value?: number;
803
+ noEndCap?: boolean;
804
+ color?: Color;
805
+ width?: number;
806
+ }
807
+ /** Data label configuration for chart series or chart-level. */
808
+ interface DataLabelOptions {
809
+ position?: 'ctr' | 'inEnd' | 'outEnd' | 'bestFit' | 't' | 'b' | 'l' | 'r';
810
+ showValue?: boolean;
811
+ showCategory?: boolean;
812
+ showSeriesName?: boolean;
813
+ showPercent?: boolean;
814
+ separator?: string;
815
+ numberFormat?: string;
816
+ fontSize?: number;
817
+ fontFace?: string;
818
+ color?: Color;
819
+ }
820
+ interface ChartSeries {
821
+ /** Display name for this series (shown in legend). */
822
+ name: string;
823
+ /** Data point values. */
824
+ values: number[];
825
+ /** Series fill/line color. */
826
+ color?: Color;
827
+ /** Per-data-point colors (e.g. for pie slices). */
828
+ colors?: Color[];
829
+ /** Line width in points (line/scatter charts). */
830
+ lineWidth?: number;
831
+ /** Line dash style (line/scatter charts). */
832
+ lineDash?: LineDash;
833
+ /** Data point marker options (line/scatter charts). */
834
+ marker?: ChartMarkerOptions;
835
+ /** Smooth curve interpolation for line charts. */
836
+ smooth?: boolean;
837
+ /** Series area fill color (area charts). */
838
+ fill?: Color;
839
+ /** Series fill opacity (0–100). */
840
+ opacity?: number;
841
+ /** Trendline for this series. */
842
+ trendline?: TrendlineOptions;
843
+ /** Error bars for this series. */
844
+ errorBars?: ErrorBarOptions;
845
+ /** Per-series data labels. */
846
+ dataLabels?: DataLabelOptions;
847
+ /** Explosion distance for individual pie/doughnut slices. */
848
+ explosion?: number;
849
+ }
850
+ /** Data input for a chart element. */
851
+ interface ChartData {
852
+ /** Category axis labels. */
853
+ categories?: string[];
854
+ /** One or more data series. */
855
+ series: ChartSeries[];
856
+ /** X-axis values for scatter/bubble charts. */
857
+ xValues?: number[];
858
+ /** Bubble size values for bubble charts. */
859
+ bubbleSizes?: number[];
860
+ }
861
+ /** Configuration options for a chart axis. */
862
+ interface AxisOptions {
863
+ /** Axis title text. */
864
+ title?: string;
865
+ /** Axis title font size in points. */
866
+ titleFontSize?: number;
867
+ /** Minimum axis value. */
868
+ min?: number;
869
+ /** Maximum axis value. */
870
+ max?: number;
871
+ /** Interval between major tick marks. */
872
+ majorUnit?: number;
873
+ /** Interval between minor tick marks. */
874
+ minorUnit?: number;
875
+ /** Axis value ordering. */
876
+ orientation?: 'minMax' | 'maxMin';
877
+ /** Axis label font size in points. */
878
+ labelFontSize?: number;
879
+ /** Axis label color. */
880
+ labelColor?: Color;
881
+ /** Axis label rotation in degrees. */
882
+ labelRotation?: number;
883
+ /** Number format string (e.g. `'#,##0'`). */
884
+ format?: string;
885
+ /** Axis position relative to the plot area. */
886
+ position?: 'b' | 't' | 'l' | 'r';
887
+ /** Hide the axis entirely. */
888
+ delete?: boolean;
889
+ /** Show major gridlines (or configure with color/width). */
890
+ majorGridlines?: boolean | {
891
+ color?: Color;
892
+ width?: number;
893
+ };
894
+ /** Show minor gridlines (or configure with color/width). */
895
+ minorGridlines?: boolean | {
896
+ color?: Color;
897
+ width?: number;
898
+ };
899
+ /** Value where the perpendicular axis crosses. */
900
+ crossesAt?: number | 'min' | 'max' | 'auto';
901
+ /** Logarithmic scale base (e.g. 10). */
902
+ logBase?: number;
903
+ }
904
+ /** Options for adding a chart element to a slide. */
905
+ interface ChartOptions extends Partial<Placement> {
906
+ /** Chart title text. */
907
+ title?: string;
908
+ /** Show the chart legend. */
909
+ showLegend?: boolean;
910
+ /** Show data labels on data points. */
911
+ showDataLabels?: boolean;
912
+ /** Show value axis gridlines. */
913
+ showGridLines?: boolean;
914
+ /** Chart title font size in points. */
915
+ titleFontSize?: number;
916
+ /** Chart title color. */
917
+ titleColor?: Color;
918
+ /** Legend position relative to the chart. */
919
+ legendPosition?: 'b' | 't' | 'l' | 'r' | 'tr';
920
+ /** Category axis configuration. */
921
+ catAxis?: AxisOptions;
922
+ /** Primary value axis configuration. */
923
+ valAxis?: AxisOptions;
924
+ /** Secondary value axis configuration. */
925
+ secondaryValAxis?: AxisOptions;
926
+ /** Plot area background styling. */
927
+ plotArea?: {
928
+ fill?: Color;
929
+ border?: LineProperties;
930
+ };
931
+ /** Gap width between bar/column groups (0–500 percent). */
932
+ barGapWidth?: number;
933
+ /** Bar/column overlap (-100 to 100 percent). */
934
+ barOverlap?: number;
935
+ /** Bar/column grouping mode. */
936
+ barGrouping?: 'clustered' | 'stacked' | 'percentStacked';
937
+ /** Pie/doughnut slice explosion distance (0–400 percent). */
938
+ pieExplosion?: number;
939
+ /** Doughnut hole size (10–90 percent). */
940
+ doughnutHoleSize?: number;
941
+ /** Line chart grouping mode. */
942
+ lineGrouping?: 'standard' | 'stacked' | 'percentStacked';
943
+ /** Area chart grouping mode. */
944
+ areaGrouping?: 'standard' | 'stacked' | 'percentStacked';
945
+ /** Scatter chart display style. */
946
+ scatterStyle?: 'lineMarker' | 'line' | 'marker' | 'smooth' | 'smoothMarker';
947
+ /** Radar chart display style. */
948
+ radarStyle?: 'standard' | 'marker' | 'filled';
949
+ /** Chart area border. */
950
+ border?: LineProperties;
951
+ /** Chart area background color. */
952
+ fill?: Color;
953
+ /** Chart-level data label configuration. */
954
+ dataLabels?: DataLabelOptions;
955
+ /** 3-D view / camera settings. */
956
+ view3D?: {
957
+ /** X-axis rotation in degrees. */
958
+ rotX?: number;
959
+ /** Y-axis rotation in degrees. */
960
+ rotY?: number;
961
+ /** Depth of the 3-D area as a percentage. */
962
+ depthPercent?: number;
963
+ /** Use right-angle axes (orthographic). */
964
+ rAngAx?: boolean;
965
+ /** Perspective field-of-view in degrees. */
966
+ perspective?: number;
967
+ };
968
+ }
969
+ /** Playback settings for embedded video or audio media. */
970
+ interface MediaPlaybackOptions {
971
+ /** Start playback at this time offset in milliseconds. */
972
+ start?: number;
973
+ /** End playback at this time offset in milliseconds. */
974
+ end?: number;
975
+ /** Loop playback continuously. */
976
+ loop?: boolean;
977
+ /** Begin playing automatically when the slide is shown. */
978
+ autoPlay?: boolean;
979
+ /** Mute audio. */
980
+ mute?: boolean;
981
+ /** Show playback controls (defaults to `true`). */
982
+ showControls?: boolean;
983
+ /** Rewind to the beginning after playback ends. */
984
+ rewind?: boolean;
985
+ /** Play in fullscreen mode. */
986
+ fullscreen?: boolean;
987
+ }
988
+ /** Poster/thumbnail image displayed before media playback begins. */
989
+ interface MediaPoster {
990
+ /** File system path to the poster image. */
991
+ path?: string;
992
+ /** Raw poster image bytes. */
993
+ data?: Uint8Array;
994
+ /** MIME type of the poster image. */
995
+ contentType?: string;
996
+ }
997
+ /** Options for adding a video or audio media element to a slide. */
998
+ interface MediaOptions extends Partial<Placement> {
999
+ /** File system path to the media file. */
1000
+ path?: string;
1001
+ /** Raw media bytes (mutually exclusive with `path`). */
1002
+ data?: Uint8Array;
1003
+ /** MIME type (defaults to `'video/mp4'` or `'audio/mpeg'`). */
1004
+ contentType?: string;
1005
+ /** Poster/thumbnail image for the media. */
1006
+ poster?: MediaPoster;
1007
+ /** Playback settings (autoplay, loop, timing, etc.). */
1008
+ playback?: MediaPlaybackOptions;
1009
+ /** Visual effects on the media frame. */
1010
+ effects?: EffectProperties;
1011
+ /** Rotation and flip. */
1012
+ transform?: TransformProperties;
1013
+ }
1014
+ /** Slideshow playback behavior properties. */
1015
+ interface SlideShowProperties {
1016
+ /** Loop the slideshow continuously. */
1017
+ loop?: boolean;
1018
+ /** Play embedded narration audio. */
1019
+ showNarration?: boolean;
1020
+ /** Play slide animations. */
1021
+ showAnimation?: boolean;
1022
+ /** Use recorded slide timings for auto-advance. */
1023
+ useTimings?: boolean;
1024
+ }
1025
+ /** Print-related presentation properties. */
1026
+ interface PrintProperties {
1027
+ /** Print a border frame around each slide. */
1028
+ frameSlides?: boolean;
1029
+ /** Include hidden slides when printing. */
1030
+ hiddenSlides?: boolean;
1031
+ }
1032
+ /** Presentation-level properties (slideshow behavior, print options). */
1033
+ interface PresentationProperties {
1034
+ /** Slideshow playback properties. */
1035
+ slideShow?: SlideShowProperties;
1036
+ /** Print properties. */
1037
+ print?: PrintProperties;
1038
+ }
1039
+ /** Identifier for the last-used PowerPoint editing view. */
1040
+ type LastViewType = 'sldView' | 'sldMasterView' | 'notesView' | 'handoutView' | 'sldSorterView';
1041
+ /** View properties controlling which editing view opens by default. */
1042
+ interface ViewProperties {
1043
+ /** The view that was active when the presentation was last saved. */
1044
+ lastView?: LastViewType;
1045
+ }
1046
+ /** A registered comment author for slide comments. */
1047
+ interface CommentAuthor {
1048
+ /** Unique author identifier (0-based). */
1049
+ id: number;
1050
+ /** Display name of the author. */
1051
+ name: string;
1052
+ /** Author initials shown in comment badges. */
1053
+ initials: string;
1054
+ /** Index of the author's most recent comment. */
1055
+ lastIdx: number;
1056
+ /** Color index for the author's comment badge. */
1057
+ clrIdx: number;
1058
+ }
1059
+ /** A comment attached to a slide. */
1060
+ interface SlideComment {
1061
+ /** ID of the comment author (from {@link CommentAuthor.id}). */
1062
+ authorId: number;
1063
+ /** Comment text content. */
1064
+ text: string;
1065
+ /** ISO 8601 date string when the comment was created. */
1066
+ date?: string;
1067
+ /** Position of the comment anchor on the slide (in points). */
1068
+ position?: {
1069
+ x: number;
1070
+ y: number;
1071
+ };
1072
+ /** Sequential comment index within the slide. */
1073
+ index?: number;
1074
+ }
1075
+ /** A user-defined key-value tag. */
1076
+ interface UserDefinedTag {
1077
+ /** Tag name/key. */
1078
+ name: string;
1079
+ /** Tag value. */
1080
+ value: string;
1081
+ }
1082
+ /** Synchronization metadata for collaborative slide updates. */
1083
+ interface SlideSyncData {
1084
+ /** Server-assigned slide identifier. */
1085
+ serverSldId: string;
1086
+ /** ISO 8601 timestamp of the last server-side modification. */
1087
+ serverSldModifiedTime: string;
1088
+ /** ISO 8601 timestamp when the client inserted this slide. */
1089
+ clientInsertedTime: string;
1090
+ }
1091
+ /** Slide transition effect type. */
1092
+ type TransitionType = 'fade' | 'push' | 'wipe' | 'split' | 'cover' | 'uncover' | 'strips' | 'blinds' | 'checker' | 'dissolve' | 'comb' | 'newsflash' | 'randomBars' | 'circle' | 'diamond' | 'plus' | 'wedge' | 'wheel' | 'zoom' | 'cut' | 'random' | 'none';
1093
+ /** Transition effect configuration for advancing to a slide. */
1094
+ interface SlideTransition {
1095
+ /** Transition effect type. */
1096
+ type?: TransitionType;
1097
+ /** Transition duration in milliseconds. */
1098
+ duration?: number;
1099
+ /** Auto-advance to the next slide after this many milliseconds (0 = click only). */
1100
+ advanceAfter?: number;
1101
+ /** Allow advancing on mouse click (defaults to `true`). */
1102
+ advanceOnClick?: boolean;
1103
+ /** Directional variant for the transition effect. */
1104
+ direction?: 'l' | 'r' | 'u' | 'd' | 'lu' | 'ru' | 'ld' | 'rd';
1105
+ /** Raw duration in milliseconds (overrides the spd fast/med/slow mapping). */
1106
+ durationMs?: number;
1107
+ }
1108
+ /** Animation preset effect name. */
1109
+ type AnimationEffect = 'appear' | 'fade' | 'flyIn' | 'split' | 'wipe' | 'blinds' | 'box' | 'checkerboard' | 'circle' | 'diamond' | 'dissolve' | 'peek' | 'plus' | 'randomBars' | 'strips' | 'wedge' | 'wheel' | 'zoom' | 'grow' | 'shrink' | 'spin' | 'transparency' | 'pulse' | 'colorPulse' | 'teeter' | 'bounce' | 'float' | 'swivel';
1110
+ /** What triggers the animation to start. */
1111
+ type AnimationTrigger = 'onClick' | 'withPrevious' | 'afterPrevious';
1112
+ /** Broad animation category. */
1113
+ type AnimationCategory = 'entrance' | 'exit' | 'emphasis' | 'motionPath';
1114
+ /** Animation definition targeting an element on a slide. */
1115
+ interface Animation {
1116
+ /** Zero-based index of the target element in the slide's element array. */
1117
+ elementIndex: number;
1118
+ /** Preset animation effect to apply. */
1119
+ effect: AnimationEffect;
1120
+ /** Animation category (defaults to `'entrance'`). */
1121
+ category?: AnimationCategory;
1122
+ /** What triggers the animation (defaults to `'onClick'`). */
1123
+ trigger?: AnimationTrigger;
1124
+ /** Animation duration in milliseconds (defaults to 500). */
1125
+ duration?: number;
1126
+ /** Delay before the animation starts in milliseconds. */
1127
+ delay?: number;
1128
+ /** Effect-specific directional variant. */
1129
+ direction?: string;
1130
+ /** Number of times to repeat, or `'indefinite'`. */
1131
+ repeatCount?: number | 'indefinite';
1132
+ /** Acceleration percentage (0–100). */
1133
+ acceleration?: number;
1134
+ /** Deceleration percentage (0–100). */
1135
+ deceleration?: number;
1136
+ /** SVG-style motion path string (e.g. 'M 0 0 L 1 0'). */
1137
+ motionPath?: string;
1138
+ }
1139
+ /** Placement options for a group of elements. */
1140
+ interface GroupOptions extends Partial<Placement> {
1141
+ }
1142
+ /** Connector routing style. */
1143
+ type ConnectorType = 'straight' | 'elbow' | 'curved';
1144
+ /** Options for adding a connector line between points on a slide. */
1145
+ interface ConnectorOptions extends Partial<Placement> {
1146
+ /** Connector routing style (defaults to `'straight'`). */
1147
+ type?: ConnectorType;
1148
+ /** Line formatting (color, width, dash, etc.). */
1149
+ line?: LineProperties;
1150
+ /** Arrowhead at the start of the connector. */
1151
+ startArrow?: LineEndProperties;
1152
+ /** Arrowhead at the end of the connector. */
1153
+ endArrow?: LineEndProperties;
1154
+ }
1155
+ /** Background fill configuration for a slide. */
1156
+ interface SlideBackground {
1157
+ /** Full fill definition (solid, gradient, pattern, or picture). */
1158
+ fill?: Fill;
1159
+ /** Shortcut for a solid background color. */
1160
+ color?: Color;
1161
+ }
1162
+
1163
+ interface SlideMasterDef {
1164
+ name: string;
1165
+ background?: Color;
1166
+ elements?: IElement[];
1167
+ }
1168
+ declare class SlideMaster {
1169
+ name: string;
1170
+ background?: Color;
1171
+ elements: IElement[];
1172
+ constructor(def: SlideMasterDef);
1173
+ }
1174
+
1175
+ type PlaceholderType = 'title' | 'body' | 'ctrTitle' | 'subTitle' | 'dt' | 'ftr' | 'sldNum';
1176
+ interface PlaceholderDef {
1177
+ type: PlaceholderType;
1178
+ placement: Placement;
1179
+ idx?: number;
1180
+ }
1181
+ type LayoutType = 'blank' | 'title' | 'titleAndContent' | 'sectionHeader' | 'twoContent';
1182
+ interface SlideLayoutDef {
1183
+ name: string;
1184
+ type?: LayoutType;
1185
+ placeholders?: PlaceholderDef[];
1186
+ }
1187
+ declare class SlideLayout {
1188
+ name: string;
1189
+ type: LayoutType;
1190
+ placeholders: PlaceholderDef[];
1191
+ constructor(def: SlideLayoutDef);
1192
+ }
1193
+ declare const builtinLayouts: Record<string, SlideLayoutDef>;
1194
+
1195
+ interface NotesMasterDef {
1196
+ name?: string;
1197
+ }
1198
+ declare class NotesMaster {
1199
+ name: string;
1200
+ constructor(def?: NotesMasterDef);
1201
+ }
1202
+
1203
+ interface HandoutMasterDef {
1204
+ name?: string;
1205
+ }
1206
+ declare class HandoutMaster {
1207
+ name: string;
1208
+ constructor(def?: HandoutMasterDef);
1209
+ }
1210
+
1211
+ declare class Registry implements IRegistry {
1212
+ private serializers;
1213
+ registerElement<E extends IElement>(type: ElementType, serializer: IElementSerializer<E>): void;
1214
+ getSerializer(type: ElementType): IElementSerializer | undefined;
1215
+ }
1216
+
1217
+ /** Data describing a single slide's content and metadata. */
1218
+ interface SlideData {
1219
+ /** Elements (text, images, shapes, etc.) placed on the slide. */
1220
+ elements: IElement[];
1221
+ /** Plain-text speaker notes for this slide. */
1222
+ notes?: string;
1223
+ /** Index into the layouts array; defaults to 0 (blank). */
1224
+ layoutIndex?: number;
1225
+ /** Comments attached to this slide. */
1226
+ comments?: SlideComment[];
1227
+ /** User-defined key-value tags for this slide. */
1228
+ tags?: UserDefinedTag[];
1229
+ /** Synchronization metadata for collaborative editing. */
1230
+ syncData?: SlideSyncData;
1231
+ /** Transition effect applied when advancing to this slide. */
1232
+ transition?: SlideTransition;
1233
+ /** Animation effects applied to elements on this slide. */
1234
+ animations?: Animation[];
1235
+ /** Background fill or image for this slide. */
1236
+ background?: SlideBackground;
1237
+ }
1238
+
1239
+ /** Builder for adding elements and metadata to a single slide. */
1240
+ declare class SlideBuilder {
1241
+ private data;
1242
+ private commentAuthors?;
1243
+ constructor(data: SlideData, commentAuthors?: CommentAuthor[]);
1244
+ /** Adds a text box to the slide. Placement dimensions are in inches. */
1245
+ addText(text: string, opts?: TextOptions): this;
1246
+ /** Adds an image to the slide from a file path or binary data. */
1247
+ addImage(opts: ImageOptions): this;
1248
+ /** Adds a preset geometry shape to the slide. */
1249
+ addShape(geometry: PresetGeometry, opts?: ShapeOptions): this;
1250
+ /** Adds a table to the slide. */
1251
+ addTable(rows: TableRow[], opts?: TableOptions): this;
1252
+ /** Adds a chart to the slide. Defaults to 6x4 inches if width/height are not specified. */
1253
+ addChart(type: ChartType, data: ChartData, opts?: ChartOptions): this;
1254
+ /** Sets speaker notes text for this slide. */
1255
+ setNotes(notes: string): this;
1256
+ /** Adds a video element to the slide. Defaults to 6x4 inches. */
1257
+ addVideo(opts: MediaOptions): this;
1258
+ /** Adds an audio element to the slide. Defaults to 1x1 inch. */
1259
+ addAudio(opts: MediaOptions): this;
1260
+ /** Adds a pre-built element directly to the slide. */
1261
+ addElement(element: IElement): this;
1262
+ /**
1263
+ * Adds a comment to the slide.
1264
+ * @param authorId - ID returned by {@link Presentation.defineCommentAuthor}.
1265
+ */
1266
+ addComment(text: string, authorId: number, opts?: {
1267
+ position?: {
1268
+ x: number;
1269
+ y: number;
1270
+ };
1271
+ date?: string;
1272
+ }): this;
1273
+ /** Sets user-defined tags on this slide as key-value pairs. */
1274
+ setTags(tags: Record<string, string>): this;
1275
+ /** Sets synchronization data for collaborative slide updates. */
1276
+ setSyncData(data: SlideSyncData): this;
1277
+ /** Sets the transition effect for this slide. */
1278
+ setTransition(transition: SlideTransition): this;
1279
+ /** Adds an animation to the slide's animation sequence. */
1280
+ addAnimation(anim: Animation): this;
1281
+ /** Sets the background fill or image for this slide. */
1282
+ setBackground(bg: SlideBackground): this;
1283
+ /**
1284
+ * Adds a group of elements that are positioned and transformed together.
1285
+ * @param buildFn - Callback receiving a {@link GroupBuilder} to populate the group.
1286
+ */
1287
+ addGroup(buildFn: (group: GroupBuilder) => void, opts?: GroupOptions): this;
1288
+ /** Adds a connector line between points on the slide. */
1289
+ addConnector(opts: ConnectorOptions): this;
1290
+ }
1291
+ /** Builder for adding child elements within a group. */
1292
+ declare class GroupBuilder {
1293
+ private children;
1294
+ constructor(children: IElement[]);
1295
+ /** Adds a shape to the group. */
1296
+ addShape(geometry: PresetGeometry, opts?: ShapeOptions): this;
1297
+ /** Adds a text box to the group. */
1298
+ addText(text: string, opts?: TextOptions): this;
1299
+ /** Adds an image to the group. */
1300
+ addImage(opts: ImageOptions): this;
1301
+ /** Adds a pre-built element directly to the group. */
1302
+ addElement(element: IElement): this;
1303
+ }
1304
+
1305
+ /** Options for creating a new presentation. */
1306
+ interface PresentationOptions {
1307
+ /** Custom theme overrides for colors and fonts. */
1308
+ theme?: Partial<Theme>;
1309
+ /** URI for HTML publish output. */
1310
+ htmlPublishUri?: string;
1311
+ /** URL for slide update synchronization. */
1312
+ slideUpdateUrl?: string;
1313
+ /** Custom slide size (default: standard widescreen 10x7.5). */
1314
+ slideSize?: {
1315
+ width: Inches;
1316
+ height: Inches;
1317
+ type?: string;
1318
+ };
1319
+ /** Default language for text runs (e.g. 'en-US'). */
1320
+ defaultLang?: string;
1321
+ /** Core document properties (Dublin Core metadata). */
1322
+ coreProperties?: {
1323
+ title?: string;
1324
+ creator?: string;
1325
+ subject?: string;
1326
+ description?: string;
1327
+ keywords?: string;
1328
+ category?: string;
1329
+ };
1330
+ }
1331
+ /** Builder for constructing PPTX presentations. */
1332
+ declare class Presentation {
1333
+ private slides;
1334
+ private registry;
1335
+ private theme;
1336
+ private masters;
1337
+ private layouts;
1338
+ private layoutNameMap;
1339
+ private presProps;
1340
+ private viewProps;
1341
+ private notesMaster?;
1342
+ private handoutMaster?;
1343
+ private commentAuthors;
1344
+ private authorNameMap;
1345
+ private presTags;
1346
+ private opts;
1347
+ /** Creates a new presentation with optional configuration. */
1348
+ constructor(opts?: PresentationOptions);
1349
+ /** Registers a plugin to extend serialization capabilities. */
1350
+ use(plugin: IPlugin): this;
1351
+ /** Defines or replaces the default slide master. */
1352
+ defineSlideMaster(def: SlideMasterDef): this;
1353
+ /** Registers a new slide layout that can be referenced by name when adding slides. */
1354
+ defineLayout(def: SlideLayoutDef): this;
1355
+ /** Defines the notes master for speaker notes formatting. */
1356
+ defineNotesMaster(def?: NotesMasterDef): this;
1357
+ /** Defines the handout master for printed handout formatting. */
1358
+ defineHandoutMaster(def?: HandoutMasterDef): this;
1359
+ /** Configures slideshow playback properties (e.g., loop, timing). */
1360
+ setShowProperties(props: SlideShowProperties): this;
1361
+ /** Configures print-related properties. */
1362
+ setPrintProperties(props: PrintProperties): this;
1363
+ /** Sets the default view properties (e.g., normal, slide sorter). */
1364
+ setViewProperties(props: ViewProperties): this;
1365
+ /**
1366
+ * Registers a comment author. Returns the author ID, reusing an existing one if the name matches.
1367
+ * @param name - Display name of the author.
1368
+ * @param initials - Author initials shown in comment badges.
1369
+ */
1370
+ defineCommentAuthor(name: string, initials: string): number;
1371
+ /** Sets user-defined tags on the presentation as key-value pairs. */
1372
+ setTags(tags: Record<string, string>): this;
1373
+ /**
1374
+ * Adds a new slide and returns a builder for populating it.
1375
+ * @param layoutName - Name of a previously defined layout; defaults to "blank".
1376
+ */
1377
+ addSlide(layoutName?: string): SlideBuilder;
1378
+ /** Serializes the presentation to a PPTX file in memory and returns the raw bytes. */
1379
+ toBuffer(): Uint8Array;
1380
+ /** Writes the presentation as a .pptx file to disk (Node.js only). */
1381
+ toFile(path: string): Promise<void>;
1382
+ }
1383
+
1384
+ declare const defaultColorScheme: ColorScheme;
1385
+ declare const defaultFontScheme: FontScheme;
1386
+ declare const defaultTheme: Theme;
1387
+
1388
+ /** Abstract base class for all slide elements. */
1389
+ declare abstract class BaseElement implements IElement {
1390
+ /** Discriminator indicating the concrete element kind. */
1391
+ abstract readonly type: ElementType;
1392
+ /** Position and size of the element on the slide. */
1393
+ placement: Placement;
1394
+ /** Optional human-readable name for the element. */
1395
+ name?: string;
1396
+ constructor(placement: Placement, name?: string);
1397
+ }
1398
+
1399
+ /** A single run of text with optional formatting. */
1400
+ interface TextRun {
1401
+ /** The text content of this run. */
1402
+ text: string;
1403
+ /** Optional formatting applied to this run (font, size, color, etc.). */
1404
+ options?: TextRunOptions;
1405
+ }
1406
+ /** A paragraph composed of one or more text runs. */
1407
+ interface TextParagraph {
1408
+ /** Ordered text runs that make up the paragraph. */
1409
+ runs: TextRun[];
1410
+ /** Optional paragraph-level formatting (alignment, spacing, etc.). */
1411
+ options?: ParagraphOptions;
1412
+ }
1413
+ /** A text box element containing one or more paragraphs. */
1414
+ declare class TextElement extends BaseElement {
1415
+ /** Element type discriminator. */
1416
+ readonly type: "text";
1417
+ /** Paragraphs that make up the text content. */
1418
+ paragraphs: TextParagraph[];
1419
+ /** Options controlling the text body (margins, wrapping, auto-fit, etc.). */
1420
+ bodyOptions?: TextBodyOptions;
1421
+ /** Background fill for the text box. */
1422
+ fill?: Fill;
1423
+ /** Outline/border properties for the text box. */
1424
+ line?: LineProperties;
1425
+ /** Visual effects (shadow, glow, etc.). */
1426
+ effects?: EffectProperties;
1427
+ /** 2-D transform (rotation, flip). */
1428
+ transform?: TransformProperties;
1429
+ /** 3D scene (camera + lighting). */
1430
+ scene3d?: Scene3DProperties;
1431
+ /** 3D shape (extrusion, bevels, material). */
1432
+ shape3d?: Shape3DProperties;
1433
+ constructor(paragraphs: TextParagraph[], placement: Placement, name?: string, opts?: {
1434
+ bodyOptions?: TextBodyOptions;
1435
+ fill?: Fill;
1436
+ line?: LineProperties;
1437
+ effects?: EffectProperties;
1438
+ transform?: TransformProperties;
1439
+ scene3d?: Scene3DProperties;
1440
+ shape3d?: Shape3DProperties;
1441
+ });
1442
+ /**
1443
+ * Creates a TextElement from a plain string, splitting on newlines into paragraphs.
1444
+ * @param text - Plain text content (newlines become paragraph breaks).
1445
+ * @param placement - Position and size on the slide.
1446
+ * @param runOptions - Optional formatting for all text runs.
1447
+ * @param paraOptions - Optional paragraph-level formatting.
1448
+ * @param bodyOptions - Optional text body options.
1449
+ * @returns A new TextElement instance.
1450
+ */
1451
+ static fromString(text: string, placement: Placement, runOptions?: TextRunOptions, paraOptions?: ParagraphOptions, bodyOptions?: TextBodyOptions): TextElement;
1452
+ }
1453
+
1454
+ /** An image element placed on a slide. */
1455
+ declare class ImageElement extends BaseElement {
1456
+ /** Element type discriminator. */
1457
+ readonly type: "image";
1458
+ /** File system path to the image (mutually exclusive with `data`). */
1459
+ path?: string;
1460
+ /** Raw image bytes (mutually exclusive with `path`). */
1461
+ data?: Uint8Array;
1462
+ /** MIME type of the image (defaults to 'image/png'). */
1463
+ contentType: string;
1464
+ /** Border/outline properties for the image. */
1465
+ border?: LineProperties;
1466
+ /** Visual effects (shadow, glow, etc.). */
1467
+ effects?: EffectProperties;
1468
+ /** 2-D transform (rotation, flip). */
1469
+ transform?: TransformProperties;
1470
+ /** Image opacity, 0-100. */
1471
+ opacity?: number;
1472
+ /** Crop offsets as fractions (0-1) from each edge. */
1473
+ crop?: {
1474
+ top?: number;
1475
+ bottom?: number;
1476
+ left?: number;
1477
+ right?: number;
1478
+ };
1479
+ /** Hyperlink attached to the image. */
1480
+ hyperlink?: HyperlinkProperties;
1481
+ /** Whether to lock the aspect ratio when resizing. */
1482
+ lockAspectRatio?: boolean;
1483
+ /** 3D scene (camera + lighting). */
1484
+ scene3d?: Scene3DProperties;
1485
+ /** 3D shape (extrusion, bevels, material). */
1486
+ shape3d?: Shape3DProperties;
1487
+ brightness?: number;
1488
+ contrast?: number;
1489
+ saturation?: number;
1490
+ duotone?: {
1491
+ color1: Color;
1492
+ color2: Color;
1493
+ };
1494
+ cropShape?: PresetGeometry;
1495
+ constructor(placement: Placement, opts: {
1496
+ path?: string;
1497
+ data?: Uint8Array;
1498
+ contentType?: string;
1499
+ border?: LineProperties;
1500
+ effects?: EffectProperties;
1501
+ transform?: TransformProperties;
1502
+ opacity?: number;
1503
+ crop?: {
1504
+ top?: number;
1505
+ bottom?: number;
1506
+ left?: number;
1507
+ right?: number;
1508
+ };
1509
+ hyperlink?: HyperlinkProperties;
1510
+ lockAspectRatio?: boolean;
1511
+ scene3d?: Scene3DProperties;
1512
+ shape3d?: Shape3DProperties;
1513
+ brightness?: number;
1514
+ contrast?: number;
1515
+ saturation?: number;
1516
+ duotone?: {
1517
+ color1: Color;
1518
+ color2: Color;
1519
+ };
1520
+ cropShape?: PresetGeometry;
1521
+ });
1522
+ }
1523
+
1524
+ /** An auto-shape element (rectangle, ellipse, arrow, etc.). */
1525
+ declare class ShapeElement extends BaseElement {
1526
+ /** Element type discriminator. */
1527
+ readonly type: "shape";
1528
+ /** Preset geometry type (e.g. 'rect', 'ellipse', 'roundRect'). */
1529
+ geometry: PresetGeometry;
1530
+ /** Background fill for the shape. */
1531
+ fill?: Fill;
1532
+ /** Outline/border properties. */
1533
+ line?: LineProperties;
1534
+ /** Visual effects (shadow, glow, etc.). */
1535
+ effects?: EffectProperties;
1536
+ /** 2-D transform (rotation, flip). */
1537
+ transform?: TransformProperties;
1538
+ /** Shape opacity, 0-100. */
1539
+ opacity?: number;
1540
+ /** Plain text content rendered inside the shape. */
1541
+ text?: string;
1542
+ /** Text body options for text rendered inside the shape. */
1543
+ textOptions?: ShapeTextOptions;
1544
+ /** Run-level formatting for the shape's text. */
1545
+ textRunOptions?: TextRunOptions;
1546
+ /** Paragraph-level formatting for the shape's text. */
1547
+ textParagraphOptions?: ParagraphOptions;
1548
+ /** Geometry adjustment values keyed by handle name. */
1549
+ adjustValues?: Record<string, number>;
1550
+ /** Hyperlink attached to the shape. */
1551
+ hyperlink?: HyperlinkProperties;
1552
+ /** 3D scene (camera + lighting). */
1553
+ scene3d?: Scene3DProperties;
1554
+ /** 3D shape (extrusion, bevels, material). */
1555
+ shape3d?: Shape3DProperties;
1556
+ /** Custom geometry (overrides preset). */
1557
+ customGeometry?: CustomGeometry;
1558
+ /** Shape protection locks. */
1559
+ locks?: ShapeLocks;
1560
+ constructor(geometry: PresetGeometry, placement: Placement, opts?: {
1561
+ fill?: Fill;
1562
+ line?: LineProperties;
1563
+ effects?: EffectProperties;
1564
+ transform?: TransformProperties;
1565
+ opacity?: number;
1566
+ text?: string;
1567
+ textOptions?: ShapeTextOptions;
1568
+ textRunOptions?: TextRunOptions;
1569
+ textParagraphOptions?: ParagraphOptions;
1570
+ adjustValues?: Record<string, number>;
1571
+ hyperlink?: HyperlinkProperties;
1572
+ scene3d?: Scene3DProperties;
1573
+ shape3d?: Shape3DProperties;
1574
+ customGeometry?: CustomGeometry;
1575
+ locks?: ShapeLocks;
1576
+ });
1577
+ }
1578
+
1579
+ /** A table element with rows, columns, and optional banding. */
1580
+ declare class TableElement extends BaseElement {
1581
+ /** Element type discriminator. */
1582
+ readonly type: "table";
1583
+ /** Row data including cells and per-row options. */
1584
+ rows: TableRow[];
1585
+ /** Column widths in EMUs. */
1586
+ colWidths?: number[];
1587
+ /** Row heights in EMUs. */
1588
+ rowHeights?: number[];
1589
+ /** Border configuration for the table. */
1590
+ border?: TableBorderOptions;
1591
+ /** Default background fill for cells. */
1592
+ fill?: Fill;
1593
+ /** Apply special formatting to the first row. */
1594
+ firstRow?: boolean;
1595
+ /** Apply special formatting to the last row. */
1596
+ lastRow?: boolean;
1597
+ /** Apply special formatting to the first column. */
1598
+ firstCol?: boolean;
1599
+ /** Apply special formatting to the last column. */
1600
+ lastCol?: boolean;
1601
+ /** Enable row banding (alternating row colors). */
1602
+ bandRow?: boolean;
1603
+ /** Enable column banding (alternating column colors). */
1604
+ bandCol?: boolean;
1605
+ /** Pair of colors for alternating row bands. */
1606
+ bandRowColors?: [Color, Color];
1607
+ /** Visual effects (shadow, glow, etc.). */
1608
+ effects?: EffectProperties;
1609
+ /** 2-D transform (rotation, flip). */
1610
+ transform?: TransformProperties;
1611
+ /** Built-in table style GUID. */
1612
+ tableStyleId?: string;
1613
+ constructor(rows: TableRow[], placement: Placement, opts?: {
1614
+ colWidths?: number[];
1615
+ rowHeights?: number[];
1616
+ border?: TableBorderOptions;
1617
+ fill?: Fill;
1618
+ firstRow?: boolean;
1619
+ lastRow?: boolean;
1620
+ firstCol?: boolean;
1621
+ lastCol?: boolean;
1622
+ bandRow?: boolean;
1623
+ bandCol?: boolean;
1624
+ bandRowColors?: [Color, Color];
1625
+ effects?: EffectProperties;
1626
+ transform?: TransformProperties;
1627
+ tableStyleId?: string;
1628
+ });
1629
+ }
1630
+
1631
+ /** A chart element (bar, line, pie, scatter, etc.). */
1632
+ declare class ChartElement extends BaseElement {
1633
+ /** Element type discriminator. */
1634
+ readonly type: "chart";
1635
+ /** The kind of chart to render (e.g. 'bar', 'line', 'pie'). */
1636
+ chartType: ChartType;
1637
+ /** Series and category data for the chart. */
1638
+ data: ChartData;
1639
+ /** Optional chart title text. */
1640
+ title?: string;
1641
+ /** Whether to display the legend (defaults to true). */
1642
+ showLegend: boolean;
1643
+ /** Whether to show data labels on data points (defaults to false). */
1644
+ showDataLabels: boolean;
1645
+ /** Whether to display grid lines (defaults to true). */
1646
+ showGridLines: boolean;
1647
+ /** Font size for the chart title, in points. */
1648
+ titleFontSize?: number;
1649
+ /** Color for the chart title. */
1650
+ titleColor?: Color;
1651
+ /** Position of the legend relative to the chart. */
1652
+ legendPosition?: 'b' | 't' | 'l' | 'r' | 'tr';
1653
+ /** Category (horizontal) axis options. */
1654
+ catAxis?: AxisOptions;
1655
+ /** Primary value (vertical) axis options. */
1656
+ valAxis?: AxisOptions;
1657
+ /** Secondary value axis options (for combo charts). */
1658
+ secondaryValAxis?: AxisOptions;
1659
+ /** Plot area background fill and border. */
1660
+ plotArea?: {
1661
+ fill?: Color;
1662
+ border?: LineProperties;
1663
+ };
1664
+ /** Gap width between bar groups, as a percentage. */
1665
+ barGapWidth?: number;
1666
+ /** Overlap between bars in a group, as a percentage (-100 to 100). */
1667
+ barOverlap?: number;
1668
+ /** Grouping mode for bar/column charts. */
1669
+ barGrouping?: 'clustered' | 'stacked' | 'percentStacked';
1670
+ /** Explosion distance for pie slices, as a percentage. */
1671
+ pieExplosion?: number;
1672
+ /** Hole size for doughnut charts, as a percentage (0-90). */
1673
+ doughnutHoleSize?: number;
1674
+ /** Grouping mode for line charts. */
1675
+ lineGrouping?: 'standard' | 'stacked' | 'percentStacked';
1676
+ /** Grouping mode for area charts. */
1677
+ areaGrouping?: 'standard' | 'stacked' | 'percentStacked';
1678
+ /** Rendering style for scatter charts. */
1679
+ scatterStyle?: 'lineMarker' | 'line' | 'marker' | 'smooth' | 'smoothMarker';
1680
+ /** Rendering style for radar charts. */
1681
+ radarStyle?: 'standard' | 'marker' | 'filled';
1682
+ /** Chart border/outline properties. */
1683
+ border?: LineProperties;
1684
+ /** Chart background fill color. */
1685
+ fill?: Color;
1686
+ /** Chart-level data label configuration. */
1687
+ dataLabels?: DataLabelOptions;
1688
+ /** 3-D view settings for the chart. */
1689
+ view3D?: {
1690
+ rotX?: number;
1691
+ rotY?: number;
1692
+ depthPercent?: number;
1693
+ rAngAx?: boolean;
1694
+ perspective?: number;
1695
+ };
1696
+ constructor(chartType: ChartType, data: ChartData, placement: Placement, opts?: {
1697
+ title?: string;
1698
+ showLegend?: boolean;
1699
+ showDataLabels?: boolean;
1700
+ showGridLines?: boolean;
1701
+ titleFontSize?: number;
1702
+ titleColor?: Color;
1703
+ legendPosition?: 'b' | 't' | 'l' | 'r' | 'tr';
1704
+ catAxis?: AxisOptions;
1705
+ valAxis?: AxisOptions;
1706
+ secondaryValAxis?: AxisOptions;
1707
+ plotArea?: {
1708
+ fill?: Color;
1709
+ border?: LineProperties;
1710
+ };
1711
+ barGapWidth?: number;
1712
+ barOverlap?: number;
1713
+ barGrouping?: 'clustered' | 'stacked' | 'percentStacked';
1714
+ pieExplosion?: number;
1715
+ doughnutHoleSize?: number;
1716
+ lineGrouping?: 'standard' | 'stacked' | 'percentStacked';
1717
+ areaGrouping?: 'standard' | 'stacked' | 'percentStacked';
1718
+ scatterStyle?: 'lineMarker' | 'line' | 'marker' | 'smooth' | 'smoothMarker';
1719
+ radarStyle?: 'standard' | 'marker' | 'filled';
1720
+ border?: LineProperties;
1721
+ fill?: Color;
1722
+ dataLabels?: DataLabelOptions;
1723
+ view3D?: {
1724
+ rotX?: number;
1725
+ rotY?: number;
1726
+ depthPercent?: number;
1727
+ rAngAx?: boolean;
1728
+ perspective?: number;
1729
+ };
1730
+ });
1731
+ }
1732
+
1733
+ /** Discriminator for the kind of embedded media. */
1734
+ type MediaType = 'video' | 'audio';
1735
+ /** An embedded video or audio media element. */
1736
+ declare class MediaElement extends BaseElement {
1737
+ /** Element type discriminator. */
1738
+ readonly type: "media";
1739
+ /** Whether this is a video or audio element. */
1740
+ mediaType: MediaType;
1741
+ /** File system path to the media file (mutually exclusive with `data`). */
1742
+ path?: string;
1743
+ /** Raw media bytes (mutually exclusive with `path`). */
1744
+ data?: Uint8Array;
1745
+ /** MIME type (defaults to 'video/mp4' or 'audio/mpeg' based on mediaType). */
1746
+ contentType: string;
1747
+ /** Poster/thumbnail image displayed before playback. */
1748
+ poster?: MediaPoster;
1749
+ /** Playback settings (autoplay, loop, etc.). */
1750
+ playback?: MediaPlaybackOptions;
1751
+ /** Visual effects (shadow, glow, etc.). */
1752
+ effects?: EffectProperties;
1753
+ /** 2-D transform (rotation, flip). */
1754
+ transform?: TransformProperties;
1755
+ constructor(mediaType: MediaType, placement: Placement, opts: {
1756
+ path?: string;
1757
+ data?: Uint8Array;
1758
+ contentType?: string;
1759
+ poster?: MediaPoster;
1760
+ playback?: MediaPlaybackOptions;
1761
+ effects?: EffectProperties;
1762
+ transform?: TransformProperties;
1763
+ });
1764
+ }
1765
+
1766
+ /** A group element that contains multiple child elements. */
1767
+ declare class GroupElement extends BaseElement {
1768
+ /** Element type discriminator. */
1769
+ readonly type: "group";
1770
+ /** Child elements contained within this group. */
1771
+ children: IElement[];
1772
+ constructor(children: IElement[], placement: Placement, name?: string);
1773
+ }
1774
+
1775
+ /** A connector line element (straight, elbow, or curved). */
1776
+ declare class ConnectorElement extends BaseElement {
1777
+ /** Element type discriminator. */
1778
+ readonly type: "connector";
1779
+ /** The connector routing style (defaults to 'straight'). */
1780
+ connectorType: ConnectorType;
1781
+ /** Line formatting (color, width, dash style, etc.). */
1782
+ line?: LineProperties;
1783
+ /** Arrowhead properties for the start of the connector. */
1784
+ startArrow?: LineEndProperties;
1785
+ /** Arrowhead properties for the end of the connector. */
1786
+ endArrow?: LineEndProperties;
1787
+ constructor(placement: Placement, opts?: {
1788
+ type?: ConnectorType;
1789
+ line?: LineProperties;
1790
+ startArrow?: LineEndProperties;
1791
+ endArrow?: LineEndProperties;
1792
+ });
1793
+ }
1794
+
1795
+ export { type Animation, type AnimationCategory, type AnimationEffect, type AnimationTrigger, type AxisOptions, type BevelPreset, type BevelProperties, type BulletOptions, type CameraPreset, type ChartData, ChartElement, type ChartMarkerOptions, type ChartOptions, type ChartSeries, type ChartType, type Color, type ColorScheme, type ColorTransform, type CommentAuthor, ConnectorElement, type ConnectorOptions, type ConnectorType, type CustomGeometry, type CustomGeometryPath, type DataLabelOptions, type EffectProperties, type ElementType, type Emu, type ErrorBarOptions, type Fill, type FontScheme, type GlowEffect, type GradientDirection, type GradientFill, type GradientStop, GroupElement, type GroupOptions, HandoutMaster, type HandoutMasterDef, type HslColor, type HyperlinkProperties, type IElement, type IElementSerializer, type IPlugin, type IRegistry, ImageElement, type ImageOptions, type Inches, type LastViewType, type LayoutType, type LightRigDirection, type LightRigType, type LineCap, type LineDash, type LineEndProperties, type LineEndSize, type LineEndType, type LineJoin, type LineProperties, MediaElement, type MediaOptions, type MediaPlaybackOptions, type MediaPoster, type MediaType, NotesMaster, type NotesMasterDef, type NumberingOptions, type ParagraphOptions, type PathCommand, type PatternFill, type PatternType, type PictureFill, type PlaceholderDef, type PlaceholderType, type Placement, Presentation, type PresentationOptions, type PresentationProperties, type PresetColor, type PresetGeometry, type PresetMaterial, type PrintProperties, type ReflectionEffect, Registry, type Scene3DProperties, type SchemeColor, type SchemeColorVal, type SerializationContext, type ShadowEffect, type Shape3DProperties, ShapeElement, type ShapeLocks, type ShapeOptions, type ShapeTextOptions, type SlideBackground, SlideBuilder, type SlideComment, SlideLayout, type SlideLayoutDef, SlideMaster, type SlideMasterDef, type SlideShowProperties, type SlideSyncData, type SlideTransition, type SoftEdgeEffect, type SrgbColor, type SystemColor, type TabStop, type TableBorderOptions, type TableCell, type TableCellBorder, TableElement, type TableOptions, type TableRow, type TextBodyOptions, TextElement, type TextOptions, type TextParagraph, type TextRun, type TextRunOptions, type Theme, type TransformProperties, type TransitionType, type TrendlineOptions, type UserDefinedTag, type ViewProperties, builtinLayouts, defaultColorScheme, defaultFontScheme, defaultTheme };