ooxml-core 1.9.0 → 1.11.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.
Files changed (202) hide show
  1. package/dist/PptxHandler-DNZHAHUY.cjs +12 -0
  2. package/dist/PptxHandler-E44KDHMQ.mjs +3 -0
  3. package/dist/{PptxHandler-EX4WBIQQ.mjs → PptxHandler-NROFYT2N.mjs} +2 -2
  4. package/dist/automation/index.cjs +3236 -2258
  5. package/dist/automation/index.mjs +3236 -2258
  6. package/dist/{chunk-SWF7KVL5.cjs → chunk-2UVH6RHI.cjs} +1608 -1163
  7. package/dist/{chunk-M76PHYRR.mjs → chunk-7DSZI7S6.mjs} +1 -1
  8. package/dist/{chunk-AT66SA5M.cjs → chunk-7QZGRB3T.cjs} +28 -10
  9. package/dist/chunk-ANZ4Q6I3.cjs +21 -0
  10. package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
  11. package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
  12. package/dist/{chunk-FIELY5PI.mjs → chunk-EC2W2MDY.mjs} +30 -2
  13. package/dist/chunk-EGTRL3QJ.mjs +19 -0
  14. package/dist/chunk-GXHKNSZX.mjs +9 -0
  15. package/dist/{chunk-OXHMZS7B.mjs → chunk-HCXUI5UC.mjs} +943 -273
  16. package/dist/chunk-HDQXPSHY.cjs +17 -0
  17. package/dist/chunk-KTYBFGEY.mjs +14 -0
  18. package/dist/chunk-QOO36KG4.cjs +42 -0
  19. package/dist/chunk-R2KZXD6U.mjs +39 -0
  20. package/dist/{chunk-IGOA57LE.mjs → chunk-U2DF3EGK.mjs} +1 -1
  21. package/dist/{chunk-OB277ZGE.mjs → chunk-UAY26XOI.mjs} +27 -9
  22. package/dist/{chunk-WSO4T2LJ.mjs → chunk-W5ARCUJB.mjs} +26 -3
  23. package/dist/chunk-XZPZHXV4.cjs +12 -0
  24. package/dist/{chunk-LCS3J3QI.mjs → chunk-YB5SRNFS.mjs} +717 -272
  25. package/dist/docx/layout/adapt-table.d.ts +2 -2
  26. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  28. package/dist/docx/layout/index.cjs +554 -83
  29. package/dist/docx/layout/index.mjs +554 -84
  30. package/dist/docx/layout/nested-fragment-edges.d.ts +9 -0
  31. package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -0
  32. package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
  33. package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
  34. package/dist/docx/layout/page-cursor.d.ts +2 -0
  35. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  36. package/dist/docx/layout/result.d.ts +20 -0
  37. package/dist/docx/layout/result.d.ts.map +1 -1
  38. package/dist/docx/layout/table-border-layout.d.ts +16 -0
  39. package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
  40. package/dist/docx/layout/table-cell-layout.d.ts +3 -2
  41. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  42. package/dist/docx/layout/table-content.d.ts +4 -0
  43. package/dist/docx/layout/table-content.d.ts.map +1 -0
  44. package/dist/docx/layout/table-footnotes.d.ts +5 -0
  45. package/dist/docx/layout/table-footnotes.d.ts.map +1 -1
  46. package/dist/docx/layout/table-frames.d.ts +4 -0
  47. package/dist/docx/layout/table-frames.d.ts.map +1 -0
  48. package/dist/docx/layout/table-layout.d.ts +8 -3
  49. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  50. package/dist/docx/layout/table-note-completion.d.ts +5 -0
  51. package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
  52. package/dist/docx/layout/table-note-stories.d.ts +6 -0
  53. package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
  54. package/dist/pptx/automation/index.cjs +801 -296
  55. package/dist/pptx/automation/index.d.ts +5 -4
  56. package/dist/pptx/automation/index.d.ts.map +1 -1
  57. package/dist/pptx/automation/index.mjs +5 -5
  58. package/dist/pptx/chunks/{text-operations-BLodkuXE.d.ts → elements-DD3UGOMd.d.ts} +27 -3248
  59. package/dist/pptx/chunks/elements-DD3UGOMd.d.ts.map +1 -0
  60. package/dist/pptx/chunks/{index-B4cnSPNz.d.ts → index-BZrFyNtU.d.ts} +113 -5
  61. package/dist/pptx/chunks/index-BZrFyNtU.d.ts.map +1 -0
  62. package/dist/pptx/chunks/{index-BZh-IMkN.d.ts → index-DdX02BSm.d.ts} +19 -3
  63. package/dist/pptx/chunks/index-DdX02BSm.d.ts.map +1 -0
  64. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts +1512 -0
  65. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts.map +1 -0
  66. package/dist/pptx/chunks/text-D49FKllA.d.ts +1473 -0
  67. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +1 -0
  68. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts +3261 -0
  69. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts.map +1 -0
  70. package/dist/pptx/cli/index.cjs +801 -296
  71. package/dist/pptx/cli/index.d.ts +1 -1
  72. package/dist/pptx/cli/index.mjs +4 -4
  73. package/dist/pptx/converter/index.cjs +1 -0
  74. package/dist/pptx/converter/index.d.ts +1 -1
  75. package/dist/pptx/converter/index.mjs +2 -2
  76. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
  77. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
  78. package/dist/pptx/editor/render/find-replace.cjs +19 -18
  79. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  80. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  81. package/dist/pptx/editor/render/font-family-update.cjs +14 -0
  82. package/dist/pptx/editor/render/font-family-update.d.ts +17 -0
  83. package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -0
  84. package/dist/pptx/editor/render/font-family-update.mjs +1 -0
  85. package/dist/pptx/editor/render/paragraph-geometry-overrides.cjs +14 -0
  86. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +17 -0
  87. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -0
  88. package/dist/pptx/editor/render/paragraph-geometry-overrides.mjs +12 -0
  89. package/dist/pptx/editor/render/remap-text.cjs +2 -2
  90. package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
  91. package/dist/pptx/editor/render/remap-text.mjs +1 -1
  92. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  93. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  94. package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
  95. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  96. package/dist/pptx/editor/render/text-content-style.cjs +18 -0
  97. package/dist/pptx/editor/render/text-content-style.d.ts +9 -0
  98. package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -0
  99. package/dist/pptx/editor/render/text-content-style.mjs +5 -0
  100. package/dist/pptx/editor/render/text-runs-style-patch.cjs +17 -0
  101. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +7 -0
  102. package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -0
  103. package/dist/pptx/editor/render/text-runs-style-patch.mjs +15 -0
  104. package/dist/pptx/editor/render/text-style-scope.cjs +173 -0
  105. package/dist/pptx/editor/render/text-style-scope.d.ts +76 -0
  106. package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -0
  107. package/dist/pptx/editor/render/text-style-scope.mjs +164 -0
  108. package/dist/pptx/editor/render/theme-editor-model.cjs +1 -1
  109. package/dist/pptx/editor/render/theme-editor-model.mjs +1 -1
  110. package/dist/pptx/editor/render/update-text-segment-style.cjs +11 -0
  111. package/dist/pptx/editor/render/update-text-segment-style.d.ts +14 -0
  112. package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -0
  113. package/dist/pptx/editor/render/update-text-segment-style.mjs +2 -0
  114. package/dist/pptx/index.cjs +1091 -296
  115. package/dist/pptx/index.d.ts +7 -5
  116. package/dist/pptx/index.mjs +5 -5
  117. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  118. package/dist/teams/index.cjs +590 -122
  119. package/dist/teams/index.mjs +590 -122
  120. package/dist/visio/date-cache.d.ts +3 -0
  121. package/dist/visio/date-cache.d.ts.map +1 -0
  122. package/dist/visio/edit-commands.d.ts +3 -3
  123. package/dist/visio/edit-commands.d.ts.map +1 -1
  124. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  125. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  126. package/dist/visio/edit-text-field-commands.d.ts +15 -0
  127. package/dist/visio/edit-text-field-commands.d.ts.map +1 -1
  128. package/dist/visio/edit-text-field.d.ts +2 -2
  129. package/dist/visio/edit-text-field.d.ts.map +1 -1
  130. package/dist/visio/edit.d.ts +1 -1
  131. package/dist/visio/edit.d.ts.map +1 -1
  132. package/dist/visio/index.cjs +501 -220
  133. package/dist/visio/index.d.ts +1 -1
  134. package/dist/visio/index.d.ts.map +1 -1
  135. package/dist/visio/index.mjs +501 -220
  136. package/dist/visio/model.d.ts +6 -0
  137. package/dist/visio/model.d.ts.map +1 -1
  138. package/dist/visio/shape-metadata.d.ts.map +1 -1
  139. package/dist/visio/shapes.d.ts.map +1 -1
  140. package/dist/visio/style.d.ts +1 -1
  141. package/dist/visio/style.d.ts.map +1 -1
  142. package/dist/visio/text-field-display.d.ts +3 -0
  143. package/dist/visio/text-field-display.d.ts.map +1 -1
  144. package/dist/visio/text-field-editability.d.ts +6 -0
  145. package/dist/visio/text-field-editability.d.ts.map +1 -0
  146. package/dist/visio/text-field-fraction.d.ts +3 -0
  147. package/dist/visio/text-field-fraction.d.ts.map +1 -0
  148. package/dist/visio/text-field-independent.d.ts +4 -0
  149. package/dist/visio/text-field-independent.d.ts.map +1 -0
  150. package/dist/visio/text-field-numeric.d.ts +1 -1
  151. package/dist/visio/text-field-numeric.d.ts.map +1 -1
  152. package/dist/visio/text-field-source.d.ts +6 -0
  153. package/dist/visio/text-field-source.d.ts.map +1 -0
  154. package/dist/visio/text-field-system-date.d.ts +4 -0
  155. package/dist/visio/text-field-system-date.d.ts.map +1 -0
  156. package/dist/visio/text-fields.d.ts +1 -0
  157. package/dist/visio/text-fields.d.ts.map +1 -1
  158. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  159. package/dist/visio/ui/index.cjs +514 -221
  160. package/dist/visio/ui/index.mjs +514 -221
  161. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  162. package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
  163. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  164. package/dist/xlsx/index.cjs +1362 -659
  165. package/dist/xlsx/index.mjs +1361 -660
  166. package/dist/xlsx/load/index.cjs +1091 -430
  167. package/dist/xlsx/load/index.mjs +1091 -430
  168. package/dist/xlsx/model-pivots.d.ts +31 -2
  169. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  170. package/dist/xlsx/pivot/admission.d.ts.map +1 -1
  171. package/dist/xlsx/pivot/aggregate.d.ts +3 -1
  172. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  173. package/dist/xlsx/pivot/data.d.ts +2 -2
  174. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  175. package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
  176. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
  177. package/dist/xlsx/pivot/hierarchy.d.ts +2 -4
  178. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
  179. package/dist/xlsx/pivot/index.d.ts +2 -0
  180. package/dist/xlsx/pivot/index.d.ts.map +1 -1
  181. package/dist/xlsx/pivot/measures.d.ts +13 -0
  182. package/dist/xlsx/pivot/measures.d.ts.map +1 -0
  183. package/dist/xlsx/pivot/page-filter-admission.d.ts +5 -0
  184. package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -0
  185. package/dist/xlsx/pivot/page-filter.d.ts +11 -0
  186. package/dist/xlsx/pivot/page-filter.d.ts.map +1 -0
  187. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  188. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  189. package/dist/xlsx/pivot/values-axis.d.ts +12 -0
  190. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
  191. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  192. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  193. package/dist/xlsx/ui/index.cjs +640 -137
  194. package/dist/xlsx/ui/index.mjs +640 -137
  195. package/package.json +2 -2
  196. package/dist/PptxHandler-AT7FVG5Q.mjs +0 -2
  197. package/dist/PptxHandler-VFSCECPL.cjs +0 -11
  198. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +0 -1
  199. package/dist/pptx/chunks/index-BZh-IMkN.d.ts.map +0 -1
  200. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts +0 -2970
  201. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
  202. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +0 -1
