docgen-utils 1.0.5

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.
Files changed (88) hide show
  1. package/README.md +118 -0
  2. package/dist/bundle.js +36086 -0
  3. package/dist/bundle.min.js +197 -0
  4. package/dist/cli.js +47432 -0
  5. package/dist/index.d.ts +9 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +9 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/packages/cli/commands/export-docs.d.ts +5 -0
  10. package/dist/packages/cli/commands/export-docs.d.ts.map +1 -0
  11. package/dist/packages/cli/commands/export-docs.js +24 -0
  12. package/dist/packages/cli/commands/export-docs.js.map +1 -0
  13. package/dist/packages/cli/commands/export-slides.d.ts +5 -0
  14. package/dist/packages/cli/commands/export-slides.d.ts.map +1 -0
  15. package/dist/packages/cli/commands/export-slides.js +86 -0
  16. package/dist/packages/cli/commands/export-slides.js.map +1 -0
  17. package/dist/packages/cli/commands/import-docx.d.ts +5 -0
  18. package/dist/packages/cli/commands/import-docx.d.ts.map +1 -0
  19. package/dist/packages/cli/commands/import-docx.js +27 -0
  20. package/dist/packages/cli/commands/import-docx.js.map +1 -0
  21. package/dist/packages/cli/commands/import-pptx.d.ts +5 -0
  22. package/dist/packages/cli/commands/import-pptx.d.ts.map +1 -0
  23. package/dist/packages/cli/commands/import-pptx.js +44 -0
  24. package/dist/packages/cli/commands/import-pptx.js.map +1 -0
  25. package/dist/packages/cli/index.d.ts +11 -0
  26. package/dist/packages/cli/index.d.ts.map +1 -0
  27. package/dist/packages/cli/index.js +103 -0
  28. package/dist/packages/cli/index.js.map +1 -0
  29. package/dist/packages/docs/common.d.ts +183 -0
  30. package/dist/packages/docs/common.d.ts.map +1 -0
  31. package/dist/packages/docs/common.js +27 -0
  32. package/dist/packages/docs/common.js.map +1 -0
  33. package/dist/packages/docs/convert.d.ts +7 -0
  34. package/dist/packages/docs/convert.d.ts.map +1 -0
  35. package/dist/packages/docs/convert.js +1399 -0
  36. package/dist/packages/docs/convert.js.map +1 -0
  37. package/dist/packages/docs/create-document.d.ts +30 -0
  38. package/dist/packages/docs/create-document.d.ts.map +1 -0
  39. package/dist/packages/docs/create-document.js +170 -0
  40. package/dist/packages/docs/create-document.js.map +1 -0
  41. package/dist/packages/docs/export.d.ts +57 -0
  42. package/dist/packages/docs/export.d.ts.map +1 -0
  43. package/dist/packages/docs/export.js +430 -0
  44. package/dist/packages/docs/export.js.map +1 -0
  45. package/dist/packages/docs/import-docx.d.ts +13 -0
  46. package/dist/packages/docs/import-docx.d.ts.map +1 -0
  47. package/dist/packages/docs/import-docx.js +2299 -0
  48. package/dist/packages/docs/import-docx.js.map +1 -0
  49. package/dist/packages/docs/parse.d.ts +6 -0
  50. package/dist/packages/docs/parse.d.ts.map +1 -0
  51. package/dist/packages/docs/parse.js +4253 -0
  52. package/dist/packages/docs/parse.js.map +1 -0
  53. package/dist/packages/shared/dom-parser-shim.d.ts +30 -0
  54. package/dist/packages/shared/dom-parser-shim.d.ts.map +1 -0
  55. package/dist/packages/shared/dom-parser-shim.js +152 -0
  56. package/dist/packages/shared/dom-parser-shim.js.map +1 -0
  57. package/dist/packages/slides/common.d.ts +325 -0
  58. package/dist/packages/slides/common.d.ts.map +1 -0
  59. package/dist/packages/slides/common.js +12 -0
  60. package/dist/packages/slides/common.js.map +1 -0
  61. package/dist/packages/slides/convert.d.ts +35 -0
  62. package/dist/packages/slides/convert.d.ts.map +1 -0
  63. package/dist/packages/slides/convert.js +308 -0
  64. package/dist/packages/slides/convert.js.map +1 -0
  65. package/dist/packages/slides/createPresentation.d.ts +51 -0
  66. package/dist/packages/slides/createPresentation.d.ts.map +1 -0
  67. package/dist/packages/slides/createPresentation.js +265 -0
  68. package/dist/packages/slides/createPresentation.js.map +1 -0
  69. package/dist/packages/slides/export.d.ts +24 -0
  70. package/dist/packages/slides/export.d.ts.map +1 -0
  71. package/dist/packages/slides/export.js +52 -0
  72. package/dist/packages/slides/export.js.map +1 -0
  73. package/dist/packages/slides/import-pptx.d.ts +13 -0
  74. package/dist/packages/slides/import-pptx.d.ts.map +1 -0
  75. package/dist/packages/slides/import-pptx.js +619 -0
  76. package/dist/packages/slides/import-pptx.js.map +1 -0
  77. package/dist/packages/slides/parse.d.ts +45 -0
  78. package/dist/packages/slides/parse.d.ts.map +1 -0
  79. package/dist/packages/slides/parse.js +1185 -0
  80. package/dist/packages/slides/parse.js.map +1 -0
  81. package/dist/packages/slides/transform.d.ts +37 -0
  82. package/dist/packages/slides/transform.d.ts.map +1 -0
  83. package/dist/packages/slides/transform.js +140 -0
  84. package/dist/packages/slides/transform.js.map +1 -0
  85. package/dist/packages/slides/vendor/VENDORING.md +58 -0
  86. package/dist/packages/slides/vendor/pptxgen.d.ts +805 -0
  87. package/dist/packages/slides/vendor/pptxgen.js +7442 -0
  88. package/package.json +57 -0
@@ -0,0 +1,805 @@
1
+ /**
2
+ * Type declarations for the vendored PptxGenJS 4.0.1 (patched).
3
+ *
4
+ * This file covers the full PptxGenJS API surface used by the slide pipeline,
5
+ * including our custom patches:
6
+ * - Gradient fills (GradientStop, GradientFillProps, ShapeFillProps.type 'gradient')
7
+ * - fontFill on text run properties (gradient text fills)
8
+ * - rectRadius on ImageOptions (rounded image corners)
9
+ * - Default text valign changed to 'top'
10
+ * - 'c' prefix accepted for center valign
11
+ *
12
+ * Upstream source: PptxGenJS 4.0.1
13
+ * Patch: pptxgen_patch.patch
14
+ */
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Core scalar types
18
+ // ---------------------------------------------------------------------------
19
+
20
+ /** Hex color string (6-character, no leading '#'). */
21
+ export type HexColor = string;
22
+
23
+ /** Theme/scheme color token. */
24
+ export type ThemeColor =
25
+ | 'tx1' | 'tx2'
26
+ | 'bg1' | 'bg2'
27
+ | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';
28
+
29
+ /** A color is either a hex string or a theme color token. */
30
+ export type Color = HexColor | ThemeColor;
31
+
32
+ /**
33
+ * Coordinate value - inches (number) or percentage string.
34
+ * @example 10.25 // inches
35
+ * @example '75%' // percentage of slide size
36
+ */
37
+ export type Coord = number | `${number}%`;
38
+
39
+ /** Margin as uniform points or [left, right, bottom, top]. */
40
+ export type Margin = number | [number, number, number, number];
41
+
42
+ export type HAlign = 'left' | 'center' | 'right' | 'justify';
43
+ export type VAlign = 'top' | 'middle' | 'bottom';
44
+
45
+ export type OutputType =
46
+ | 'arraybuffer'
47
+ | 'base64'
48
+ | 'binarystring'
49
+ | 'blob'
50
+ | 'nodebuffer'
51
+ | 'uint8array';
52
+
53
+ // ---------------------------------------------------------------------------
54
+ // Position
55
+ // ---------------------------------------------------------------------------
56
+
57
+ export interface PositionProps {
58
+ /** Horizontal position (inches or percentage). */
59
+ x?: Coord;
60
+ /** Vertical position (inches or percentage). */
61
+ y?: Coord;
62
+ /** Width (inches or percentage). */
63
+ w?: Coord;
64
+ /** Height (inches or percentage). */
65
+ h?: Coord;
66
+ }
67
+
68
+ // ---------------------------------------------------------------------------
69
+ // Gradient fills (CUSTOM PATCH)
70
+ // ---------------------------------------------------------------------------
71
+
72
+ /** Single color stop within a gradient. */
73
+ export interface GradientStop {
74
+ /** Color at this stop (hex or theme color). */
75
+ color: Color;
76
+ /** Position of the stop (0-100). */
77
+ position: number;
78
+ /**
79
+ * Transparency at this stop (0-100).
80
+ * @default 0
81
+ */
82
+ transparency?: number;
83
+ }
84
+
85
+ /** Gradient fill configuration. */
86
+ export interface GradientFillProps {
87
+ /** Gradient type. */
88
+ type: 'linear' | 'radial';
89
+ /**
90
+ * Angle in CSS degrees for linear gradients (0-359).
91
+ * - 0 = bottom-to-top, 90 = left-to-right, 180 = top-to-bottom
92
+ * @default 0
93
+ */
94
+ angle?: number;
95
+ /** Array of color stops (must have >= 2 entries). */
96
+ stops: GradientStop[];
97
+ /**
98
+ * Center X for radial gradients (0-100).
99
+ * @default 50
100
+ */
101
+ centerX?: number;
102
+ /**
103
+ * Center Y for radial gradients (0-100).
104
+ * @default 50
105
+ */
106
+ centerY?: number;
107
+ }
108
+
109
+ // ---------------------------------------------------------------------------
110
+ // Fill / Line / Shadow
111
+ // ---------------------------------------------------------------------------
112
+
113
+ /**
114
+ * Shape fill properties.
115
+ *
116
+ * Simple solid fill:
117
+ * ```ts
118
+ * { color: 'FF0000' }
119
+ * { color: 'FF0000', transparency: 50 }
120
+ * ```
121
+ *
122
+ * Gradient fill (CUSTOM PATCH):
123
+ * ```ts
124
+ * { type: 'gradient', gradient: { type: 'linear', angle: 90, stops: [...] } }
125
+ * ```
126
+ */
127
+ export interface ShapeFillProps {
128
+ /** Fill color (hex or theme). Required for solid fills. */
129
+ color?: Color;
130
+ /**
131
+ * Fill type.
132
+ * @default 'solid'
133
+ */
134
+ type?: 'none' | 'solid' | 'gradient';
135
+ /**
136
+ * Gradient fill properties.
137
+ * Required when `type` is `'gradient'`.
138
+ */
139
+ gradient?: GradientFillProps;
140
+ /**
141
+ * Transparency (percent, 0-100).
142
+ * @default 0
143
+ */
144
+ transparency?: number;
145
+ /**
146
+ * @deprecated v3.3.0 - use `transparency`
147
+ */
148
+ alpha?: number;
149
+ }
150
+
151
+ /** Shape/line outline properties. */
152
+ export interface ShapeLineProps extends ShapeFillProps {
153
+ /**
154
+ * Line width (points).
155
+ * @default 1
156
+ */
157
+ width?: number;
158
+ /** Dash type. */
159
+ dashType?:
160
+ | 'solid'
161
+ | 'dash'
162
+ | 'dashDot'
163
+ | 'lgDash'
164
+ | 'lgDashDot'
165
+ | 'lgDashDotDot'
166
+ | 'sysDash'
167
+ | 'sysDot';
168
+ /** Begin arrow type. */
169
+ beginArrowType?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle';
170
+ /** End arrow type. */
171
+ endArrowType?: 'none' | 'arrow' | 'diamond' | 'oval' | 'stealth' | 'triangle';
172
+ /**
173
+ * Line width (points).
174
+ * @deprecated v3.3.0 - use `width`
175
+ */
176
+ pt?: number;
177
+ /**
178
+ * Line size (points).
179
+ * @deprecated v3.3.0 - use `width`
180
+ */
181
+ size?: number;
182
+ }
183
+
184
+ /** Shadow properties for shapes, text, and images. */
185
+ export interface ShadowProps {
186
+ /**
187
+ * Shadow type.
188
+ * @default 'none'
189
+ */
190
+ type: 'outer' | 'inner' | 'none';
191
+ /**
192
+ * Opacity (0.0 - 1.0).
193
+ * @example 0.5
194
+ */
195
+ opacity?: number;
196
+ /**
197
+ * Blur radius (points, 0-100).
198
+ * @default 0
199
+ */
200
+ blur?: number;
201
+ /**
202
+ * Angle (degrees, 0-359).
203
+ * @default 0
204
+ */
205
+ angle?: number;
206
+ /**
207
+ * Shadow offset (points, 0-200).
208
+ * @default 0
209
+ */
210
+ offset?: number;
211
+ /**
212
+ * Shadow color (hex).
213
+ * @example 'FF3399'
214
+ */
215
+ color?: HexColor;
216
+ /**
217
+ * Whether to rotate the shadow with the shape.
218
+ * @default false
219
+ */
220
+ rotateWithShape?: boolean;
221
+ }
222
+
223
+ /** Border properties used by charts, shapes, and tables. */
224
+ export interface BorderProps {
225
+ /** Border type. */
226
+ type?: 'none' | 'dash' | 'solid';
227
+ /** Border color (hex). */
228
+ color?: HexColor;
229
+ /** Border size (points). */
230
+ pt?: number;
231
+ }
232
+
233
+ /** Hyperlink properties. */
234
+ export interface HyperlinkProps {
235
+ /** Target slide number. */
236
+ slide?: number;
237
+ /** Target URL. */
238
+ url?: string;
239
+ /** Tooltip text. */
240
+ tooltip?: string;
241
+ }
242
+
243
+ // ---------------------------------------------------------------------------
244
+ // Text properties
245
+ // ---------------------------------------------------------------------------
246
+
247
+ /** Underline style options. */
248
+ export interface UnderlineProps {
249
+ style?:
250
+ | 'dash'
251
+ | 'dashHeavy'
252
+ | 'dashLong'
253
+ | 'dashLongHeavy'
254
+ | 'dbl'
255
+ | 'dotDash'
256
+ | 'dotDashHeave'
257
+ | 'dotDotDash'
258
+ | 'dotDotDashHeavy'
259
+ | 'dotted'
260
+ | 'dottedHeavy'
261
+ | 'heavy'
262
+ | 'none'
263
+ | 'sng'
264
+ | 'wavy'
265
+ | 'wavyDbl'
266
+ | 'wavyHeavy';
267
+ color?: Color;
268
+ }
269
+
270
+ /** Text glow effect. */
271
+ export interface TextGlowProps {
272
+ /** Glow size (points). */
273
+ size?: number;
274
+ /** Glow color. */
275
+ color?: Color;
276
+ /** Glow opacity. */
277
+ opacity?: number;
278
+ }
279
+
280
+ /** Bullet configuration. */
281
+ export interface BulletProps {
282
+ /** Bullet type. */
283
+ type?: 'bullet' | 'number';
284
+ /** Bullet character code (unicode). */
285
+ characterCode?: string;
286
+ /** Indent between bullet and text (points). */
287
+ indent?: number;
288
+ /** Number type (for numbered lists). */
289
+ numberType?:
290
+ | 'alphaLcParenBoth'
291
+ | 'alphaLcParenR'
292
+ | 'alphaLcPeriod'
293
+ | 'alphaUcParenBoth'
294
+ | 'alphaUcParenR'
295
+ | 'alphaUcPeriod'
296
+ | 'arabicParenBoth'
297
+ | 'arabicParenR'
298
+ | 'arabicPeriod'
299
+ | 'arabicPlain'
300
+ | 'romanLcParenBoth'
301
+ | 'romanLcParenR'
302
+ | 'romanLcPeriod'
303
+ | 'romanUcParenBoth'
304
+ | 'romanUcParenR'
305
+ | 'romanUcPeriod';
306
+ /** Start number for numbered bullets. */
307
+ numberStartAt?: number;
308
+ /**
309
+ * @deprecated v3.3.0 - use `characterCode`
310
+ */
311
+ code?: string;
312
+ /**
313
+ * @deprecated v3.3.0 - use `indent`
314
+ */
315
+ marginPt?: number;
316
+ /**
317
+ * @deprecated v3.3.0 - use `numberStartAt`
318
+ */
319
+ startAt?: number;
320
+ }
321
+
322
+ /**
323
+ * Base text properties shared by text runs, table cells, and shape text.
324
+ *
325
+ * Note: default valign changed from 'center' to 'top' in our patch for
326
+ * consistency with CSS rendering.
327
+ */
328
+ export interface TextBaseProps {
329
+ /** Horizontal alignment. */
330
+ align?: HAlign;
331
+ /** Bold. */
332
+ bold?: boolean;
333
+ /** Insert a line break before this run. */
334
+ breakLine?: boolean;
335
+ /** Bullet options (true for default bullet, or BulletProps). */
336
+ bullet?: boolean | BulletProps;
337
+ /**
338
+ * Text color (hex or theme).
339
+ * Ignored when `fontFill` is set.
340
+ */
341
+ color?: Color;
342
+ /**
343
+ * Text fill (supports gradient fills). CUSTOM PATCH.
344
+ * Takes priority over `color` when set.
345
+ * @example { type: 'gradient', gradient: { type: 'linear', angle: 90, stops: [...] } }
346
+ */
347
+ fontFill?: ShapeFillProps;
348
+ /** Font face name. */
349
+ fontFace?: string;
350
+ /** Font size (points). */
351
+ fontSize?: number;
352
+ /** Text highlight color (hex). */
353
+ highlight?: HexColor;
354
+ /** Indent level (0-based). */
355
+ indentLevel?: number;
356
+ /** Italic. */
357
+ italic?: boolean;
358
+ /** Language (ISO 639-1). */
359
+ lang?: string;
360
+ /** Soft line break (shift+enter) before content. */
361
+ softBreakBefore?: boolean;
362
+ /** Tab stop positions. */
363
+ tabStops?: Array<{ position: number; alignment?: 'l' | 'r' | 'ctr' | 'dec' }>;
364
+ /** Transparency (percent, 0-100). */
365
+ transparency?: number;
366
+ /** Underline options. */
367
+ underline?: boolean | UnderlineProps;
368
+ /**
369
+ * Vertical alignment.
370
+ * Accepts 'top', 'middle', 'bottom'. Our patch also accepts leading 'c' for center.
371
+ * @default 'top'
372
+ */
373
+ valign?: VAlign;
374
+ /** Character spacing (points). */
375
+ charSpacing?: number;
376
+ /** Text glow effect. */
377
+ glow?: TextGlowProps;
378
+ /** Text outline. */
379
+ outline?: { size?: number; color?: Color };
380
+ /** Text direction. */
381
+ textDirection?: 'horz' | 'vert' | 'vert270' | 'wordArtVert';
382
+ }
383
+
384
+ // ---------------------------------------------------------------------------
385
+ // Text options (for addText)
386
+ // ---------------------------------------------------------------------------
387
+
388
+ /**
389
+ * Options for `Slide.addText()`.
390
+ * Combines position, text-base props, and shape-level props.
391
+ */
392
+ export interface TextOptions extends PositionProps, TextBaseProps {
393
+ /** Shape fill. */
394
+ fill?: ShapeFillProps;
395
+ /** Shape line/border. */
396
+ line?: ShapeLineProps;
397
+ /** Shape shadow. */
398
+ shadow?: ShadowProps;
399
+ /** Margin (points). */
400
+ margin?: Margin;
401
+ /** Paragraph spacing before (points). */
402
+ paraSpaceBefore?: number;
403
+ /** Paragraph spacing after (points). */
404
+ paraSpaceAfter?: number;
405
+ /** Line spacing (points). */
406
+ lineSpacing?: number;
407
+ /** Line spacing multiplier. */
408
+ lineSpacingMultiple?: number;
409
+ /** Hyperlink. */
410
+ hyperlink?: HyperlinkProps;
411
+ /** Shape type for the text box background. */
412
+ shape?: string;
413
+ /** Rounded rectangle radius (inches). */
414
+ rectRadius?: number;
415
+ /** Rotation (degrees, -360 to 360). */
416
+ rotate?: number;
417
+ /** Text wrapping. */
418
+ wrap?: boolean;
419
+ /** Internal inset (points). */
420
+ inset?: number;
421
+ /** Auto-fit text to shape. */
422
+ autoFit?: boolean;
423
+ /** Auto-shrink text to fit. */
424
+ shrinkText?: boolean;
425
+ /** Object name. */
426
+ objectName?: string;
427
+ /** Placeholder type name. */
428
+ placeholder?: string;
429
+ /** Vertical text direction. */
430
+ vert?: string;
431
+ }
432
+
433
+ /** Single text run within a rich-text array. */
434
+ export interface TextRun {
435
+ text: string;
436
+ options?: TextBaseProps;
437
+ }
438
+
439
+ /** Text argument for addText: plain string or array of text runs. */
440
+ export type TextProps = string | TextRun[];
441
+
442
+ // ---------------------------------------------------------------------------
443
+ // Image options
444
+ // ---------------------------------------------------------------------------
445
+
446
+ /** Image sizing configuration. */
447
+ export interface ImageSizing {
448
+ type: 'contain' | 'cover' | 'crop';
449
+ w: Coord;
450
+ h: Coord;
451
+ x?: Coord;
452
+ y?: Coord;
453
+ }
454
+
455
+ /** Options for `Slide.addImage()`. */
456
+ export interface ImageOptions extends PositionProps {
457
+ /** Base64-encoded image data. */
458
+ data?: string;
459
+ /** URL or file path. */
460
+ path?: string;
461
+ /** Image sizing / cropping. */
462
+ sizing?: ImageSizing;
463
+ /** Render as ellipse. */
464
+ rounding?: boolean;
465
+ /**
466
+ * Rounded rectangle clip radius (inches). CUSTOM PATCH.
467
+ * Overrides `rounding` when set.
468
+ * @example 0.2
469
+ */
470
+ rectRadius?: number;
471
+ /** Shadow. */
472
+ shadow?: ShadowProps;
473
+ /** Hyperlink. */
474
+ hyperlink?: HyperlinkProps;
475
+ /** Rotation (degrees). */
476
+ rotate?: number;
477
+ /** Alt text. */
478
+ altText?: string;
479
+ /** Transparency (percent, 0-100). */
480
+ transparency?: number;
481
+ /** Flip horizontally. */
482
+ flipH?: boolean;
483
+ /** Flip vertically. */
484
+ flipV?: boolean;
485
+ /** Object name. */
486
+ objectName?: string;
487
+ /** Placeholder type. */
488
+ placeholder?: string;
489
+ }
490
+
491
+ // ---------------------------------------------------------------------------
492
+ // Shape options
493
+ // ---------------------------------------------------------------------------
494
+
495
+ /** Options for `Slide.addShape()`. */
496
+ export interface ShapeOptions extends PositionProps {
497
+ /** Shape fill (solid or gradient). */
498
+ fill?: ShapeFillProps;
499
+ /** Shape line/border. */
500
+ line?: ShapeLineProps;
501
+ /** Shadow. */
502
+ shadow?: ShadowProps;
503
+ /** Rounded rectangle radius (0.0-1.0 or inches depending on context). */
504
+ rectRadius?: number;
505
+ /** Rotation (degrees). */
506
+ rotate?: number;
507
+ /** Flip horizontally. */
508
+ flipH?: boolean;
509
+ /** Flip vertically. */
510
+ flipV?: boolean;
511
+ /** Hyperlink. */
512
+ hyperlink?: HyperlinkProps;
513
+ /** Object name. */
514
+ objectName?: string;
515
+ /** Horizontal alignment. */
516
+ align?: HAlign;
517
+ /**
518
+ * Arc angle range (for PIE, ARC, BLOCK_ARC shapes).
519
+ * @example [270, 0]
520
+ */
521
+ angleRange?: [number, number];
522
+ /** Block-arc thickness ratio (0.0-1.0). */
523
+ arcThicknessRatio?: number;
524
+ /** Custom geometry points. */
525
+ points?: Array<Record<string, unknown>>;
526
+ }
527
+
528
+ // ---------------------------------------------------------------------------
529
+ // Table types
530
+ // ---------------------------------------------------------------------------
531
+
532
+ export interface TableCellProps extends TextBaseProps {
533
+ border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps];
534
+ colspan?: number;
535
+ fill?: ShapeFillProps;
536
+ hyperlink?: HyperlinkProps;
537
+ margin?: Margin;
538
+ rowspan?: number;
539
+ }
540
+
541
+ export interface TableCell {
542
+ text: string | TextRun[];
543
+ options?: TableCellProps;
544
+ }
545
+
546
+ export type TableRow = TableCell[];
547
+
548
+ export interface TableProps extends PositionProps, TextBaseProps {
549
+ autoPage?: boolean;
550
+ autoPageCharWeight?: number;
551
+ autoPageLineWeight?: number;
552
+ autoPageRepeatHeader?: boolean;
553
+ autoPageSlideStartY?: number;
554
+ colW?: number | number[];
555
+ rowH?: number | number[];
556
+ border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps];
557
+ fill?: ShapeFillProps;
558
+ margin?: Margin;
559
+ objectName?: string;
560
+ }
561
+
562
+ // ---------------------------------------------------------------------------
563
+ // Background
564
+ // ---------------------------------------------------------------------------
565
+
566
+ export interface BackgroundProps extends ShapeFillProps {
567
+ /** Base64-encoded image data. */
568
+ data?: string;
569
+ /** Image path/URL. */
570
+ path?: string;
571
+ }
572
+
573
+ // ---------------------------------------------------------------------------
574
+ // Write options
575
+ // ---------------------------------------------------------------------------
576
+
577
+ export interface WriteBaseProps {
578
+ /** Compression (can reduce file size ~30%). */
579
+ compression?: boolean;
580
+ }
581
+
582
+ export interface WriteOptions extends WriteBaseProps {
583
+ /** Output type. */
584
+ outputType?: OutputType;
585
+ }
586
+
587
+ export interface WriteFileProps extends WriteBaseProps {
588
+ /** Output file name. */
589
+ fileName?: string;
590
+ }
591
+
592
+ // ---------------------------------------------------------------------------
593
+ // Layout
594
+ // ---------------------------------------------------------------------------
595
+
596
+ export interface PresLayout {
597
+ /** Layout name. */
598
+ name: string;
599
+ /** Width in EMU (914400 EMU per inch). */
600
+ width: number;
601
+ /** Height in EMU (914400 EMU per inch). */
602
+ height: number;
603
+ }
604
+
605
+ // ---------------------------------------------------------------------------
606
+ // Slide
607
+ // ---------------------------------------------------------------------------
608
+
609
+ export interface Slide {
610
+ /**
611
+ * Add text to the slide.
612
+ * @param text - Plain string or array of TextRun objects for rich text.
613
+ * @param options - Position, formatting, and shape options.
614
+ */
615
+ addText(
616
+ text: string | TextRun[],
617
+ options?: TextOptions,
618
+ ): Slide;
619
+
620
+ /**
621
+ * Add an image to the slide.
622
+ * @param options - Image source, position, sizing, and rounding options.
623
+ */
624
+ addImage(options: ImageOptions): Slide;
625
+
626
+ /**
627
+ * Add a shape to the slide.
628
+ * @param shapeName - Shape type name (e.g. 'rect', 'roundRect', 'line').
629
+ * @param options - Position, fill, line, shadow, and other shape options.
630
+ */
631
+ addShape(shapeName: string, options?: ShapeOptions): Slide;
632
+
633
+ /**
634
+ * Add a table to the slide.
635
+ * @param rows - Array of row arrays, each containing TableCell objects.
636
+ * @param options - Table layout and style options.
637
+ */
638
+ addTable(rows: TableRow[], options?: TableProps): Slide;
639
+
640
+ /**
641
+ * Add a chart to the slide.
642
+ * @param type - Chart type string.
643
+ * @param data - Chart data series.
644
+ * @param options - Chart options.
645
+ */
646
+ addChart(
647
+ type: string,
648
+ data: Record<string, unknown>[],
649
+ options?: Record<string, unknown>,
650
+ ): Slide;
651
+
652
+ /**
653
+ * Add media (audio/video) to the slide.
654
+ * @param options - Media options including type, path/data, and position.
655
+ */
656
+ addMedia(options: Record<string, unknown>): Slide;
657
+
658
+ /**
659
+ * Add speaker notes to the slide.
660
+ * @param notes - Plain text notes content.
661
+ */
662
+ addNotes(notes: string): Slide;
663
+
664
+ /**
665
+ * Slide background.
666
+ * Set to `{ color: 'FFFFFF' }` for solid, or use gradient/image props.
667
+ */
668
+ background: BackgroundProps;
669
+
670
+ /** Slide number (1-based, read-only at runtime). */
671
+ readonly _slideNum: number;
672
+ }
673
+
674
+ // ---------------------------------------------------------------------------
675
+ // PptxGenJS class
676
+ // ---------------------------------------------------------------------------
677
+
678
+ /**
679
+ * PptxGenJS presentation generator.
680
+ *
681
+ * This is the vendored & patched build (4.0.1). See `slides/vendor/VENDORING.md`.
682
+ */
683
+ declare class PptxGenJS {
684
+ /**
685
+ * Library version string.
686
+ */
687
+ readonly version: string;
688
+
689
+ /**
690
+ * Resolved presentation layout dimensions.
691
+ * Width and height are in EMU (914400 EMU = 1 inch).
692
+ */
693
+ readonly presLayout: PresLayout;
694
+
695
+ /**
696
+ * All slides in the presentation (read-only array).
697
+ */
698
+ readonly slides: Slide[];
699
+
700
+ /**
701
+ * Shape type constants.
702
+ * @example pptx.ShapeType.rect, pptx.ShapeType.roundRect, pptx.ShapeType.line
703
+ */
704
+ readonly ShapeType: Record<string, string>;
705
+
706
+ /**
707
+ * Horizontal alignment enum.
708
+ */
709
+ readonly AlignH: Record<string, string>;
710
+
711
+ /**
712
+ * Vertical alignment enum.
713
+ */
714
+ readonly AlignV: Record<string, string>;
715
+
716
+ /**
717
+ * Chart type enum.
718
+ */
719
+ readonly ChartType: Record<string, string>;
720
+
721
+ /**
722
+ * Scheme color enum.
723
+ */
724
+ readonly SchemeColor: Record<string, string>;
725
+
726
+ // ---- Presentation metadata ----
727
+
728
+ /**
729
+ * Presentation layout name.
730
+ * Standard: 'LAYOUT_4x3', 'LAYOUT_16x9', 'LAYOUT_16x10', 'LAYOUT_WIDE'.
731
+ */
732
+ layout: string;
733
+
734
+ /** Whether Right-to-Left mode is enabled. */
735
+ rtlMode: boolean;
736
+
737
+ /** Author metadata. */
738
+ author: string;
739
+ /** Company metadata. */
740
+ company: string;
741
+ /** Revision number (must be a whole number). */
742
+ revision: string;
743
+ /** Subject metadata. */
744
+ subject: string;
745
+ /** Title metadata. */
746
+ title: string;
747
+ /** Theme (default fonts). */
748
+ theme: { headFontFace?: string; bodyFontFace?: string };
749
+
750
+ // ---- Methods ----
751
+
752
+ /**
753
+ * Add a new slide to the presentation.
754
+ * @param masterName - Optional master slide name or options.
755
+ */
756
+ addSlide(masterName?: string | { masterName?: string; sectionTitle?: string }): Slide;
757
+
758
+ /**
759
+ * Define a custom slide layout.
760
+ * @param layout - Layout dimensions.
761
+ */
762
+ defineLayout(layout: PresLayout): void;
763
+
764
+ /**
765
+ * Define a slide master (layout template).
766
+ * @param props - Master slide properties.
767
+ */
768
+ defineSlideMaster(props: Record<string, unknown>): void;
769
+
770
+ /**
771
+ * Export the presentation to a buffer/string.
772
+ * @param options - Output type and compression.
773
+ */
774
+ write(options?: WriteOptions): Promise<string | ArrayBuffer | Blob | Uint8Array | Buffer>;
775
+
776
+ /**
777
+ * Export the presentation to a file (Node.js) or trigger download (browser).
778
+ * @param options - Output file name and compression.
779
+ */
780
+ writeFile(options?: WriteFileProps): Promise<string>;
781
+
782
+ /**
783
+ * Export the presentation as a stream.
784
+ * @param options - Compression options.
785
+ */
786
+ stream(options?: WriteBaseProps): Promise<string | ArrayBuffer | Blob | Uint8Array>;
787
+
788
+ /**
789
+ * Add a section to the presentation.
790
+ * @param props - Section properties.
791
+ */
792
+ addSection(props: { title: string }): void;
793
+
794
+ /**
795
+ * Convert an HTML table element to slides.
796
+ * @param eleId - HTML element ID.
797
+ * @param props - Options for table-to-slides conversion.
798
+ */
799
+ tableToSlides(eleId: string, props?: Record<string, unknown>): void;
800
+ }
801
+
802
+ export default PptxGenJS;
803
+ export {
804
+ PptxGenJS,
805
+ };