@@ -0,0 +1,3261 @@
1
+ import { k as XmlObject, r as TextSegment, v as Pptx3DScene, w as PptxDrawingGuide, y as Pptx3DShape } from "./text-D49FKllA.js";
2
+ import { t as PptxThemeColorRef } from "./color-ref-DT599vEx.js";
3
+ import { F as PlaceholderTextLevelStyle, Ln as PptxImageProperties, m as PptxElement, rt as ParsedTableStyleMap } from "./elements-DD3UGOMd.js";
4
+ //#region pptx/core/types/transition.d.ts
5
+ /**
6
+ * Available slide transition effects.
7
+ *
8
+ * Maps to the OOXML child element names under `<p:transition>` / `<p14:transition>`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const t: PptxTransitionType = "morph";
13
+ * // => "morph" — one of 40+ transition effects
14
+ * ```
15
+ */
16
+ type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window' | 'cube' | 'flip' | 'rotate' | 'box' | 'orbit' | 'fallOver' | 'drape' | 'curtains' | 'wind' | 'prestige' | 'fracture' | 'crush' | 'peelOff' | 'pageCurlDouble' | 'pageCurlSingle' | 'airplane' | 'origami';
17
+ /** Cardinal direction tokens from OOXML transition `@_dir`. */
18
+ type PptxTransitionDirection4 = 'l' | 'r' | 'u' | 'd';
19
+ /** 8-way direction tokens (cardinal + diagonal) for cover/uncover. */
20
+ type PptxTransitionDirection8 = PptxTransitionDirection4 | 'lu' | 'ld' | 'ru' | 'rd';
21
+ /** Strip direction tokens from OOXML. */
22
+ type PptxStripDirection = 'lu' | 'ld' | 'ru' | 'rd';
23
+ /** Split orientation from OOXML `@_orient`. */
24
+ type PptxSplitOrientation = 'horz' | 'vert';
25
+ /** Split in/out direction from OOXML `@_dir`. */
26
+ type PptxSplitDirection = 'in' | 'out';
27
+ /** Schema-defined `ST_TransitionSpeed` values. */
28
+ type PptxTransitionSpeed = 'slow' | 'med' | 'fast';
29
+ /**
30
+ * Valid direction sets per transition type.
31
+ *
32
+ * The p14 (Office 2010+) and p15 (Office 2013+) entries below are COM-verified:
33
+ * each direction token was confirmed by enumerating PowerPoint's own
34
+ * `PpEntryEffect` constants (reflected off the installed
35
+ * `Microsoft.Office.Interop.PowerPoint` type library) and reading back the
36
+ * `p:transition` XML PowerPoint itself saved for each one, exactly like the
37
+ * `p14-prism-family` and `P15_INVX_PRESETS` measurements. Two findings that
38
+ * contradict the naive "4-way cardinal for every named Left/Up/Right/Down
39
+ * effect" assumption:
40
+ * - `switch` and `flip` each expose four named directions in PowerPoint's UI
41
+ * (Left/Up/Right/Down), but the saved XML only ever carries `dir="l"` or
42
+ * `dir="r"`: Up and Down both collapse to `dir="r"` on save. Modelling them
43
+ * as 4-way here would offer a picker button PowerPoint itself cannot
44
+ * persist.
45
+ * - `ripple`'s only named directions are the four DIAGONALS (`lu`/`ld`/`ru`/
46
+ * `rd`, PowerPoint's "Ripple" gallery calls them Left-Up/Left-Down/etc.);
47
+ * there is no cardinal `l`/`r`/`u`/`d` variant, and the unset default is a
48
+ * fifth "From Center" state with no `dir` attribute at all.
49
+ */
50
+ declare const TRANSITION_VALID_DIRECTIONS: Readonly<Partial<Record<PptxTransitionType, readonly string[]>>>;
51
+ /**
52
+ * Transition types offering a "Pattern" effect option alongside direction
53
+ * (COM-verified via `p14:glitter/@pattern` and `p14:shred/@pattern`).
54
+ */
55
+ declare const TRANSITION_PATTERN_OPTIONS: Readonly<Partial<Record<PptxTransitionType, readonly string[]>>>;
56
+ /**
57
+ * Transition types offering the "Through Black" checkbox
58
+ * (OOXML `@_thruBlk`, `CT_OptionalBlackTransition`). COM-verified: enumerating
59
+ * every `PpEntryEffect` constant found a dedicated black variant only for
60
+ * `Cut` (`ppEffectCutThroughBlack`) and the legacy `Fade` entry (`ppEffectFade`,
61
+ * as opposed to the newer non-black `ppEffectFadeSmoothly`); no Blinds/
62
+ * Checkerboard "through black" `PpEntryEffect` constant exists despite the
63
+ * `thruBlk` attribute being generically parseable off any standard transition
64
+ * child.
65
+ */
66
+ declare const TRANSITION_THRUBLK_TYPES: ReadonlySet<PptxTransitionType>;
67
+ /**
68
+ * Slide transition configuration.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const transition: PptxSlideTransition = {
73
+ * type: "fade",
74
+ * durationMs: 700,
75
+ * advanceOnClick: true,
76
+ * advanceAfterMs: 5000,
77
+ * };
78
+ * // => { type: "fade", durationMs: 700, advanceOnClick: true, advanceAfterMs: 5000 }
79
+ * ```
80
+ */
81
+ /**
82
+ * Morph granularity (`<p159:morph @option>`).
83
+ *
84
+ * - `byObject` - match whole shapes (PowerPoint's default)
85
+ * - `byWord` - additionally morph text word by word
86
+ * - `byChar` - additionally morph text character by character
87
+ */
88
+ type PptxMorphOption = 'byObject' | 'byWord' | 'byChar';
89
+ interface PptxSlideTransition {
90
+ type: PptxTransitionType;
91
+ /** Schema-defined transition speed. Defaults to `fast` when omitted. */
92
+ speed?: PptxTransitionSpeed;
93
+ durationMs?: number;
94
+ direction?: string;
95
+ advanceOnClick?: boolean;
96
+ advanceAfterMs?: number;
97
+ /** Number of spokes for wheel transition (1-8). */
98
+ spokes?: number;
99
+ /** Pattern type for shred transition. */
100
+ pattern?: string;
101
+ /**
102
+ * Through-black flag (OOXML `@_thruBlk`). COM-verified to actually apply to
103
+ * `cut` and `fade` (see {@link TRANSITION_THRUBLK_TYPES}); parsed generically
104
+ * off any standard transition child so an unexpected authored value still
105
+ * round-trips.
106
+ */
107
+ thruBlk?: boolean;
108
+ /** Split orientation (horz/vert) parsed from `@_orient`. */
109
+ orient?: PptxSplitOrientation;
110
+ /**
111
+ * Morph granularity from `<p159:morph @option>`: how finely PowerPoint
112
+ * matches content between the two slides. Only meaningful when
113
+ * {@link type} is `morph`; defaults to `byObject` when the attribute is
114
+ * absent, matching PowerPoint's own default.
115
+ */
116
+ morphOption?: PptxMorphOption;
117
+ /** Relationship ID of transition sound from `p:sndAc/p:stSnd/@r:embed` when present. */
118
+ soundRId?: string;
119
+ /** Embedded WAV display name from `p:stSnd/p:snd/@name`. */
120
+ soundName?: string;
121
+ /** Whether the transition sound repeats until another sound starts. */
122
+ soundLoop?: boolean;
123
+ /** Resolved transition sound media path within the package. */
124
+ soundPath?: string;
125
+ /** Human-readable sound file name (extracted from soundPath, or set by the
126
+ * UI when a new file is picked, before it has a soundPath at all). */
127
+ soundFileName?: string;
128
+ /**
129
+ * A newly-picked local sound file awaiting embedding, as a `data:` URL.
130
+ * Set by the transitions ribbon's Sound picker (`applyTransitionSoundFile`
131
+ * in `pptx-viewer-shared`) when the user chooses a file that is not yet
132
+ * part of the package; mirrors `imageData`/`mediaData` on picture and media
133
+ * elements. The save pipeline (`embedTransitionSound`) writes the bytes to
134
+ * `ppt/media/`, mints a relationship, sets `soundRId`/`soundPath`, and
135
+ * clears this field so a later save does not re-embed the same bytes.
136
+ */
137
+ soundData?: string;
138
+ /**
139
+ * When true, the transition stops the currently-playing sound (OOXML `p:sndAc/p:endSnd`).
140
+ * Mutually exclusive with `soundRId`/`soundPath` (which use `p:stSnd`).
141
+ */
142
+ stopSound?: boolean;
143
+ /** Preserved sound-action XML node from `p:sndAc` for lossless round-trip. */
144
+ rawSoundAction?: XmlObject;
145
+ /** Preserved extension-list XML node from `p:extLst` within the transition for lossless round-trip. */
146
+ rawExtLst?: XmlObject;
147
+ /** Original transition node, retained to preserve unknown attributes and children. */
148
+ rawTransition?: XmlObject;
149
+ }
150
+ //#endregion
151
+ //#region pptx/core/types/animation-behavior.d.ts
152
+ /** Timing of one behaviour, from its own `p:cBhvr/p:cTn`. */
153
+ interface PptxAnimationBehaviorTiming {
154
+ /** The behavior's own fill, independent of its containing effect. */
155
+ fill?: 'remove' | 'freeze' | 'hold' | 'transition';
156
+ /** Preserved timing profile cannot be reduced to a finite delayed one-shot set. */
157
+ unsupportedSetTiming?: boolean;
158
+ /** `p:cTn/@dur` in ms; absent when `indefinite` or unset. */
159
+ durationMs?: number;
160
+ /** Start offset in ms from `p:stCondLst/p:cond/@delay`, relative to the effect start. */
161
+ delayMs?: number;
162
+ /** `p:cTn/@accel` as a 0..1 fraction of the behaviour's duration. */
163
+ accel?: number;
164
+ /** `p:cTn/@decel` as a 0..1 fraction of the behaviour's duration. */
165
+ decel?: number;
166
+ /** `p:cTn/@autoRev`: play forward, then backward, doubling the active time. */
167
+ autoReverse?: boolean;
168
+ /** `p:cTn/@repeatCount` in plain iterations (OOXML stores thousandths). */
169
+ repeatCount?: number;
170
+ /** `p:cTn/@tmFilter`: the raw `"t,v; t,v; ..."` time remapping list. */
171
+ tmFilter?: string;
172
+ }
173
+ interface BehaviorBase {
174
+ /** Lower-cased `p:attrNameLst` entries, in document order. */
175
+ attrNames: string[];
176
+ /** `p:cBhvr/@additive` (`base`, `sum`, `repl`, `mult`, `none`). */
177
+ additive?: string;
178
+ timing: PptxAnimationBehaviorTiming;
179
+ }
180
+ /** `p:set`: a discrete value held from the behaviour's start. */
181
+ interface PptxSetBehavior extends BehaviorBase {
182
+ kind: 'set';
183
+ value: string | number | boolean;
184
+ }
185
+ /** `p:anim`: a `p:tavLst` ramp or a `from`/`to`/`by` formula ramp. */
186
+ interface PptxAnimBehavior extends BehaviorBase {
187
+ kind: 'anim';
188
+ calcMode?: 'discrete' | 'lin' | 'fmla';
189
+ valueType?: string;
190
+ from?: string;
191
+ to?: string;
192
+ by?: string;
193
+ keyframes: PptxAnimationKeyframe[];
194
+ }
195
+ /** `p:animEffect`: a filter transition (`fade`, `wipe(down)`...). */
196
+ interface PptxAnimEffectBehavior extends BehaviorBase {
197
+ kind: 'animEffect';
198
+ filter?: string;
199
+ transition?: 'in' | 'out' | 'none';
200
+ }
201
+ /** A `p:animScale` factor pair (1 = unscaled) or a `p:animMotion` offset (slide fractions). */
202
+ interface PptxBehaviorPoint {
203
+ x: number;
204
+ y: number;
205
+ }
206
+ /** `p:animScale`: scale factors as fractions (OOXML stores percent*1000, so `100000` = 1). */
207
+ interface PptxAnimScaleBehavior extends BehaviorBase {
208
+ kind: 'animScale';
209
+ from?: PptxBehaviorPoint;
210
+ to?: PptxBehaviorPoint;
211
+ by?: PptxBehaviorPoint;
212
+ zoomContents?: boolean;
213
+ }
214
+ /** `p:animRot`: rotation in degrees (OOXML stores 60000ths). */
215
+ interface PptxAnimRotBehavior extends BehaviorBase {
216
+ kind: 'animRot';
217
+ from?: number;
218
+ to?: number;
219
+ by?: number;
220
+ }
221
+ /** `p:animMotion`: a path (slide fractions) or a `from`/`to`/`by` offset. */
222
+ interface PptxAnimMotionBehavior extends BehaviorBase {
223
+ kind: 'animMotion';
224
+ path?: string;
225
+ origin?: string;
226
+ from?: PptxBehaviorPoint;
227
+ to?: PptxBehaviorPoint;
228
+ by?: PptxBehaviorPoint;
229
+ }
230
+ /** One behaviour child of an effect, tagged by its OOXML element. */
231
+ type PptxAnimationBehavior = PptxSetBehavior | PptxAnimBehavior | PptxAnimEffectBehavior | PptxAnimScaleBehavior | PptxAnimRotBehavior | PptxAnimMotionBehavior;
232
+ //#endregion
233
+ //#region pptx/core/types/animation.d.ts
234
+ /**
235
+ * Built-in animation preset names used for entrance, exit, and emphasis effects.
236
+ *
237
+ * @example
238
+ * ```ts
239
+ * const preset: PptxAnimationPreset = "fadeIn";
240
+ * // => "fadeIn" — one of: none | fadeIn | flyIn | zoomIn | fadeOut | flyOut | zoomOut | spin | pulse | ...
241
+ * ```
242
+ */
243
+ type PptxAnimationPreset = 'none' | 'appear' | 'fadeIn' | 'flyIn' | 'zoomIn' | 'bounceIn' | 'wipeIn' | 'splitIn' | 'dissolveIn' | 'wheelIn' | 'blindsIn' | 'boxIn' | 'floatIn' | 'riseUp' | 'swivel' | 'expandIn' | 'checkerboardIn' | 'flashIn' | 'peekIn' | 'randomBarsIn' | 'spinnerIn' | 'growTurnIn' | 'fadeOut' | 'flyOut' | 'zoomOut' | 'bounceOut' | 'wipeOut' | 'shrinkOut' | 'dissolveOut' | 'disappear' | 'spin' | 'pulse' | 'colorWave' | 'bounce' | 'flash' | 'growShrink' | 'teeter' | 'transparency' | 'boldFlash' | 'wave';
244
+ /** Animation timing curve. */
245
+ type PptxAnimationTimingCurve = 'ease' | 'ease-in' | 'ease-out' | 'linear';
246
+ /** Repeat mode for animations. */
247
+ type PptxAnimationRepeatMode = 'untilNextClick' | 'untilEndOfSlide';
248
+ /** Animation trigger type from OOXML `p:cTn`. */
249
+ type PptxAnimationTrigger = 'onClick' | 'onShapeClick' | 'onHover' | 'afterPrevious' | 'withPrevious' | 'afterDelay' |
250
+ /**
251
+ * Starts when a media element's playback reaches a named bookmark
252
+ * (PowerPoint's "Trigger > On Bookmark"). The media element is
253
+ * {@link PptxElementAnimation.triggerShapeId} and the bookmark
254
+ * {@link PptxElementAnimation.triggerBookmark}; saved as an interactive
255
+ * sequence gated on `p:cond evt="onMediaBookmark"` with a `p14:bmkTgt`.
256
+ */
257
+ 'onMediaBookmark';
258
+ /**
259
+ * Native animation kind. The historic shape-targeted preset animations are
260
+ * implicitly the default kind (`undefined`). Media animations (`p:audio`,
261
+ * `p:video`) emit dedicated entries so playback order on the slide timeline
262
+ * is preserved alongside other animations.
263
+ */
264
+ type PptxNativeAnimationKind = 'media';
265
+ /**
266
+ * `p:spTgt/p:graphicEl` (CT_TLGraphicalObjectBuildElement, ECMA-376 S19.5.34):
267
+ * identifies exactly which series/category/element of a chart or diagram
268
+ * build a per-stage effect reveals, when a deck authors one effect per stage
269
+ * instead of a single staged `p:bldGraphic` reveal.
270
+ */
271
+ interface PptxAnimationGraphicElementTarget {
272
+ /** Which graphic kind: `p:dgm` (diagram) or `p:chart`. */
273
+ kind: 'dgm' | 'chart';
274
+ /** `@_seriesIdx`, 0-based series index, when the target is series-scoped. */
275
+ seriesIdx?: number;
276
+ /** `@_categoryIdx`, 0-based category index, when the target is category-scoped. */
277
+ categoryIdx?: number;
278
+ /**
279
+ * `p:dgm/@_id` (CT_TLBuildDiagram, ECMA-376 S19.5.10): the diagram DATA MODEL
280
+ * point id (`dgm:pt/@modelId`) this per-stage effect reveals, when a
281
+ * `p:bldDgm` build authors one effect per node instead of a single staged
282
+ * reveal. `dgm`-kind targets only; a `chart`-kind target never carries this.
283
+ * Matches `PptxSmartArtNode.id` (parsed from the same `@modelId`), so a
284
+ * diagram renderer can reveal the exact authored node.
285
+ */
286
+ id?: string;
287
+ /**
288
+ * `@_bldStep`: `ST_TLChartBuildStep` (`category` / `categoryEl` / `series` /
289
+ * `seriesEl`) for a `chart`-kind target, or `ST_TLDiagramBuildStep`
290
+ * (`sp` / `bg`) for a `dgm`-kind target.
291
+ */
292
+ bldStep?: string;
293
+ }
294
+ /**
295
+ * `p:spTgt/p:oleChartEl` (CT_TLOleChartTargetElement, ECMA-376 S19.5.44):
296
+ * legacy pre-DrawingML OLE Graph chart sub-element targeting.
297
+ */
298
+ interface PptxAnimationOleChartElementTarget {
299
+ /** `@_type` (ST_TLOleChartSubelementType): entireChart / series / category / ... */
300
+ subelementType: string;
301
+ /** `@_lvl`, optional sub-element level. */
302
+ level?: number;
303
+ }
304
+ /** A target selected by `p:tgtEl` in the PresentationML timing model. */
305
+ type PptxAnimationTarget = {
306
+ type: 'shape';
307
+ shapeId: string;
308
+ /** Whether `p:spTgt/p:bg` limits the effect to the shape background. */
309
+ backgroundOnly?: boolean;
310
+ /**
311
+ * `p:spTgt/p:subSp/@_spid`: the id of a shape NESTED inside the group
312
+ * named by {@link shapeId} (CT_TLSubShapeId, ECMA-376 S19.5.71).
313
+ * PowerPoint authors this when a user animates one member of a group
314
+ * without ungrouping it: `shapeId` stays the outer group's id for
315
+ * round-trip, but this sub-shape is the real playback target.
316
+ */
317
+ subShapeId?: string;
318
+ /** `p:spTgt/p:graphicEl`: chart/diagram series/category/element target. */
319
+ graphicElement?: PptxAnimationGraphicElementTarget;
320
+ /** `p:spTgt/p:oleChartEl`: legacy OLE chart sub-element target. */
321
+ oleChartElement?: PptxAnimationOleChartElementTarget;
322
+ rawXml?: XmlObject;
323
+ } | {
324
+ type: 'slide';
325
+ rawXml?: XmlObject;
326
+ } | {
327
+ type: 'sound';
328
+ relationshipId: string;
329
+ name?: string;
330
+ rawXml?: XmlObject;
331
+ } | {
332
+ type: 'ink';
333
+ shapeId: string;
334
+ rawXml?: XmlObject;
335
+ } | {
336
+ type: 'unknown';
337
+ rawXml: XmlObject;
338
+ };
339
+ /** Nested build choice carried by `p:bldGraphic`. */
340
+ type PptxGraphicBuild = {
341
+ mode: 'asOne';
342
+ rawXml?: XmlObject;
343
+ } | {
344
+ mode: 'sub';
345
+ kind: 'diagram';
346
+ build: string;
347
+ reverse: boolean;
348
+ rawXml?: XmlObject;
349
+ } | {
350
+ mode: 'sub';
351
+ kind: 'chart';
352
+ build: string;
353
+ animateBackground: boolean;
354
+ rawXml?: XmlObject;
355
+ };
356
+ /**
357
+ * A single `p:tmpl` timing template parsed from a TEXT `p:bldP/p:tmplLst`
358
+ * (CT_TLTemplate, ECMA-376 §19.5.85; the list itself is CT_TLTemplateList,
359
+ * §19.5.84).
360
+ *
361
+ * PowerPoint writes these as the timing PowerPoint would apply to a build
362
+ * level that does not yet have an instantiated effect, so that promoting or
363
+ * demoting an outline paragraph, or adding a new bullet at a level with no
364
+ * prior animation, has a default to clone. They are not consulted at
365
+ * playback: the animation actually shown for every paragraph level already
366
+ * visible on the slide is the real, instantiated `p:tnLst` under
367
+ * `p:timing/p:tnLst`, which the rest of this parser already models in full.
368
+ *
369
+ * The nested time-node tree under each template's own `p:tnLst` is kept as
370
+ * a preserved `XmlObject` rather than deep-parsed into
371
+ * {@link PptxNativeAnimation} records: it is schema-identical to the
372
+ * top-level timing tree but scoped to a template that is never itself
373
+ * executed, so structurally modelling it would stand up a second, unused
374
+ * parallel animation model. Parsing stops at typed round-trip; see
375
+ * `docs/guide/limitations.md`.
376
+ */
377
+ interface PptxTimingTemplate {
378
+ /** Build level this template targets, from `p:tmpl/@lvl` (ST_TLLevel, default 0). */
379
+ level: number;
380
+ /** Preserved `p:tnLst` (CT_TimeNodeList) subtree, verbatim. */
381
+ timeNodeList: XmlObject;
382
+ /** Preserved `p:tmpl` XML node (its attributes plus any unmodelled children). */
383
+ rawXml?: XmlObject;
384
+ }
385
+ /**
386
+ * Parsed native animation record from `p:timing / p:tnLst`.
387
+ *
388
+ * Represents a single animation node in the OOXML timing tree,
389
+ * including motion paths, scale transforms, and text build settings.
390
+ *
391
+ * @example
392
+ * ```ts
393
+ * const anim: PptxNativeAnimation = {
394
+ * targetId: "shape_1",
395
+ * presetClass: "entr",
396
+ * presetId: 10,
397
+ * trigger: "afterPrevious",
398
+ * durationMs: 500,
399
+ * };
400
+ * // => { targetId: "shape_1", presetClass: "entr", presetId: 10, trigger: "afterPrevious", durationMs: 500 }
401
+ * ```
402
+ */
403
+ interface PptxNativeAnimation {
404
+ /** Target element/shape ID. */
405
+ targetId?: string;
406
+ /** Full timing target, including sound and ink target variants. */
407
+ target?: PptxAnimationTarget;
408
+ /** Trigger type. */
409
+ trigger?: PptxAnimationTrigger;
410
+ /**
411
+ * Shape ID that triggers this animation: the clicked shape of an
412
+ * interactive sequence, or the media element of an `onMediaBookmark` one.
413
+ */
414
+ triggerShapeId?: string;
415
+ /** Bookmark name an `onMediaBookmark` interactive sequence waits for. */
416
+ triggerBookmark?: string;
417
+ /** Whether this effect belongs to an OOXML `interactiveSeq`. */
418
+ interactiveSequence?: boolean;
419
+ /** Whether `p:endSync/p:rtn[@val="all"]` makes that sequence replayable. */
420
+ interactiveRestart?: boolean;
421
+ /** Effect preset class (entr, exit, emph, path). */
422
+ presetClass?: 'entr' | 'exit' | 'emph' | 'path';
423
+ /** Effect preset sub-type identifier. */
424
+ presetId?: number;
425
+ /**
426
+ * Effect preset direction/variant code from `p:cTn/@presetSubtype`
427
+ * (ECMA-376 CT_TLCommonTimeNodeData). For Fly In/Out this encodes the
428
+ * edge/corner the object travels from as a bitmask (1=top, 2=right,
429
+ * 4=bottom, 8=left; corners combine bits). Absent means the preset default.
430
+ */
431
+ presetSubtype?: number;
432
+ /** Duration in milliseconds. */
433
+ durationMs?: number;
434
+ /** Delay in milliseconds. */
435
+ delayMs?: number;
436
+ /**
437
+ * Acceleration fraction in the range 0..1, parsed from `p:cTn/@accel`
438
+ * (ST_PositiveFixedPercentage, stored as 1000ths of a percent). A non-zero
439
+ * value means the effect eases in (starts slow). Absent means no easing-in.
440
+ */
441
+ accel?: number;
442
+ /**
443
+ * Deceleration fraction in the range 0..1, parsed from `p:cTn/@decel`.
444
+ * A non-zero value means the effect eases out (ends slow). Absent means no
445
+ * easing-out. When both {@link accel} and {@link decel} are set, the effect
446
+ * eases in and out.
447
+ */
448
+ decel?: number;
449
+ /** Trigger delay in milliseconds (for afterDelay). */
450
+ triggerDelayMs?: number;
451
+ /** SVG path string for motion path animations (`p:animMotion/@path`). */
452
+ motionPath?: string;
453
+ /** Motion origin: "layout" or "parent". */
454
+ motionOrigin?: string;
455
+ /**
456
+ * Whether the element auto-rotates to follow the motion path tangent.
457
+ * Viewer-authoring-only hint: OOXML has no such flag (`p:animMotion/@rAng`
458
+ * is a plain rotation angle that PowerPoint writes as "0" on every path),
459
+ * so the parser never sets this.
460
+ */
461
+ motionPathRotateAuto?: boolean;
462
+ /** Path edit mode from `p:animMotion/@pathEditMode` (e.g. "relative", "fixed"). */
463
+ motionPathEditMode?: string;
464
+ /** Comma-separated point-types string from `p:animMotion/@ptsTypes`. */
465
+ motionPtsTypes?: string;
466
+ /** Authored path rotation in degrees from `p:animMotion/@rAng`. */
467
+ motionPathRotationAngle?: number;
468
+ /** Motion-path rotation centre X in slide percentage units (`p:rCtr/@x`). */
469
+ motionPathRotationCenterX?: number;
470
+ /** Motion-path rotation centre Y in slide percentage units (`p:rCtr/@y`). */
471
+ motionPathRotationCenterY?: number;
472
+ /** Rotation angle in degrees for `p:animRot/@by` (converted from 60000ths). */
473
+ rotationBy?: number;
474
+ /** Starting rotation angle in degrees for `p:animRot/@from` (converted from 60000ths). */
475
+ rotationFrom?: number;
476
+ /** Ending rotation angle in degrees for `p:animRot/@to` (converted from 60000ths). */
477
+ rotationTo?: number;
478
+ /** X scale factor (percentage / 100) for `p:animScale/p:by/@x`. */
479
+ scaleByX?: number;
480
+ /** Y scale factor (percentage / 100) for `p:animScale/p:by/@y`. */
481
+ scaleByY?: number;
482
+ /** Starting X scale factor for `p:animScale/p:from/@x`. */
483
+ scaleFromX?: number;
484
+ /** Starting Y scale factor for `p:animScale/p:from/@y`. */
485
+ scaleFromY?: number;
486
+ /** Ending X scale factor for `p:animScale/p:to/@x`. */
487
+ scaleToX?: number;
488
+ /** Ending Y scale factor for `p:animScale/p:to/@y`. */
489
+ scaleToY?: number;
490
+ /** Whether `p:animScale/@zoomContents` was set ("1"/"true"). */
491
+ scaleZoomContents?: boolean;
492
+ /** Parsed `p:tav` keyframes from `p:tavLst` (CT_TLAnimVariantList). */
493
+ keyframes?: PptxAnimationKeyframe[];
494
+ /**
495
+ * The attribute {@link keyframes} drives, from the SAME node's
496
+ * `p:cBhvr/p:attrNameLst/p:attrName` (ECMA-376 S19.5.4). `p:tavLst` is
497
+ * schema-generic: without this, playback could see a numeric ramp but not
498
+ * know whether it targeted opacity, position, colour, or something with
499
+ * no CSS mapping. Lowercased and trimmed; common values seen in the wild
500
+ * (and written by this codebase's own animation writer) include
501
+ * `"style.opacity"`, `"style.color"`, `"style.visibility"`, `"fillcolor"`,
502
+ * `"stroke.color"`, `"r"` (rotation, only meaningful on `p:animRot`), and
503
+ * `"ppt_x"` / `"ppt_y"` (position, normally driven via `p:animMotion`
504
+ * instead). Absent when the behaviour carries no `p:attrNameLst`.
505
+ */
506
+ attrName?: string;
507
+ /** Every generic `p:anim` sibling composed by the authored effect. */
508
+ attributeAnimations?: PptxAttributeAnimation[];
509
+ /** Repeat count (e.g. `2`, `Infinity` for indefinite). */
510
+ repeatCount?: number;
511
+ /** Whether the animation plays in reverse after completion. */
512
+ autoReverse?: boolean;
513
+ /** Text build type from `p:bldP/@build` in `p:bldLst`. */
514
+ buildType?: PptxTextBuildType;
515
+ /** Build level for multi-level lists from `p:bldP/@bldLvl`. */
516
+ buildLevel?: number;
517
+ /** Group ID linking a `p:bldP` entry to its timing animation node. */
518
+ groupId?: string;
519
+ /**
520
+ * Sound relationship ID to play when animation triggers. Modern PowerPoint
521
+ * (COM-verified against 2016) writes this as a `p:audio/p:cMediaNode`
522
+ * sibling of the effect's own `p:childTnLst`, targeting `p:sndTgt` rather
523
+ * than a shape; the legacy `p:stSnd` form (directly on `p:cTn`) is still
524
+ * accepted on load for round-trip of older-authored decks, but PowerPoint
525
+ * itself no longer writes it and does not recognise it back
526
+ * (`Effect.EffectInformation.SoundEffect` reads empty against it).
527
+ */
528
+ soundRId?: string;
529
+ /** Resolved sound file path from relationship. */
530
+ soundPath?: string;
531
+ /**
532
+ * The embedded sound's `@_name` (from `p:snd`/`p:sndTgt`). For one of
533
+ * PowerPoint's 19 built-in stock sounds this is the exact upper-case file
534
+ * name PowerPoint itself writes (e.g. `"CHIMES.WAV"`); see
535
+ * `pptx-viewer-shared`'s `effect-sound-catalogue.ts`, which matches this
536
+ * value back to a gallery entry. Absent for a custom sound with no name,
537
+ * or when unresolved.
538
+ */
539
+ soundName?: string;
540
+ /** Whether to stop any currently playing sound (`p:endSnd`). */
541
+ stopSound?: boolean;
542
+ /**
543
+ * End-state behaviour from `p:cTn/@fill` (ST_TLTimeNodeFillType, ECMA-376
544
+ * §19.5.27). `hold`/`freeze` mean the effect's final frame persists after
545
+ * it finishes; `remove` (the default when absent) means the target reverts
546
+ * to its pre-effect appearance. `transition` behaves like `hold` until the
547
+ * next time node starts. Absent means the OOXML default (`remove`).
548
+ */
549
+ fill?: 'remove' | 'freeze' | 'hold' | 'transition';
550
+ /**
551
+ * Restart behaviour from `p:cTn/@restart` (ST_TLTimeNodeRestartType).
552
+ * Absent means the OOXML default (`always`).
553
+ */
554
+ restart?: 'always' | 'whenNotActive' | 'never';
555
+ /**
556
+ * Repeat duration in milliseconds from `p:cTn/@repeatDur`. `Infinity`
557
+ * represents the literal `"indefinite"` token.
558
+ */
559
+ repeatDurMs?: number;
560
+ /**
561
+ * Playback speed multiplier from `p:cTn/@spd` (ST_Percentage, normalized
562
+ * from OOXML's 1000ths-of-a-percent storage to a plain percentage, e.g.
563
+ * `150` for 150% / double speed). Absent means normal (100%) speed.
564
+ */
565
+ speedPct?: number;
566
+ /**
567
+ * Reverse the paragraph build order from `p:bldP/@rev` (TEXT build only).
568
+ * Not to be confused with {@link PptxGraphicBuild}'s `reverse` field, which
569
+ * carries the unrelated `p:bldDgm`/`@rev` DIAGRAM-build reverse flag.
570
+ */
571
+ buildReverse?: boolean;
572
+ /**
573
+ * Auto-advance time in milliseconds from `p:bldP/@advAuto`. `Infinity`
574
+ * represents the literal `"indefinite"` token. Absent means the build
575
+ * step waits for a click.
576
+ */
577
+ buildAdvAutoMs?: number;
578
+ /**
579
+ * Per-build-level timing templates from a TEXT `p:bldP/p:tmplLst`
580
+ * (ECMA-376 §19.5.84 CT_TLTemplateList). Parsed for round-trip only; see
581
+ * {@link PptxTimingTemplate} for why they are not consulted at playback.
582
+ */
583
+ buildTemplates?: PptxTimingTemplate[];
584
+ /**
585
+ * Whether the enclosing `p:seq` allows concurrent play with its siblings,
586
+ * from `p:seq/@concurrent`. Parsed for round-trip; not yet honoured by
587
+ * playback (see `docs/guide/limitations.md`).
588
+ */
589
+ seqConcurrent?: boolean;
590
+ /** Next-action behaviour from `p:seq/@nextAc` (ST_TLNextActionType). */
591
+ seqNextAction?: 'none' | 'seek';
592
+ /** Previous-action behaviour from `p:seq/@prevAc` (ST_TLPreviousActionType). */
593
+ seqPrevAction?: 'none' | 'skipTimeNode';
594
+ /**
595
+ * Whether the enclosing click-level group (a direct `p:par` child of the
596
+ * `mainSeq`) begins automatically when the slide appears, rather than waiting
597
+ * for a click.
598
+ *
599
+ * PowerPoint gates a click step with a lone `<p:cond delay="indefinite"/>`;
600
+ * a group that also carries a time-node condition (`onBegin`/`onEnd` with a
601
+ * `@tn`) or a finite delay starts on slide entry ("With/After Previous" as the
602
+ * first effect on the slide). The flat animation list cannot express that on
603
+ * its own, so the parse layer stamps it here.
604
+ */
605
+ groupAutoStart?: boolean;
606
+ /**
607
+ * Index of the enclosing effect-wrapper `p:par` inside the click-level group.
608
+ *
609
+ * Effects that share a wrapper are OOXML siblings: they all start when that
610
+ * wrapper starts, and each `p:cond/@delay` is measured from the wrapper's
611
+ * start, NOT chained off the effect before it. Playback uses this to place
612
+ * simultaneous effects at their true offsets instead of accumulating delays.
613
+ */
614
+ parGroupIndex?: number;
615
+ /**
616
+ * Absolute start offset of the enclosing effect-wrapper from its click group.
617
+ *
618
+ * Structural `p:par` wrappers can carry their own start conditions. Keeping
619
+ * this offset separate from the effect's delay prevents playback from
620
+ * replacing an authored absolute start with a duration-based approximation.
621
+ */
622
+ parGroupDelayMs?: number;
623
+ /** Structured start conditions parsed from `p:stCondLst`. */
624
+ startConditions?: AnimationCondition[];
625
+ /** Structured end conditions parsed from `p:endCondLst`. */
626
+ endConditions?: AnimationCondition[];
627
+ /** Preserved raw `p:endCondLst` XML node for lossless round-trip. */
628
+ rawEndCondLst?: XmlObject;
629
+ /** Color animation data from `p:animClr`. */
630
+ colorAnimation?: PptxColorAnimation;
631
+ /** Text-level target: character range or paragraph range from `p:txEl`. */
632
+ textTarget?: PptxTextAnimationTarget;
633
+ /** Whether this animation is inside an exclusive container (`p:excl`). */
634
+ exclusive?: boolean;
635
+ /**
636
+ * Identifies which `p:excl` container this animation belongs to, when
637
+ * {@link exclusive} is set. ECMA-376 S19.5.24 CT_TLExclusiveTimeNode: at
638
+ * most one direct child of an exclusive container may be active at a
639
+ * time, so starting one child stops any other currently-playing child of
640
+ * the SAME container. Two different `p:excl` containers on the same slide
641
+ * are independent groups; this id (assigned per container encountered
642
+ * during parsing, stable only within one parse's animation list) lets
643
+ * playback tell them apart. Absent when {@link exclusive} is unset.
644
+ */
645
+ exclGroupId?: number;
646
+ /** Command type from `p:cmd` (@_type: call/evt/verb). */
647
+ commandType?: string;
648
+ /** Command string from `p:cmd` (@_cmd). */
649
+ commandString?: string;
650
+ /** Iteration configuration from `p:iterate`. */
651
+ iterate?: PptxAnimationIterate;
652
+ /**
653
+ * Discriminator for non-preset animation kinds. When `undefined`, the
654
+ * entry represents the default shape-effect animation. The `'media'`
655
+ * kind represents a `p:audio` / `p:video` timing node, captured here so
656
+ * playback order in the timeline is preserved alongside other animations.
657
+ */
658
+ kind?: PptxNativeAnimationKind;
659
+ /**
660
+ * For `kind === 'media'`, identifies whether this is an audio or video
661
+ * media node so writers know which OOXML element to re-emit.
662
+ */
663
+ mediaType?: 'audio' | 'video';
664
+ /**
665
+ * SmartArt build attribute (`p:bldDgm/@bld`) when this animation is
666
+ * associated with a SmartArt diagram build. Common values include
667
+ * `whole`, `one`, `lvlOne`, `lvlAtOnce`.
668
+ */
669
+ smartArtBuild?: string;
670
+ /**
671
+ * Graphic-frame build attribute (`p:bldGraphic/@bld`) when this animation
672
+ * is associated with a generic graphic frame build (charts, tables, etc.
673
+ * that aren't OLE charts).
674
+ */
675
+ graphicBuild?: string;
676
+ /**
677
+ * OLE-embedded chart build attribute (`p:bldOleChart/@bld`) when this
678
+ * animation stages an OLE chart graphic frame. Values follow
679
+ * ST_TLOleChartBuildType: `allAtOnce`, `series`, `category`, `seriesEl`,
680
+ * `categoryEl`. Lets a staged-reveal renderer build the chart by series /
681
+ * category / element to match PowerPoint, rather than as one whole element.
682
+ */
683
+ oleChartBuild?: string;
684
+ /** Schema-accurate `p:bldGraphic/p:bldAsOne|p:bldSub` representation. */
685
+ graphicBuildProperties?: PptxGraphicBuild;
686
+ /**
687
+ * Opaque map of `p:cTn` attributes that don't have a typed home on this
688
+ * interface but must round-trip through parse → save. Keys are stored
689
+ * verbatim including the `@_` prefix used by the underlying XML parser
690
+ * (e.g. `@_evtFilter`, `@_display`, `@_masterRel`, `@_nodePh`,
691
+ * `@_endSync`, `@_progress`). The `subTnLst` child element is also
692
+ * preserved here under the literal key `p:subTnLst`. The `afterEffect`
693
+ * attribute is surfaced separately as a typed boolean ({@link afterEffect})
694
+ * because it changes write semantics for subsequent timing nodes.
695
+ */
696
+ cTnAttributes?: Record<string, unknown>;
697
+ /** Parent timing cannot be reduced to the bounded fixed-opacity interval. */
698
+ unsupportedOpacitySetTiming?: boolean;
699
+ /** Admitted isolated held whole-shape visibility flip from native preset zero. */
700
+ visibilitySetTiming?: PptxVisibilitySetTiming;
701
+ /** A retained preset-zero visibility body has an unmeasured target, value or clock. */
702
+ unsupportedVisibilitySet?: boolean;
703
+ /**
704
+ * Whether the OOXML `p:cTn/@afterEffect` flag is set. Indicates this node
705
+ * runs after the parent effect's main body has completed; affects how
706
+ * subsequent peer nodes are sequenced when serialised back to OOXML.
707
+ */
708
+ afterEffect?: boolean;
709
+ /**
710
+ * "After animation" end-state behaviour: dim-to-colour, hide-after-
711
+ * animation, or hide-on-next-click. Populated directly by the
712
+ * native-timing parser (`native-animation-after-effect.ts`) when the
713
+ * effect's `p:cTn/p:subTnLst` carries PowerPoint's genuine after-effect
714
+ * shape, so a real-world deck's build shows up here even with no
715
+ * `pptx:editorMeta`. `applyAfterAnimationFromEditorList` in
716
+ * `pptx-viewer-shared` overrides this from the matching
717
+ * {@link PptxElementAnimation.afterAnimation} entry when the editor's
718
+ * per-element animation list has one (the model the animation panel
719
+ * writes `afterAnimation` into), so an edit through our own UI always wins.
720
+ */
721
+ afterAnimationAction?: PptxAfterAnimationAction;
722
+ /** Dim-to color hex, present when {@link afterAnimationAction} is `dimToColor` AND the dim target is an already-resolved `a:srgbClr`. */
723
+ afterAnimationColor?: string;
724
+ /**
725
+ * The typed theme reference when a `dimToColor` target is an `a:schemeClr`
726
+ * (e.g. `accent2`) instead of `a:srgbClr`: this parse layer has no theme to
727
+ * resolve it to sRGB with (see {@link afterAnimationColor}'s doc), so a
728
+ * playback consumer resolves this against the deck's theme colour map.
729
+ * Mutually exclusive with {@link afterAnimationColor} being set.
730
+ */
731
+ afterAnimationColorRef?: PptxThemeColorRef;
732
+ /**
733
+ * Parsed `p:animEffect` filter descriptor. `presetId`/`presetClass` remain
734
+ * the primary effect selector (see `resolveEffect` in `pptx-viewer-shared`);
735
+ * this is the fallback used when a preset table lookup misses (unmapped or
736
+ * absent `presetId`), which happens for decks authored by tools other than
737
+ * PowerPoint that only emit the SMIL-style filter string.
738
+ */
739
+ effectFilter?: PptxAnimationEffectFilter;
740
+ /**
741
+ * This effect's own `p:cTn/@_id` (a raw OOXML time-node id, not a shape
742
+ * id). Lets playback resolve a `p:cond/@tn` dependency (see
743
+ * {@link AnimationCondition.targetTimeNodeId}) against the SPECIFIC node
744
+ * it names rather than assuming it is always the positionally-previous
745
+ * effect. Absent when the node carried no `@_id`.
746
+ */
747
+ nodeId?: number;
748
+ /**
749
+ * Interpolation mode for this effect's PRIMARY `p:anim`-family behaviour
750
+ * (the same node {@link keyframes}/{@link attrName} were read from), from
751
+ * `@_calcmode` (ST_TLAnimateBehaviorCalcMode, ECMA-376 S19.5.2). See
752
+ * {@link PptxAttributeAnimation.calcMode} for the per-component version.
753
+ */
754
+ calcMode?: 'discrete' | 'lin' | 'fmla';
755
+ /**
756
+ * `p:cBhvr/@_additive` (ST_TLBehaviorAdditiveType, ECMA-376 S19.5.4):
757
+ * controls how this behaviour's value composites with sibling behaviours
758
+ * driving the same attribute on the same target. `sum` accumulates
759
+ * (e.g. a combined scale+rotate), `repl`/`base`/`none`/`mult` replace or
760
+ * otherwise combine. Absent means the OOXML default (`base`).
761
+ */
762
+ cBhvrAdditive?: 'base' | 'sum' | 'repl' | 'mult' | 'none';
763
+ /**
764
+ * `p:cBhvr/@_accumulate` (ST_TLBehaviorAccumulateType): `always` means
765
+ * each `p:cTn/@repeatCount` repeat starts from the PREVIOUS repeat's end
766
+ * value (e.g. a 3x Spin totals 1080deg instead of replaying 0-360 three
767
+ * times); `none` (the OOXML default) resets every repeat.
768
+ */
769
+ cBhvrAccumulate?: 'none' | 'always';
770
+ /**
771
+ * `p:cBhvr/@_xfrmType` (only meaningful on `p:animMotion`): `point`
772
+ * (default) or `img`, a legacy compatibility hint. Round-tripped only.
773
+ */
774
+ cBhvrXfrmType?: 'point' | 'img';
775
+ /**
776
+ * `p:cBhvr/@_override` (ST_TLBehaviorOverrideType): `normal` (default) or
777
+ * `childStyle`, a legacy compatibility hint. Round-tripped only.
778
+ */
779
+ cBhvrOverride?: 'normal' | 'childStyle';
780
+ /**
781
+ * `p:set` discrete attribute assignments composed alongside this effect
782
+ * (ECMA-376 S19.5.79 CT_TLSetBehavior): an instantaneous (non-interpolated)
783
+ * value change, as opposed to {@link attributeAnimations}'s `p:anim`
784
+ * keyframe ramps. PowerPoint authors several font-style emphasis effects
785
+ * this way (Bold Reveal, Underline, Bold Flash, Change Font Size), since
786
+ * "on/off" or "size N" has nothing to interpolate. Not yet consulted by
787
+ * shared playback (round-trip/typed-model only so far).
788
+ */
789
+ setAnimations?: PptxSetAnimation[];
790
+ /**
791
+ * Every behaviour child of this effect (`p:set`, `p:anim`, `p:animEffect`,
792
+ * `p:animScale`, `p:animRot`, `p:animMotion`) with its own timing, as
793
+ * authored. The single-valued fields above flatten a composed preset;
794
+ * this keeps the whole tree so playback can follow what PowerPoint wrote
795
+ * (see `animation-behavior-player` in `pptx-viewer-shared`).
796
+ */
797
+ behaviors?: PptxAnimationBehavior[];
798
+ }
799
+ /**
800
+ * One `p:set` discrete (non-interpolated) attribute assignment composed
801
+ * alongside an authored effect. See {@link PptxNativeAnimation.setAnimations}.
802
+ *
803
+ * @see ECMA-376 S19.5.79 CT_TLSetBehavior
804
+ */
805
+ interface PptxSetAnimation {
806
+ /** Lowercased target attribute from `p:cBhvr/p:attrNameLst/p:attrName`. */
807
+ attrName: string;
808
+ /** Decoded value from `p:to` (same variant shape as a `p:tav/p:val`). */
809
+ value: string | boolean | number;
810
+ /** Discriminant indicating which `p:to` child carried the value. */
811
+ valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
812
+ /** Duration from this behaviour's nested `p:cTn/@dur`. */
813
+ durationMs?: number;
814
+ /** Start offset from this behaviour's nested `p:stCondLst`. */
815
+ delayMs?: number;
816
+ }
817
+ /**
818
+ * Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
819
+ * describes `@filter` as a free-form string of the form `family(subtype)`,
820
+ * optionally followed by `;`-separated fallback candidates (only the first
821
+ * is honoured, per ECMA-376 S19.5.3's "first supported filter wins" rule).
822
+ *
823
+ * @example
824
+ * ```ts
825
+ * const f: PptxAnimationEffectFilter = { family: 'wipe', subtype: 'up', transition: 'in', raw: 'wipe(up)' };
826
+ * ```
827
+ */
828
+ interface PptxAnimationEffectFilter {
829
+ /** Filter family name (e.g. `"wipe"`, `"barn"`, `"checkerboard"`), lowercased. */
830
+ family: string;
831
+ /**
832
+ * Parenthesised subtype/direction token verbatim (e.g. `"up"`,
833
+ * `"inVertical"`, `"across"`, `"4"`). Absent when the filter has no
834
+ * subtype (e.g. bare `"dissolve"`).
835
+ */
836
+ subtype?: string;
837
+ /**
838
+ * `p:animEffect/@transition`: `"in"` reveals the target (the OOXML
839
+ * default when the attribute is omitted), `"out"` conceals it, `"none"`
840
+ * applies the filter without a visibility change (a static filter pass).
841
+ */
842
+ transition?: 'in' | 'out' | 'none';
843
+ /** Raw filter string exactly as authored, for round-trip/debugging. */
844
+ raw: string;
845
+ }
846
+ /**
847
+ * Single keyframe parsed from a `p:tav` element (CT_TLTimeAnimateValue).
848
+ *
849
+ * Each entry in a `p:tavLst` has a time fraction (`@_tm`, in 1000ths of the
850
+ * total duration; or the literal "indefinite" / "large") and a typed value
851
+ * child under `p:val/p:strVal|p:boolVal|p:intVal|p:fltVal|p:clrVal`.
852
+ *
853
+ * @see ECMA-376 §19.5.30 CT_TLAnimVariantList / §19.5.92 CT_TLTimeAnimateValue
854
+ */
855
+ interface PptxAnimationKeyframe {
856
+ /**
857
+ * Time fraction. A finite number is the OOXML `@_tm` integer (0–100000
858
+ * for percentage, where 100000 = 100% of duration). A string preserves
859
+ * special tokens ("indefinite", "large").
860
+ */
861
+ tm: number | string;
862
+ /** Decoded keyframe value. */
863
+ value: string | boolean | number;
864
+ /** Discriminant indicating which `p:val` child carried the value. */
865
+ valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
866
+ /**
867
+ * Optional formula carried on `p:tav/@_fmla`. Preserved for round-trip
868
+ * fidelity; consumers may use it to drive computed animation values.
869
+ */
870
+ fmla?: string;
871
+ /**
872
+ * The typed theme reference when a `p:val/p:clrVal` stop is an
873
+ * `a:schemeClr` (e.g. `accent1`), including any `tint`/`shade`/`lumMod`/
874
+ * `lumOff`/`alpha` children. {@link value} keeps the bare scheme name for
875
+ * round-trip; a playback consumer needs this ref (resolved against the
876
+ * deck's theme colour map) to turn the stop into a real CSS colour, which
877
+ * the bare name alone cannot do. Absent for an `a:srgbClr` stop, whose
878
+ * {@link value} is already a resolved `#rrggbb` hex string.
879
+ */
880
+ colorRef?: PptxThemeColorRef;
881
+ }
882
+ /** One generic `p:anim` behaviour inside a composed PowerPoint effect. */
883
+ interface PptxAttributeAnimation {
884
+ /** Lowercased target attribute from `p:attrNameLst`. */
885
+ attrName: string;
886
+ /**
887
+ * Authored value stops from this behaviour's `p:tavLst`. Empty when the
888
+ * behaviour instead uses the simpler `from`/`to`/`by` attribute form (see
889
+ * below); at least one of `keyframes`, `from`/`to`, or `by` is present.
890
+ */
891
+ keyframes: PptxAnimationKeyframe[];
892
+ /**
893
+ * `p:anim/@_from` (a formula string, ECMA-376 S19.5.4 CT_TLAnimateBehavior):
894
+ * the absolute starting value, used instead of `p:tavLst` when the
895
+ * behaviour only has two endpoints. PowerPoint writes this form for some
896
+ * built-in presets (e.g. "Grow And Turn"'s `ppt_x` fly-in): a bare
897
+ * `p:anim from="..." to="..."` with no `p:tavLst` child at all. See
898
+ * `animation-ppt-formula-ground-truth.md` in `pptx-viewer-shared` for the
899
+ * real-PowerPoint sample this was found in.
900
+ */
901
+ from?: string;
902
+ /** `p:anim/@_to`: the absolute ending value. See {@link from}. */
903
+ to?: string;
904
+ /**
905
+ * `p:anim/@_by`: a DELTA formula added to wherever the attribute already
906
+ * stands (as opposed to `from`/`to`'s absolute values), typically paired
907
+ * with `p:cBhvr/@_additive="sum"` so it composites with a sibling
908
+ * behaviour driving the same attribute instead of replacing it.
909
+ */
910
+ by?: string;
911
+ /** Duration from this behaviour's nested `p:cTn/@dur`. */
912
+ durationMs?: number;
913
+ /** Start offset from this behaviour's nested `p:stCondLst`. */
914
+ delayMs?: number;
915
+ /**
916
+ * Interpolation mode from this behaviour's own `@_calcmode`
917
+ * (ST_TLAnimateBehaviorCalcMode, ECMA-376 S19.5.2): `discrete` snaps to
918
+ * each `p:tav` stop with no interpolation, `lin` (the OOXML default)
919
+ * interpolates linearly. `fmla` as the WHOLE behaviour's calc mode has
920
+ * never been observed in a real PowerPoint file and is not consulted at
921
+ * playback; what PowerPoint actually writes is `calcmode="lin"` with a
922
+ * per-stop `p:tav/@fmla` (see {@link PptxAnimationKeyframe.fmla}), which
923
+ * IS consulted regardless of this field's value. Absent means `lin`.
924
+ */
925
+ calcMode?: 'discrete' | 'lin' | 'fmla';
926
+ /**
927
+ * `p:anim/@_p14:bounceEnd` (Office 2010 `p14` extension attribute,
928
+ * MS-OI29500), normalized to a 0-1 fraction of this behaviour's own
929
+ * duration. PowerPoint's "Bounce End" effect option (COM:
930
+ * `Effect.Timing.BounceEnd` + `BounceEndIntensity`) writes this on the
931
+ * position-ramp `p:anim` node(s): the share of the duration spent
932
+ * BOUNCING at the end. Measured from PowerPoint's own CreateVideo frames,
933
+ * the travel completes at `1 - bounceEnd` and the rest is a damped
934
+ * oscillation about the final value (see shared's `animation-bounce-end`).
935
+ * Mirrored verbatim by PowerPoint onto the enclosing
936
+ * `p:cTn/@_p14:presetBounceEnd`. Absent for every animation that doesn't
937
+ * use this effect option (the overwhelming majority).
938
+ */
939
+ bounceEnd?: number;
940
+ }
941
+ /** Signed HSL channel deltas parsed from `p:animClr/p:by/p:hsl`. */
942
+ interface PptxHslColorDelta {
943
+ /** Hue offset in degrees. OOXML stores this in 60000ths of a degree. */
944
+ hue: number;
945
+ /** Saturation offset in percentage points. */
946
+ saturation: number;
947
+ /** Lightness offset in percentage points. */
948
+ lightness: number;
949
+ }
950
+ /** Color animation data parsed from `p:animClr`. */
951
+ interface PptxColorAnimation {
952
+ /** Color interpolation space: "hsl" or "rgb". */
953
+ colorSpace: 'hsl' | 'rgb';
954
+ /** Direction for HSL interpolation: "cw" (clockwise) or "ccw". */
955
+ direction?: 'cw' | 'ccw';
956
+ /**
957
+ * Optional `p:animClr/@path` value preserved for round-trip. When set,
958
+ * the colour sweep follows a path-based interpolation rather than the
959
+ * straight cw/ccw arc. ECMA-376 §19.5.13 documents this attribute as a
960
+ * companion to `@dir` for HSL colour-space animations.
961
+ */
962
+ path?: string;
963
+ /** Starting color as hex string, or the bare scheme name (e.g. `accent1`) for a theme colour; see {@link fromColorRef}. */
964
+ fromColor?: string;
965
+ /** Ending color as hex string, or the bare scheme name; see {@link toColorRef}. */
966
+ toColor?: string;
967
+ /**
968
+ * Color delta (for "by" animations) as hex string, or the bare scheme name;
969
+ * see {@link byColorRef}. For HSL colour-space animations this retains the
970
+ * historical byte-packed compatibility value; consumers should prefer
971
+ * {@link hslDelta}, which preserves signed values.
972
+ */
973
+ byColor?: string;
974
+ /**
975
+ * The typed theme reference when {@link fromColor} is an `a:schemeClr`
976
+ * (including `tint`/`shade`/`lumMod`/`lumOff`/`alpha`), so playback can
977
+ * resolve it against the deck's theme colour map. Absent when `fromColor`
978
+ * is already a resolved `#rrggbb` hex (an `a:srgbClr` stop).
979
+ */
980
+ fromColorRef?: PptxThemeColorRef;
981
+ /** The typed theme reference for {@link toColor}; see {@link fromColorRef}. */
982
+ toColorRef?: PptxThemeColorRef;
983
+ /**
984
+ * The typed theme reference for {@link byColor} (RGB colour space only; an
985
+ * HSL `by` is a signed delta, never a theme colour). See {@link fromColorRef}.
986
+ */
987
+ byColorRef?: PptxThemeColorRef;
988
+ /**
989
+ * Typed HSL delta from `p:by/p:hsl`. This preserves signed values and their
990
+ * OOXML units without forcing them through the legacy byte-packed `byColor`
991
+ * representation.
992
+ */
993
+ hslDelta?: PptxHslColorDelta;
994
+ /**
995
+ * Target attribute from `p:attrNameLst` (e.g. "fillcolor", "style.color",
996
+ * "stroke.color"). Used to determine which CSS property to animate.
997
+ */
998
+ targetAttribute?: string;
999
+ /**
1000
+ * All sibling `p:animClr` behaviours authored for the same timing node.
1001
+ * The top-level fields continue to mirror the first behaviour for backwards
1002
+ * compatibility; this list is present only when there is more than one.
1003
+ */
1004
+ components?: readonly PptxColorAnimation[];
1005
+ }
1006
+ /** Text-level animation target from `p:txEl`. */
1007
+ interface PptxTextAnimationTarget {
1008
+ /** Target type: character range or paragraph range. */
1009
+ type: 'charRg' | 'pRg';
1010
+ /** Start index (0-based). */
1011
+ start: number;
1012
+ /** End index (exclusive). */
1013
+ end: number;
1014
+ }
1015
+ /**
1016
+ * Event types for animation conditions from `p:cond/@evt`.
1017
+ *
1018
+ * These map directly to OOXML condition event attribute values
1019
+ * (ISO/IEC 29500-1 S19.5.28 CT_TLTimeCondition).
1020
+ */
1021
+ type AnimationConditionEvent = 'onBegin' | 'onEnd' | 'begin' | 'end' | 'onClick' | 'onMouseOver' | 'onMouseOut' | 'onNext' | 'onPrev' | 'onStopAudio' | 'onDblClick' | 'onMediaBookmark';
1022
+ /**
1023
+ * `p14:bmkTgt` (Office 2010 `p14` extension, MS-OI29500): names the specific
1024
+ * media element and bookmark an `evt="onMediaBookmark"` condition fires for.
1025
+ * `bookmarkName` matches a `p14:bmk/@_name` on that media element's own
1026
+ * `p14:bmkLst` (see `MediaBookmark.label` in `core/types/elements.ts`).
1027
+ */
1028
+ interface PptxMediaBookmarkTarget {
1029
+ /** `p14:bmkTgt/@_spid`: the media element's shape id. */
1030
+ shapeId: string;
1031
+ /** `p14:bmkTgt/@_bmkName`: the bookmark's name. */
1032
+ bookmarkName: string;
1033
+ }
1034
+ /**
1035
+ * Structured representation of a single OOXML animation condition
1036
+ * from `p:cond` elements inside `p:stCondLst` or `p:endCondLst`.
1037
+ *
1038
+ * Conditions control when an animation starts or ends, and can reference
1039
+ * events, time delays, and target time node IDs.
1040
+ *
1041
+ * @example
1042
+ * ```ts
1043
+ * const cond: AnimationCondition = {
1044
+ * event: "onClick",
1045
+ * delay: 0,
1046
+ * targetShapeId: "shape_5",
1047
+ * };
1048
+ * ```
1049
+ */
1050
+ interface AnimationCondition {
1051
+ /** Event that triggers the condition. */
1052
+ event?: AnimationConditionEvent;
1053
+ /**
1054
+ * The media element/bookmark this condition fires for, when
1055
+ * {@link event} is `onMediaBookmark`. See {@link PptxMediaBookmarkTarget}.
1056
+ */
1057
+ bookmarkTarget?: PptxMediaBookmarkTarget;
1058
+ /** Delay in milliseconds (from `@_delay`). "indefinite" is represented as -1. */
1059
+ delay?: number;
1060
+ /** Target time node ID reference (from `@_tn`). */
1061
+ targetTimeNodeId?: number;
1062
+ /** Target shape ID from `p:tgtEl/p:spTgt/@spid`. */
1063
+ targetShapeId?: string;
1064
+ /** Whether the condition targets a slide (from `p:tgtEl/p:sldTgt`). */
1065
+ targetSlide?: boolean;
1066
+ /** Full target choice, including `p:sndTgt` and `p:inkTgt`. */
1067
+ target?: PptxAnimationTarget;
1068
+ }
1069
+ /** Iteration configuration from `p:iterate`. */
1070
+ interface PptxAnimationIterate {
1071
+ /** Iteration type: el (element), lt (letter), wd (word). */
1072
+ type: 'el' | 'lt' | 'wd';
1073
+ /** Whether to iterate backwards. */
1074
+ backwards?: boolean;
1075
+ /** Timing interval (percentage of total duration, in 1000ths). */
1076
+ tmPct?: number;
1077
+ /** Absolute timing interval in ms. */
1078
+ tmAbs?: number;
1079
+ }
1080
+ /** Build type for text build (paragraph/word/letter) animations from `p:bldP/@build`. */
1081
+ type PptxTextBuildType = 'allAtOnce' | 'byParagraph' | 'byWord' | 'byChar';
1082
+ /** Direction for fly-in / fly-out / wipe effects. */
1083
+ type PptxAnimationDirection = 'fromLeft' | 'fromRight' | 'fromTop' | 'fromBottom' | 'fromTopLeft' | 'fromTopRight' | 'fromBottomLeft' | 'fromBottomRight';
1084
+ /** Sequence mode for paragraph-level animations. */
1085
+ type PptxAnimationSequence = 'asOne' | 'byParagraph' | 'byWord' | 'byLetter';
1086
+ /** Behavior after animation finishes. */
1087
+ type PptxAfterAnimationAction = 'none' | 'hideOnNextClick' | 'hideAfterAnimation' | 'dimToColor';
1088
+ /**
1089
+ * High-level animation data associated with a slide element.
1090
+ *
1091
+ * Combines entrance, exit, and emphasis presets with timing and
1092
+ * trigger configuration. Used by the editor’s animation panel
1093
+ * and the `setPptxElementAnimation` tool.
1094
+ *
1095
+ * @example
1096
+ * ```ts
1097
+ * const anim: PptxElementAnimation = {
1098
+ * elementId: "title_1",
1099
+ * entrance: "fadeIn",
1100
+ * durationMs: 600,
1101
+ * order: 1,
1102
+ * trigger: "afterPrevious",
1103
+ * };
1104
+ * // => { elementId: "title_1", entrance: "fadeIn", durationMs: 600, order: 1, trigger: "afterPrevious" }
1105
+ * ```
1106
+ */
1107
+ interface PptxElementAnimation {
1108
+ elementId: string;
1109
+ entrance?: PptxAnimationPreset;
1110
+ exit?: PptxAnimationPreset;
1111
+ emphasis?: PptxAnimationPreset;
1112
+ durationMs?: number;
1113
+ delayMs?: number;
1114
+ order?: number;
1115
+ /**
1116
+ * The {@link order} the loader derived from the slide's `p:timing` tree for
1117
+ * an entry whose `pptx:editorMeta` record authored no `@order`. The tree
1118
+ * already expresses that position (and every load re-derives it), so the
1119
+ * writer omits `@order` while `order` still equals this value; a reorder
1120
+ * changes `order` and the attribute is written again. Load-time bookkeeping
1121
+ * only; never set it by hand.
1122
+ */
1123
+ orderFromTimeline?: number;
1124
+ trigger?: PptxAnimationTrigger;
1125
+ /**
1126
+ * Shape ID that triggers this animation: the shape clicked for
1127
+ * `onShapeClick`, or the media element whose bookmark fires it for
1128
+ * `onMediaBookmark`.
1129
+ */
1130
+ triggerShapeId?: string;
1131
+ /** Bookmark name (`p14:bmk/@name`) an `onMediaBookmark` trigger waits for. */
1132
+ triggerBookmark?: string;
1133
+ timingCurve?: PptxAnimationTimingCurve;
1134
+ repeatCount?: number;
1135
+ repeatMode?: PptxAnimationRepeatMode;
1136
+ /** Direction for directional effects (fly in/out, wipe, etc.). */
1137
+ direction?: PptxAnimationDirection;
1138
+ /** Sequence mode — animate as one object or by paragraph/word/letter. */
1139
+ sequence?: PptxAnimationSequence;
1140
+ /** What happens after the animation finishes playing. */
1141
+ afterAnimation?: PptxAfterAnimationAction;
1142
+ /** Dim-to color hex (used when afterAnimation is "dimToColor"). */
1143
+ afterAnimationColor?: string;
1144
+ /** Imported after-state for controls, not an authored override or serialized extension. */
1145
+ nativeAfterAnimation?: PptxAfterAnimationAction;
1146
+ nativeAfterAnimationColor?: string;
1147
+ /** SVG motion path string for custom motion path animations. */
1148
+ motionPath?: string;
1149
+ /**
1150
+ * Path edit mode for `p:animMotion/@pathEditMode`. Defaults to "relative"
1151
+ * when emitted without an explicit value.
1152
+ */
1153
+ motionPathEditMode?: string;
1154
+ /** Comma-separated point-types string for `p:animMotion/@ptsTypes`. */
1155
+ motionPtsTypes?: string;
1156
+ /** Authored path rotation in degrees from `p:animMotion/@rAng`. */
1157
+ motionPathRotationAngle?: number;
1158
+ /** Motion-path rotation centre X in slide percentage units (`p:rCtr/@x`). */
1159
+ motionPathRotationCenterX?: number;
1160
+ /** Motion-path rotation centre Y in slide percentage units (`p:rCtr/@y`). */
1161
+ motionPathRotationCenterY?: number;
1162
+ /**
1163
+ * Sound relationship ID to play when animation triggers. Written on save
1164
+ * as a `p:audio/p:cMediaNode` sibling of the effect's own `p:childTnLst`
1165
+ * (see `PptxNativeAnimation.soundRId` for the COM-verified detail).
1166
+ */
1167
+ soundRId?: string;
1168
+ /** Resolved sound file path from relationship. */
1169
+ soundPath?: string;
1170
+ /**
1171
+ * The `@_name` to write on the embedded sound (`p:sndTgt`). For a stock
1172
+ * gallery pick this is the exact PowerPoint file name (e.g.
1173
+ * `"CHIMES.WAV"`), which is what makes PowerPoint itself recognise the
1174
+ * sound as that built-in entry when it reopens the saved deck (there is no
1175
+ * separate "built-in" flag anywhere in the schema). Set by
1176
+ * `pptx-viewer-shared`'s `setEffectSound` when the pick carries a
1177
+ * `soundName`; absent for a custom file with no meaningful name.
1178
+ */
1179
+ soundName?: string;
1180
+ /** Whether to stop any currently playing sound (`p:endSnd`). */
1181
+ stopSound?: boolean;
1182
+ /**
1183
+ * Pending, not-yet-embedded sound chosen in the authoring UI, as a
1184
+ * `data:audio/...;base64,...` URL. Mirrors the `imageData` /
1185
+ * `mediaData` pending-embed convention used elsewhere in the typed model:
1186
+ * on save, the writer converts this to real bytes under `ppt/media/`,
1187
+ * mints a relationship, and replaces this field with the resolved
1188
+ * {@link soundRId} / {@link soundPath}. Cleared once embedded.
1189
+ */
1190
+ soundData?: string;
1191
+ /**
1192
+ * Display name for the chosen sound (e.g. the uploaded file's name),
1193
+ * shown by the authoring UI's sound picker. Purely cosmetic; has no
1194
+ * OOXML equivalent and is not required for playback. For a stock gallery
1195
+ * pick, the UI derives its label from {@link soundName} via the catalogue
1196
+ * instead of this field.
1197
+ */
1198
+ soundFileName?: string;
1199
+ /**
1200
+ * Per-build-level timing template(s) from the {@link sequence}'s own
1201
+ * `p:bldP/p:tmplLst` (ECMA-376 §19.5.84), carried over from the loaded
1202
+ * `PptxNativeAnimation.buildTemplates` this element animation was derived
1203
+ * from so a full timing-tree rebuild (`PptxAnimationWriteService`'s
1204
+ * `buildTimingXml`, when the slide had no prior `p:timing`) can re-emit
1205
+ * them instead of silently dropping the deck's authored per-level
1206
+ * defaults. Absent when {@link sequence} carries no such template.
1207
+ */
1208
+ buildTemplates?: PptxTimingTemplate[];
1209
+ }
1210
+ /**
1211
+ * A read-only anchor representing one of the deck's own effect groups: a
1212
+ * top-level click group (`p:par` under `p:timing`'s main sequence) that this
1213
+ * app did not author, so it is never exposed as an editable
1214
+ * {@link PptxElementAnimation}.
1215
+ *
1216
+ * The authoring UI merges these anchors alongside `PptxSlide.animations` to
1217
+ * render the FULL animation sequence (editor-authored and deck-native
1218
+ * effects together) and lets an editor-authored entry be dragged to any
1219
+ * position relative to them. `order` is the anchor's position among ALL
1220
+ * top-level click groups (editor-owned and native) at load time, in the same
1221
+ * numbering space as {@link PptxElementAnimation.order}, so the two
1222
+ * populations sort into one coherent timeline.
1223
+ *
1224
+ * Anchors are never written back: on save, an untouched anchor's own click
1225
+ * group is repositioned (if an editor-authored effect was dragged past it)
1226
+ * but never mutated, so the deck's own effect stays byte-identical apart
1227
+ * from its position in the sequence.
1228
+ */
1229
+ interface PptxAnimationTimelineAnchor {
1230
+ /**
1231
+ * Position of this group among all top-level click groups in the main
1232
+ * animation sequence at load time (dense, shared with editor entries'
1233
+ * `order`).
1234
+ */
1235
+ order: number;
1236
+ /** Shape id(s) this group's effects target, for a readable UI label. */
1237
+ targetIds: string[];
1238
+ /** Effect preset classes present in the group (entr/exit/emph/path). */
1239
+ presetClasses: Array<'entr' | 'exit' | 'emph' | 'path'>;
1240
+ }
1241
+ interface PptxVisibilitySetTiming {
1242
+ /** Delay from effect start until the shape becomes visible. */
1243
+ delayMs: number;
1244
+ /** Native one-millisecond visibility behavior interval. */
1245
+ durationMs: number;
1246
+ }
1247
+ //#endregion
1248
+ //#region pptx/core/types/comment-mentions.d.ts
1249
+ /**
1250
+ * A single `@`-mention inside a modern comment body.
1251
+ *
1252
+ * Offsets index into the comment's FLATTENED plain text: every `a:t` value
1253
+ * below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
1254
+ * same string `PptxComment.text` carries, so an edit to `text` invalidates
1255
+ * every offset after the edit point and the serializer re-bases them.
1256
+ *
1257
+ * The markup Office uses for a mention is `CT_Mention` (documented for the
1258
+ * SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
1259
+ * `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
1260
+ * publish a mention element at all, so `rawXml` is retained and re-emitted
1261
+ * attribute-for-attribute: a producer that spells the attributes differently
1262
+ * still round-trips.
1263
+ *
1264
+ * @example
1265
+ * ```ts
1266
+ * const mention: PptxCommentMention = {
1267
+ * personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
1268
+ * authorName: "Bob Example",
1269
+ * startIndex: 3,
1270
+ * length: 11,
1271
+ * };
1272
+ * // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
1273
+ * ```
1274
+ */
1275
+ interface PptxCommentMention {
1276
+ /** `mentionId`: GUID identifying this mention instance. */
1277
+ id?: string;
1278
+ /** `mentionpersonId`: the `p188:author` id of the mentioned person. */
1279
+ personId: string;
1280
+ /** Display name resolved from the author list at parse time, when known. */
1281
+ authorName?: string;
1282
+ /** Character offset of the mentioned span in the flattened plain text. */
1283
+ startIndex: number;
1284
+ /** Character length of the mentioned span. */
1285
+ length: number;
1286
+ /**
1287
+ * `uri` of the `p188:ext` this mention list was read from. Undefined means
1288
+ * the list is a direct child of `p188:cm`, which is where it is written for
1289
+ * newly authored mentions.
1290
+ */
1291
+ containerUri?: string;
1292
+ /** Original `p188:mention` node, retained for unknown-attribute preservation. */
1293
+ rawXml?: XmlObject;
1294
+ }
1295
+ //#endregion
1296
+ //#region pptx/core/types/metadata.d.ts
1297
+ /**
1298
+ * A slide comment — may be a legacy positional comment or a modern
1299
+ * threaded comment with replies.
1300
+ *
1301
+ * @example
1302
+ * ```ts
1303
+ * const comment: PptxComment = {
1304
+ * id: "c1",
1305
+ * text: "Please update this chart.",
1306
+ * author: "Alice",
1307
+ * createdAt: "2024-06-01T10:00:00Z",
1308
+ * resolved: false,
1309
+ * };
1310
+ * // => satisfies PptxComment
1311
+ * ```
1312
+ */
1313
+ interface PptxComment {
1314
+ id: string;
1315
+ text: string;
1316
+ /** Storage vocabulary used by this comment. Omitted means legacy PresentationML. */
1317
+ format?: 'legacy' | 'modern';
1318
+ /** Stable GUID author identifier used by Office 2021 modern comments. */
1319
+ authorId?: string;
1320
+ /** Optional parent comment id for reply threading metadata. */
1321
+ parentId?: string;
1322
+ author?: string;
1323
+ createdAt?: string;
1324
+ x?: number;
1325
+ y?: number;
1326
+ /** Whether this comment has been resolved/marked done. */
1327
+ resolved?: boolean;
1328
+ /** Native p188 status token. */
1329
+ status?: 'active' | 'resolved' | 'closed';
1330
+ /** Modern comment classification tags and author IDs that liked the comment. */
1331
+ tags?: string[];
1332
+ likes?: string[];
1333
+ startDate?: string;
1334
+ dueDate?: string;
1335
+ assignedTo?: string[];
1336
+ /** Task completion in thousandths of a percent, from 0 through 100000. */
1337
+ complete?: number;
1338
+ priority?: number;
1339
+ title?: string;
1340
+ /** Modern threaded comment support (p15:threadingInfo). */
1341
+ threadId?: string;
1342
+ /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
1343
+ mentions?: PptxCommentMention[];
1344
+ /** Replies to this comment (for modern threaded comments). */
1345
+ replies?: PptxComment[];
1346
+ /** ID of the element this comment is associated with (if any). */
1347
+ elementId?: string;
1348
+ /** Original `p:cm` subtree, retained for unknown child and extension preservation. */
1349
+ rawXml?: XmlObject;
1350
+ }
1351
+ /** Office 2021 comment author from the p188 Author part. */
1352
+ interface PptxModernCommentAuthor {
1353
+ id: string;
1354
+ name: string;
1355
+ initials?: string;
1356
+ userId: string;
1357
+ providerId: string;
1358
+ rawXml?: XmlObject;
1359
+ }
1360
+ /**
1361
+ * A comment author from `ppt/commentAuthors.xml`.
1362
+ *
1363
+ * Stores all attributes needed for lossless round-trip serialization
1364
+ * of the `p:cmAuthor` element (id, name, initials, lastIdx, clrIdx).
1365
+ *
1366
+ * @see ECMA-376 Part 1, §19.4.2 (cmAuthor)
1367
+ *
1368
+ * @example
1369
+ * ```ts
1370
+ * const author: PptxCommentAuthor = {
1371
+ * id: "0",
1372
+ * name: "John Doe",
1373
+ * initials: "JD",
1374
+ * lastIdx: 3,
1375
+ * clrIdx: 0,
1376
+ * };
1377
+ * // => satisfies PptxCommentAuthor
1378
+ * ```
1379
+ */
1380
+ interface PptxCommentAuthor {
1381
+ /** Unique numeric author identifier (`@_id`). */
1382
+ id: string;
1383
+ /** Author display name (`@_name`). */
1384
+ name: string;
1385
+ /** Author initials (`@_initials`). */
1386
+ initials: string;
1387
+ /** Last comment index used by this author (`@_lastIdx`). */
1388
+ lastIdx: number;
1389
+ /** Colour index assigned to this author (`@_clrIdx`). */
1390
+ clrIdx: number;
1391
+ /** Original `p:cmAuthor` subtree, retained for unknown attribute preservation. */
1392
+ rawXml?: XmlObject;
1393
+ }
1394
+ /**
1395
+ * A compatibility warning generated during parse or save when the
1396
+ * file uses features not fully supported by the editor.
1397
+ *
1398
+ * @example
1399
+ * ```ts
1400
+ * const warning: PptxCompatibilityWarning = {
1401
+ * code: "UNSUPPORTED_3D",
1402
+ * message: "3D rotation effects may not render accurately.",
1403
+ * severity: "warning",
1404
+ * scope: "element",
1405
+ * slideId: "slide-1",
1406
+ * elementId: "elem-42",
1407
+ * };
1408
+ * // => satisfies PptxCompatibilityWarning
1409
+ * ```
1410
+ */
1411
+ interface PptxCompatibilityWarning {
1412
+ code: string;
1413
+ message: string;
1414
+ severity: 'info' | 'warning';
1415
+ scope: 'presentation' | 'slide' | 'element' | 'save';
1416
+ slideId?: string;
1417
+ elementId?: string;
1418
+ xmlPath?: string;
1419
+ }
1420
+ /**
1421
+ * A single name–value tag from `ppt/tags/*.xml`.
1422
+ *
1423
+ * @example
1424
+ * ```ts
1425
+ * const tag: PptxTag = { name: "CUSTOM_ID", value: "12345" };
1426
+ * // => satisfies PptxTag
1427
+ * ```
1428
+ */
1429
+ interface PptxTag {
1430
+ name: string;
1431
+ value: string;
1432
+ }
1433
+ /**
1434
+ * A collection of tags from a single tags XML part.
1435
+ *
1436
+ * @example
1437
+ * ```ts
1438
+ * const coll: PptxTagCollection = {
1439
+ * path: "ppt/tags/tag1.xml",
1440
+ * tags: [{ name: "CUSTOM_ID", value: "12345" }],
1441
+ * };
1442
+ * // => satisfies PptxTagCollection
1443
+ * ```
1444
+ */
1445
+ interface PptxTagCollection {
1446
+ /** File path within the PPTX archive. */
1447
+ path?: string;
1448
+ /** Package owner of the tags relationship. New collections default to presentation. */
1449
+ owner?: 'presentation' | 'slide' | 'part';
1450
+ /** Source OPC part that owns the relationship, e.g. ppt/slides/slide1.xml. */
1451
+ sourcePartPath?: string;
1452
+ /** Durable relationship identifier from the owning part. */
1453
+ relationshipId?: string;
1454
+ /** Tags in this collection. */
1455
+ tags: PptxTag[];
1456
+ /** Parsed tag-list XML retained for unknown-node preservation. */
1457
+ rawXml?: XmlObject;
1458
+ }
1459
+ /**
1460
+ * A custom document property from `docProps/custom.xml`.
1461
+ *
1462
+ * @example
1463
+ * ```ts
1464
+ * const prop: PptxCustomProperty = {
1465
+ * name: "Project",
1466
+ * value: "pptx",
1467
+ * type: "lpwstr",
1468
+ * };
1469
+ * // => satisfies PptxCustomProperty
1470
+ * ```
1471
+ */
1472
+ interface PptxCustomProperty {
1473
+ /** Property name. */
1474
+ name: string;
1475
+ /** Property value (always stringified). */
1476
+ value: string;
1477
+ /** Original VT type (e.g. "lpwstr", "i4", "bool", "filetime"). */
1478
+ type: string;
1479
+ }
1480
+ /**
1481
+ * Core document properties from `docProps/core.xml` (Dublin Core + OOXML).
1482
+ *
1483
+ * @example
1484
+ * ```ts
1485
+ * const core: PptxCoreProperties = {
1486
+ * title: "Q4 Business Review",
1487
+ * creator: "Alice",
1488
+ * created: "2024-01-15T08:00:00Z",
1489
+ * modified: "2024-06-01T12:30:00Z",
1490
+ * lastModifiedBy: "Bob",
1491
+ * };
1492
+ * // => satisfies PptxCoreProperties
1493
+ * ```
1494
+ */
1495
+ interface PptxCoreProperties {
1496
+ /** dc:title */
1497
+ title?: string;
1498
+ /** dc:subject */
1499
+ subject?: string;
1500
+ /** dc:creator */
1501
+ creator?: string;
1502
+ /** cp:keywords */
1503
+ keywords?: string;
1504
+ /** dc:description */
1505
+ description?: string;
1506
+ /** cp:lastModifiedBy */
1507
+ lastModifiedBy?: string;
1508
+ /** cp:revision */
1509
+ revision?: string;
1510
+ /** dcterms:created (ISO 8601) */
1511
+ created?: string;
1512
+ /** dcterms:modified (ISO 8601) */
1513
+ modified?: string;
1514
+ /** cp:category */
1515
+ category?: string;
1516
+ /** cp:contentStatus */
1517
+ contentStatus?: string;
1518
+ }
1519
+ /**
1520
+ * Extended (application) properties from `docProps/app.xml`.
1521
+ *
1522
+ * @example
1523
+ * ```ts
1524
+ * const app: PptxAppProperties = {
1525
+ * application: "Microsoft Office PowerPoint",
1526
+ * appVersion: "16.0000",
1527
+ * slides: 24,
1528
+ * words: 1500,
1529
+ * company: "Acme Corp",
1530
+ * };
1531
+ * // => satisfies PptxAppProperties
1532
+ * ```
1533
+ */
1534
+ interface PptxAppProperties {
1535
+ /** Application name (e.g. "Microsoft Office PowerPoint"). */
1536
+ application?: string;
1537
+ /** Application version string. */
1538
+ appVersion?: string;
1539
+ /** Presentation format (e.g. "On-screen Show (16:9)"). */
1540
+ presentationFormat?: string;
1541
+ /** Total number of slides. */
1542
+ slides?: number;
1543
+ /** Number of hidden slides. */
1544
+ hiddenSlides?: number;
1545
+ /** Number of notes slides. */
1546
+ notes?: number;
1547
+ /** Total editing time in minutes. */
1548
+ totalTime?: number;
1549
+ /** Number of words. */
1550
+ words?: number;
1551
+ /** Number of paragraphs. */
1552
+ paragraphs?: number;
1553
+ /** Company name. */
1554
+ company?: string;
1555
+ /** Manager name. */
1556
+ manager?: string;
1557
+ /** Template name. */
1558
+ template?: string;
1559
+ /** Hyperlink base URL. */
1560
+ hyperlinkBase?: string;
1561
+ /** Document security bitmask (`<DocSecurity>`). */
1562
+ docSecurity?: number;
1563
+ /** Number of multimedia clips (`<MMClips>`). */
1564
+ mmClips?: number;
1565
+ /** Whether thumbnail images were scaled to fit (`<ScaleCrop>`). */
1566
+ scaleCrop?: boolean;
1567
+ /** Whether hyperlinks are current (`<LinksUpToDate>`). */
1568
+ linksUpToDate?: boolean;
1569
+ /** Whether the document is shared (`<SharedDoc>`). */
1570
+ sharedDoc?: boolean;
1571
+ /** Whether hyperlinks changed since last save (`<HyperlinksChanged>`). */
1572
+ hyperlinksChanged?: boolean;
1573
+ }
1574
+ //#endregion
1575
+ //#region pptx/core/types/theme.d.ts
1576
+ /**
1577
+ * Theme object model — colour scheme, font scheme, and format scheme
1578
+ * parsed from `ppt/theme/theme1.xml`.
1579
+ *
1580
+ * The colour scheme provides the 12 canonical OOXML colour slots.
1581
+ * The font scheme defines major (heading) and minor (body) typefaces.
1582
+ * The format scheme holds fill, line, and effect style matrices at
1583
+ * three intensity levels (subtle, moderate, intense).
1584
+ *
1585
+ * @module pptx-types/theme
1586
+ */
1587
+ /**
1588
+ * The 12 OOXML theme colour scheme keys in canonical order.
1589
+ *
1590
+ * @example
1591
+ * ```ts
1592
+ * for (const key of THEME_COLOR_SCHEME_KEYS) {
1593
+ * console.log(key, theme.colorScheme?.[key]);
1594
+ * }
1595
+ * // => e.g. "dk1 #000000", "lt1 #FFFFFF", "accent1 #4F81BD", …
1596
+ * ```
1597
+ */
1598
+ declare const THEME_COLOR_SCHEME_KEYS: readonly ['dk1', 'lt1', 'dk2', 'lt2', 'accent1', 'accent2', 'accent3', 'accent4', 'accent5', 'accent6', 'hlink', 'folHlink'];
1599
+ /**
1600
+ * Resolved hex values for the 12 theme colour slots.
1601
+ *
1602
+ * @example
1603
+ * ```ts
1604
+ * const scheme: PptxThemeColorScheme = {
1605
+ * dk1: "#000000", lt1: "#FFFFFF",
1606
+ * dk2: "#1F497D", lt2: "#EEECE1",
1607
+ * accent1: "#4F81BD", accent2: "#C0504D",
1608
+ * accent3: "#9BBB59", accent4: "#8064A2",
1609
+ * accent5: "#4BACC6", accent6: "#F79646",
1610
+ * hlink: "#0000FF", folHlink: "#800080",
1611
+ * };
1612
+ * // => satisfies PptxThemeColorScheme
1613
+ * ```
1614
+ */
1615
+ interface PptxThemeColorScheme {
1616
+ dk1: string;
1617
+ lt1: string;
1618
+ dk2: string;
1619
+ lt2: string;
1620
+ accent1: string;
1621
+ accent2: string;
1622
+ accent3: string;
1623
+ accent4: string;
1624
+ accent5: string;
1625
+ accent6: string;
1626
+ hlink: string;
1627
+ folHlink: string;
1628
+ }
1629
+ /**
1630
+ * A font-family triplet for major or minor theme fonts.
1631
+ *
1632
+ * Supports Latin, East Asian, and Complex Script font families.
1633
+ *
1634
+ * @example
1635
+ * ```ts
1636
+ * const fonts: PptxThemeFontGroup = {
1637
+ * latin: "Calibri Light",
1638
+ * eastAsia: "MS PGothic",
1639
+ * complexScript: "Arial",
1640
+ * };
1641
+ * // => satisfies PptxThemeFontGroup
1642
+ * ```
1643
+ */
1644
+ interface PptxThemeFontGroup {
1645
+ latin?: string;
1646
+ eastAsia?: string;
1647
+ complexScript?: string;
1648
+ /**
1649
+ * Per-script typeface overrides (`<a:font script="Hans|Hant|Arab|Hebr|
1650
+ * Thai|Beng|Gujr|Khmr|Knda|…"/>` per ECMA-376 §20.1.4.1.16). Keyed by
1651
+ * the four-letter ISO 15924 script tag from the `script` attribute.
1652
+ *
1653
+ * Phase 4 Stream A / M4.
1654
+ */
1655
+ byScript?: Record<string, string>;
1656
+ }
1657
+ /**
1658
+ * Theme font scheme — major (headings) and minor (body) font families.
1659
+ *
1660
+ * @example
1661
+ * ```ts
1662
+ * const scheme: PptxThemeFontScheme = {
1663
+ * majorFont: { latin: "Calibri Light" },
1664
+ * minorFont: { latin: "Calibri", eastAsia: "MS PGothic" },
1665
+ * };
1666
+ * // => satisfies PptxThemeFontScheme
1667
+ * ```
1668
+ */
1669
+ interface PptxThemeFontScheme {
1670
+ majorFont?: PptxThemeFontGroup;
1671
+ minorFont?: PptxThemeFontGroup;
1672
+ }
1673
+ /**
1674
+ * A single fill style entry from the theme format scheme.
1675
+ * Each entry is one of: solid, gradient, pattern, or no fill.
1676
+ * The raw XML node is also stored so that `phClr` substitution can happen
1677
+ * at resolution time.
1678
+ *
1679
+ * @example
1680
+ * ```ts
1681
+ * const solidFill: PptxThemeFillStyle = {
1682
+ * kind: "solid",
1683
+ * color: "#4F81BD",
1684
+ * opacity: 1,
1685
+ * };
1686
+ *
1687
+ * const gradientFill: PptxThemeFillStyle = {
1688
+ * kind: "gradient",
1689
+ * gradientAngle: 90,
1690
+ * gradientType: "linear",
1691
+ * gradientStops: [
1692
+ * { color: "#4F81BD", position: 0 },
1693
+ * { color: "#1F497D", position: 1 },
1694
+ * ],
1695
+ * };
1696
+ * // => satisfies PptxThemeFillStyle
1697
+ * ```
1698
+ */
1699
+ interface PptxThemeFillStyle {
1700
+ /**
1701
+ * Discriminator for the fill type.
1702
+ *
1703
+ * `'group'` corresponds to `<a:grpFill/>` — a fill that inherits the
1704
+ * containing group shape's fill at render time. Captured for round-trip
1705
+ * preservation in `fmtScheme/fillStyleLst`.
1706
+ */
1707
+ kind: 'solid' | 'gradient' | 'pattern' | 'none' | 'group';
1708
+ /** Pre-resolved colour (may be `undefined` when `phClr`-dependent). */
1709
+ color?: string;
1710
+ opacity?: number;
1711
+ /** Gradient-specific fields (only present when `kind === "gradient"`). */
1712
+ gradientStops?: Array<{
1713
+ color: string;
1714
+ position: number;
1715
+ opacity?: number;
1716
+ }>;
1717
+ gradientAngle?: number;
1718
+ gradientType?: 'linear' | 'radial';
1719
+ gradientCss?: string;
1720
+ /** Pattern-specific fields (only present when `kind === "pattern"`). */
1721
+ patternPreset?: string;
1722
+ patternBackgroundColor?: string;
1723
+ /** Raw XML node preserved for `phClr` re-resolution. */
1724
+ rawNode?: unknown;
1725
+ }
1726
+ /**
1727
+ * A single line style entry from `a:lnStyleLst`.
1728
+ * Provides width, dash, join, cap, and optional fill colour.
1729
+ *
1730
+ * @example
1731
+ * ```ts
1732
+ * const line: PptxThemeLineStyle = {
1733
+ * width: 1.5,
1734
+ * color: "#4F81BD",
1735
+ * dash: "solid",
1736
+ * lineJoin: "round",
1737
+ * lineCap: "flat",
1738
+ * };
1739
+ * // => satisfies PptxThemeLineStyle
1740
+ * ```
1741
+ */
1742
+ interface PptxThemeLineStyle {
1743
+ /** Line width in pixels (converted from EMU). */
1744
+ width?: number;
1745
+ color?: string;
1746
+ opacity?: number;
1747
+ dash?: string;
1748
+ lineJoin?: 'round' | 'bevel' | 'miter';
1749
+ lineCap?: 'flat' | 'rnd' | 'sq';
1750
+ compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
1751
+ /** Raw XML node preserved for `phClr` re-resolution. */
1752
+ rawNode?: unknown;
1753
+ }
1754
+ /**
1755
+ * A single effect style entry from `a:effectStyleLst`.
1756
+ * Each entry may define shadow, glow, soft-edge, reflection, blur,
1757
+ * and optionally a 3-D scene/shape.
1758
+ *
1759
+ * @example
1760
+ * ```ts
1761
+ * const dropShadow: PptxThemeEffectStyle = {
1762
+ * shadowColor: "#000000",
1763
+ * shadowBlur: 4,
1764
+ * shadowOffsetX: 2,
1765
+ * shadowOffsetY: 3,
1766
+ * shadowOpacity: 0.4,
1767
+ * };
1768
+ * // => satisfies PptxThemeEffectStyle
1769
+ * ```
1770
+ */
1771
+ interface PptxThemeEffectStyle {
1772
+ shadowColor?: string;
1773
+ shadowBlur?: number;
1774
+ shadowOffsetX?: number;
1775
+ shadowOffsetY?: number;
1776
+ shadowOpacity?: number;
1777
+ glowColor?: string;
1778
+ glowRadius?: number;
1779
+ glowOpacity?: number;
1780
+ softEdgeRadius?: number;
1781
+ innerShadowColor?: string;
1782
+ innerShadowOpacity?: number;
1783
+ innerShadowBlur?: number;
1784
+ innerShadowOffsetX?: number;
1785
+ innerShadowOffsetY?: number;
1786
+ reflectionBlurRadius?: number;
1787
+ reflectionStartOpacity?: number;
1788
+ reflectionEndOpacity?: number;
1789
+ reflectionEndPosition?: number;
1790
+ reflectionDirection?: number;
1791
+ reflectionRotation?: number;
1792
+ reflectionDistance?: number;
1793
+ /** 3D scene/camera from `a:scene3d` on the effect style (idx 3 typically). */
1794
+ scene3d?: Pptx3DScene;
1795
+ /** 3D shape extrusion/bevel from `a:sp3d` on the effect style (idx 3 typically). */
1796
+ shape3d?: Pptx3DShape;
1797
+ /** Raw XML node preserved for `phClr` re-resolution. */
1798
+ rawNode?: unknown;
1799
+ }
1800
+ /**
1801
+ * The full parsed format scheme from `a:fmtScheme` inside `a:themeElements`.
1802
+ * Contains three fill style lists and one line/effect style list each,
1803
+ * at three intensity levels: subtle (idx 1), moderate (idx 2), intense (idx 3).
1804
+ *
1805
+ * OOXML reference indices:
1806
+ * - fillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1-3)
1807
+ * - lnStyleLst: idx 1-3 (used by `a:lnRef @idx` 1-3)
1808
+ * - effectStyleLst: idx 1-3 (used by `a:effectRef @idx` 1-3)
1809
+ * - bgFillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1001-1003)
1810
+ *
1811
+ * @example
1812
+ * ```ts
1813
+ * const fmt: PptxThemeFormatScheme = {
1814
+ * name: "Office",
1815
+ * fillStyles: [solidFill, gradientFill, intenseFill],
1816
+ * lineStyles: [thinLine, mediumLine, thickLine],
1817
+ * effectStyles: [subtle, moderate, intense],
1818
+ * backgroundFillStyles: [solidBg, gradientBg, intenseBg],
1819
+ * };
1820
+ * // => satisfies PptxThemeFormatScheme
1821
+ * ```
1822
+ */
1823
+ interface PptxThemeFormatScheme {
1824
+ /** The `@name` attribute of the format scheme. */
1825
+ name?: string;
1826
+ /** Fill styles at indices 1-3 (subtle, moderate, intense). */
1827
+ fillStyles: PptxThemeFillStyle[];
1828
+ /** Line styles at indices 1-3. */
1829
+ lineStyles: PptxThemeLineStyle[];
1830
+ /** Effect styles at indices 1-3. */
1831
+ effectStyles: PptxThemeEffectStyle[];
1832
+ /** Background fill styles at indices 1-3 (referenced via idx 1001-1003). */
1833
+ backgroundFillStyles: PptxThemeFillStyle[];
1834
+ }
1835
+ /**
1836
+ * Full parsed theme object available to renderers.
1837
+ *
1838
+ * @example
1839
+ * ```ts
1840
+ * const theme: PptxTheme = {
1841
+ * name: "Office Theme",
1842
+ * colorScheme: { dk1: "#000", lt1: "#FFF", /* … *\/ },
1843
+ * fontScheme: {
1844
+ * majorFont: { latin: "Calibri Light" },
1845
+ * minorFont: { latin: "Calibri" },
1846
+ * },
1847
+ * };
1848
+ * // => satisfies PptxTheme
1849
+ * ```
1850
+ */
1851
+ interface PptxTheme {
1852
+ /** Theme name from `a:theme @name`. */
1853
+ name?: string;
1854
+ /** Resolved colour scheme. */
1855
+ colorScheme?: PptxThemeColorScheme;
1856
+ /** Resolved font scheme. */
1857
+ fontScheme?: PptxThemeFontScheme;
1858
+ /** Format scheme — fill, line, effect and background fill style matrices. */
1859
+ formatScheme?: PptxThemeFormatScheme;
1860
+ }
1861
+ /**
1862
+ * Snapshot of `<a:objectDefaults>` (ECMA-376 §20.1.6.7). Each child
1863
+ * (`spDef`, `lnDef`, `txDef`) carries `<a:spPr>`, `<a:bodyPr>`,
1864
+ * `<a:lstStyle>`, `<a:style>`. We capture them as raw parser objects so
1865
+ * round-trip is byte-stable regardless of schema-walking depth.
1866
+ *
1867
+ * Phase 4 Stream A / M5.
1868
+ */
1869
+ interface PptxThemeObjectDefaults {
1870
+ /** Raw `<a:spDef>` parser object, or `undefined` if absent. */
1871
+ spDef?: unknown;
1872
+ /** Raw `<a:lnDef>` parser object, or `undefined` if absent. */
1873
+ lnDef?: unknown;
1874
+ /** Raw `<a:txDef>` parser object, or `undefined` if absent. */
1875
+ txDef?: unknown;
1876
+ }
1877
+ //#endregion
1878
+ //#region pptx/core/types/masters.d.ts
1879
+ /**
1880
+ * A placeholder slot declared on a master or layout.
1881
+ *
1882
+ * The geometry fields are in CSS pixels (EMU / {@link EMU_PER_PX}) and are only
1883
+ * present when the shape carried an explicit `a:xfrm`. Placeholders that
1884
+ * inherit their frame from the master leave them undefined, so consumers that
1885
+ * draw placeholder outlines (the layout gallery) must skip those entries
1886
+ * rather than assume a zero-sized box at the origin.
1887
+ *
1888
+ * @example
1889
+ * ```ts
1890
+ * const frame: PptxPlaceholderFrame = { type: "body", idx: "1", x: 63, y: 130 };
1891
+ * // => satisfies PptxPlaceholderFrame
1892
+ * ```
1893
+ */
1894
+ interface PptxPlaceholderFrame {
1895
+ /** `p:ph/@type`, lower-cased by the parser; defaults to `body` when omitted. */
1896
+ type: string;
1897
+ /** `p:ph/@idx`, when present. */
1898
+ idx?: string;
1899
+ /** Left offset in CSS pixels, when the shape declares `a:off`. */
1900
+ x?: number;
1901
+ /** Top offset in CSS pixels, when the shape declares `a:off`. */
1902
+ y?: number;
1903
+ /** Width in CSS pixels, when the shape declares `a:ext`. */
1904
+ width?: number;
1905
+ /** Height in CSS pixels, when the shape declares `a:ext`. */
1906
+ height?: number;
1907
+ }
1908
+ /**
1909
+ * Parsed notes master from `ppt/notesMasters/notesMaster1.xml`.
1910
+ *
1911
+ * @example
1912
+ * ```ts
1913
+ * const notes: PptxNotesMaster = {
1914
+ * path: "ppt/notesMasters/notesMaster1.xml",
1915
+ * backgroundColor: "#FFFFFF",
1916
+ * placeholders: [{ type: "body" }, { type: "sldImg" }],
1917
+ * };
1918
+ * // => satisfies PptxNotesMaster
1919
+ * ```
1920
+ */
1921
+ interface PptxNotesMaster {
1922
+ /** File path within the PPTX archive. */
1923
+ path: string;
1924
+ /** Background colour of the notes master. */
1925
+ backgroundColor?: string;
1926
+ /** Background image data URL. */
1927
+ backgroundImage?: string;
1928
+ /** Crop, tiling and image effects authored on the background blip fill. */
1929
+ backgroundImageProperties?: PptxImageProperties;
1930
+ /** Placeholder shapes found on the notes master. */
1931
+ placeholders?: PptxPlaceholderFrame[];
1932
+ /** Editable elements on the notes master (header, footer, date, page number, slide image, notes body). */
1933
+ elements?: PptxElement[];
1934
+ /** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
1935
+ headerFooter?: PptxHeaderFooterFlags;
1936
+ /** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
1937
+ clrMap?: Record<string, string>;
1938
+ /**
1939
+ * Notes text defaults from `<p:notesStyle>` (`CT_TextListStyle`, ECMA-376
1940
+ * §19.3.1.34): the same `a:defPPr` + `a:lvl1pPr`..`a:lvl9pPr` shape as
1941
+ * {@link PptxMasterTextStyles}'s per-category styles, keyed 0-8 with the
1942
+ * default at `-1`. Governs the notes body placeholder's font size, indent
1943
+ * levels, and bullet style wherever a notes slide does not override them.
1944
+ * Parsed read-only for the render cascade; the save side preserves the
1945
+ * original `<p:notesStyle>` XML verbatim rather than re-serialising this.
1946
+ */
1947
+ notesStyle?: PptxTextStyleLevels;
1948
+ }
1949
+ /**
1950
+ * Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
1951
+ *
1952
+ * @example
1953
+ * ```ts
1954
+ * const handout: PptxHandoutMaster = {
1955
+ * path: "ppt/handoutMasters/handoutMaster1.xml",
1956
+ * slidesPerPage: 6,
1957
+ * };
1958
+ * // => satisfies PptxHandoutMaster
1959
+ * ```
1960
+ */
1961
+ interface PptxHandoutMaster {
1962
+ /** File path within the PPTX archive. */
1963
+ path: string;
1964
+ /** Background colour of the handout master. */
1965
+ backgroundColor?: string;
1966
+ /** Background image data URL. */
1967
+ backgroundImage?: string;
1968
+ /** Crop, tiling and image effects authored on the background blip fill. */
1969
+ backgroundImageProperties?: PptxImageProperties;
1970
+ /** Placeholder shapes found on the handout master. */
1971
+ placeholders?: PptxPlaceholderFrame[];
1972
+ /** Editable elements on the handout master (header, footer, date, page number, slide placeholders). */
1973
+ elements?: PptxElement[];
1974
+ /** Number of slides per page for handout print layout (1, 2, 3, 4, 6, or 9). */
1975
+ slidesPerPage?: number;
1976
+ /** Header/footer flags from `<p:hf>` on the handout master (P-H3). */
1977
+ headerFooter?: PptxHeaderFooterFlags;
1978
+ /** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
1979
+ clrMap?: Record<string, string>;
1980
+ }
1981
+ /**
1982
+ * Active tab within the master view sidebar.
1983
+ *
1984
+ * @example
1985
+ * ```ts
1986
+ * const tab: MasterViewTab = "slides";
1987
+ * // => "slides" — one of: "slides" | "notes" | "handout"
1988
+ * ```
1989
+ */
1990
+ type MasterViewTab = 'slides' | 'notes' | 'handout';
1991
+ /**
1992
+ * Structured slide master data.
1993
+ *
1994
+ * @example
1995
+ * ```ts
1996
+ * const master: PptxSlideMaster = {
1997
+ * path: "ppt/slideMasters/slideMaster1.xml",
1998
+ * name: "Office Theme",
1999
+ * backgroundColor: "#FFFFFF",
2000
+ * themePath: "ppt/theme/theme1.xml",
2001
+ * };
2002
+ * // => satisfies PptxSlideMaster
2003
+ * ```
2004
+ */
2005
+ interface PptxSlideMaster {
2006
+ /** File path within the PPTX archive. */
2007
+ path: string;
2008
+ /** Human-readable name if available. */
2009
+ name?: string;
2010
+ /** Background colour of the slide master. */
2011
+ backgroundColor?: string;
2012
+ /** Background image data URL for the slide master. */
2013
+ backgroundImage?: string;
2014
+ /** Crop, tiling and image effects authored on the background blip fill. */
2015
+ backgroundImageProperties?: PptxImageProperties;
2016
+ /** Theme file path this master references. */
2017
+ themePath?: string;
2018
+ /** Layout paths associated with this master. */
2019
+ layoutPaths?: string[];
2020
+ /** Placeholder shapes on the master. */
2021
+ placeholders?: PptxPlaceholderFrame[];
2022
+ /** Parsed element shapes on the master slide (for master view rendering). */
2023
+ elements?: PptxElement[];
2024
+ /** Parsed slide layout objects associated with this master. */
2025
+ layouts?: PptxSlideLayout[];
2026
+ /** Text styles from `p:txStyles` — title, body, and other text defaults. */
2027
+ txStyles?: PptxMasterTextStyles;
2028
+ /** Header/footer flags from `<p:hf>` on this master (P-H3). */
2029
+ headerFooter?: PptxHeaderFooterFlags;
2030
+ /**
2031
+ * Colour map from `<p:clrMap>` (12 alias attributes: bg1/tx1/bg2/tx2,
2032
+ * accent1-6, hlink, folHlink). Applied at save time when present.
2033
+ */
2034
+ clrMap?: Record<string, string>;
2035
+ /**
2036
+ * Whether the master is marked as preserved (prevent auto-deletion,
2037
+ * `@preserve`). Mirrors {@link PptxSlideLayout.preserve}: PowerPoint
2038
+ * silently drops an unused master unless this is set.
2039
+ *
2040
+ * ECMA-376 §19.3.1.38 (CT_SlideMaster).
2041
+ */
2042
+ preserve?: boolean;
2043
+ }
2044
+ /**
2045
+ * Per-level paragraph properties for a text style category.
2046
+ * Each entry maps a 0-based level index to its style defaults.
2047
+ */
2048
+ type PptxTextStyleLevels = Record<number, PlaceholderTextLevelStyle>;
2049
+ /**
2050
+ * Text styles parsed from `p:txStyles` on a slide master.
2051
+ * Provides cascading defaults for title, body, and other text.
2052
+ */
2053
+ interface PptxMasterTextStyles {
2054
+ /** Title text style (`p:titleStyle`). */
2055
+ titleStyle?: PptxTextStyleLevels;
2056
+ /** Body text style (`p:bodyStyle`). */
2057
+ bodyStyle?: PptxTextStyleLevels;
2058
+ /** Other text style (`p:otherStyle`). */
2059
+ otherStyle?: PptxTextStyleLevels;
2060
+ }
2061
+ /**
2062
+ * Per-part header/footer flags from `<p:hf>` (CT_HeaderFooter, ECMA-376
2063
+ * §19.3.1.21). Defaults are "all true" — fields are only set on the typed
2064
+ * model when they were explicitly read, so callers can distinguish "unset"
2065
+ * (preserve original XML) from "false" (override).
2066
+ */
2067
+ interface PptxHeaderFooterFlags {
2068
+ /** `@hdr` — show header placeholder. Spec default: `true`. */
2069
+ hasHeader?: boolean;
2070
+ /** `@ftr` — show footer placeholder. Spec default: `true`. */
2071
+ hasFooter?: boolean;
2072
+ /** `@dt` — show date/time placeholder. Spec default: `true`. */
2073
+ hasDateTime?: boolean;
2074
+ /** `@sldNum` — show slide-number placeholder. Spec default: `true`. */
2075
+ hasSlideNumber?: boolean;
2076
+ }
2077
+ /**
2078
+ * A slide layout associated with a slide master.
2079
+ *
2080
+ * @example
2081
+ * ```ts
2082
+ * const layout: PptxSlideLayout = {
2083
+ * path: "ppt/slideLayouts/slideLayout2.xml",
2084
+ * name: "Title and Content",
2085
+ * };
2086
+ * // => satisfies PptxSlideLayout
2087
+ * ```
2088
+ */
2089
+ interface PptxSlideLayout {
2090
+ /** File path within the PPTX archive. */
2091
+ path: string;
2092
+ /** Human-readable layout name. */
2093
+ name?: string;
2094
+ /** Background colour of the layout. */
2095
+ backgroundColor?: string;
2096
+ /** Background image data URL for the layout. */
2097
+ backgroundImage?: string;
2098
+ /** Crop, tiling and image effects authored on the background blip fill. */
2099
+ backgroundImageProperties?: PptxImageProperties;
2100
+ /** Parsed element shapes on the layout. */
2101
+ elements?: PptxElement[];
2102
+ /** Placeholder shapes on the layout. */
2103
+ placeholders?: PptxPlaceholderFrame[];
2104
+ /** Matching name attribute for layout identification (`@matchingName`). */
2105
+ matchingName?: string;
2106
+ /** Whether the layout is marked as preserved (prevent deletion, `@preserve`). */
2107
+ preserve?: boolean;
2108
+ /** Whether master placeholder animations should play (`@showMasterPhAnim`). */
2109
+ showMasterPhAnim?: boolean;
2110
+ /** Whether this layout is user-drawn (`@userDrawn`). */
2111
+ userDrawn?: boolean;
2112
+ /** Colour map override from `p:clrMapOvr`. */
2113
+ clrMapOverride?: Record<string, string>;
2114
+ /** Header/footer flags from `<p:hf>` on this layout (P-H3). */
2115
+ headerFooter?: PptxHeaderFooterFlags;
2116
+ }
2117
+ /**
2118
+ * Rendered content of a single layout, used to draw gallery thumbnails.
2119
+ *
2120
+ * Produced on demand rather than during load: materialising every layout's
2121
+ * artwork (and decoding its images) up front costs a noticeable amount of time
2122
+ * on decks with many masters, and most sessions never open the layout gallery
2123
+ * at all.
2124
+ *
2125
+ * @example
2126
+ * ```ts
2127
+ * const preview: PptxLayoutPreview = {
2128
+ * path: "ppt/slideLayouts/slideLayout2.xml",
2129
+ * width: 960,
2130
+ * height: 540,
2131
+ * elements: [],
2132
+ * placeholders: [{ type: "title" }],
2133
+ * };
2134
+ * // => satisfies PptxLayoutPreview
2135
+ * ```
2136
+ */
2137
+ interface PptxLayoutPreview {
2138
+ /** ZIP path of the layout this preview belongs to. */
2139
+ path: string;
2140
+ /** Slide width in CSS pixels, so a thumbnail can compute its own scale. */
2141
+ width: number;
2142
+ /** Slide height in CSS pixels. */
2143
+ height: number;
2144
+ /** Background resolved from the layout, falling back to its master's. */
2145
+ backgroundColor?: string;
2146
+ /** Background image data URL, when the layout or master declares one. */
2147
+ backgroundImage?: string;
2148
+ /** Crop, tiling and image effects authored on the resolved background image. */
2149
+ backgroundImageProperties?: PptxImageProperties;
2150
+ /** The layout's own artwork (pictures, shapes and static text). */
2151
+ elements: PptxElement[];
2152
+ /** Placeholder slots, drawn as outlined frames in the gallery. */
2153
+ placeholders: PptxPlaceholderFrame[];
2154
+ }
2155
+ /**
2156
+ * A theme part available in the presentation package.
2157
+ *
2158
+ * @example
2159
+ * ```ts
2160
+ * const opt: PptxThemeOption = {
2161
+ * path: "ppt/theme/theme1.xml",
2162
+ * name: "Office Theme",
2163
+ * };
2164
+ * // => satisfies PptxThemeOption
2165
+ * ```
2166
+ */
2167
+ interface PptxThemeOption {
2168
+ /** File path within the PPTX archive (e.g. `ppt/theme/theme2.xml`). */
2169
+ path: string;
2170
+ /** Human-readable theme name from `a:theme/@name`, when present. */
2171
+ name?: string;
2172
+ }
2173
+ //#endregion
2174
+ //#region pptx/core/types/embedded-font.d.ts
2175
+ interface PptxEmbeddedFontDataId {
2176
+ /** Required relationship identifier from `r:id`. */
2177
+ relationshipId?: string | null;
2178
+ /** Original leaf retained for unknown attribute preservation. */
2179
+ rawXml?: XmlObject;
2180
+ }
2181
+ interface PptxEmbeddedFontDescriptor {
2182
+ typeface?: string | null;
2183
+ panose?: string | null;
2184
+ pitchFamily?: string | null;
2185
+ charset?: string | null;
2186
+ rawXml?: XmlObject;
2187
+ }
2188
+ interface PptxEmbeddedFontListEntry {
2189
+ font: PptxEmbeddedFontDescriptor;
2190
+ regular?: PptxEmbeddedFontDataId | null;
2191
+ bold?: PptxEmbeddedFontDataId | null;
2192
+ italic?: PptxEmbeddedFontDataId | null;
2193
+ boldItalic?: PptxEmbeddedFontDataId | null;
2194
+ rawXml?: XmlObject;
2195
+ }
2196
+ interface PptxEmbeddedFontList {
2197
+ fonts: PptxEmbeddedFontListEntry[];
2198
+ /** Original list retained for unknown attribute and child preservation. */
2199
+ rawXml?: XmlObject;
2200
+ }
2201
+ //#endregion
2202
+ //#region pptx/core/types/presentation-print-properties.d.ts
2203
+ type PptxPrintOutput = 'slides' | 'handouts1' | 'handouts2' | 'handouts3' | 'handouts4' | 'handouts6' | 'handouts9' | 'notes' | 'outline';
2204
+ type PptxPrintColorMode = 'bw' | 'gray' | 'clr';
2205
+ /** PresentationML `CT_PrintProperties` (`p:prnPr`). */
2206
+ interface PptxPresentationPrintProperties {
2207
+ printWhat?: PptxPrintOutput | null;
2208
+ colorMode?: PptxPrintColorMode | null;
2209
+ hiddenSlides?: boolean | null;
2210
+ scaleToFitPaper?: boolean | null;
2211
+ frameSlides?: boolean | null;
2212
+ /** Original subtree retained for unknown attributes and `p:extLst`. */
2213
+ rawXml?: XmlObject;
2214
+ }
2215
+ //#endregion
2216
+ //#region pptx/core/types/view-properties.d.ts
2217
+ /**
2218
+ * View properties types parsed from `ppt/viewProps.xml`.
2219
+ *
2220
+ * Models the `p:viewPr` element and its child views:
2221
+ * normalViewPr, slideViewPr, outlineViewPr, notesTextViewPr,
2222
+ * sorterViewPr, notesViewPr.
2223
+ *
2224
+ * @module pptx-types/view-properties
2225
+ */
2226
+ /**
2227
+ * Scale factor for a view (numerator / denominator percentage).
2228
+ */
2229
+ interface PptxViewScale {
2230
+ /** Numerator of the scale percentage (e.g. 100 for 100%). */
2231
+ n: number;
2232
+ /** Denominator of the scale percentage (e.g. 100 for 100%). */
2233
+ d: number;
2234
+ /** Optional independent vertical scale. When absent, the X scale is used. */
2235
+ sy?: {
2236
+ n: number;
2237
+ d: number;
2238
+ };
2239
+ }
2240
+ /**
2241
+ * Origin point for a view (x, y in twips or EMU).
2242
+ */
2243
+ interface PptxViewOrigin {
2244
+ x: number;
2245
+ y: number;
2246
+ }
2247
+ /** A horizontal or vertical drawing guide in slide coordinates. */
2248
+ interface PptxViewGuide {
2249
+ orientation?: 'horz' | 'vert';
2250
+ position?: number;
2251
+ }
2252
+ /** Positive grid spacing from `p:gridSpacing`. */
2253
+ interface PptxGridSpacing {
2254
+ cx: number;
2255
+ cy: number;
2256
+ }
2257
+ /**
2258
+ * Restored region dimensions for normal view splitter.
2259
+ * Represents `p:restoredLeft` or `p:restoredTop`.
2260
+ */
2261
+ interface PptxRestoredRegion {
2262
+ /** Size as a percentage of the available space (thousandths of a percent). */
2263
+ sz: number;
2264
+ /** Whether auto-adjust is enabled. */
2265
+ autoAdjust?: boolean;
2266
+ }
2267
+ /**
2268
+ * Normal view properties (`p:normalViewPr`).
2269
+ * Controls the splitter positions in normal (editing) view.
2270
+ */
2271
+ interface PptxNormalViewProperties {
2272
+ /** Whether to show outline icons in the slide panel. */
2273
+ showOutlineIcons?: boolean;
2274
+ /** Whether the outline/slide panel is snapped closed. */
2275
+ snapVertSplitter?: boolean;
2276
+ /** Vertical splitter bar state: 'minimized' | 'maximized' | 'restored'. */
2277
+ vertBarState?: string;
2278
+ /** Horizontal splitter bar state. */
2279
+ horzBarState?: string;
2280
+ /** Whether to prefer single-slide view in the panel. */
2281
+ preferSingleView?: boolean;
2282
+ /** Restored left region (slide panel width). */
2283
+ restoredLeft?: PptxRestoredRegion;
2284
+ /** Restored top region (notes panel height). */
2285
+ restoredTop?: PptxRestoredRegion;
2286
+ }
2287
+ /**
2288
+ * Common slide view properties shared by slideViewPr, outlineViewPr,
2289
+ * notesTextViewPr, and notesViewPr.
2290
+ */
2291
+ interface PptxCommonSlideViewProperties {
2292
+ /** Whether snap-to-grid is enabled. */
2293
+ snapToGrid?: boolean;
2294
+ /** Whether snap-to-objects is enabled. */
2295
+ snapToObjects?: boolean;
2296
+ /** Whether drawing guides are shown. */
2297
+ showGuides?: boolean;
2298
+ /** Whether the application may vary the scale automatically. */
2299
+ variableScale?: boolean;
2300
+ /** Drawing guides shown in this slide view. */
2301
+ guides?: PptxViewGuide[];
2302
+ /** View origin (scroll position). */
2303
+ origin?: PptxViewOrigin;
2304
+ /** View scale. */
2305
+ scale?: PptxViewScale;
2306
+ }
2307
+ /**
2308
+ * Full view properties from `ppt/viewProps.xml`.
2309
+ */
2310
+ interface PptxViewProperties {
2311
+ /** Last used view type (`p:viewPr/@lastView`). */
2312
+ lastView?: string;
2313
+ /** Whether comments are shown (`p:viewPr/@showComments`). */
2314
+ showComments?: boolean;
2315
+ /** Normal view properties (splitter positions). */
2316
+ normalViewPr?: PptxNormalViewProperties;
2317
+ /** Slide view properties. */
2318
+ slideViewPr?: PptxCommonSlideViewProperties;
2319
+ /** Outline view properties. */
2320
+ outlineViewPr?: PptxCommonSlideViewProperties;
2321
+ /** Notes text view properties. */
2322
+ notesTextViewPr?: PptxCommonSlideViewProperties;
2323
+ /** Sorter view scale. */
2324
+ sorterViewPr?: {
2325
+ scale?: PptxViewScale;
2326
+ };
2327
+ /** Notes view properties. */
2328
+ notesViewPr?: PptxCommonSlideViewProperties;
2329
+ /** Grid spacing in positive DrawingML coordinates. */
2330
+ gridSpacing?: PptxGridSpacing;
2331
+ /** Raw XML preserved for lossless round-trip of unparsed attributes. */
2332
+ rawXml?: Record<string, unknown>;
2333
+ }
2334
+ //#endregion
2335
+ //#region pptx/core/types/presentation.d.ts
2336
+ /**
2337
+ * A customer data reference from `p:custDataLst / p:custData`.
2338
+ *
2339
+ * Enterprise add-ins and integrations store custom data parts in the
2340
+ * package and reference them via relationship IDs in the slide or
2341
+ * presentation XML.
2342
+ *
2343
+ * @see ECMA-376 Part 1, §19.2.1.3 (custDataLst), §19.3.1.6 (custData)
2344
+ */
2345
+ interface PptxCustomerData {
2346
+ /** Resolved part path inside the package (e.g. `customXml/item1.xml`). */
2347
+ id?: string;
2348
+ /** Relationship ID referencing the custom data part. */
2349
+ relId?: string;
2350
+ /** Raw string content of the custom data part (if resolvable). */
2351
+ data?: string;
2352
+ /** OPC content type for the custom data part. */
2353
+ contentType?: string;
2354
+ /** Raw `p:custData` XML retained for unknown-node preservation. */
2355
+ rawXml?: XmlObject;
2356
+ }
2357
+ /**
2358
+ * An ActiveX control reference from `p:controls / p:control`.
2359
+ *
2360
+ * ActiveX form controls (buttons, text boxes, check boxes, combo boxes, etc.)
2361
+ * are embedded via OLE parts and referenced by relationship ID in the slide XML.
2362
+ *
2363
+ * @see ECMA-376 Part 1, §19.3.1.3 (controls), §19.3.1.2 (control)
2364
+ */
2365
+ interface PptxActiveXControl {
2366
+ /** Relationship ID referencing the ActiveX binary part. */
2367
+ relId: string;
2368
+ /** Control name from @name attribute. */
2369
+ name?: string;
2370
+ /** Shape ID this control is linked to (from @spid). */
2371
+ shapeId?: string;
2372
+ /**
2373
+ * `p:control/@showAsIcon` (CT_Control, ECMA-376 S19.3.1.2): whether the
2374
+ * control renders as its static icon rather than its live appearance.
2375
+ * `undefined` when the source authored no explicit value (schema default
2376
+ * `false`).
2377
+ */
2378
+ showAsIcon?: boolean;
2379
+ /**
2380
+ * `p:control/@imgW` in EMU (ST_PositiveCoordinate32): the width the host
2381
+ * reserves for the control's icon/preview image. Distinct from
2382
+ * {@link width}, which is the fallback `p:pic`'s own `a:ext/@cx` in px;
2383
+ * `imgW`/`imgH` are direct attributes on `p:control` itself.
2384
+ */
2385
+ imgWidthEmu?: number;
2386
+ /** `p:control/@imgH` in EMU (ST_PositiveCoordinate32). @see imgWidthEmu */
2387
+ imgHeightEmu?: number;
2388
+ /** X position (px) of the control's fallback picture, if present. */
2389
+ x?: number;
2390
+ /** Y position (px) of the control's fallback picture, if present. */
2391
+ y?: number;
2392
+ /** Width (px) of the control's fallback picture, if present. */
2393
+ width?: number;
2394
+ /** Height (px) of the control's fallback picture, if present. */
2395
+ height?: number;
2396
+ /**
2397
+ * Relationship ID of the control's static fallback picture
2398
+ * (`mc:AlternateContent > mc:Fallback > p:pic > p:blipFill > a:blip@r:embed`).
2399
+ * Renderers resolve this to an image so a control shows its last static
2400
+ * frame instead of a blank area (the live ActiveX cannot run in a viewer).
2401
+ */
2402
+ fallbackImageRelId?: string;
2403
+ /** Raw XML for round-trip preservation. */
2404
+ rawXml?: XmlObject;
2405
+ }
2406
+ /**
2407
+ * Pattern fill on a slide background.
2408
+ *
2409
+ * Mirrors the `<a:pattFill>` choice inside `<p:bgPr>`. Renderers should
2410
+ * draw a 2-colour preset pattern (e.g. `dkDnDiag`, `pct50`).
2411
+ *
2412
+ * ECMA-376 §20.1.8.47.
2413
+ *
2414
+ * @example
2415
+ * ```ts
2416
+ * const pattern: PptxSlideBackgroundPattern = {
2417
+ * preset: "ltDnDiag",
2418
+ * fgColor: "#4472C4",
2419
+ * bgColor: "#FFFFFF",
2420
+ * };
2421
+ * // => satisfies PptxSlideBackgroundPattern
2422
+ * ```
2423
+ */
2424
+ interface PptxSlideBackgroundPattern {
2425
+ /** DrawingML preset pattern token (`@_prst`). */
2426
+ preset: string;
2427
+ /** Foreground colour resolved to `#RRGGBB`. */
2428
+ fgColor?: string;
2429
+ /** Background colour resolved to `#RRGGBB`. */
2430
+ bgColor?: string;
2431
+ }
2432
+ /**
2433
+ * A single slide in a parsed PPTX presentation.
2434
+ *
2435
+ * Contains the element tree, background settings, notes, comments,
2436
+ * transition / animation data, and metadata like layout path and section.
2437
+ *
2438
+ * @example
2439
+ * ```ts
2440
+ * const slide: PptxSlide = {
2441
+ * id: "slide1",
2442
+ * rId: "rId2",
2443
+ * slideNumber: 1,
2444
+ * elements: [titleTextBox, subtitleTextBox],
2445
+ * backgroundColor: "#FFFFFF",
2446
+ * notes: "Remember to mention quarterly goals.",
2447
+ * };
2448
+ * // => satisfies PptxSlide
2449
+ * ```
2450
+ */
2451
+ interface PptxSlide {
2452
+ id: string;
2453
+ rId: string;
2454
+ /**
2455
+ * `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
2456
+ * that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
2457
+ * name slides by.
2458
+ *
2459
+ * It lives in `presentation.xml`, NOT in the slide part, so it cannot be
2460
+ * recovered from `rawXml`. Without it on the model, code that writes a
2461
+ * section's membership has nothing correct to write and falls back to the
2462
+ * slide NUMBER, which is 1-based and therefore never matches a real deck's
2463
+ * ids: the section reloads with no slides in it.
2464
+ */
2465
+ slideId?: string;
2466
+ sourceSlideId?: string;
2467
+ /**
2468
+ * The slide name, `p:cSld/@name`: loaded from the part, written back on
2469
+ * save (an empty string clears the attribute), and settable via
2470
+ * `SlideBuilder.setName`.
2471
+ */
2472
+ name?: string;
2473
+ layoutPath?: string;
2474
+ layoutName?: string;
2475
+ slideNumber: number;
2476
+ hidden?: boolean;
2477
+ sectionName?: string;
2478
+ sectionId?: string;
2479
+ elements: PptxElement[];
2480
+ backgroundColor?: string;
2481
+ backgroundImage?: string;
2482
+ /** Crop, tiling and image effects authored on the background blip fill. */
2483
+ backgroundImageProperties?: PptxImageProperties;
2484
+ backgroundGradient?: string;
2485
+ /**
2486
+ * Pattern fill on the slide background (`<a:pattFill>` inside `<p:bgPr>`).
2487
+ *
2488
+ * When present, renderers should draw a real two-colour pattern using
2489
+ * the named DrawingML preset (e.g. `"ltDnDiag"`, `"pct50"`). The flat
2490
+ * `backgroundColor` field is left set to the foreground colour for
2491
+ * fallback rendering paths that don't understand patterns.
2492
+ *
2493
+ * ECMA-376 §20.1.8.47.
2494
+ */
2495
+ backgroundPattern?: PptxSlideBackgroundPattern;
2496
+ /**
2497
+ * `<p:bgPr/@shadeToTitle>`: boolean flag instructing the renderer to
2498
+ * anchor the background gradient on the title placeholder as a
2499
+ * rectangular path gradient (COM-measured against real PowerPoint;
2500
+ * it does NOT recolour toward the title's text colour, despite the
2501
+ * attribute's name). Parsed and round-tripped here on the core model;
2502
+ * the actual visual effect is applied by `pptx-viewer-shared`'s
2503
+ * `getSlideBackgroundStyle` (see `render/background-shade-to-title.ts`),
2504
+ * consumed by all five bindings, not by core itself. Legacy PowerPoint
2505
+ * 97-2003 hint, not observed in any real-world corpus file this project
2506
+ * has collected and not settable from any modern PowerPoint UI; see
2507
+ * `docs/guide/limitations.md`.
2508
+ *
2509
+ * ECMA-376 §19.3.1.2 (CT_BackgroundProperties).
2510
+ */
2511
+ backgroundShadeToTitle?: boolean;
2512
+ transition?: PptxSlideTransition;
2513
+ animations?: PptxElementAnimation[];
2514
+ /**
2515
+ * Read-only anchors for the deck's own (non-editor-authored) effect
2516
+ * groups, merged with `animations` by the authoring UI so drag-to-reorder
2517
+ * can target any position in the full sequence. See
2518
+ * {@link PptxAnimationTimelineAnchor}.
2519
+ */
2520
+ animationTimelineAnchors?: PptxAnimationTimelineAnchor[];
2521
+ /** Native OOXML animation data parsed from `p:timing`. */
2522
+ nativeAnimations?: PptxNativeAnimation[];
2523
+ /** Preserved raw `p:timing` XML for lossless round-trip of native animations. */
2524
+ rawTiming?: XmlObject;
2525
+ notes?: string;
2526
+ /** Rich text segments for the slide notes (preserves formatting). */
2527
+ notesSegments?: TextSegment[];
2528
+ /**
2529
+ * Parsed shapes from the notes slide's `<p:cSld>/<p:spTree>` so the full
2530
+ * notes-page shape tree can be inspected and mutated, not just the body
2531
+ * placeholder text. When undefined, the existing notes XML is left
2532
+ * untouched on save and only `notes` / `notesSegments` are written.
2533
+ */
2534
+ notesShapes?: PptxElement[];
2535
+ /**
2536
+ * Per-notes-slide colour map override parsed from `<p:notes>/<p:clrMapOvr>`.
2537
+ * Captured for lossless round-trip of the notes-slide's colour scheme.
2538
+ */
2539
+ notesClrMapOverride?: Record<string, string>;
2540
+ /** Optional `<p:cSld @name>` value of the notes slide, for round-trip. */
2541
+ notesCSldName?: string;
2542
+ comments?: PptxComment[];
2543
+ /** Source package metadata for an Office 2021 p188 comment part. */
2544
+ modernCommentPart?: PptxModernCommentPart;
2545
+ warnings?: PptxCompatibilityWarning[];
2546
+ rawXml?: XmlObject;
2547
+ /** Per-slide colour map override parsed from `p:clrMapOvr`. */
2548
+ clrMapOverride?: Record<string, string>;
2549
+ /** Whether background animations should play (`p:bg/@showAnimation`). */
2550
+ backgroundShowAnimation?: boolean;
2551
+ /** Whether master slide shapes should be shown on this slide (`p:sld/@showMasterSp`). */
2552
+ showMasterShapes?: boolean;
2553
+ /**
2554
+ * Whether inherited master placeholder animations should replay on this
2555
+ * slide (`p:sld/@showMasterPhAnim`). Distinct from {@link showMasterShapes}:
2556
+ * this governs animation timing, not shape visibility. Mirrors
2557
+ * `p:sldLayout/@showMasterPhAnim`, ECMA-376 §19.3.1.38.
2558
+ */
2559
+ showMasterPhAnim?: boolean;
2560
+ /** Drawing guides parsed from slide extension list. */
2561
+ guides?: PptxDrawingGuide[];
2562
+ /** When explicitly `false`, the slide is unmodified and save can skip re-serialization. */
2563
+ isDirty?: boolean;
2564
+ /** Customer data references from `p:custDataLst` on this slide. */
2565
+ customerData?: PptxCustomerData[];
2566
+ /** ActiveX control references from `p:controls` on this slide. */
2567
+ activeXControls?: PptxActiveXControl[];
2568
+ /**
2569
+ * Shapes parsed from a referenced legacy VML drawing part
2570
+ * (`ppt/drawings/vmlDrawing*.vml`, linked via a `legacyDrawing`
2571
+ * relationship). These are read-only render hints: the VML part itself is
2572
+ * preserved verbatim on save, so this field is not re-serialized.
2573
+ */
2574
+ legacyVmlElements?: PptxElement[];
2575
+ /** Per-slide header/footer flags from `<p:hf>` (P-H3). */
2576
+ headerFooterFlags?: PptxHeaderFooterFlags;
2577
+ /** Server-backed slide synchronization metadata stored in a related OPC part. */
2578
+ slideSynchronization?: PptxSlideSyncProperties;
2579
+ }
2580
+ interface PptxModernCommentPart {
2581
+ path: string;
2582
+ relationshipId: string;
2583
+ /** Original p188:cmLst root, including unknown attributes and extensions. */
2584
+ rawXml?: XmlObject;
2585
+ }
2586
+ /** Metadata from a `p:sldSyncPr` slide synchronization data part. */
2587
+ interface PptxSlideSyncProperties {
2588
+ serverSlideId: string;
2589
+ serverSlideModifiedTime: string;
2590
+ clientInsertedTime: string;
2591
+ extensionList?: XmlObject;
2592
+ rawXml?: XmlObject;
2593
+ partPath?: string;
2594
+ relationshipId?: string;
2595
+ }
2596
+ /**
2597
+ * A slide layout available in the loaded presentation.
2598
+ *
2599
+ * Each entry maps to a `<p:sldLayout>` inside `ppt/slideLayouts/`.
2600
+ *
2601
+ * @example
2602
+ * ```ts
2603
+ * const layout: PptxLayoutOption = {
2604
+ * path: "ppt/slideLayouts/slideLayout2.xml",
2605
+ * name: "Title and Content",
2606
+ * };
2607
+ * // => satisfies PptxLayoutOption
2608
+ * ```
2609
+ */
2610
+ interface PptxLayoutOption {
2611
+ path: string;
2612
+ name: string;
2613
+ /** Standard layout type from `p:sldLayout/@type` (e.g. "obj", "twoColTx", "blank"). */
2614
+ type?: string;
2615
+ /** ZIP path of the slide master this layout belongs to. */
2616
+ masterPath?: string;
2617
+ }
2618
+ /**
2619
+ * Header, footer, date-time, and slide-number placeholders.
2620
+ *
2621
+ * Parsed from `ppt/presProps.xml` and individual slide layouts.
2622
+ *
2623
+ * @example
2624
+ * ```ts
2625
+ * const hf: PptxHeaderFooter = {
2626
+ * hasFooter: true,
2627
+ * footerText: "Confidential",
2628
+ * hasSlideNumber: true,
2629
+ * };
2630
+ * // => satisfies PptxHeaderFooter
2631
+ * ```
2632
+ */
2633
+ interface PptxHeaderFooter {
2634
+ hasHeader?: boolean;
2635
+ headerText?: string;
2636
+ hasFooter?: boolean;
2637
+ footerText?: string;
2638
+ hasDateTime?: boolean;
2639
+ dateTimeText?: string;
2640
+ dateTimeAuto?: boolean;
2641
+ /**
2642
+ * The master date placeholder's own `a:fld/@type` (e.g. "datetime2"), NOT a
2643
+ * format pattern. It is one of the predefined OOXML datetime field types
2644
+ * (`datetime1`-`datetime13`); the display pattern for each is resolved by
2645
+ * `resolveFieldDateText` in `packages/shared/src/render/text-field-substitution.ts`.
2646
+ */
2647
+ dateFormat?: string;
2648
+ hasSlideNumber?: boolean;
2649
+ }
2650
+ /**
2651
+ * Presentation-level properties parsed from `presentationPr.xml`.
2652
+ *
2653
+ * Controls slideshow behaviour, print settings, custom colours, and grid.
2654
+ *
2655
+ * @example
2656
+ * ```ts
2657
+ * const props: PptxPresentationProperties = {
2658
+ * showType: "presented",
2659
+ * loopContinuously: false,
2660
+ * advanceMode: "useTimings",
2661
+ * };
2662
+ * // => satisfies PptxPresentationProperties
2663
+ * ```
2664
+ */
2665
+ interface PptxPresentationProperties {
2666
+ /** Show type: presented, browsed, kiosk. */
2667
+ showType?: 'presented' | 'browsed' | 'kiosk';
2668
+ /** Whether to loop the slideshow continuously. */
2669
+ loopContinuously?: boolean;
2670
+ /** Whether to show without narration. */
2671
+ showWithNarration?: boolean;
2672
+ /** Whether to show without animation. */
2673
+ showWithAnimation?: boolean;
2674
+ /** Advance slides mode: manual click or use stored timings. */
2675
+ advanceMode?: 'manual' | 'useTimings';
2676
+ /** Show slides: 'all', a custom show id, or a from-to range. */
2677
+ showSlidesMode?: 'all' | 'customShow' | 'range';
2678
+ /** Custom show id to use when showSlidesMode is 'customShow'. */
2679
+ showSlidesCustomShowId?: string;
2680
+ /** Slide range start (1-based) when showSlidesMode is 'range'. */
2681
+ showSlidesFrom?: number;
2682
+ /** Slide range end (1-based) when showSlidesMode is 'range'. */
2683
+ showSlidesTo?: number;
2684
+ /** Whether to show subtitles/captions during presentation mode. */
2685
+ showSubtitles?: boolean;
2686
+ /** Typed `p:prnPr` settings. Set to null during save to remove the element. */
2687
+ printProperties?: PptxPresentationPrintProperties | null;
2688
+ /** Most-recently-used colours from the presentation palette. */
2689
+ mruColors?: string[];
2690
+ /**
2691
+ * Pen colour for presentation mode annotations (from `p:showPr/p:penClr`).
2692
+ * `p:penClr` is a full `EG_ColorChoice` (P1-G2): a scheme/preset/system
2693
+ * swatch resolves to a hex string here just like a direct `a:srgbClr`.
2694
+ */
2695
+ penColor?: string;
2696
+ /**
2697
+ * The resolved hex value {@link penColor} had at parse time, and the
2698
+ * original `p:penClr` colour-choice XML node, preserved so a save that
2699
+ * never touches the pen colour re-emits the original scheme/preset
2700
+ * reference verbatim instead of flattening it to a baked `a:srgbClr`.
2701
+ * Internal round-trip bookkeeping; not meant to be set by API callers.
2702
+ */
2703
+ penColorOriginal?: string;
2704
+ /** @see penColorOriginal */
2705
+ penColorXml?: XmlObject;
2706
+ /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
2707
+ kioskRestartTime?: number;
2708
+ /**
2709
+ * `p:showPr/p:browse/@showScrollbar` (CT_ShowInfoBrowse §19.2.1.10 /
2710
+ * §19.3.1.43), the "Show scrollbar" checkbox in PowerPoint's Set Up Show
2711
+ * dialog. Only meaningful when `showType` is `"browsed"`; the schema
2712
+ * default is `true`. `undefined` means the source authored no explicit
2713
+ * value (or `showType` is not `"browsed"`).
2714
+ */
2715
+ showScrollbar?: boolean;
2716
+ }
2717
+ /**
2718
+ * Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
2719
+ *
2720
+ * @example
2721
+ * ```ts
2722
+ * const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
2723
+ * // => satisfies PptxSlideSize
2724
+ * ```
2725
+ */
2726
+ interface PptxSlideSize {
2727
+ /** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
2728
+ widthEmu?: number;
2729
+ /** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
2730
+ heightEmu?: number;
2731
+ /**
2732
+ * `@type` (ST_SlideSizeType). The schema default is `custom`, which is
2733
+ * why PowerPoint omits the attribute for a non-preset size.
2734
+ */
2735
+ type?: string;
2736
+ }
2737
+ /**
2738
+ * A named custom slide show (`p:custShowLst / p:custShow`).
2739
+ *
2740
+ * Custom shows define ordered subsets of slides that can be presented
2741
+ * independently of the full deck.
2742
+ *
2743
+ * @example
2744
+ * ```ts
2745
+ * const show: PptxCustomShow = {
2746
+ * name: "Executive Summary",
2747
+ * id: "0",
2748
+ * slideRIds: ["rId2", "rId5", "rId8"],
2749
+ * };
2750
+ * // => satisfies PptxCustomShow
2751
+ * ```
2752
+ */
2753
+ interface PptxCustomShow {
2754
+ /** Custom show name. */
2755
+ name: string;
2756
+ /** Custom show id. */
2757
+ id: string;
2758
+ /** Ordered list of slide relationship IDs included in this custom show. */
2759
+ slideRIds: string[];
2760
+ /** Original `p:custShow` subtree used to preserve unmodelled attributes and extensions. */
2761
+ rawXml?: XmlObject;
2762
+ }
2763
+ /**
2764
+ * An ordered section in the presentation (from `p:sectionLst` / `p14:sectionLst`).
2765
+ *
2766
+ * Sections group consecutive slides under a named heading (visible
2767
+ * in the PowerPoint slide sorter).
2768
+ *
2769
+ * @example
2770
+ * ```ts
2771
+ * const section: PptxSection = {
2772
+ * id: "sec_1",
2773
+ * name: "Introduction",
2774
+ * slideIds: ["256", "257"],
2775
+ * };
2776
+ * // => satisfies PptxSection
2777
+ * ```
2778
+ */
2779
+ interface PptxSection {
2780
+ /** Section unique identifier (GUID or synthetic). */
2781
+ id: string;
2782
+ /** Human-readable section name. */
2783
+ name: string;
2784
+ /** Ordered list of numeric slide IDs that belong to this section. */
2785
+ slideIds: string[];
2786
+ /** Whether the section is collapsed in the slide sorter (from p15:sectionPr). */
2787
+ collapsed?: boolean;
2788
+ /** Section highlight color hex (from p15:sectionPr/@clr). */
2789
+ color?: string;
2790
+ /** Original section subtree used to preserve unmodelled attributes and extensions. */
2791
+ rawXml?: XmlObject;
2792
+ }
2793
+ /**
2794
+ * Write-protection hash data parsed from `p:modifyVerifier` in `presentation.xml`.
2795
+ *
2796
+ * When present, the presentation is marked as "read-only recommended" or
2797
+ * write-protected with a password hash. The hash parameters follow the
2798
+ * ECMA-376 Part 1, section 19.2.1.22 specification.
2799
+ *
2800
+ * @example
2801
+ * ```ts
2802
+ * const verifier: PptxModifyVerifier = {
2803
+ * algorithmName: "SHA-512",
2804
+ * hashData: "base64EncodedHash==",
2805
+ * saltData: "base64EncodedSalt==",
2806
+ * spinValue: 100000,
2807
+ * };
2808
+ * // => satisfies PptxModifyVerifier
2809
+ * ```
2810
+ */
2811
+ interface PptxModifyVerifier {
2812
+ /** Hash algorithm name (e.g. "SHA-512", "SHA-1"). */
2813
+ algorithmName?: string;
2814
+ /** Base64-encoded hash value. */
2815
+ hashData?: string;
2816
+ /** Base64-encoded salt value. */
2817
+ saltData?: string;
2818
+ /** Number of hash iterations (spin count). */
2819
+ spinValue?: number;
2820
+ /** Legacy algorithm ID extension. */
2821
+ algIdExt?: string;
2822
+ /** Legacy algorithm ID. */
2823
+ cryptAlgorithmSid?: number;
2824
+ /** Cryptographic algorithm type (e.g. "typeAny"). */
2825
+ cryptAlgorithmType?: string;
2826
+ /** Cryptographic provider name. */
2827
+ cryptProvider?: string;
2828
+ /** Cryptographic provider type (e.g. "providerTypeRsaFull"). */
2829
+ cryptProviderType?: string;
2830
+ /** Cryptographic algorithm class (e.g. "hash"). */
2831
+ cryptAlgorithmClass?: string;
2832
+ }
2833
+ /**
2834
+ * Photo album metadata from `p:photoAlbum` in `presentation.xml`.
2835
+ *
2836
+ * Stores settings for presentations created via Insert > Photo Album.
2837
+ *
2838
+ * @see ECMA-376 Part 1, §19.2.1.27
2839
+ */
2840
+ interface PptxPhotoAlbum {
2841
+ /** Whether photos are displayed in black-and-white. */
2842
+ bw?: boolean;
2843
+ /** Whether captions are shown below each photo. */
2844
+ showCaptions?: boolean;
2845
+ /** Photo album layout (e.g. "1pic", "2pic", "4pic", "fitToSlide"). */
2846
+ layout?: string;
2847
+ /** Frame style applied to each photo (e.g. "frameStyle1"). */
2848
+ frame?: string;
2849
+ /**
2850
+ * `p:photoAlbum/@isPhoto` (ECMA-376 S19.2.1.27, CT_PhotoAlbum): whether
2851
+ * the pictures placed by the album wizard are real photographs, as
2852
+ * opposed to clip art or other embedded images. `undefined` when the
2853
+ * source authored no explicit value (schema default `false`); this is a
2854
+ * purely declarative wizard-provenance flag, not something this library
2855
+ * gates any layout/frame behaviour on.
2856
+ */
2857
+ isPhoto?: boolean;
2858
+ }
2859
+ /**
2860
+ * A recognizer-owned `p:smartTags` reference from `presentation.xml`
2861
+ * (CT_SmartTags, ECMA-376 S19.2.1.42): a bare relationship id pointing at a
2862
+ * legacy Office "Smart Tags" recognizer part, distinct from the
2863
+ * user-authored `p:tags` construct (see {@link PptxTagCollection}).
2864
+ *
2865
+ * This library has no data model for recognizer part CONTENT (there is no
2866
+ * way to create, inspect, or edit one through the public API), so this type
2867
+ * only captures enough to preserve an authored reference losslessly: the
2868
+ * relationship id and, when resolvable, the target part path.
2869
+ */
2870
+ interface PptxSmartTagsReference {
2871
+ /** Relationship id from `p:smartTags/@r:id`. */
2872
+ relId: string;
2873
+ /** Resolved ZIP path of the referenced recognizer part, when resolvable. */
2874
+ targetPath?: string;
2875
+ /** Raw `p:smartTags` XML retained for lossless round-trip. */
2876
+ rawXml?: XmlObject;
2877
+ }
2878
+ /**
2879
+ * East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
2880
+ *
2881
+ * Defines forbidden start/end characters for a given language so that
2882
+ * line-breaking follows East Asian typographic rules.
2883
+ *
2884
+ * @see ECMA-376 Part 1, §19.2.1.17
2885
+ */
2886
+ interface PptxKinsoku {
2887
+ /** Language code (e.g. "ja-JP", "zh-CN"). */
2888
+ lang?: string | null;
2889
+ /** Characters that cannot begin a line. */
2890
+ invalStChars?: string;
2891
+ /** Characters that cannot end a line. */
2892
+ invalEndChars?: string;
2893
+ /** Original leaf retained for unknown attribute preservation. */
2894
+ rawXml?: XmlObject;
2895
+ }
2896
+ /**
2897
+ * Root data structure returned by {@link PptxHandlerCore.load}.
2898
+ *
2899
+ * Contains every slide, canvas dimensions, theme data, layout options,
2900
+ * metadata, and optional features (custom shows, sections, macros,
2901
+ * digital signatures, embedded fonts).
2902
+ *
2903
+ * @example
2904
+ * ```ts
2905
+ * const data: PptxData = await handler.load(buffer);
2906
+ * console.log(`${data.slides.length} slides, ${data.width}×${data.height}`);
2907
+ * // => e.g. "24 slides, 960×540"
2908
+ * ```
2909
+ */
2910
+ interface PptxData {
2911
+ slides: PptxSlide[];
2912
+ width: number;
2913
+ height: number;
2914
+ /** Slide width in EMU (for save round-trip). */
2915
+ widthEmu?: number;
2916
+ /** Slide height in EMU (for save round-trip). */
2917
+ heightEmu?: number;
2918
+ /** Slide size type from `p:sldSz/@type` (e.g. "screen4x3", "screen16x9", "custom"). */
2919
+ slideSizeType?: string;
2920
+ /** Notes page width in EMU (from `p:notesSz`). */
2921
+ notesWidthEmu?: number;
2922
+ /** Notes page height in EMU (from `p:notesSz`). */
2923
+ notesHeightEmu?: number;
2924
+ layoutOptions?: PptxLayoutOption[];
2925
+ headerFooter?: PptxHeaderFooter;
2926
+ /** Presentation-level properties parsed from `presentationPr.xml`. */
2927
+ presentationProperties?: PptxPresentationProperties;
2928
+ /** Named custom slide shows from `p:custShowLst`. */
2929
+ customShows?: PptxCustomShow[];
2930
+ /** Ordered presentation sections from `p:sectionLst` / `p14:sectionLst`. */
2931
+ sections?: PptxSection[];
2932
+ warnings?: PptxCompatibilityWarning[];
2933
+ /** Map of theme colour scheme keys to resolved hex values. */
2934
+ themeColorMap?: Record<string, string>;
2935
+ /** Full parsed theme object with colours, fonts, and name. */
2936
+ theme?: PptxTheme;
2937
+ /** Available theme parts discovered in `ppt/theme/`. */
2938
+ themeOptions?: PptxThemeOption[];
2939
+ /** Parsed table style definitions from `ppt/tableStyles.xml`. */
2940
+ tableStyleMap?: ParsedTableStyleMap;
2941
+ /**
2942
+ * The current default table style GUID (`ppt/tableStyles.xml`'s
2943
+ * `a:tblStyleLst/@def`): the style PowerPoint applies to a newly inserted
2944
+ * table. Matches `PptxSaveOptions.tableStylesDefaultId` so a save call
2945
+ * that omits it can fall back to what was loaded.
2946
+ */
2947
+ tableStylesDefaultId?: string;
2948
+ /** Whether the presentation is password-protected. */
2949
+ isPasswordProtected?: boolean;
2950
+ /** Embedded font data (name + binary data URL) extracted from the presentation. */
2951
+ embeddedFonts?: PptxEmbeddedFont[];
2952
+ /** Typed `p:embeddedFontLst` package metadata, including unresolved variants. */
2953
+ embeddedFontList?: PptxEmbeddedFontList;
2954
+ /**
2955
+ * `p:presentation/@embedTrueTypeFonts` (ECMA-376 §19.2.1.26): the author's
2956
+ * saved preference that TrueType fonts referenced by the deck be embedded.
2957
+ * `undefined` when the attribute is absent (spec default `false`).
2958
+ *
2959
+ * This is purely declarative in this library: fonts are only ever embedded
2960
+ * when the caller explicitly supplies `embeddedFontList`/`embeddedFonts`
2961
+ * (there is no automatic embed-on-save), so toggling this flag does not
2962
+ * gate any embedding behaviour of its own here - it only round-trips the
2963
+ * author's stated preference, the same way real PowerPoint reads it back
2964
+ * as a checkbox state rather than a trigger. See `@saveSubsetFonts`,
2965
+ * which is a separate, deliberately unimplemented flag (no glyph
2966
+ * subsetting) that does not interact with this one.
2967
+ */
2968
+ embedTrueTypeFonts?: boolean;
2969
+ /**
2970
+ * `p:presentation/@firstSlideNum`: a `slidenum` field on slide `i` (0-based)
2971
+ * shows `firstSlideNumber + i`. Absent means the spec default, 1.
2972
+ */
2973
+ firstSlideNumber?: number;
2974
+ /**
2975
+ * Presentation-level default text style (`p:defaultTextStyle`): the
2976
+ * last-resort paragraph/run-property fallback for every shape (placeholder
2977
+ * or not) whose local and inherited cascade leaves a field undefined.
2978
+ * Keyed the same way as {@link PptxMasterTextStyles} categories: `-1` is
2979
+ * `a:defPPr`, `0`-`8` are `a:lvl1pPr`-`a:lvl9pPr`.
2980
+ */
2981
+ defaultTextStyle?: PptxTextStyleLevels;
2982
+ /** Most-recently-used colour list from presentation properties. */
2983
+ mruColors?: string[];
2984
+ /** Parsed notes master data if present in the PPTX. */
2985
+ notesMaster?: PptxNotesMaster;
2986
+ /** Parsed handout master data if present in the PPTX. */
2987
+ handoutMaster?: PptxHandoutMaster;
2988
+ /** Structured slide master data for each master in the presentation. */
2989
+ slideMasters?: PptxSlideMaster[];
2990
+ /** Parsed tag collections attached to the presentation or slides. */
2991
+ tags?: PptxTagCollection[];
2992
+ /** Custom document properties from `docProps/custom.xml`. */
2993
+ customProperties?: PptxCustomProperty[];
2994
+ /** Core document properties from `docProps/core.xml`. */
2995
+ coreProperties?: PptxCoreProperties;
2996
+ /** Extended (application) properties from `docProps/app.xml`. */
2997
+ appProperties?: PptxAppProperties;
2998
+ /** Whether the presentation contains VBA macros (is a .pptm file). */
2999
+ hasMacros?: boolean;
3000
+ /** Whether the presentation contains digital signatures (`_xmlsignatures/` parts). */
3001
+ hasDigitalSignatures?: boolean;
3002
+ /** Number of digital signatures found. */
3003
+ digitalSignatureCount?: number;
3004
+ /** Presentation-level drawing guides from `p:extLst`. */
3005
+ presentationGuides?: PptxDrawingGuide[];
3006
+ /** View properties from `ppt/viewProps.xml`. */
3007
+ viewProperties?: PptxViewProperties;
3008
+ /** Write-protection verifier from `p:modifyVerifier` in `presentation.xml`. */
3009
+ modifyVerifier?: PptxModifyVerifier;
3010
+ /** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
3011
+ photoAlbum?: PptxPhotoAlbum;
3012
+ /**
3013
+ * Legacy Smart Tags recognizer reference from `p:smartTags` in
3014
+ * `presentation.xml`. Read-only: there is no data model for the
3015
+ * recognizer part's own content, so this exists to make the reference
3016
+ * inspectable and to prove it survives a save (the owning part and its
3017
+ * relationship are preserved passively, like any other unmodelled part).
3018
+ */
3019
+ smartTags?: PptxSmartTagsReference;
3020
+ /** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
3021
+ kinsoku?: PptxKinsoku;
3022
+ /** Custom XML data parts from `customXml/` in the OPC package. */
3023
+ customXmlParts?: PptxCustomXmlPart[];
3024
+ /** Customer data references from `p:custDataLst` in `presentation.xml`. */
3025
+ customerData?: PptxCustomerData[];
3026
+ /** Thumbnail image binary data from `docProps/thumbnail.{jpeg,png}`. */
3027
+ thumbnailData?: Uint8Array;
3028
+ /** Comment authors parsed from `ppt/commentAuthors.xml` for round-trip preservation. */
3029
+ commentAuthors?: PptxCommentAuthor[];
3030
+ /** Office 2021 p188 authors from the modern Author part. */
3031
+ modernCommentAuthors?: PptxModernCommentAuthor[];
3032
+ /**
3033
+ * OOXML conformance class of the loaded file.
3034
+ * - `'strict'` -- ISO/IEC 29500 Strict (uses `purl.oclc.org` namespace URIs)
3035
+ * - `'transitional'` -- ECMA-376 Transitional (uses `schemas.openxmlformats.org` URIs)
3036
+ *
3037
+ * When saving, if the save option `conformance` is `'preserve'` (default),
3038
+ * the file will be saved using the same conformance class as the original.
3039
+ */
3040
+ conformance?: 'strict' | 'transitional';
3041
+ }
3042
+ /**
3043
+ * Target format for slide export.
3044
+ *
3045
+ * @see {@link PptxExportOptions}
3046
+ */
3047
+ type PptxExportFormat = 'pdf' | 'png' | 'svg';
3048
+ /**
3049
+ * Options controlling slide export to raster or vector formats.
3050
+ *
3051
+ * @example
3052
+ * ```ts
3053
+ * const opts: PptxExportOptions = {
3054
+ * format: "png",
3055
+ * slideIndices: [0, 2, 4],
3056
+ * dpi: 300,
3057
+ * };
3058
+ * // => satisfies PptxExportOptions
3059
+ * ```
3060
+ */
3061
+ interface PptxExportOptions {
3062
+ /** Target format. */
3063
+ format: PptxExportFormat;
3064
+ /** Slide indices to export (0-based). If omitted, all slides are exported. */
3065
+ slideIndices?: number[];
3066
+ /** Output width in pixels (for PNG). Height is derived from aspect ratio. */
3067
+ width?: number;
3068
+ /** DPI for raster export (default 150). */
3069
+ dpi?: number;
3070
+ /** Whether to include hidden slides. */
3071
+ includeHidden?: boolean;
3072
+ }
3073
+ /**
3074
+ * Embedded font data extracted from a PPTX file.
3075
+ *
3076
+ * Used to register `@font-face` rules so the renderer can display
3077
+ * the correct typeface even when the system font is missing.
3078
+ *
3079
+ * @example
3080
+ * ```ts
3081
+ * const font: PptxEmbeddedFont = {
3082
+ * name: "CustomSans",
3083
+ * dataUrl: "data:font/truetype;base64,AAEAK...",
3084
+ * format: "truetype",
3085
+ * };
3086
+ * // => satisfies PptxEmbeddedFont
3087
+ * ```
3088
+ */
3089
+ /**
3090
+ * A single Custom XML Data Part stored in `customXml/` within the OPC package.
3091
+ *
3092
+ * These parts are used by add-ins, data-binding, and enterprise templates
3093
+ * to store structured data alongside the presentation.
3094
+ *
3095
+ * @see ECMA-376 Part 1, §15.2.5
3096
+ */
3097
+ interface PptxCustomXmlPart {
3098
+ /** Item number (e.g. "1" for `customXml/item1.xml`). */
3099
+ id: string;
3100
+ /** Raw XML string content of the custom XML item. */
3101
+ data: string;
3102
+ /** Schema target namespace URI from `itemProps` (ds:schemaRef/@ds:uri). */
3103
+ schemaUri?: string;
3104
+ /** Raw XML string content of the associated `itemProps` file. */
3105
+ properties?: string;
3106
+ /** Raw XML string content of the OPC relationship file (`customXml/_rels/item{id}.xml.rels`). */
3107
+ rels?: string;
3108
+ }
3109
+ interface PptxEmbeddedFont {
3110
+ name: string;
3111
+ dataUrl: string;
3112
+ bold?: boolean;
3113
+ italic?: boolean;
3114
+ /** CSS font format hint (e.g. "truetype", "opentype"). */
3115
+ format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
3116
+ /**
3117
+ * Deobfuscated (clear-text) font binary data preserved from load
3118
+ * for round-trip re-embedding on save. When present, the save
3119
+ * pipeline will re-obfuscate and write this data back into the ZIP.
3120
+ */
3121
+ rawFontData?: Uint8Array;
3122
+ /**
3123
+ * Original ZIP path of the font part (e.g. `ppt/fonts/{GUID}.fntdata`).
3124
+ * Preserved from load for round-trip.
3125
+ */
3126
+ partPath?: string;
3127
+ /**
3128
+ * The GUID used for obfuscation, either from the `fontKey` attribute
3129
+ * or extracted from the part path. Preserved from load for round-trip.
3130
+ */
3131
+ fontGuid?: string;
3132
+ /**
3133
+ * Relationship ID (e.g. `rId21`) of the font part in
3134
+ * `ppt/_rels/presentation.xml.rels`. Preserved from load so the save
3135
+ * pipeline can reuse the original part/rel instead of minting a new
3136
+ * GUID-named copy alongside the stale original.
3137
+ */
3138
+ originalRId?: string;
3139
+ /**
3140
+ * Raw bytes of the original obfuscated font part exactly as they were
3141
+ * stored in the source ZIP. When the loader could not determine a
3142
+ * usable GUID (e.g. EOT extraction path), the save pipeline preserves
3143
+ * these bytes verbatim under the original path/rel.
3144
+ */
3145
+ originalPartBytes?: Uint8Array;
3146
+ }
3147
+ //#endregion
3148
+ //#region pptx/core/builders/sdk/merge-operations.d.ts
3149
+ /**
3150
+ * Options controlling how slides are merged from source into target.
3151
+ */
3152
+ interface MergeOptions {
3153
+ /** Which slides to take from source (0-based indices). Default: all */
3154
+ slideIndices?: number[];
3155
+ /** Where to insert in target (0-based). Default: end */
3156
+ insertAt?: number;
3157
+ /** Whether to keep source theme (false = use target theme). Default: false */
3158
+ keepSourceTheme?: boolean;
3159
+ }
3160
+ /**
3161
+ * Merge slides from a source presentation into a target.
3162
+ *
3163
+ * This is a data-level merge that operates on {@link PptxData} objects.
3164
+ * Slides are deep-cloned from the source, re-numbered to avoid ID
3165
+ * conflicts, and inserted into the target's slides array.
3166
+ *
3167
+ * Media embedded as data URLs (imageData, mediaData, backgroundImage,
3168
+ * posterFrameData) travel with the cloned elements automatically.
3169
+ *
3170
+ * @param targetData - The target presentation data (will be modified in place).
3171
+ * @param sourceData - The source presentation data (read-only — slides are cloned).
3172
+ * @param options - Merge configuration.
3173
+ * @returns Number of slides merged.
3174
+ *
3175
+ * @example
3176
+ * ```ts
3177
+ * const target = await handler.load(targetBuffer);
3178
+ * const source = await handler.load(sourceBuffer);
3179
+ *
3180
+ * const count = mergePresentation(target, source, {
3181
+ * slideIndices: [0, 2],
3182
+ * insertAt: 1,
3183
+ * });
3184
+ * console.log(`Merged ${count} slides`);
3185
+ * ```
3186
+ */
3187
+ declare function mergePresentation(targetData: PptxData, sourceData: PptxData, options?: MergeOptions): number;
3188
+ //#endregion
3189
+ //#region pptx/core/builders/sdk/text-operations.d.ts
3190
+ /**
3191
+ * A single text match result returned by {@link findText}.
3192
+ */
3193
+ interface FindResult {
3194
+ /** 0-based slide index. */
3195
+ slideIndex: number;
3196
+ /** ID of the element containing the match. */
3197
+ elementId: string;
3198
+ /** Index of the text segment within the element. */
3199
+ segmentIndex: number;
3200
+ /** The matched text. */
3201
+ text: string;
3202
+ /** Character offset within the segment where the match starts. */
3203
+ matchIndex: number;
3204
+ }
3205
+ /**
3206
+ * Search for text across all slides in the presentation.
3207
+ *
3208
+ * Searches through all text segments in all elements (including
3209
+ * group children recursively). Supports both plain string and
3210
+ * RegExp patterns.
3211
+ *
3212
+ * @param slides - Array of slides to search.
3213
+ * @param search - Plain string or RegExp to search for.
3214
+ * @returns Array of match results with location information.
3215
+ *
3216
+ * @example
3217
+ * ```ts
3218
+ * const results = findText(data.slides, /Q[1-4] \d{4}/);
3219
+ * console.log(`Found ${results.length} date references`);
3220
+ * ```
3221
+ */
3222
+ declare function findText(slides: PptxSlide[], search: string | RegExp): FindResult[];
3223
+ /**
3224
+ * Replace all occurrences of a search pattern in a single slide's elements.
3225
+ *
3226
+ * Mutates the slide's elements in place. Searches through all
3227
+ * text segments including group children recursively.
3228
+ *
3229
+ * @param slide - The slide to perform replacements on.
3230
+ * @param search - Plain string or RegExp to search for.
3231
+ * @param replacement - The replacement string (supports `$1`, `$&` etc. for RegExp).
3232
+ * @returns The number of replacements made.
3233
+ *
3234
+ * @example
3235
+ * ```ts
3236
+ * const count = replaceTextInSlide(data.slides[0], "2025", "2026");
3237
+ * console.log(`Updated ${count} occurrences on slide 1`);
3238
+ * ```
3239
+ */
3240
+ declare function replaceTextInSlide(slide: PptxSlide, search: string | RegExp, replacement: string): number;
3241
+ /**
3242
+ * Replace all occurrences of a search pattern across all slides.
3243
+ *
3244
+ * Mutates slides' elements in place. Searches through all text
3245
+ * segments including group children recursively.
3246
+ *
3247
+ * @param slides - Array of slides to perform replacements on.
3248
+ * @param search - Plain string or RegExp to search for.
3249
+ * @param replacement - The replacement string.
3250
+ * @returns The total number of replacements made across all slides.
3251
+ *
3252
+ * @example
3253
+ * ```ts
3254
+ * const count = replaceText(data.slides, "Acme Corp", "NewCo Inc");
3255
+ * console.log(`Rebranded ${count} occurrences`);
3256
+ * ```
3257
+ */
3258
+ declare function replaceText(slides: PptxSlide[], search: string | RegExp, replacement: string): number;
3259
+ //#endregion
3260
+ export { PptxThemeOption as $, PptxAnimScaleBehavior as $t, PptxNormalViewProperties as A, PptxAnimationRepeatMode as At, PptxEmbeddedFontDescriptor as B, PptxHslColorDelta as Bt, PptxSlide as C, PptxAnimationDirection as Ct, PptxSmartTagsReference as D, PptxAnimationKeyframe as Dt, PptxSlideSyncProperties as E, PptxAnimationIterate as Et, PptxViewScale as F, PptxAnimationTrigger as Ft, PptxHeaderFooterFlags as G, PptxTextAnimationTarget as Gt, PptxEmbeddedFontListEntry as H, PptxNativeAnimation as Ht, PptxPresentationPrintProperties as I, PptxAttributeAnimation as It, PptxNotesMaster as J, PptxVisibilitySetTiming as Jt, PptxLayoutPreview as K, PptxTextBuildType as Kt, PptxPrintColorMode as L, PptxColorAnimation as Lt, PptxViewGuide as M, PptxAnimationTarget as Mt, PptxViewOrigin as N, PptxAnimationTimelineAnchor as Nt, PptxCommonSlideViewProperties as O, PptxAnimationOleChartElementTarget as Ot, PptxViewProperties as P, PptxAnimationTimingCurve as Pt, PptxTextStyleLevels as Q, PptxAnimRotBehavior as Qt, PptxPrintOutput as R, PptxElementAnimation as Rt, PptxSection as S, PptxAfterAnimationAction as St, PptxSlideSize as T, PptxAnimationGraphicElementTarget as Tt, MasterViewTab as U, PptxNativeAnimationKind as Ut, PptxEmbeddedFontList as V, PptxMediaBookmarkTarget as Vt, PptxHandoutMaster as W, PptxSetAnimation as Wt, PptxSlideLayout as X, PptxAnimEffectBehavior as Xt, PptxPlaceholderFrame as Y, PptxAnimBehavior as Yt, PptxSlideMaster as Z, PptxAnimMotionBehavior as Zt, PptxLayoutOption as _, PptxTag as _t, MergeOptions as a, PptxSlideTransition as an, PptxThemeFontScheme as at, PptxPhotoAlbum as b, AnimationCondition as bt, PptxCustomShow as c, PptxStripDirection as cn, PptxThemeObjectDefaults as ct, PptxData as d, PptxTransitionSpeed as dn, PptxComment as dt, PptxAnimationBehavior as en, PptxTheme as et, PptxEmbeddedFont as f, PptxTransitionType as fn, PptxCommentAuthor as ft, PptxKinsoku as g, PptxModernCommentAuthor as gt, PptxHeaderFooter as h, TRANSITION_VALID_DIRECTIONS as hn, PptxCustomProperty as ht, replaceTextInSlide as i, PptxMorphOption as in, PptxThemeFontGroup as it, PptxRestoredRegion as j, PptxAnimationSequence as jt, PptxGridSpacing as k, PptxAnimationPreset as kt, PptxCustomXmlPart as l, PptxTransitionDirection4 as ln, THEME_COLOR_SCHEME_KEYS as lt, PptxExportOptions as m, TRANSITION_THRUBLK_TYPES as mn, PptxCoreProperties as mt, findText as n, PptxBehaviorPoint as nn, PptxThemeEffectStyle as nt, mergePresentation as o, PptxSplitDirection as on, PptxThemeFormatScheme as ot, PptxExportFormat as p, TRANSITION_PATTERN_OPTIONS as pn, PptxCompatibilityWarning as pt, PptxMasterTextStyles as q, PptxTimingTemplate as qt, replaceText as r, PptxSetBehavior as rn, PptxThemeFillStyle as rt, PptxActiveXControl as s, PptxSplitOrientation as sn, PptxThemeLineStyle as st, FindResult as t, PptxAnimationBehaviorTiming as tn, PptxThemeColorScheme as tt, PptxCustomerData as u, PptxTransitionDirection8 as un, PptxAppProperties as ut, PptxModernCommentPart as v, PptxTagCollection as vt, PptxSlideBackgroundPattern as w, PptxAnimationEffectFilter as wt, PptxPresentationProperties as x, AnimationConditionEvent as xt, PptxModifyVerifier as y, PptxCommentMention as yt, PptxEmbeddedFontDataId as z, PptxGraphicBuild as zt };
3261
+ //# sourceMappingURL=text-operations-CyMTMfID.d.ts.map