ooxml-core 1.10.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 (162) hide show
  1. package/dist/PptxHandler-DNZHAHUY.cjs +12 -0
  2. package/dist/PptxHandler-E44KDHMQ.mjs +3 -0
  3. package/dist/{PptxHandler-ADEFY476.mjs → PptxHandler-NROFYT2N.mjs} +2 -2
  4. package/dist/automation/index.cjs +3293 -2867
  5. package/dist/automation/index.mjs +3293 -2867
  6. package/dist/{chunk-3N6XMMTT.cjs → chunk-2UVH6RHI.cjs} +1138 -996
  7. package/dist/{chunk-ZOUGMAZG.mjs → chunk-7DSZI7S6.mjs} +1 -1
  8. package/dist/{chunk-S6DOCMQC.cjs → chunk-7QZGRB3T.cjs} +0 -10
  9. package/dist/chunk-ANZ4Q6I3.cjs +21 -0
  10. package/dist/{chunk-5NVJN4E6.mjs → chunk-EC2W2MDY.mjs} +1 -1
  11. package/dist/chunk-EGTRL3QJ.mjs +19 -0
  12. package/dist/chunk-GXHKNSZX.mjs +9 -0
  13. package/dist/{chunk-CCHYFCPD.mjs → chunk-HCXUI5UC.mjs} +296 -103
  14. package/dist/chunk-HDQXPSHY.cjs +17 -0
  15. package/dist/chunk-KTYBFGEY.mjs +14 -0
  16. package/dist/chunk-QOO36KG4.cjs +42 -0
  17. package/dist/chunk-R2KZXD6U.mjs +39 -0
  18. package/dist/{chunk-A6P7G3UK.mjs → chunk-U2DF3EGK.mjs} +1 -1
  19. package/dist/{chunk-R6KSBNKX.mjs → chunk-UAY26XOI.mjs} +1 -9
  20. package/dist/{chunk-WUE5ZHU3.mjs → chunk-W5ARCUJB.mjs} +3 -3
  21. package/dist/chunk-XZPZHXV4.cjs +12 -0
  22. package/dist/{chunk-ZE53K7DH.mjs → chunk-YB5SRNFS.mjs} +244 -102
  23. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  24. package/dist/docx/layout/index.cjs +125 -56
  25. package/dist/docx/layout/index.mjs +125 -56
  26. package/dist/docx/layout/nested-fragment-edges.d.ts +9 -0
  27. package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -0
  28. package/dist/docx/layout/result.d.ts +7 -0
  29. package/dist/docx/layout/result.d.ts.map +1 -1
  30. package/dist/docx/layout/table-border-layout.d.ts +1 -1
  31. package/dist/docx/layout/table-border-layout.d.ts.map +1 -1
  32. package/dist/docx/layout/table-cell-layout.d.ts +1 -1
  33. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  34. package/dist/docx/layout/table-frames.d.ts.map +1 -1
  35. package/dist/docx/layout/table-layout.d.ts +1 -1
  36. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  37. package/dist/pptx/automation/index.cjs +266 -114
  38. package/dist/pptx/automation/index.d.ts +5 -4
  39. package/dist/pptx/automation/index.d.ts.map +1 -1
  40. package/dist/pptx/automation/index.mjs +5 -5
  41. package/dist/pptx/chunks/{text-operations-BqHmLaLA.d.ts → elements-DD3UGOMd.d.ts} +17 -3262
  42. package/dist/pptx/chunks/elements-DD3UGOMd.d.ts.map +1 -0
  43. package/dist/pptx/chunks/{index-DUCGeZh7.d.ts → index-BZrFyNtU.d.ts} +53 -5
  44. package/dist/pptx/chunks/index-BZrFyNtU.d.ts.map +1 -0
  45. package/dist/pptx/chunks/{index-Cuxtr76Y.d.ts → index-DdX02BSm.d.ts} +5 -3
  46. package/dist/pptx/chunks/index-DdX02BSm.d.ts.map +1 -0
  47. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts +1512 -0
  48. package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts.map +1 -0
  49. package/dist/pptx/chunks/text-D49FKllA.d.ts +1473 -0
  50. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +1 -0
  51. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts +3261 -0
  52. package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts.map +1 -0
  53. package/dist/pptx/cli/index.cjs +266 -114
  54. package/dist/pptx/cli/index.d.ts +1 -1
  55. package/dist/pptx/cli/index.mjs +4 -4
  56. package/dist/pptx/converter/index.d.ts +1 -1
  57. package/dist/pptx/converter/index.mjs +2 -2
  58. package/dist/pptx/editor/render/find-replace.cjs +17 -16
  59. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  60. package/dist/pptx/editor/render/find-replace.mjs +2 -1
  61. package/dist/pptx/editor/render/font-family-update.cjs +14 -0
  62. package/dist/pptx/editor/render/font-family-update.d.ts +17 -0
  63. package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -0
  64. package/dist/pptx/editor/render/font-family-update.mjs +1 -0
  65. package/dist/pptx/editor/render/paragraph-geometry-overrides.cjs +14 -0
  66. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +17 -0
  67. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -0
  68. package/dist/pptx/editor/render/paragraph-geometry-overrides.mjs +12 -0
  69. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  70. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  71. package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
  72. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  73. package/dist/pptx/editor/render/text-content-style.cjs +18 -0
  74. package/dist/pptx/editor/render/text-content-style.d.ts +9 -0
  75. package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -0
  76. package/dist/pptx/editor/render/text-content-style.mjs +5 -0
  77. package/dist/pptx/editor/render/text-runs-style-patch.cjs +17 -0
  78. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +7 -0
  79. package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -0
  80. package/dist/pptx/editor/render/text-runs-style-patch.mjs +15 -0
  81. package/dist/pptx/editor/render/text-style-scope.cjs +173 -0
  82. package/dist/pptx/editor/render/text-style-scope.d.ts +76 -0
  83. package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -0
  84. package/dist/pptx/editor/render/text-style-scope.mjs +164 -0
  85. package/dist/pptx/editor/render/theme-editor-model.cjs +1 -1
  86. package/dist/pptx/editor/render/theme-editor-model.mjs +1 -1
  87. package/dist/pptx/editor/render/update-text-segment-style.cjs +11 -0
  88. package/dist/pptx/editor/render/update-text-segment-style.d.ts +14 -0
  89. package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -0
  90. package/dist/pptx/editor/render/update-text-segment-style.mjs +2 -0
  91. package/dist/pptx/index.cjs +329 -114
  92. package/dist/pptx/index.d.ts +7 -5
  93. package/dist/pptx/index.mjs +5 -5
  94. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  95. package/dist/teams/index.cjs +112 -16
  96. package/dist/teams/index.mjs +112 -16
  97. package/dist/visio/edit-commands.d.ts +3 -3
  98. package/dist/visio/edit-commands.d.ts.map +1 -1
  99. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  100. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  101. package/dist/visio/edit-text-field-commands.d.ts +15 -0
  102. package/dist/visio/edit-text-field-commands.d.ts.map +1 -1
  103. package/dist/visio/edit-text-field.d.ts +2 -2
  104. package/dist/visio/edit-text-field.d.ts.map +1 -1
  105. package/dist/visio/edit.d.ts +1 -1
  106. package/dist/visio/edit.d.ts.map +1 -1
  107. package/dist/visio/index.cjs +382 -210
  108. package/dist/visio/index.d.ts +1 -1
  109. package/dist/visio/index.d.ts.map +1 -1
  110. package/dist/visio/index.mjs +382 -210
  111. package/dist/visio/model.d.ts +6 -0
  112. package/dist/visio/model.d.ts.map +1 -1
  113. package/dist/visio/shapes.d.ts.map +1 -1
  114. package/dist/visio/style.d.ts +1 -1
  115. package/dist/visio/style.d.ts.map +1 -1
  116. package/dist/visio/text-field-display.d.ts +3 -0
  117. package/dist/visio/text-field-display.d.ts.map +1 -1
  118. package/dist/visio/text-field-editability.d.ts +6 -0
  119. package/dist/visio/text-field-editability.d.ts.map +1 -0
  120. package/dist/visio/text-field-independent.d.ts +4 -0
  121. package/dist/visio/text-field-independent.d.ts.map +1 -0
  122. package/dist/visio/text-field-source.d.ts +6 -0
  123. package/dist/visio/text-field-source.d.ts.map +1 -0
  124. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  125. package/dist/visio/ui/index.cjs +394 -211
  126. package/dist/visio/ui/index.mjs +394 -211
  127. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  128. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  129. package/dist/xlsx/index.cjs +773 -514
  130. package/dist/xlsx/index.mjs +772 -515
  131. package/dist/xlsx/load/index.cjs +541 -292
  132. package/dist/xlsx/load/index.mjs +541 -292
  133. package/dist/xlsx/model-pivots.d.ts +8 -0
  134. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  135. package/dist/xlsx/pivot/admission.d.ts.map +1 -1
  136. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  137. package/dist/xlsx/pivot/data.d.ts +2 -2
  138. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  139. package/dist/xlsx/pivot/index.d.ts +2 -0
  140. package/dist/xlsx/pivot/index.d.ts.map +1 -1
  141. package/dist/xlsx/pivot/measures.d.ts +1 -1
  142. package/dist/xlsx/pivot/measures.d.ts.map +1 -1
  143. package/dist/xlsx/pivot/page-filter-admission.d.ts +5 -0
  144. package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -0
  145. package/dist/xlsx/pivot/page-filter.d.ts +11 -0
  146. package/dist/xlsx/pivot/page-filter.d.ts.map +1 -0
  147. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  148. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  149. package/dist/xlsx/pivot/values-axis.d.ts +4 -1
  150. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -1
  151. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  152. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  153. package/dist/xlsx/ui/index.cjs +95 -12
  154. package/dist/xlsx/ui/index.mjs +95 -12
  155. package/package.json +2 -2
  156. package/dist/PptxHandler-5UURGJEV.mjs +0 -2
  157. package/dist/PptxHandler-U5XB2HUE.cjs +0 -11
  158. package/dist/pptx/chunks/index-Cuxtr76Y.d.ts.map +0 -1
  159. package/dist/pptx/chunks/index-DUCGeZh7.d.ts.map +0 -1
  160. package/dist/pptx/chunks/smart-art-D-sXa_Nb.d.ts +0 -2980
  161. package/dist/pptx/chunks/smart-art-D-sXa_Nb.d.ts.map +0 -1
  162. package/dist/pptx/chunks/text-operations-BqHmLaLA.d.ts.map +0 -1
@@ -1,5 +1,6 @@
1
- import { Gt as PptxCustomPathProperties, Jt as TextSegment, Wt as GeometryAdjustmentHandle, Yt as TextStyle, _n as ShadowEffect, bn as XmlObject, en as EffectDagContainer, gn as PptxShapeLocks, hn as PptxDrawingGuide, ln as Pptx3DScene, mn as ConnectorConnectionPoint, n as PptxSmartArtData, pn as ConnectorArrowType, un as Pptx3DShape, vn as StrokeDashType } from "./smart-art-D-sXa_Nb.js";
1
+ import { C as ConnectorConnectionPoint, D as StrokeDashType, E as ShadowEffect, S as ConnectorArrowType, T as PptxShapeLocks, i as TextStyle, k as XmlObject, l as EffectDagContainer, r as TextSegment, v as Pptx3DScene, y as Pptx3DShape } from "./text-D49FKllA.js";
2
2
  import { t as PptxThemeColorRef } from "./color-ref-DT599vEx.js";
3
+ import { Gt as PptxCustomPathProperties, Wt as GeometryAdjustmentHandle, n as PptxSmartArtData } from "./smart-art-ENMMEbmW.js";
3
4
  //#region pptx/core/types/shape-style.d.ts
4
5
  interface PptxCustomDashSegment {
5
6
  /** Dash length as a non-negative percentage in thousandths of one percent. */
@@ -3702,1240 +3703,6 @@ interface ParsedTableStyleEntry {
3702
3703
  */
3703
3704
  type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
3704
3705
  //#endregion
3705
- //#region pptx/core/types/transition.d.ts
3706
- /**
3707
- * Available slide transition effects.
3708
- *
3709
- * Maps to the OOXML child element names under `<p:transition>` / `<p14:transition>`.
3710
- *
3711
- * @example
3712
- * ```ts
3713
- * const t: PptxTransitionType = "morph";
3714
- * // => "morph" — one of 40+ transition effects
3715
- * ```
3716
- */
3717
- 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';
3718
- /** Cardinal direction tokens from OOXML transition `@_dir`. */
3719
- type PptxTransitionDirection4 = 'l' | 'r' | 'u' | 'd';
3720
- /** 8-way direction tokens (cardinal + diagonal) for cover/uncover. */
3721
- type PptxTransitionDirection8 = PptxTransitionDirection4 | 'lu' | 'ld' | 'ru' | 'rd';
3722
- /** Strip direction tokens from OOXML. */
3723
- type PptxStripDirection = 'lu' | 'ld' | 'ru' | 'rd';
3724
- /** Split orientation from OOXML `@_orient`. */
3725
- type PptxSplitOrientation = 'horz' | 'vert';
3726
- /** Split in/out direction from OOXML `@_dir`. */
3727
- type PptxSplitDirection = 'in' | 'out';
3728
- /** Schema-defined `ST_TransitionSpeed` values. */
3729
- type PptxTransitionSpeed = 'slow' | 'med' | 'fast';
3730
- /**
3731
- * Valid direction sets per transition type.
3732
- *
3733
- * The p14 (Office 2010+) and p15 (Office 2013+) entries below are COM-verified:
3734
- * each direction token was confirmed by enumerating PowerPoint's own
3735
- * `PpEntryEffect` constants (reflected off the installed
3736
- * `Microsoft.Office.Interop.PowerPoint` type library) and reading back the
3737
- * `p:transition` XML PowerPoint itself saved for each one, exactly like the
3738
- * `p14-prism-family` and `P15_INVX_PRESETS` measurements. Two findings that
3739
- * contradict the naive "4-way cardinal for every named Left/Up/Right/Down
3740
- * effect" assumption:
3741
- * - `switch` and `flip` each expose four named directions in PowerPoint's UI
3742
- * (Left/Up/Right/Down), but the saved XML only ever carries `dir="l"` or
3743
- * `dir="r"`: Up and Down both collapse to `dir="r"` on save. Modelling them
3744
- * as 4-way here would offer a picker button PowerPoint itself cannot
3745
- * persist.
3746
- * - `ripple`'s only named directions are the four DIAGONALS (`lu`/`ld`/`ru`/
3747
- * `rd`, PowerPoint's "Ripple" gallery calls them Left-Up/Left-Down/etc.);
3748
- * there is no cardinal `l`/`r`/`u`/`d` variant, and the unset default is a
3749
- * fifth "From Center" state with no `dir` attribute at all.
3750
- */
3751
- declare const TRANSITION_VALID_DIRECTIONS: Readonly<Partial<Record<PptxTransitionType, readonly string[]>>>;
3752
- /**
3753
- * Transition types offering a "Pattern" effect option alongside direction
3754
- * (COM-verified via `p14:glitter/@pattern` and `p14:shred/@pattern`).
3755
- */
3756
- declare const TRANSITION_PATTERN_OPTIONS: Readonly<Partial<Record<PptxTransitionType, readonly string[]>>>;
3757
- /**
3758
- * Transition types offering the "Through Black" checkbox
3759
- * (OOXML `@_thruBlk`, `CT_OptionalBlackTransition`). COM-verified: enumerating
3760
- * every `PpEntryEffect` constant found a dedicated black variant only for
3761
- * `Cut` (`ppEffectCutThroughBlack`) and the legacy `Fade` entry (`ppEffectFade`,
3762
- * as opposed to the newer non-black `ppEffectFadeSmoothly`); no Blinds/
3763
- * Checkerboard "through black" `PpEntryEffect` constant exists despite the
3764
- * `thruBlk` attribute being generically parseable off any standard transition
3765
- * child.
3766
- */
3767
- declare const TRANSITION_THRUBLK_TYPES: ReadonlySet<PptxTransitionType>;
3768
- /**
3769
- * Slide transition configuration.
3770
- *
3771
- * @example
3772
- * ```ts
3773
- * const transition: PptxSlideTransition = {
3774
- * type: "fade",
3775
- * durationMs: 700,
3776
- * advanceOnClick: true,
3777
- * advanceAfterMs: 5000,
3778
- * };
3779
- * // => { type: "fade", durationMs: 700, advanceOnClick: true, advanceAfterMs: 5000 }
3780
- * ```
3781
- */
3782
- /**
3783
- * Morph granularity (`<p159:morph @option>`).
3784
- *
3785
- * - `byObject` - match whole shapes (PowerPoint's default)
3786
- * - `byWord` - additionally morph text word by word
3787
- * - `byChar` - additionally morph text character by character
3788
- */
3789
- type PptxMorphOption = 'byObject' | 'byWord' | 'byChar';
3790
- interface PptxSlideTransition {
3791
- type: PptxTransitionType;
3792
- /** Schema-defined transition speed. Defaults to `fast` when omitted. */
3793
- speed?: PptxTransitionSpeed;
3794
- durationMs?: number;
3795
- direction?: string;
3796
- advanceOnClick?: boolean;
3797
- advanceAfterMs?: number;
3798
- /** Number of spokes for wheel transition (1-8). */
3799
- spokes?: number;
3800
- /** Pattern type for shred transition. */
3801
- pattern?: string;
3802
- /**
3803
- * Through-black flag (OOXML `@_thruBlk`). COM-verified to actually apply to
3804
- * `cut` and `fade` (see {@link TRANSITION_THRUBLK_TYPES}); parsed generically
3805
- * off any standard transition child so an unexpected authored value still
3806
- * round-trips.
3807
- */
3808
- thruBlk?: boolean;
3809
- /** Split orientation (horz/vert) parsed from `@_orient`. */
3810
- orient?: PptxSplitOrientation;
3811
- /**
3812
- * Morph granularity from `<p159:morph @option>`: how finely PowerPoint
3813
- * matches content between the two slides. Only meaningful when
3814
- * {@link type} is `morph`; defaults to `byObject` when the attribute is
3815
- * absent, matching PowerPoint's own default.
3816
- */
3817
- morphOption?: PptxMorphOption;
3818
- /** Relationship ID of transition sound from `p:sndAc/p:stSnd/@r:embed` when present. */
3819
- soundRId?: string;
3820
- /** Embedded WAV display name from `p:stSnd/p:snd/@name`. */
3821
- soundName?: string;
3822
- /** Whether the transition sound repeats until another sound starts. */
3823
- soundLoop?: boolean;
3824
- /** Resolved transition sound media path within the package. */
3825
- soundPath?: string;
3826
- /** Human-readable sound file name (extracted from soundPath, or set by the
3827
- * UI when a new file is picked, before it has a soundPath at all). */
3828
- soundFileName?: string;
3829
- /**
3830
- * A newly-picked local sound file awaiting embedding, as a `data:` URL.
3831
- * Set by the transitions ribbon's Sound picker (`applyTransitionSoundFile`
3832
- * in `pptx-viewer-shared`) when the user chooses a file that is not yet
3833
- * part of the package; mirrors `imageData`/`mediaData` on picture and media
3834
- * elements. The save pipeline (`embedTransitionSound`) writes the bytes to
3835
- * `ppt/media/`, mints a relationship, sets `soundRId`/`soundPath`, and
3836
- * clears this field so a later save does not re-embed the same bytes.
3837
- */
3838
- soundData?: string;
3839
- /**
3840
- * When true, the transition stops the currently-playing sound (OOXML `p:sndAc/p:endSnd`).
3841
- * Mutually exclusive with `soundRId`/`soundPath` (which use `p:stSnd`).
3842
- */
3843
- stopSound?: boolean;
3844
- /** Preserved sound-action XML node from `p:sndAc` for lossless round-trip. */
3845
- rawSoundAction?: XmlObject;
3846
- /** Preserved extension-list XML node from `p:extLst` within the transition for lossless round-trip. */
3847
- rawExtLst?: XmlObject;
3848
- /** Original transition node, retained to preserve unknown attributes and children. */
3849
- rawTransition?: XmlObject;
3850
- }
3851
- //#endregion
3852
- //#region pptx/core/types/animation-behavior.d.ts
3853
- /** Timing of one behaviour, from its own `p:cBhvr/p:cTn`. */
3854
- interface PptxAnimationBehaviorTiming {
3855
- /** The behavior's own fill, independent of its containing effect. */
3856
- fill?: 'remove' | 'freeze' | 'hold' | 'transition';
3857
- /** Preserved timing profile cannot be reduced to a finite delayed one-shot set. */
3858
- unsupportedSetTiming?: boolean;
3859
- /** `p:cTn/@dur` in ms; absent when `indefinite` or unset. */
3860
- durationMs?: number;
3861
- /** Start offset in ms from `p:stCondLst/p:cond/@delay`, relative to the effect start. */
3862
- delayMs?: number;
3863
- /** `p:cTn/@accel` as a 0..1 fraction of the behaviour's duration. */
3864
- accel?: number;
3865
- /** `p:cTn/@decel` as a 0..1 fraction of the behaviour's duration. */
3866
- decel?: number;
3867
- /** `p:cTn/@autoRev`: play forward, then backward, doubling the active time. */
3868
- autoReverse?: boolean;
3869
- /** `p:cTn/@repeatCount` in plain iterations (OOXML stores thousandths). */
3870
- repeatCount?: number;
3871
- /** `p:cTn/@tmFilter`: the raw `"t,v; t,v; ..."` time remapping list. */
3872
- tmFilter?: string;
3873
- }
3874
- interface BehaviorBase {
3875
- /** Lower-cased `p:attrNameLst` entries, in document order. */
3876
- attrNames: string[];
3877
- /** `p:cBhvr/@additive` (`base`, `sum`, `repl`, `mult`, `none`). */
3878
- additive?: string;
3879
- timing: PptxAnimationBehaviorTiming;
3880
- }
3881
- /** `p:set`: a discrete value held from the behaviour's start. */
3882
- interface PptxSetBehavior extends BehaviorBase {
3883
- kind: 'set';
3884
- value: string | number | boolean;
3885
- }
3886
- /** `p:anim`: a `p:tavLst` ramp or a `from`/`to`/`by` formula ramp. */
3887
- interface PptxAnimBehavior extends BehaviorBase {
3888
- kind: 'anim';
3889
- calcMode?: 'discrete' | 'lin' | 'fmla';
3890
- valueType?: string;
3891
- from?: string;
3892
- to?: string;
3893
- by?: string;
3894
- keyframes: PptxAnimationKeyframe[];
3895
- }
3896
- /** `p:animEffect`: a filter transition (`fade`, `wipe(down)`...). */
3897
- interface PptxAnimEffectBehavior extends BehaviorBase {
3898
- kind: 'animEffect';
3899
- filter?: string;
3900
- transition?: 'in' | 'out' | 'none';
3901
- }
3902
- /** A `p:animScale` factor pair (1 = unscaled) or a `p:animMotion` offset (slide fractions). */
3903
- interface PptxBehaviorPoint {
3904
- x: number;
3905
- y: number;
3906
- }
3907
- /** `p:animScale`: scale factors as fractions (OOXML stores percent*1000, so `100000` = 1). */
3908
- interface PptxAnimScaleBehavior extends BehaviorBase {
3909
- kind: 'animScale';
3910
- from?: PptxBehaviorPoint;
3911
- to?: PptxBehaviorPoint;
3912
- by?: PptxBehaviorPoint;
3913
- zoomContents?: boolean;
3914
- }
3915
- /** `p:animRot`: rotation in degrees (OOXML stores 60000ths). */
3916
- interface PptxAnimRotBehavior extends BehaviorBase {
3917
- kind: 'animRot';
3918
- from?: number;
3919
- to?: number;
3920
- by?: number;
3921
- }
3922
- /** `p:animMotion`: a path (slide fractions) or a `from`/`to`/`by` offset. */
3923
- interface PptxAnimMotionBehavior extends BehaviorBase {
3924
- kind: 'animMotion';
3925
- path?: string;
3926
- origin?: string;
3927
- from?: PptxBehaviorPoint;
3928
- to?: PptxBehaviorPoint;
3929
- by?: PptxBehaviorPoint;
3930
- }
3931
- /** One behaviour child of an effect, tagged by its OOXML element. */
3932
- type PptxAnimationBehavior = PptxSetBehavior | PptxAnimBehavior | PptxAnimEffectBehavior | PptxAnimScaleBehavior | PptxAnimRotBehavior | PptxAnimMotionBehavior;
3933
- //#endregion
3934
- //#region pptx/core/types/animation.d.ts
3935
- /**
3936
- * Built-in animation preset names used for entrance, exit, and emphasis effects.
3937
- *
3938
- * @example
3939
- * ```ts
3940
- * const preset: PptxAnimationPreset = "fadeIn";
3941
- * // => "fadeIn" — one of: none | fadeIn | flyIn | zoomIn | fadeOut | flyOut | zoomOut | spin | pulse | ...
3942
- * ```
3943
- */
3944
- 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';
3945
- /** Animation timing curve. */
3946
- type PptxAnimationTimingCurve = 'ease' | 'ease-in' | 'ease-out' | 'linear';
3947
- /** Repeat mode for animations. */
3948
- type PptxAnimationRepeatMode = 'untilNextClick' | 'untilEndOfSlide';
3949
- /** Animation trigger type from OOXML `p:cTn`. */
3950
- type PptxAnimationTrigger = 'onClick' | 'onShapeClick' | 'onHover' | 'afterPrevious' | 'withPrevious' | 'afterDelay' |
3951
- /**
3952
- * Starts when a media element's playback reaches a named bookmark
3953
- * (PowerPoint's "Trigger > On Bookmark"). The media element is
3954
- * {@link PptxElementAnimation.triggerShapeId} and the bookmark
3955
- * {@link PptxElementAnimation.triggerBookmark}; saved as an interactive
3956
- * sequence gated on `p:cond evt="onMediaBookmark"` with a `p14:bmkTgt`.
3957
- */
3958
- 'onMediaBookmark';
3959
- /**
3960
- * Native animation kind. The historic shape-targeted preset animations are
3961
- * implicitly the default kind (`undefined`). Media animations (`p:audio`,
3962
- * `p:video`) emit dedicated entries so playback order on the slide timeline
3963
- * is preserved alongside other animations.
3964
- */
3965
- type PptxNativeAnimationKind = 'media';
3966
- /**
3967
- * `p:spTgt/p:graphicEl` (CT_TLGraphicalObjectBuildElement, ECMA-376 S19.5.34):
3968
- * identifies exactly which series/category/element of a chart or diagram
3969
- * build a per-stage effect reveals, when a deck authors one effect per stage
3970
- * instead of a single staged `p:bldGraphic` reveal.
3971
- */
3972
- interface PptxAnimationGraphicElementTarget {
3973
- /** Which graphic kind: `p:dgm` (diagram) or `p:chart`. */
3974
- kind: 'dgm' | 'chart';
3975
- /** `@_seriesIdx`, 0-based series index, when the target is series-scoped. */
3976
- seriesIdx?: number;
3977
- /** `@_categoryIdx`, 0-based category index, when the target is category-scoped. */
3978
- categoryIdx?: number;
3979
- /**
3980
- * `p:dgm/@_id` (CT_TLBuildDiagram, ECMA-376 S19.5.10): the diagram DATA MODEL
3981
- * point id (`dgm:pt/@modelId`) this per-stage effect reveals, when a
3982
- * `p:bldDgm` build authors one effect per node instead of a single staged
3983
- * reveal. `dgm`-kind targets only; a `chart`-kind target never carries this.
3984
- * Matches `PptxSmartArtNode.id` (parsed from the same `@modelId`), so a
3985
- * diagram renderer can reveal the exact authored node.
3986
- */
3987
- id?: string;
3988
- /**
3989
- * `@_bldStep`: `ST_TLChartBuildStep` (`category` / `categoryEl` / `series` /
3990
- * `seriesEl`) for a `chart`-kind target, or `ST_TLDiagramBuildStep`
3991
- * (`sp` / `bg`) for a `dgm`-kind target.
3992
- */
3993
- bldStep?: string;
3994
- }
3995
- /**
3996
- * `p:spTgt/p:oleChartEl` (CT_TLOleChartTargetElement, ECMA-376 S19.5.44):
3997
- * legacy pre-DrawingML OLE Graph chart sub-element targeting.
3998
- */
3999
- interface PptxAnimationOleChartElementTarget {
4000
- /** `@_type` (ST_TLOleChartSubelementType): entireChart / series / category / ... */
4001
- subelementType: string;
4002
- /** `@_lvl`, optional sub-element level. */
4003
- level?: number;
4004
- }
4005
- /** A target selected by `p:tgtEl` in the PresentationML timing model. */
4006
- type PptxAnimationTarget = {
4007
- type: 'shape';
4008
- shapeId: string;
4009
- /** Whether `p:spTgt/p:bg` limits the effect to the shape background. */
4010
- backgroundOnly?: boolean;
4011
- /**
4012
- * `p:spTgt/p:subSp/@_spid`: the id of a shape NESTED inside the group
4013
- * named by {@link shapeId} (CT_TLSubShapeId, ECMA-376 S19.5.71).
4014
- * PowerPoint authors this when a user animates one member of a group
4015
- * without ungrouping it: `shapeId` stays the outer group's id for
4016
- * round-trip, but this sub-shape is the real playback target.
4017
- */
4018
- subShapeId?: string;
4019
- /** `p:spTgt/p:graphicEl`: chart/diagram series/category/element target. */
4020
- graphicElement?: PptxAnimationGraphicElementTarget;
4021
- /** `p:spTgt/p:oleChartEl`: legacy OLE chart sub-element target. */
4022
- oleChartElement?: PptxAnimationOleChartElementTarget;
4023
- rawXml?: XmlObject;
4024
- } | {
4025
- type: 'slide';
4026
- rawXml?: XmlObject;
4027
- } | {
4028
- type: 'sound';
4029
- relationshipId: string;
4030
- name?: string;
4031
- rawXml?: XmlObject;
4032
- } | {
4033
- type: 'ink';
4034
- shapeId: string;
4035
- rawXml?: XmlObject;
4036
- } | {
4037
- type: 'unknown';
4038
- rawXml: XmlObject;
4039
- };
4040
- /** Nested build choice carried by `p:bldGraphic`. */
4041
- type PptxGraphicBuild = {
4042
- mode: 'asOne';
4043
- rawXml?: XmlObject;
4044
- } | {
4045
- mode: 'sub';
4046
- kind: 'diagram';
4047
- build: string;
4048
- reverse: boolean;
4049
- rawXml?: XmlObject;
4050
- } | {
4051
- mode: 'sub';
4052
- kind: 'chart';
4053
- build: string;
4054
- animateBackground: boolean;
4055
- rawXml?: XmlObject;
4056
- };
4057
- /**
4058
- * A single `p:tmpl` timing template parsed from a TEXT `p:bldP/p:tmplLst`
4059
- * (CT_TLTemplate, ECMA-376 §19.5.85; the list itself is CT_TLTemplateList,
4060
- * §19.5.84).
4061
- *
4062
- * PowerPoint writes these as the timing PowerPoint would apply to a build
4063
- * level that does not yet have an instantiated effect, so that promoting or
4064
- * demoting an outline paragraph, or adding a new bullet at a level with no
4065
- * prior animation, has a default to clone. They are not consulted at
4066
- * playback: the animation actually shown for every paragraph level already
4067
- * visible on the slide is the real, instantiated `p:tnLst` under
4068
- * `p:timing/p:tnLst`, which the rest of this parser already models in full.
4069
- *
4070
- * The nested time-node tree under each template's own `p:tnLst` is kept as
4071
- * a preserved `XmlObject` rather than deep-parsed into
4072
- * {@link PptxNativeAnimation} records: it is schema-identical to the
4073
- * top-level timing tree but scoped to a template that is never itself
4074
- * executed, so structurally modelling it would stand up a second, unused
4075
- * parallel animation model. Parsing stops at typed round-trip; see
4076
- * `docs/guide/limitations.md`.
4077
- */
4078
- interface PptxTimingTemplate {
4079
- /** Build level this template targets, from `p:tmpl/@lvl` (ST_TLLevel, default 0). */
4080
- level: number;
4081
- /** Preserved `p:tnLst` (CT_TimeNodeList) subtree, verbatim. */
4082
- timeNodeList: XmlObject;
4083
- /** Preserved `p:tmpl` XML node (its attributes plus any unmodelled children). */
4084
- rawXml?: XmlObject;
4085
- }
4086
- /**
4087
- * Parsed native animation record from `p:timing / p:tnLst`.
4088
- *
4089
- * Represents a single animation node in the OOXML timing tree,
4090
- * including motion paths, scale transforms, and text build settings.
4091
- *
4092
- * @example
4093
- * ```ts
4094
- * const anim: PptxNativeAnimation = {
4095
- * targetId: "shape_1",
4096
- * presetClass: "entr",
4097
- * presetId: 10,
4098
- * trigger: "afterPrevious",
4099
- * durationMs: 500,
4100
- * };
4101
- * // => { targetId: "shape_1", presetClass: "entr", presetId: 10, trigger: "afterPrevious", durationMs: 500 }
4102
- * ```
4103
- */
4104
- interface PptxNativeAnimation {
4105
- /** Target element/shape ID. */
4106
- targetId?: string;
4107
- /** Full timing target, including sound and ink target variants. */
4108
- target?: PptxAnimationTarget;
4109
- /** Trigger type. */
4110
- trigger?: PptxAnimationTrigger;
4111
- /**
4112
- * Shape ID that triggers this animation: the clicked shape of an
4113
- * interactive sequence, or the media element of an `onMediaBookmark` one.
4114
- */
4115
- triggerShapeId?: string;
4116
- /** Bookmark name an `onMediaBookmark` interactive sequence waits for. */
4117
- triggerBookmark?: string;
4118
- /** Whether this effect belongs to an OOXML `interactiveSeq`. */
4119
- interactiveSequence?: boolean;
4120
- /** Whether `p:endSync/p:rtn[@val="all"]` makes that sequence replayable. */
4121
- interactiveRestart?: boolean;
4122
- /** Effect preset class (entr, exit, emph, path). */
4123
- presetClass?: 'entr' | 'exit' | 'emph' | 'path';
4124
- /** Effect preset sub-type identifier. */
4125
- presetId?: number;
4126
- /**
4127
- * Effect preset direction/variant code from `p:cTn/@presetSubtype`
4128
- * (ECMA-376 CT_TLCommonTimeNodeData). For Fly In/Out this encodes the
4129
- * edge/corner the object travels from as a bitmask (1=top, 2=right,
4130
- * 4=bottom, 8=left; corners combine bits). Absent means the preset default.
4131
- */
4132
- presetSubtype?: number;
4133
- /** Duration in milliseconds. */
4134
- durationMs?: number;
4135
- /** Delay in milliseconds. */
4136
- delayMs?: number;
4137
- /**
4138
- * Acceleration fraction in the range 0..1, parsed from `p:cTn/@accel`
4139
- * (ST_PositiveFixedPercentage, stored as 1000ths of a percent). A non-zero
4140
- * value means the effect eases in (starts slow). Absent means no easing-in.
4141
- */
4142
- accel?: number;
4143
- /**
4144
- * Deceleration fraction in the range 0..1, parsed from `p:cTn/@decel`.
4145
- * A non-zero value means the effect eases out (ends slow). Absent means no
4146
- * easing-out. When both {@link accel} and {@link decel} are set, the effect
4147
- * eases in and out.
4148
- */
4149
- decel?: number;
4150
- /** Trigger delay in milliseconds (for afterDelay). */
4151
- triggerDelayMs?: number;
4152
- /** SVG path string for motion path animations (`p:animMotion/@path`). */
4153
- motionPath?: string;
4154
- /** Motion origin: "layout" or "parent". */
4155
- motionOrigin?: string;
4156
- /**
4157
- * Whether the element auto-rotates to follow the motion path tangent.
4158
- * Viewer-authoring-only hint: OOXML has no such flag (`p:animMotion/@rAng`
4159
- * is a plain rotation angle that PowerPoint writes as "0" on every path),
4160
- * so the parser never sets this.
4161
- */
4162
- motionPathRotateAuto?: boolean;
4163
- /** Path edit mode from `p:animMotion/@pathEditMode` (e.g. "relative", "fixed"). */
4164
- motionPathEditMode?: string;
4165
- /** Comma-separated point-types string from `p:animMotion/@ptsTypes`. */
4166
- motionPtsTypes?: string;
4167
- /** Authored path rotation in degrees from `p:animMotion/@rAng`. */
4168
- motionPathRotationAngle?: number;
4169
- /** Motion-path rotation centre X in slide percentage units (`p:rCtr/@x`). */
4170
- motionPathRotationCenterX?: number;
4171
- /** Motion-path rotation centre Y in slide percentage units (`p:rCtr/@y`). */
4172
- motionPathRotationCenterY?: number;
4173
- /** Rotation angle in degrees for `p:animRot/@by` (converted from 60000ths). */
4174
- rotationBy?: number;
4175
- /** Starting rotation angle in degrees for `p:animRot/@from` (converted from 60000ths). */
4176
- rotationFrom?: number;
4177
- /** Ending rotation angle in degrees for `p:animRot/@to` (converted from 60000ths). */
4178
- rotationTo?: number;
4179
- /** X scale factor (percentage / 100) for `p:animScale/p:by/@x`. */
4180
- scaleByX?: number;
4181
- /** Y scale factor (percentage / 100) for `p:animScale/p:by/@y`. */
4182
- scaleByY?: number;
4183
- /** Starting X scale factor for `p:animScale/p:from/@x`. */
4184
- scaleFromX?: number;
4185
- /** Starting Y scale factor for `p:animScale/p:from/@y`. */
4186
- scaleFromY?: number;
4187
- /** Ending X scale factor for `p:animScale/p:to/@x`. */
4188
- scaleToX?: number;
4189
- /** Ending Y scale factor for `p:animScale/p:to/@y`. */
4190
- scaleToY?: number;
4191
- /** Whether `p:animScale/@zoomContents` was set ("1"/"true"). */
4192
- scaleZoomContents?: boolean;
4193
- /** Parsed `p:tav` keyframes from `p:tavLst` (CT_TLAnimVariantList). */
4194
- keyframes?: PptxAnimationKeyframe[];
4195
- /**
4196
- * The attribute {@link keyframes} drives, from the SAME node's
4197
- * `p:cBhvr/p:attrNameLst/p:attrName` (ECMA-376 S19.5.4). `p:tavLst` is
4198
- * schema-generic: without this, playback could see a numeric ramp but not
4199
- * know whether it targeted opacity, position, colour, or something with
4200
- * no CSS mapping. Lowercased and trimmed; common values seen in the wild
4201
- * (and written by this codebase's own animation writer) include
4202
- * `"style.opacity"`, `"style.color"`, `"style.visibility"`, `"fillcolor"`,
4203
- * `"stroke.color"`, `"r"` (rotation, only meaningful on `p:animRot`), and
4204
- * `"ppt_x"` / `"ppt_y"` (position, normally driven via `p:animMotion`
4205
- * instead). Absent when the behaviour carries no `p:attrNameLst`.
4206
- */
4207
- attrName?: string;
4208
- /** Every generic `p:anim` sibling composed by the authored effect. */
4209
- attributeAnimations?: PptxAttributeAnimation[];
4210
- /** Repeat count (e.g. `2`, `Infinity` for indefinite). */
4211
- repeatCount?: number;
4212
- /** Whether the animation plays in reverse after completion. */
4213
- autoReverse?: boolean;
4214
- /** Text build type from `p:bldP/@build` in `p:bldLst`. */
4215
- buildType?: PptxTextBuildType;
4216
- /** Build level for multi-level lists from `p:bldP/@bldLvl`. */
4217
- buildLevel?: number;
4218
- /** Group ID linking a `p:bldP` entry to its timing animation node. */
4219
- groupId?: string;
4220
- /**
4221
- * Sound relationship ID to play when animation triggers. Modern PowerPoint
4222
- * (COM-verified against 2016) writes this as a `p:audio/p:cMediaNode`
4223
- * sibling of the effect's own `p:childTnLst`, targeting `p:sndTgt` rather
4224
- * than a shape; the legacy `p:stSnd` form (directly on `p:cTn`) is still
4225
- * accepted on load for round-trip of older-authored decks, but PowerPoint
4226
- * itself no longer writes it and does not recognise it back
4227
- * (`Effect.EffectInformation.SoundEffect` reads empty against it).
4228
- */
4229
- soundRId?: string;
4230
- /** Resolved sound file path from relationship. */
4231
- soundPath?: string;
4232
- /**
4233
- * The embedded sound's `@_name` (from `p:snd`/`p:sndTgt`). For one of
4234
- * PowerPoint's 19 built-in stock sounds this is the exact upper-case file
4235
- * name PowerPoint itself writes (e.g. `"CHIMES.WAV"`); see
4236
- * `pptx-viewer-shared`'s `effect-sound-catalogue.ts`, which matches this
4237
- * value back to a gallery entry. Absent for a custom sound with no name,
4238
- * or when unresolved.
4239
- */
4240
- soundName?: string;
4241
- /** Whether to stop any currently playing sound (`p:endSnd`). */
4242
- stopSound?: boolean;
4243
- /**
4244
- * End-state behaviour from `p:cTn/@fill` (ST_TLTimeNodeFillType, ECMA-376
4245
- * §19.5.27). `hold`/`freeze` mean the effect's final frame persists after
4246
- * it finishes; `remove` (the default when absent) means the target reverts
4247
- * to its pre-effect appearance. `transition` behaves like `hold` until the
4248
- * next time node starts. Absent means the OOXML default (`remove`).
4249
- */
4250
- fill?: 'remove' | 'freeze' | 'hold' | 'transition';
4251
- /**
4252
- * Restart behaviour from `p:cTn/@restart` (ST_TLTimeNodeRestartType).
4253
- * Absent means the OOXML default (`always`).
4254
- */
4255
- restart?: 'always' | 'whenNotActive' | 'never';
4256
- /**
4257
- * Repeat duration in milliseconds from `p:cTn/@repeatDur`. `Infinity`
4258
- * represents the literal `"indefinite"` token.
4259
- */
4260
- repeatDurMs?: number;
4261
- /**
4262
- * Playback speed multiplier from `p:cTn/@spd` (ST_Percentage, normalized
4263
- * from OOXML's 1000ths-of-a-percent storage to a plain percentage, e.g.
4264
- * `150` for 150% / double speed). Absent means normal (100%) speed.
4265
- */
4266
- speedPct?: number;
4267
- /**
4268
- * Reverse the paragraph build order from `p:bldP/@rev` (TEXT build only).
4269
- * Not to be confused with {@link PptxGraphicBuild}'s `reverse` field, which
4270
- * carries the unrelated `p:bldDgm`/`@rev` DIAGRAM-build reverse flag.
4271
- */
4272
- buildReverse?: boolean;
4273
- /**
4274
- * Auto-advance time in milliseconds from `p:bldP/@advAuto`. `Infinity`
4275
- * represents the literal `"indefinite"` token. Absent means the build
4276
- * step waits for a click.
4277
- */
4278
- buildAdvAutoMs?: number;
4279
- /**
4280
- * Per-build-level timing templates from a TEXT `p:bldP/p:tmplLst`
4281
- * (ECMA-376 §19.5.84 CT_TLTemplateList). Parsed for round-trip only; see
4282
- * {@link PptxTimingTemplate} for why they are not consulted at playback.
4283
- */
4284
- buildTemplates?: PptxTimingTemplate[];
4285
- /**
4286
- * Whether the enclosing `p:seq` allows concurrent play with its siblings,
4287
- * from `p:seq/@concurrent`. Parsed for round-trip; not yet honoured by
4288
- * playback (see `docs/guide/limitations.md`).
4289
- */
4290
- seqConcurrent?: boolean;
4291
- /** Next-action behaviour from `p:seq/@nextAc` (ST_TLNextActionType). */
4292
- seqNextAction?: 'none' | 'seek';
4293
- /** Previous-action behaviour from `p:seq/@prevAc` (ST_TLPreviousActionType). */
4294
- seqPrevAction?: 'none' | 'skipTimeNode';
4295
- /**
4296
- * Whether the enclosing click-level group (a direct `p:par` child of the
4297
- * `mainSeq`) begins automatically when the slide appears, rather than waiting
4298
- * for a click.
4299
- *
4300
- * PowerPoint gates a click step with a lone `<p:cond delay="indefinite"/>`;
4301
- * a group that also carries a time-node condition (`onBegin`/`onEnd` with a
4302
- * `@tn`) or a finite delay starts on slide entry ("With/After Previous" as the
4303
- * first effect on the slide). The flat animation list cannot express that on
4304
- * its own, so the parse layer stamps it here.
4305
- */
4306
- groupAutoStart?: boolean;
4307
- /**
4308
- * Index of the enclosing effect-wrapper `p:par` inside the click-level group.
4309
- *
4310
- * Effects that share a wrapper are OOXML siblings: they all start when that
4311
- * wrapper starts, and each `p:cond/@delay` is measured from the wrapper's
4312
- * start, NOT chained off the effect before it. Playback uses this to place
4313
- * simultaneous effects at their true offsets instead of accumulating delays.
4314
- */
4315
- parGroupIndex?: number;
4316
- /**
4317
- * Absolute start offset of the enclosing effect-wrapper from its click group.
4318
- *
4319
- * Structural `p:par` wrappers can carry their own start conditions. Keeping
4320
- * this offset separate from the effect's delay prevents playback from
4321
- * replacing an authored absolute start with a duration-based approximation.
4322
- */
4323
- parGroupDelayMs?: number;
4324
- /** Structured start conditions parsed from `p:stCondLst`. */
4325
- startConditions?: AnimationCondition[];
4326
- /** Structured end conditions parsed from `p:endCondLst`. */
4327
- endConditions?: AnimationCondition[];
4328
- /** Preserved raw `p:endCondLst` XML node for lossless round-trip. */
4329
- rawEndCondLst?: XmlObject;
4330
- /** Color animation data from `p:animClr`. */
4331
- colorAnimation?: PptxColorAnimation;
4332
- /** Text-level target: character range or paragraph range from `p:txEl`. */
4333
- textTarget?: PptxTextAnimationTarget;
4334
- /** Whether this animation is inside an exclusive container (`p:excl`). */
4335
- exclusive?: boolean;
4336
- /**
4337
- * Identifies which `p:excl` container this animation belongs to, when
4338
- * {@link exclusive} is set. ECMA-376 S19.5.24 CT_TLExclusiveTimeNode: at
4339
- * most one direct child of an exclusive container may be active at a
4340
- * time, so starting one child stops any other currently-playing child of
4341
- * the SAME container. Two different `p:excl` containers on the same slide
4342
- * are independent groups; this id (assigned per container encountered
4343
- * during parsing, stable only within one parse's animation list) lets
4344
- * playback tell them apart. Absent when {@link exclusive} is unset.
4345
- */
4346
- exclGroupId?: number;
4347
- /** Command type from `p:cmd` (@_type: call/evt/verb). */
4348
- commandType?: string;
4349
- /** Command string from `p:cmd` (@_cmd). */
4350
- commandString?: string;
4351
- /** Iteration configuration from `p:iterate`. */
4352
- iterate?: PptxAnimationIterate;
4353
- /**
4354
- * Discriminator for non-preset animation kinds. When `undefined`, the
4355
- * entry represents the default shape-effect animation. The `'media'`
4356
- * kind represents a `p:audio` / `p:video` timing node, captured here so
4357
- * playback order in the timeline is preserved alongside other animations.
4358
- */
4359
- kind?: PptxNativeAnimationKind;
4360
- /**
4361
- * For `kind === 'media'`, identifies whether this is an audio or video
4362
- * media node so writers know which OOXML element to re-emit.
4363
- */
4364
- mediaType?: 'audio' | 'video';
4365
- /**
4366
- * SmartArt build attribute (`p:bldDgm/@bld`) when this animation is
4367
- * associated with a SmartArt diagram build. Common values include
4368
- * `whole`, `one`, `lvlOne`, `lvlAtOnce`.
4369
- */
4370
- smartArtBuild?: string;
4371
- /**
4372
- * Graphic-frame build attribute (`p:bldGraphic/@bld`) when this animation
4373
- * is associated with a generic graphic frame build (charts, tables, etc.
4374
- * that aren't OLE charts).
4375
- */
4376
- graphicBuild?: string;
4377
- /**
4378
- * OLE-embedded chart build attribute (`p:bldOleChart/@bld`) when this
4379
- * animation stages an OLE chart graphic frame. Values follow
4380
- * ST_TLOleChartBuildType: `allAtOnce`, `series`, `category`, `seriesEl`,
4381
- * `categoryEl`. Lets a staged-reveal renderer build the chart by series /
4382
- * category / element to match PowerPoint, rather than as one whole element.
4383
- */
4384
- oleChartBuild?: string;
4385
- /** Schema-accurate `p:bldGraphic/p:bldAsOne|p:bldSub` representation. */
4386
- graphicBuildProperties?: PptxGraphicBuild;
4387
- /**
4388
- * Opaque map of `p:cTn` attributes that don't have a typed home on this
4389
- * interface but must round-trip through parse → save. Keys are stored
4390
- * verbatim including the `@_` prefix used by the underlying XML parser
4391
- * (e.g. `@_evtFilter`, `@_display`, `@_masterRel`, `@_nodePh`,
4392
- * `@_endSync`, `@_progress`). The `subTnLst` child element is also
4393
- * preserved here under the literal key `p:subTnLst`. The `afterEffect`
4394
- * attribute is surfaced separately as a typed boolean ({@link afterEffect})
4395
- * because it changes write semantics for subsequent timing nodes.
4396
- */
4397
- cTnAttributes?: Record<string, unknown>;
4398
- /** Parent timing cannot be reduced to the bounded fixed-opacity interval. */
4399
- unsupportedOpacitySetTiming?: boolean;
4400
- /**
4401
- * Whether the OOXML `p:cTn/@afterEffect` flag is set. Indicates this node
4402
- * runs after the parent effect's main body has completed; affects how
4403
- * subsequent peer nodes are sequenced when serialised back to OOXML.
4404
- */
4405
- afterEffect?: boolean;
4406
- /**
4407
- * "After animation" end-state behaviour: dim-to-colour, hide-after-
4408
- * animation, or hide-on-next-click. Populated directly by the
4409
- * native-timing parser (`native-animation-after-effect.ts`) when the
4410
- * effect's `p:cTn/p:subTnLst` carries PowerPoint's genuine after-effect
4411
- * shape, so a real-world deck's build shows up here even with no
4412
- * `pptx:editorMeta`. `applyAfterAnimationFromEditorList` in
4413
- * `pptx-viewer-shared` overrides this from the matching
4414
- * {@link PptxElementAnimation.afterAnimation} entry when the editor's
4415
- * per-element animation list has one (the model the animation panel
4416
- * writes `afterAnimation` into), so an edit through our own UI always wins.
4417
- */
4418
- afterAnimationAction?: PptxAfterAnimationAction;
4419
- /** Dim-to color hex, present when {@link afterAnimationAction} is `dimToColor` AND the dim target is an already-resolved `a:srgbClr`. */
4420
- afterAnimationColor?: string;
4421
- /**
4422
- * The typed theme reference when a `dimToColor` target is an `a:schemeClr`
4423
- * (e.g. `accent2`) instead of `a:srgbClr`: this parse layer has no theme to
4424
- * resolve it to sRGB with (see {@link afterAnimationColor}'s doc), so a
4425
- * playback consumer resolves this against the deck's theme colour map.
4426
- * Mutually exclusive with {@link afterAnimationColor} being set.
4427
- */
4428
- afterAnimationColorRef?: PptxThemeColorRef;
4429
- /**
4430
- * Parsed `p:animEffect` filter descriptor. `presetId`/`presetClass` remain
4431
- * the primary effect selector (see `resolveEffect` in `pptx-viewer-shared`);
4432
- * this is the fallback used when a preset table lookup misses (unmapped or
4433
- * absent `presetId`), which happens for decks authored by tools other than
4434
- * PowerPoint that only emit the SMIL-style filter string.
4435
- */
4436
- effectFilter?: PptxAnimationEffectFilter;
4437
- /**
4438
- * This effect's own `p:cTn/@_id` (a raw OOXML time-node id, not a shape
4439
- * id). Lets playback resolve a `p:cond/@tn` dependency (see
4440
- * {@link AnimationCondition.targetTimeNodeId}) against the SPECIFIC node
4441
- * it names rather than assuming it is always the positionally-previous
4442
- * effect. Absent when the node carried no `@_id`.
4443
- */
4444
- nodeId?: number;
4445
- /**
4446
- * Interpolation mode for this effect's PRIMARY `p:anim`-family behaviour
4447
- * (the same node {@link keyframes}/{@link attrName} were read from), from
4448
- * `@_calcmode` (ST_TLAnimateBehaviorCalcMode, ECMA-376 S19.5.2). See
4449
- * {@link PptxAttributeAnimation.calcMode} for the per-component version.
4450
- */
4451
- calcMode?: 'discrete' | 'lin' | 'fmla';
4452
- /**
4453
- * `p:cBhvr/@_additive` (ST_TLBehaviorAdditiveType, ECMA-376 S19.5.4):
4454
- * controls how this behaviour's value composites with sibling behaviours
4455
- * driving the same attribute on the same target. `sum` accumulates
4456
- * (e.g. a combined scale+rotate), `repl`/`base`/`none`/`mult` replace or
4457
- * otherwise combine. Absent means the OOXML default (`base`).
4458
- */
4459
- cBhvrAdditive?: 'base' | 'sum' | 'repl' | 'mult' | 'none';
4460
- /**
4461
- * `p:cBhvr/@_accumulate` (ST_TLBehaviorAccumulateType): `always` means
4462
- * each `p:cTn/@repeatCount` repeat starts from the PREVIOUS repeat's end
4463
- * value (e.g. a 3x Spin totals 1080deg instead of replaying 0-360 three
4464
- * times); `none` (the OOXML default) resets every repeat.
4465
- */
4466
- cBhvrAccumulate?: 'none' | 'always';
4467
- /**
4468
- * `p:cBhvr/@_xfrmType` (only meaningful on `p:animMotion`): `point`
4469
- * (default) or `img`, a legacy compatibility hint. Round-tripped only.
4470
- */
4471
- cBhvrXfrmType?: 'point' | 'img';
4472
- /**
4473
- * `p:cBhvr/@_override` (ST_TLBehaviorOverrideType): `normal` (default) or
4474
- * `childStyle`, a legacy compatibility hint. Round-tripped only.
4475
- */
4476
- cBhvrOverride?: 'normal' | 'childStyle';
4477
- /**
4478
- * `p:set` discrete attribute assignments composed alongside this effect
4479
- * (ECMA-376 S19.5.79 CT_TLSetBehavior): an instantaneous (non-interpolated)
4480
- * value change, as opposed to {@link attributeAnimations}'s `p:anim`
4481
- * keyframe ramps. PowerPoint authors several font-style emphasis effects
4482
- * this way (Bold Reveal, Underline, Bold Flash, Change Font Size), since
4483
- * "on/off" or "size N" has nothing to interpolate. Not yet consulted by
4484
- * shared playback (round-trip/typed-model only so far).
4485
- */
4486
- setAnimations?: PptxSetAnimation[];
4487
- /**
4488
- * Every behaviour child of this effect (`p:set`, `p:anim`, `p:animEffect`,
4489
- * `p:animScale`, `p:animRot`, `p:animMotion`) with its own timing, as
4490
- * authored. The single-valued fields above flatten a composed preset;
4491
- * this keeps the whole tree so playback can follow what PowerPoint wrote
4492
- * (see `animation-behavior-player` in `pptx-viewer-shared`).
4493
- */
4494
- behaviors?: PptxAnimationBehavior[];
4495
- }
4496
- /**
4497
- * One `p:set` discrete (non-interpolated) attribute assignment composed
4498
- * alongside an authored effect. See {@link PptxNativeAnimation.setAnimations}.
4499
- *
4500
- * @see ECMA-376 S19.5.79 CT_TLSetBehavior
4501
- */
4502
- interface PptxSetAnimation {
4503
- /** Lowercased target attribute from `p:cBhvr/p:attrNameLst/p:attrName`. */
4504
- attrName: string;
4505
- /** Decoded value from `p:to` (same variant shape as a `p:tav/p:val`). */
4506
- value: string | boolean | number;
4507
- /** Discriminant indicating which `p:to` child carried the value. */
4508
- valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
4509
- /** Duration from this behaviour's nested `p:cTn/@dur`. */
4510
- durationMs?: number;
4511
- /** Start offset from this behaviour's nested `p:stCondLst`. */
4512
- delayMs?: number;
4513
- }
4514
- /**
4515
- * Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
4516
- * describes `@filter` as a free-form string of the form `family(subtype)`,
4517
- * optionally followed by `;`-separated fallback candidates (only the first
4518
- * is honoured, per ECMA-376 S19.5.3's "first supported filter wins" rule).
4519
- *
4520
- * @example
4521
- * ```ts
4522
- * const f: PptxAnimationEffectFilter = { family: 'wipe', subtype: 'up', transition: 'in', raw: 'wipe(up)' };
4523
- * ```
4524
- */
4525
- interface PptxAnimationEffectFilter {
4526
- /** Filter family name (e.g. `"wipe"`, `"barn"`, `"checkerboard"`), lowercased. */
4527
- family: string;
4528
- /**
4529
- * Parenthesised subtype/direction token verbatim (e.g. `"up"`,
4530
- * `"inVertical"`, `"across"`, `"4"`). Absent when the filter has no
4531
- * subtype (e.g. bare `"dissolve"`).
4532
- */
4533
- subtype?: string;
4534
- /**
4535
- * `p:animEffect/@transition`: `"in"` reveals the target (the OOXML
4536
- * default when the attribute is omitted), `"out"` conceals it, `"none"`
4537
- * applies the filter without a visibility change (a static filter pass).
4538
- */
4539
- transition?: 'in' | 'out' | 'none';
4540
- /** Raw filter string exactly as authored, for round-trip/debugging. */
4541
- raw: string;
4542
- }
4543
- /**
4544
- * Single keyframe parsed from a `p:tav` element (CT_TLTimeAnimateValue).
4545
- *
4546
- * Each entry in a `p:tavLst` has a time fraction (`@_tm`, in 1000ths of the
4547
- * total duration; or the literal "indefinite" / "large") and a typed value
4548
- * child under `p:val/p:strVal|p:boolVal|p:intVal|p:fltVal|p:clrVal`.
4549
- *
4550
- * @see ECMA-376 §19.5.30 CT_TLAnimVariantList / §19.5.92 CT_TLTimeAnimateValue
4551
- */
4552
- interface PptxAnimationKeyframe {
4553
- /**
4554
- * Time fraction. A finite number is the OOXML `@_tm` integer (0–100000
4555
- * for percentage, where 100000 = 100% of duration). A string preserves
4556
- * special tokens ("indefinite", "large").
4557
- */
4558
- tm: number | string;
4559
- /** Decoded keyframe value. */
4560
- value: string | boolean | number;
4561
- /** Discriminant indicating which `p:val` child carried the value. */
4562
- valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
4563
- /**
4564
- * Optional formula carried on `p:tav/@_fmla`. Preserved for round-trip
4565
- * fidelity; consumers may use it to drive computed animation values.
4566
- */
4567
- fmla?: string;
4568
- /**
4569
- * The typed theme reference when a `p:val/p:clrVal` stop is an
4570
- * `a:schemeClr` (e.g. `accent1`), including any `tint`/`shade`/`lumMod`/
4571
- * `lumOff`/`alpha` children. {@link value} keeps the bare scheme name for
4572
- * round-trip; a playback consumer needs this ref (resolved against the
4573
- * deck's theme colour map) to turn the stop into a real CSS colour, which
4574
- * the bare name alone cannot do. Absent for an `a:srgbClr` stop, whose
4575
- * {@link value} is already a resolved `#rrggbb` hex string.
4576
- */
4577
- colorRef?: PptxThemeColorRef;
4578
- }
4579
- /** One generic `p:anim` behaviour inside a composed PowerPoint effect. */
4580
- interface PptxAttributeAnimation {
4581
- /** Lowercased target attribute from `p:attrNameLst`. */
4582
- attrName: string;
4583
- /**
4584
- * Authored value stops from this behaviour's `p:tavLst`. Empty when the
4585
- * behaviour instead uses the simpler `from`/`to`/`by` attribute form (see
4586
- * below); at least one of `keyframes`, `from`/`to`, or `by` is present.
4587
- */
4588
- keyframes: PptxAnimationKeyframe[];
4589
- /**
4590
- * `p:anim/@_from` (a formula string, ECMA-376 S19.5.4 CT_TLAnimateBehavior):
4591
- * the absolute starting value, used instead of `p:tavLst` when the
4592
- * behaviour only has two endpoints. PowerPoint writes this form for some
4593
- * built-in presets (e.g. "Grow And Turn"'s `ppt_x` fly-in): a bare
4594
- * `p:anim from="..." to="..."` with no `p:tavLst` child at all. See
4595
- * `animation-ppt-formula-ground-truth.md` in `pptx-viewer-shared` for the
4596
- * real-PowerPoint sample this was found in.
4597
- */
4598
- from?: string;
4599
- /** `p:anim/@_to`: the absolute ending value. See {@link from}. */
4600
- to?: string;
4601
- /**
4602
- * `p:anim/@_by`: a DELTA formula added to wherever the attribute already
4603
- * stands (as opposed to `from`/`to`'s absolute values), typically paired
4604
- * with `p:cBhvr/@_additive="sum"` so it composites with a sibling
4605
- * behaviour driving the same attribute instead of replacing it.
4606
- */
4607
- by?: string;
4608
- /** Duration from this behaviour's nested `p:cTn/@dur`. */
4609
- durationMs?: number;
4610
- /** Start offset from this behaviour's nested `p:stCondLst`. */
4611
- delayMs?: number;
4612
- /**
4613
- * Interpolation mode from this behaviour's own `@_calcmode`
4614
- * (ST_TLAnimateBehaviorCalcMode, ECMA-376 S19.5.2): `discrete` snaps to
4615
- * each `p:tav` stop with no interpolation, `lin` (the OOXML default)
4616
- * interpolates linearly. `fmla` as the WHOLE behaviour's calc mode has
4617
- * never been observed in a real PowerPoint file and is not consulted at
4618
- * playback; what PowerPoint actually writes is `calcmode="lin"` with a
4619
- * per-stop `p:tav/@fmla` (see {@link PptxAnimationKeyframe.fmla}), which
4620
- * IS consulted regardless of this field's value. Absent means `lin`.
4621
- */
4622
- calcMode?: 'discrete' | 'lin' | 'fmla';
4623
- /**
4624
- * `p:anim/@_p14:bounceEnd` (Office 2010 `p14` extension attribute,
4625
- * MS-OI29500), normalized to a 0-1 fraction of this behaviour's own
4626
- * duration. PowerPoint's "Bounce End" effect option (COM:
4627
- * `Effect.Timing.BounceEnd` + `BounceEndIntensity`) writes this on the
4628
- * position-ramp `p:anim` node(s): the share of the duration spent
4629
- * BOUNCING at the end. Measured from PowerPoint's own CreateVideo frames,
4630
- * the travel completes at `1 - bounceEnd` and the rest is a damped
4631
- * oscillation about the final value (see shared's `animation-bounce-end`).
4632
- * Mirrored verbatim by PowerPoint onto the enclosing
4633
- * `p:cTn/@_p14:presetBounceEnd`. Absent for every animation that doesn't
4634
- * use this effect option (the overwhelming majority).
4635
- */
4636
- bounceEnd?: number;
4637
- }
4638
- /** Signed HSL channel deltas parsed from `p:animClr/p:by/p:hsl`. */
4639
- interface PptxHslColorDelta {
4640
- /** Hue offset in degrees. OOXML stores this in 60000ths of a degree. */
4641
- hue: number;
4642
- /** Saturation offset in percentage points. */
4643
- saturation: number;
4644
- /** Lightness offset in percentage points. */
4645
- lightness: number;
4646
- }
4647
- /** Color animation data parsed from `p:animClr`. */
4648
- interface PptxColorAnimation {
4649
- /** Color interpolation space: "hsl" or "rgb". */
4650
- colorSpace: 'hsl' | 'rgb';
4651
- /** Direction for HSL interpolation: "cw" (clockwise) or "ccw". */
4652
- direction?: 'cw' | 'ccw';
4653
- /**
4654
- * Optional `p:animClr/@path` value preserved for round-trip. When set,
4655
- * the colour sweep follows a path-based interpolation rather than the
4656
- * straight cw/ccw arc. ECMA-376 §19.5.13 documents this attribute as a
4657
- * companion to `@dir` for HSL colour-space animations.
4658
- */
4659
- path?: string;
4660
- /** Starting color as hex string, or the bare scheme name (e.g. `accent1`) for a theme colour; see {@link fromColorRef}. */
4661
- fromColor?: string;
4662
- /** Ending color as hex string, or the bare scheme name; see {@link toColorRef}. */
4663
- toColor?: string;
4664
- /**
4665
- * Color delta (for "by" animations) as hex string, or the bare scheme name;
4666
- * see {@link byColorRef}. For HSL colour-space animations this retains the
4667
- * historical byte-packed compatibility value; consumers should prefer
4668
- * {@link hslDelta}, which preserves signed values.
4669
- */
4670
- byColor?: string;
4671
- /**
4672
- * The typed theme reference when {@link fromColor} is an `a:schemeClr`
4673
- * (including `tint`/`shade`/`lumMod`/`lumOff`/`alpha`), so playback can
4674
- * resolve it against the deck's theme colour map. Absent when `fromColor`
4675
- * is already a resolved `#rrggbb` hex (an `a:srgbClr` stop).
4676
- */
4677
- fromColorRef?: PptxThemeColorRef;
4678
- /** The typed theme reference for {@link toColor}; see {@link fromColorRef}. */
4679
- toColorRef?: PptxThemeColorRef;
4680
- /**
4681
- * The typed theme reference for {@link byColor} (RGB colour space only; an
4682
- * HSL `by` is a signed delta, never a theme colour). See {@link fromColorRef}.
4683
- */
4684
- byColorRef?: PptxThemeColorRef;
4685
- /**
4686
- * Typed HSL delta from `p:by/p:hsl`. This preserves signed values and their
4687
- * OOXML units without forcing them through the legacy byte-packed `byColor`
4688
- * representation.
4689
- */
4690
- hslDelta?: PptxHslColorDelta;
4691
- /**
4692
- * Target attribute from `p:attrNameLst` (e.g. "fillcolor", "style.color",
4693
- * "stroke.color"). Used to determine which CSS property to animate.
4694
- */
4695
- targetAttribute?: string;
4696
- /**
4697
- * All sibling `p:animClr` behaviours authored for the same timing node.
4698
- * The top-level fields continue to mirror the first behaviour for backwards
4699
- * compatibility; this list is present only when there is more than one.
4700
- */
4701
- components?: readonly PptxColorAnimation[];
4702
- }
4703
- /** Text-level animation target from `p:txEl`. */
4704
- interface PptxTextAnimationTarget {
4705
- /** Target type: character range or paragraph range. */
4706
- type: 'charRg' | 'pRg';
4707
- /** Start index (0-based). */
4708
- start: number;
4709
- /** End index (exclusive). */
4710
- end: number;
4711
- }
4712
- /**
4713
- * Event types for animation conditions from `p:cond/@evt`.
4714
- *
4715
- * These map directly to OOXML condition event attribute values
4716
- * (ISO/IEC 29500-1 S19.5.28 CT_TLTimeCondition).
4717
- */
4718
- type AnimationConditionEvent = 'onBegin' | 'onEnd' | 'begin' | 'end' | 'onClick' | 'onMouseOver' | 'onMouseOut' | 'onNext' | 'onPrev' | 'onStopAudio' | 'onDblClick' | 'onMediaBookmark';
4719
- /**
4720
- * `p14:bmkTgt` (Office 2010 `p14` extension, MS-OI29500): names the specific
4721
- * media element and bookmark an `evt="onMediaBookmark"` condition fires for.
4722
- * `bookmarkName` matches a `p14:bmk/@_name` on that media element's own
4723
- * `p14:bmkLst` (see `MediaBookmark.label` in `core/types/elements.ts`).
4724
- */
4725
- interface PptxMediaBookmarkTarget {
4726
- /** `p14:bmkTgt/@_spid`: the media element's shape id. */
4727
- shapeId: string;
4728
- /** `p14:bmkTgt/@_bmkName`: the bookmark's name. */
4729
- bookmarkName: string;
4730
- }
4731
- /**
4732
- * Structured representation of a single OOXML animation condition
4733
- * from `p:cond` elements inside `p:stCondLst` or `p:endCondLst`.
4734
- *
4735
- * Conditions control when an animation starts or ends, and can reference
4736
- * events, time delays, and target time node IDs.
4737
- *
4738
- * @example
4739
- * ```ts
4740
- * const cond: AnimationCondition = {
4741
- * event: "onClick",
4742
- * delay: 0,
4743
- * targetShapeId: "shape_5",
4744
- * };
4745
- * ```
4746
- */
4747
- interface AnimationCondition {
4748
- /** Event that triggers the condition. */
4749
- event?: AnimationConditionEvent;
4750
- /**
4751
- * The media element/bookmark this condition fires for, when
4752
- * {@link event} is `onMediaBookmark`. See {@link PptxMediaBookmarkTarget}.
4753
- */
4754
- bookmarkTarget?: PptxMediaBookmarkTarget;
4755
- /** Delay in milliseconds (from `@_delay`). "indefinite" is represented as -1. */
4756
- delay?: number;
4757
- /** Target time node ID reference (from `@_tn`). */
4758
- targetTimeNodeId?: number;
4759
- /** Target shape ID from `p:tgtEl/p:spTgt/@spid`. */
4760
- targetShapeId?: string;
4761
- /** Whether the condition targets a slide (from `p:tgtEl/p:sldTgt`). */
4762
- targetSlide?: boolean;
4763
- /** Full target choice, including `p:sndTgt` and `p:inkTgt`. */
4764
- target?: PptxAnimationTarget;
4765
- }
4766
- /** Iteration configuration from `p:iterate`. */
4767
- interface PptxAnimationIterate {
4768
- /** Iteration type: el (element), lt (letter), wd (word). */
4769
- type: 'el' | 'lt' | 'wd';
4770
- /** Whether to iterate backwards. */
4771
- backwards?: boolean;
4772
- /** Timing interval (percentage of total duration, in 1000ths). */
4773
- tmPct?: number;
4774
- /** Absolute timing interval in ms. */
4775
- tmAbs?: number;
4776
- }
4777
- /** Build type for text build (paragraph/word/letter) animations from `p:bldP/@build`. */
4778
- type PptxTextBuildType = 'allAtOnce' | 'byParagraph' | 'byWord' | 'byChar';
4779
- /** Direction for fly-in / fly-out / wipe effects. */
4780
- type PptxAnimationDirection = 'fromLeft' | 'fromRight' | 'fromTop' | 'fromBottom' | 'fromTopLeft' | 'fromTopRight' | 'fromBottomLeft' | 'fromBottomRight';
4781
- /** Sequence mode for paragraph-level animations. */
4782
- type PptxAnimationSequence = 'asOne' | 'byParagraph' | 'byWord' | 'byLetter';
4783
- /** Behavior after animation finishes. */
4784
- type PptxAfterAnimationAction = 'none' | 'hideOnNextClick' | 'hideAfterAnimation' | 'dimToColor';
4785
- /**
4786
- * High-level animation data associated with a slide element.
4787
- *
4788
- * Combines entrance, exit, and emphasis presets with timing and
4789
- * trigger configuration. Used by the editor’s animation panel
4790
- * and the `setPptxElementAnimation` tool.
4791
- *
4792
- * @example
4793
- * ```ts
4794
- * const anim: PptxElementAnimation = {
4795
- * elementId: "title_1",
4796
- * entrance: "fadeIn",
4797
- * durationMs: 600,
4798
- * order: 1,
4799
- * trigger: "afterPrevious",
4800
- * };
4801
- * // => { elementId: "title_1", entrance: "fadeIn", durationMs: 600, order: 1, trigger: "afterPrevious" }
4802
- * ```
4803
- */
4804
- interface PptxElementAnimation {
4805
- elementId: string;
4806
- entrance?: PptxAnimationPreset;
4807
- exit?: PptxAnimationPreset;
4808
- emphasis?: PptxAnimationPreset;
4809
- durationMs?: number;
4810
- delayMs?: number;
4811
- order?: number;
4812
- /**
4813
- * The {@link order} the loader derived from the slide's `p:timing` tree for
4814
- * an entry whose `pptx:editorMeta` record authored no `@order`. The tree
4815
- * already expresses that position (and every load re-derives it), so the
4816
- * writer omits `@order` while `order` still equals this value; a reorder
4817
- * changes `order` and the attribute is written again. Load-time bookkeeping
4818
- * only; never set it by hand.
4819
- */
4820
- orderFromTimeline?: number;
4821
- trigger?: PptxAnimationTrigger;
4822
- /**
4823
- * Shape ID that triggers this animation: the shape clicked for
4824
- * `onShapeClick`, or the media element whose bookmark fires it for
4825
- * `onMediaBookmark`.
4826
- */
4827
- triggerShapeId?: string;
4828
- /** Bookmark name (`p14:bmk/@name`) an `onMediaBookmark` trigger waits for. */
4829
- triggerBookmark?: string;
4830
- timingCurve?: PptxAnimationTimingCurve;
4831
- repeatCount?: number;
4832
- repeatMode?: PptxAnimationRepeatMode;
4833
- /** Direction for directional effects (fly in/out, wipe, etc.). */
4834
- direction?: PptxAnimationDirection;
4835
- /** Sequence mode — animate as one object or by paragraph/word/letter. */
4836
- sequence?: PptxAnimationSequence;
4837
- /** What happens after the animation finishes playing. */
4838
- afterAnimation?: PptxAfterAnimationAction;
4839
- /** Dim-to color hex (used when afterAnimation is "dimToColor"). */
4840
- afterAnimationColor?: string;
4841
- /** Imported after-state for controls, not an authored override or serialized extension. */
4842
- nativeAfterAnimation?: PptxAfterAnimationAction;
4843
- nativeAfterAnimationColor?: string;
4844
- /** SVG motion path string for custom motion path animations. */
4845
- motionPath?: string;
4846
- /**
4847
- * Path edit mode for `p:animMotion/@pathEditMode`. Defaults to "relative"
4848
- * when emitted without an explicit value.
4849
- */
4850
- motionPathEditMode?: string;
4851
- /** Comma-separated point-types string for `p:animMotion/@ptsTypes`. */
4852
- motionPtsTypes?: string;
4853
- /** Authored path rotation in degrees from `p:animMotion/@rAng`. */
4854
- motionPathRotationAngle?: number;
4855
- /** Motion-path rotation centre X in slide percentage units (`p:rCtr/@x`). */
4856
- motionPathRotationCenterX?: number;
4857
- /** Motion-path rotation centre Y in slide percentage units (`p:rCtr/@y`). */
4858
- motionPathRotationCenterY?: number;
4859
- /**
4860
- * Sound relationship ID to play when animation triggers. Written on save
4861
- * as a `p:audio/p:cMediaNode` sibling of the effect's own `p:childTnLst`
4862
- * (see `PptxNativeAnimation.soundRId` for the COM-verified detail).
4863
- */
4864
- soundRId?: string;
4865
- /** Resolved sound file path from relationship. */
4866
- soundPath?: string;
4867
- /**
4868
- * The `@_name` to write on the embedded sound (`p:sndTgt`). For a stock
4869
- * gallery pick this is the exact PowerPoint file name (e.g.
4870
- * `"CHIMES.WAV"`), which is what makes PowerPoint itself recognise the
4871
- * sound as that built-in entry when it reopens the saved deck (there is no
4872
- * separate "built-in" flag anywhere in the schema). Set by
4873
- * `pptx-viewer-shared`'s `setEffectSound` when the pick carries a
4874
- * `soundName`; absent for a custom file with no meaningful name.
4875
- */
4876
- soundName?: string;
4877
- /** Whether to stop any currently playing sound (`p:endSnd`). */
4878
- stopSound?: boolean;
4879
- /**
4880
- * Pending, not-yet-embedded sound chosen in the authoring UI, as a
4881
- * `data:audio/...;base64,...` URL. Mirrors the `imageData` /
4882
- * `mediaData` pending-embed convention used elsewhere in the typed model:
4883
- * on save, the writer converts this to real bytes under `ppt/media/`,
4884
- * mints a relationship, and replaces this field with the resolved
4885
- * {@link soundRId} / {@link soundPath}. Cleared once embedded.
4886
- */
4887
- soundData?: string;
4888
- /**
4889
- * Display name for the chosen sound (e.g. the uploaded file's name),
4890
- * shown by the authoring UI's sound picker. Purely cosmetic; has no
4891
- * OOXML equivalent and is not required for playback. For a stock gallery
4892
- * pick, the UI derives its label from {@link soundName} via the catalogue
4893
- * instead of this field.
4894
- */
4895
- soundFileName?: string;
4896
- /**
4897
- * Per-build-level timing template(s) from the {@link sequence}'s own
4898
- * `p:bldP/p:tmplLst` (ECMA-376 §19.5.84), carried over from the loaded
4899
- * `PptxNativeAnimation.buildTemplates` this element animation was derived
4900
- * from so a full timing-tree rebuild (`PptxAnimationWriteService`'s
4901
- * `buildTimingXml`, when the slide had no prior `p:timing`) can re-emit
4902
- * them instead of silently dropping the deck's authored per-level
4903
- * defaults. Absent when {@link sequence} carries no such template.
4904
- */
4905
- buildTemplates?: PptxTimingTemplate[];
4906
- }
4907
- /**
4908
- * A read-only anchor representing one of the deck's own effect groups: a
4909
- * top-level click group (`p:par` under `p:timing`'s main sequence) that this
4910
- * app did not author, so it is never exposed as an editable
4911
- * {@link PptxElementAnimation}.
4912
- *
4913
- * The authoring UI merges these anchors alongside `PptxSlide.animations` to
4914
- * render the FULL animation sequence (editor-authored and deck-native
4915
- * effects together) and lets an editor-authored entry be dragged to any
4916
- * position relative to them. `order` is the anchor's position among ALL
4917
- * top-level click groups (editor-owned and native) at load time, in the same
4918
- * numbering space as {@link PptxElementAnimation.order}, so the two
4919
- * populations sort into one coherent timeline.
4920
- *
4921
- * Anchors are never written back: on save, an untouched anchor's own click
4922
- * group is repositioned (if an editor-authored effect was dragged past it)
4923
- * but never mutated, so the deck's own effect stays byte-identical apart
4924
- * from its position in the sequence.
4925
- */
4926
- interface PptxAnimationTimelineAnchor {
4927
- /**
4928
- * Position of this group among all top-level click groups in the main
4929
- * animation sequence at load time (dense, shared with editor entries'
4930
- * `order`).
4931
- */
4932
- order: number;
4933
- /** Shape id(s) this group's effects target, for a readable UI label. */
4934
- targetIds: string[];
4935
- /** Effect preset classes present in the group (entr/exit/emph/path). */
4936
- presetClasses: Array<'entr' | 'exit' | 'emph' | 'path'>;
4937
- }
4938
- //#endregion
4939
3706
  //#region pptx/core/types/media.d.ts
4940
3707
  /**
4941
3708
  * Discriminator for embedded media element types.
@@ -5169,354 +3936,27 @@ interface ActionButtonPreset {
5169
3936
  iconPath: string;
5170
3937
  }
5171
3938
  //#endregion
5172
- //#region pptx/core/types/comment-mentions.d.ts
5173
- /**
5174
- * A single `@`-mention inside a modern comment body.
5175
- *
5176
- * Offsets index into the comment's FLATTENED plain text: every `a:t` value
5177
- * below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
5178
- * same string `PptxComment.text` carries, so an edit to `text` invalidates
5179
- * every offset after the edit point and the serializer re-bases them.
5180
- *
5181
- * The markup Office uses for a mention is `CT_Mention` (documented for the
5182
- * SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
5183
- * `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
5184
- * publish a mention element at all, so `rawXml` is retained and re-emitted
5185
- * attribute-for-attribute: a producer that spells the attributes differently
5186
- * still round-trips.
5187
- *
5188
- * @example
5189
- * ```ts
5190
- * const mention: PptxCommentMention = {
5191
- * personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
5192
- * authorName: "Bob Example",
5193
- * startIndex: 3,
5194
- * length: 11,
5195
- * };
5196
- * // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
5197
- * ```
5198
- */
5199
- interface PptxCommentMention {
5200
- /** `mentionId`: GUID identifying this mention instance. */
5201
- id?: string;
5202
- /** `mentionpersonId`: the `p188:author` id of the mentioned person. */
5203
- personId: string;
5204
- /** Display name resolved from the author list at parse time, when known. */
5205
- authorName?: string;
5206
- /** Character offset of the mentioned span in the flattened plain text. */
5207
- startIndex: number;
5208
- /** Character length of the mentioned span. */
5209
- length: number;
5210
- /**
5211
- * `uri` of the `p188:ext` this mention list was read from. Undefined means
5212
- * the list is a direct child of `p188:cm`, which is where it is written for
5213
- * newly authored mentions.
5214
- */
5215
- containerUri?: string;
5216
- /** Original `p188:mention` node, retained for unknown-attribute preservation. */
5217
- rawXml?: XmlObject;
5218
- }
5219
- //#endregion
5220
- //#region pptx/core/types/metadata.d.ts
5221
- /**
5222
- * A slide comment — may be a legacy positional comment or a modern
5223
- * threaded comment with replies.
5224
- *
5225
- * @example
5226
- * ```ts
5227
- * const comment: PptxComment = {
5228
- * id: "c1",
5229
- * text: "Please update this chart.",
5230
- * author: "Alice",
5231
- * createdAt: "2024-06-01T10:00:00Z",
5232
- * resolved: false,
5233
- * };
5234
- * // => satisfies PptxComment
5235
- * ```
5236
- */
5237
- interface PptxComment {
5238
- id: string;
5239
- text: string;
5240
- /** Storage vocabulary used by this comment. Omitted means legacy PresentationML. */
5241
- format?: 'legacy' | 'modern';
5242
- /** Stable GUID author identifier used by Office 2021 modern comments. */
5243
- authorId?: string;
5244
- /** Optional parent comment id for reply threading metadata. */
5245
- parentId?: string;
5246
- author?: string;
5247
- createdAt?: string;
5248
- x?: number;
5249
- y?: number;
5250
- /** Whether this comment has been resolved/marked done. */
5251
- resolved?: boolean;
5252
- /** Native p188 status token. */
5253
- status?: 'active' | 'resolved' | 'closed';
5254
- /** Modern comment classification tags and author IDs that liked the comment. */
5255
- tags?: string[];
5256
- likes?: string[];
5257
- startDate?: string;
5258
- dueDate?: string;
5259
- assignedTo?: string[];
5260
- /** Task completion in thousandths of a percent, from 0 through 100000. */
5261
- complete?: number;
5262
- priority?: number;
5263
- title?: string;
5264
- /** Modern threaded comment support (p15:threadingInfo). */
5265
- threadId?: string;
5266
- /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
5267
- mentions?: PptxCommentMention[];
5268
- /** Replies to this comment (for modern threaded comments). */
5269
- replies?: PptxComment[];
5270
- /** ID of the element this comment is associated with (if any). */
5271
- elementId?: string;
5272
- /** Original `p:cm` subtree, retained for unknown child and extension preservation. */
5273
- rawXml?: XmlObject;
5274
- }
5275
- /** Office 2021 comment author from the p188 Author part. */
5276
- interface PptxModernCommentAuthor {
5277
- id: string;
5278
- name: string;
5279
- initials?: string;
5280
- userId: string;
5281
- providerId: string;
5282
- rawXml?: XmlObject;
5283
- }
3939
+ //#region pptx/core/types/element-base.d.ts
5284
3940
  /**
5285
- * A comment author from `ppt/commentAuthors.xml`.
5286
- *
5287
- * Stores all attributes needed for lossless round-trip serialization
5288
- * of the `p:cmAuthor` element (id, name, initials, lastIdx, clrIdx).
3941
+ * Properties shared by **every** element on a slide.
5289
3942
  *
5290
- * @see ECMA-376 Part 1, §19.4.2 (cmAuthor)
3943
+ * Position and size are in pixels (converted from EMU at parse time).
3944
+ * Optional properties apply to subsets of elements or may be absent in
3945
+ * the original OOXML.
5291
3946
  *
5292
3947
  * @example
5293
3948
  * ```ts
5294
- * const author: PptxCommentAuthor = {
5295
- * id: "0",
5296
- * name: "John Doe",
5297
- * initials: "JD",
5298
- * lastIdx: 3,
5299
- * clrIdx: 0,
3949
+ * const base: PptxElementBase = {
3950
+ * id: "el_001",
3951
+ * x: 100, y: 50,
3952
+ * width: 400, height: 200,
3953
+ * rotation: 15,
3954
+ * opacity: 0.9,
5300
3955
  * };
5301
- * // => satisfies PptxCommentAuthor
3956
+ * // => satisfies PptxElementBase
5302
3957
  * ```
5303
3958
  */
5304
- interface PptxCommentAuthor {
5305
- /** Unique numeric author identifier (`@_id`). */
5306
- id: string;
5307
- /** Author display name (`@_name`). */
5308
- name: string;
5309
- /** Author initials (`@_initials`). */
5310
- initials: string;
5311
- /** Last comment index used by this author (`@_lastIdx`). */
5312
- lastIdx: number;
5313
- /** Colour index assigned to this author (`@_clrIdx`). */
5314
- clrIdx: number;
5315
- /** Original `p:cmAuthor` subtree, retained for unknown attribute preservation. */
5316
- rawXml?: XmlObject;
5317
- }
5318
- /**
5319
- * A compatibility warning generated during parse or save when the
5320
- * file uses features not fully supported by the editor.
5321
- *
5322
- * @example
5323
- * ```ts
5324
- * const warning: PptxCompatibilityWarning = {
5325
- * code: "UNSUPPORTED_3D",
5326
- * message: "3D rotation effects may not render accurately.",
5327
- * severity: "warning",
5328
- * scope: "element",
5329
- * slideId: "slide-1",
5330
- * elementId: "elem-42",
5331
- * };
5332
- * // => satisfies PptxCompatibilityWarning
5333
- * ```
5334
- */
5335
- interface PptxCompatibilityWarning {
5336
- code: string;
5337
- message: string;
5338
- severity: 'info' | 'warning';
5339
- scope: 'presentation' | 'slide' | 'element' | 'save';
5340
- slideId?: string;
5341
- elementId?: string;
5342
- xmlPath?: string;
5343
- }
5344
- /**
5345
- * A single name–value tag from `ppt/tags/*.xml`.
5346
- *
5347
- * @example
5348
- * ```ts
5349
- * const tag: PptxTag = { name: "CUSTOM_ID", value: "12345" };
5350
- * // => satisfies PptxTag
5351
- * ```
5352
- */
5353
- interface PptxTag {
5354
- name: string;
5355
- value: string;
5356
- }
5357
- /**
5358
- * A collection of tags from a single tags XML part.
5359
- *
5360
- * @example
5361
- * ```ts
5362
- * const coll: PptxTagCollection = {
5363
- * path: "ppt/tags/tag1.xml",
5364
- * tags: [{ name: "CUSTOM_ID", value: "12345" }],
5365
- * };
5366
- * // => satisfies PptxTagCollection
5367
- * ```
5368
- */
5369
- interface PptxTagCollection {
5370
- /** File path within the PPTX archive. */
5371
- path?: string;
5372
- /** Package owner of the tags relationship. New collections default to presentation. */
5373
- owner?: 'presentation' | 'slide' | 'part';
5374
- /** Source OPC part that owns the relationship, e.g. ppt/slides/slide1.xml. */
5375
- sourcePartPath?: string;
5376
- /** Durable relationship identifier from the owning part. */
5377
- relationshipId?: string;
5378
- /** Tags in this collection. */
5379
- tags: PptxTag[];
5380
- /** Parsed tag-list XML retained for unknown-node preservation. */
5381
- rawXml?: XmlObject;
5382
- }
5383
- /**
5384
- * A custom document property from `docProps/custom.xml`.
5385
- *
5386
- * @example
5387
- * ```ts
5388
- * const prop: PptxCustomProperty = {
5389
- * name: "Project",
5390
- * value: "pptx",
5391
- * type: "lpwstr",
5392
- * };
5393
- * // => satisfies PptxCustomProperty
5394
- * ```
5395
- */
5396
- interface PptxCustomProperty {
5397
- /** Property name. */
5398
- name: string;
5399
- /** Property value (always stringified). */
5400
- value: string;
5401
- /** Original VT type (e.g. "lpwstr", "i4", "bool", "filetime"). */
5402
- type: string;
5403
- }
5404
- /**
5405
- * Core document properties from `docProps/core.xml` (Dublin Core + OOXML).
5406
- *
5407
- * @example
5408
- * ```ts
5409
- * const core: PptxCoreProperties = {
5410
- * title: "Q4 Business Review",
5411
- * creator: "Alice",
5412
- * created: "2024-01-15T08:00:00Z",
5413
- * modified: "2024-06-01T12:30:00Z",
5414
- * lastModifiedBy: "Bob",
5415
- * };
5416
- * // => satisfies PptxCoreProperties
5417
- * ```
5418
- */
5419
- interface PptxCoreProperties {
5420
- /** dc:title */
5421
- title?: string;
5422
- /** dc:subject */
5423
- subject?: string;
5424
- /** dc:creator */
5425
- creator?: string;
5426
- /** cp:keywords */
5427
- keywords?: string;
5428
- /** dc:description */
5429
- description?: string;
5430
- /** cp:lastModifiedBy */
5431
- lastModifiedBy?: string;
5432
- /** cp:revision */
5433
- revision?: string;
5434
- /** dcterms:created (ISO 8601) */
5435
- created?: string;
5436
- /** dcterms:modified (ISO 8601) */
5437
- modified?: string;
5438
- /** cp:category */
5439
- category?: string;
5440
- /** cp:contentStatus */
5441
- contentStatus?: string;
5442
- }
5443
- /**
5444
- * Extended (application) properties from `docProps/app.xml`.
5445
- *
5446
- * @example
5447
- * ```ts
5448
- * const app: PptxAppProperties = {
5449
- * application: "Microsoft Office PowerPoint",
5450
- * appVersion: "16.0000",
5451
- * slides: 24,
5452
- * words: 1500,
5453
- * company: "Acme Corp",
5454
- * };
5455
- * // => satisfies PptxAppProperties
5456
- * ```
5457
- */
5458
- interface PptxAppProperties {
5459
- /** Application name (e.g. "Microsoft Office PowerPoint"). */
5460
- application?: string;
5461
- /** Application version string. */
5462
- appVersion?: string;
5463
- /** Presentation format (e.g. "On-screen Show (16:9)"). */
5464
- presentationFormat?: string;
5465
- /** Total number of slides. */
5466
- slides?: number;
5467
- /** Number of hidden slides. */
5468
- hiddenSlides?: number;
5469
- /** Number of notes slides. */
5470
- notes?: number;
5471
- /** Total editing time in minutes. */
5472
- totalTime?: number;
5473
- /** Number of words. */
5474
- words?: number;
5475
- /** Number of paragraphs. */
5476
- paragraphs?: number;
5477
- /** Company name. */
5478
- company?: string;
5479
- /** Manager name. */
5480
- manager?: string;
5481
- /** Template name. */
5482
- template?: string;
5483
- /** Hyperlink base URL. */
5484
- hyperlinkBase?: string;
5485
- /** Document security bitmask (`<DocSecurity>`). */
5486
- docSecurity?: number;
5487
- /** Number of multimedia clips (`<MMClips>`). */
5488
- mmClips?: number;
5489
- /** Whether thumbnail images were scaled to fit (`<ScaleCrop>`). */
5490
- scaleCrop?: boolean;
5491
- /** Whether hyperlinks are current (`<LinksUpToDate>`). */
5492
- linksUpToDate?: boolean;
5493
- /** Whether the document is shared (`<SharedDoc>`). */
5494
- sharedDoc?: boolean;
5495
- /** Whether hyperlinks changed since last save (`<HyperlinksChanged>`). */
5496
- hyperlinksChanged?: boolean;
5497
- }
5498
- //#endregion
5499
- //#region pptx/core/types/element-base.d.ts
5500
- /**
5501
- * Properties shared by **every** element on a slide.
5502
- *
5503
- * Position and size are in pixels (converted from EMU at parse time).
5504
- * Optional properties apply to subsets of elements or may be absent in
5505
- * the original OOXML.
5506
- *
5507
- * @example
5508
- * ```ts
5509
- * const base: PptxElementBase = {
5510
- * id: "el_001",
5511
- * x: 100, y: 50,
5512
- * width: 400, height: 200,
5513
- * rotation: 15,
5514
- * opacity: 0.9,
5515
- * };
5516
- * // => satisfies PptxElementBase
5517
- * ```
5518
- */
5519
- interface PptxElementBase {
3959
+ interface PptxElementBase {
5520
3960
  id: string;
5521
3961
  /**
5522
3962
  * The shape's native OOXML id from `p:cNvPr/@id` (an unsigned integer, as a
@@ -6655,1690 +5095,5 @@ type PptxElementWithShapeStyle = TextPptxElement | ShapePptxElement | ConnectorP
6655
5095
  /** Elements that hold raster image data. */
6656
5096
  type PptxImageLikeElement = ImagePptxElement | PicturePptxElement;
6657
5097
  //#endregion
6658
- //#region pptx/core/types/theme.d.ts
6659
- /**
6660
- * Theme object model — colour scheme, font scheme, and format scheme
6661
- * parsed from `ppt/theme/theme1.xml`.
6662
- *
6663
- * The colour scheme provides the 12 canonical OOXML colour slots.
6664
- * The font scheme defines major (heading) and minor (body) typefaces.
6665
- * The format scheme holds fill, line, and effect style matrices at
6666
- * three intensity levels (subtle, moderate, intense).
6667
- *
6668
- * @module pptx-types/theme
6669
- */
6670
- /**
6671
- * The 12 OOXML theme colour scheme keys in canonical order.
6672
- *
6673
- * @example
6674
- * ```ts
6675
- * for (const key of THEME_COLOR_SCHEME_KEYS) {
6676
- * console.log(key, theme.colorScheme?.[key]);
6677
- * }
6678
- * // => e.g. "dk1 #000000", "lt1 #FFFFFF", "accent1 #4F81BD", …
6679
- * ```
6680
- */
6681
- declare const THEME_COLOR_SCHEME_KEYS: readonly ['dk1', 'lt1', 'dk2', 'lt2', 'accent1', 'accent2', 'accent3', 'accent4', 'accent5', 'accent6', 'hlink', 'folHlink'];
6682
- /**
6683
- * Resolved hex values for the 12 theme colour slots.
6684
- *
6685
- * @example
6686
- * ```ts
6687
- * const scheme: PptxThemeColorScheme = {
6688
- * dk1: "#000000", lt1: "#FFFFFF",
6689
- * dk2: "#1F497D", lt2: "#EEECE1",
6690
- * accent1: "#4F81BD", accent2: "#C0504D",
6691
- * accent3: "#9BBB59", accent4: "#8064A2",
6692
- * accent5: "#4BACC6", accent6: "#F79646",
6693
- * hlink: "#0000FF", folHlink: "#800080",
6694
- * };
6695
- * // => satisfies PptxThemeColorScheme
6696
- * ```
6697
- */
6698
- interface PptxThemeColorScheme {
6699
- dk1: string;
6700
- lt1: string;
6701
- dk2: string;
6702
- lt2: string;
6703
- accent1: string;
6704
- accent2: string;
6705
- accent3: string;
6706
- accent4: string;
6707
- accent5: string;
6708
- accent6: string;
6709
- hlink: string;
6710
- folHlink: string;
6711
- }
6712
- /**
6713
- * A font-family triplet for major or minor theme fonts.
6714
- *
6715
- * Supports Latin, East Asian, and Complex Script font families.
6716
- *
6717
- * @example
6718
- * ```ts
6719
- * const fonts: PptxThemeFontGroup = {
6720
- * latin: "Calibri Light",
6721
- * eastAsia: "MS PGothic",
6722
- * complexScript: "Arial",
6723
- * };
6724
- * // => satisfies PptxThemeFontGroup
6725
- * ```
6726
- */
6727
- interface PptxThemeFontGroup {
6728
- latin?: string;
6729
- eastAsia?: string;
6730
- complexScript?: string;
6731
- /**
6732
- * Per-script typeface overrides (`<a:font script="Hans|Hant|Arab|Hebr|
6733
- * Thai|Beng|Gujr|Khmr|Knda|…"/>` per ECMA-376 §20.1.4.1.16). Keyed by
6734
- * the four-letter ISO 15924 script tag from the `script` attribute.
6735
- *
6736
- * Phase 4 Stream A / M4.
6737
- */
6738
- byScript?: Record<string, string>;
6739
- }
6740
- /**
6741
- * Theme font scheme — major (headings) and minor (body) font families.
6742
- *
6743
- * @example
6744
- * ```ts
6745
- * const scheme: PptxThemeFontScheme = {
6746
- * majorFont: { latin: "Calibri Light" },
6747
- * minorFont: { latin: "Calibri", eastAsia: "MS PGothic" },
6748
- * };
6749
- * // => satisfies PptxThemeFontScheme
6750
- * ```
6751
- */
6752
- interface PptxThemeFontScheme {
6753
- majorFont?: PptxThemeFontGroup;
6754
- minorFont?: PptxThemeFontGroup;
6755
- }
6756
- /**
6757
- * A single fill style entry from the theme format scheme.
6758
- * Each entry is one of: solid, gradient, pattern, or no fill.
6759
- * The raw XML node is also stored so that `phClr` substitution can happen
6760
- * at resolution time.
6761
- *
6762
- * @example
6763
- * ```ts
6764
- * const solidFill: PptxThemeFillStyle = {
6765
- * kind: "solid",
6766
- * color: "#4F81BD",
6767
- * opacity: 1,
6768
- * };
6769
- *
6770
- * const gradientFill: PptxThemeFillStyle = {
6771
- * kind: "gradient",
6772
- * gradientAngle: 90,
6773
- * gradientType: "linear",
6774
- * gradientStops: [
6775
- * { color: "#4F81BD", position: 0 },
6776
- * { color: "#1F497D", position: 1 },
6777
- * ],
6778
- * };
6779
- * // => satisfies PptxThemeFillStyle
6780
- * ```
6781
- */
6782
- interface PptxThemeFillStyle {
6783
- /**
6784
- * Discriminator for the fill type.
6785
- *
6786
- * `'group'` corresponds to `<a:grpFill/>` — a fill that inherits the
6787
- * containing group shape's fill at render time. Captured for round-trip
6788
- * preservation in `fmtScheme/fillStyleLst`.
6789
- */
6790
- kind: 'solid' | 'gradient' | 'pattern' | 'none' | 'group';
6791
- /** Pre-resolved colour (may be `undefined` when `phClr`-dependent). */
6792
- color?: string;
6793
- opacity?: number;
6794
- /** Gradient-specific fields (only present when `kind === "gradient"`). */
6795
- gradientStops?: Array<{
6796
- color: string;
6797
- position: number;
6798
- opacity?: number;
6799
- }>;
6800
- gradientAngle?: number;
6801
- gradientType?: 'linear' | 'radial';
6802
- gradientCss?: string;
6803
- /** Pattern-specific fields (only present when `kind === "pattern"`). */
6804
- patternPreset?: string;
6805
- patternBackgroundColor?: string;
6806
- /** Raw XML node preserved for `phClr` re-resolution. */
6807
- rawNode?: unknown;
6808
- }
6809
- /**
6810
- * A single line style entry from `a:lnStyleLst`.
6811
- * Provides width, dash, join, cap, and optional fill colour.
6812
- *
6813
- * @example
6814
- * ```ts
6815
- * const line: PptxThemeLineStyle = {
6816
- * width: 1.5,
6817
- * color: "#4F81BD",
6818
- * dash: "solid",
6819
- * lineJoin: "round",
6820
- * lineCap: "flat",
6821
- * };
6822
- * // => satisfies PptxThemeLineStyle
6823
- * ```
6824
- */
6825
- interface PptxThemeLineStyle {
6826
- /** Line width in pixels (converted from EMU). */
6827
- width?: number;
6828
- color?: string;
6829
- opacity?: number;
6830
- dash?: string;
6831
- lineJoin?: 'round' | 'bevel' | 'miter';
6832
- lineCap?: 'flat' | 'rnd' | 'sq';
6833
- compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
6834
- /** Raw XML node preserved for `phClr` re-resolution. */
6835
- rawNode?: unknown;
6836
- }
6837
- /**
6838
- * A single effect style entry from `a:effectStyleLst`.
6839
- * Each entry may define shadow, glow, soft-edge, reflection, blur,
6840
- * and optionally a 3-D scene/shape.
6841
- *
6842
- * @example
6843
- * ```ts
6844
- * const dropShadow: PptxThemeEffectStyle = {
6845
- * shadowColor: "#000000",
6846
- * shadowBlur: 4,
6847
- * shadowOffsetX: 2,
6848
- * shadowOffsetY: 3,
6849
- * shadowOpacity: 0.4,
6850
- * };
6851
- * // => satisfies PptxThemeEffectStyle
6852
- * ```
6853
- */
6854
- interface PptxThemeEffectStyle {
6855
- shadowColor?: string;
6856
- shadowBlur?: number;
6857
- shadowOffsetX?: number;
6858
- shadowOffsetY?: number;
6859
- shadowOpacity?: number;
6860
- glowColor?: string;
6861
- glowRadius?: number;
6862
- glowOpacity?: number;
6863
- softEdgeRadius?: number;
6864
- innerShadowColor?: string;
6865
- innerShadowOpacity?: number;
6866
- innerShadowBlur?: number;
6867
- innerShadowOffsetX?: number;
6868
- innerShadowOffsetY?: number;
6869
- reflectionBlurRadius?: number;
6870
- reflectionStartOpacity?: number;
6871
- reflectionEndOpacity?: number;
6872
- reflectionEndPosition?: number;
6873
- reflectionDirection?: number;
6874
- reflectionRotation?: number;
6875
- reflectionDistance?: number;
6876
- /** 3D scene/camera from `a:scene3d` on the effect style (idx 3 typically). */
6877
- scene3d?: Pptx3DScene;
6878
- /** 3D shape extrusion/bevel from `a:sp3d` on the effect style (idx 3 typically). */
6879
- shape3d?: Pptx3DShape;
6880
- /** Raw XML node preserved for `phClr` re-resolution. */
6881
- rawNode?: unknown;
6882
- }
6883
- /**
6884
- * The full parsed format scheme from `a:fmtScheme` inside `a:themeElements`.
6885
- * Contains three fill style lists and one line/effect style list each,
6886
- * at three intensity levels: subtle (idx 1), moderate (idx 2), intense (idx 3).
6887
- *
6888
- * OOXML reference indices:
6889
- * - fillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1-3)
6890
- * - lnStyleLst: idx 1-3 (used by `a:lnRef @idx` 1-3)
6891
- * - effectStyleLst: idx 1-3 (used by `a:effectRef @idx` 1-3)
6892
- * - bgFillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1001-1003)
6893
- *
6894
- * @example
6895
- * ```ts
6896
- * const fmt: PptxThemeFormatScheme = {
6897
- * name: "Office",
6898
- * fillStyles: [solidFill, gradientFill, intenseFill],
6899
- * lineStyles: [thinLine, mediumLine, thickLine],
6900
- * effectStyles: [subtle, moderate, intense],
6901
- * backgroundFillStyles: [solidBg, gradientBg, intenseBg],
6902
- * };
6903
- * // => satisfies PptxThemeFormatScheme
6904
- * ```
6905
- */
6906
- interface PptxThemeFormatScheme {
6907
- /** The `@name` attribute of the format scheme. */
6908
- name?: string;
6909
- /** Fill styles at indices 1-3 (subtle, moderate, intense). */
6910
- fillStyles: PptxThemeFillStyle[];
6911
- /** Line styles at indices 1-3. */
6912
- lineStyles: PptxThemeLineStyle[];
6913
- /** Effect styles at indices 1-3. */
6914
- effectStyles: PptxThemeEffectStyle[];
6915
- /** Background fill styles at indices 1-3 (referenced via idx 1001-1003). */
6916
- backgroundFillStyles: PptxThemeFillStyle[];
6917
- }
6918
- /**
6919
- * Full parsed theme object available to renderers.
6920
- *
6921
- * @example
6922
- * ```ts
6923
- * const theme: PptxTheme = {
6924
- * name: "Office Theme",
6925
- * colorScheme: { dk1: "#000", lt1: "#FFF", /* … *\/ },
6926
- * fontScheme: {
6927
- * majorFont: { latin: "Calibri Light" },
6928
- * minorFont: { latin: "Calibri" },
6929
- * },
6930
- * };
6931
- * // => satisfies PptxTheme
6932
- * ```
6933
- */
6934
- interface PptxTheme {
6935
- /** Theme name from `a:theme @name`. */
6936
- name?: string;
6937
- /** Resolved colour scheme. */
6938
- colorScheme?: PptxThemeColorScheme;
6939
- /** Resolved font scheme. */
6940
- fontScheme?: PptxThemeFontScheme;
6941
- /** Format scheme — fill, line, effect and background fill style matrices. */
6942
- formatScheme?: PptxThemeFormatScheme;
6943
- }
6944
- /**
6945
- * Snapshot of `<a:objectDefaults>` (ECMA-376 §20.1.6.7). Each child
6946
- * (`spDef`, `lnDef`, `txDef`) carries `<a:spPr>`, `<a:bodyPr>`,
6947
- * `<a:lstStyle>`, `<a:style>`. We capture them as raw parser objects so
6948
- * round-trip is byte-stable regardless of schema-walking depth.
6949
- *
6950
- * Phase 4 Stream A / M5.
6951
- */
6952
- interface PptxThemeObjectDefaults {
6953
- /** Raw `<a:spDef>` parser object, or `undefined` if absent. */
6954
- spDef?: unknown;
6955
- /** Raw `<a:lnDef>` parser object, or `undefined` if absent. */
6956
- lnDef?: unknown;
6957
- /** Raw `<a:txDef>` parser object, or `undefined` if absent. */
6958
- txDef?: unknown;
6959
- }
6960
- //#endregion
6961
- //#region pptx/core/types/masters.d.ts
6962
- /**
6963
- * A placeholder slot declared on a master or layout.
6964
- *
6965
- * The geometry fields are in CSS pixels (EMU / {@link EMU_PER_PX}) and are only
6966
- * present when the shape carried an explicit `a:xfrm`. Placeholders that
6967
- * inherit their frame from the master leave them undefined, so consumers that
6968
- * draw placeholder outlines (the layout gallery) must skip those entries
6969
- * rather than assume a zero-sized box at the origin.
6970
- *
6971
- * @example
6972
- * ```ts
6973
- * const frame: PptxPlaceholderFrame = { type: "body", idx: "1", x: 63, y: 130 };
6974
- * // => satisfies PptxPlaceholderFrame
6975
- * ```
6976
- */
6977
- interface PptxPlaceholderFrame {
6978
- /** `p:ph/@type`, lower-cased by the parser; defaults to `body` when omitted. */
6979
- type: string;
6980
- /** `p:ph/@idx`, when present. */
6981
- idx?: string;
6982
- /** Left offset in CSS pixels, when the shape declares `a:off`. */
6983
- x?: number;
6984
- /** Top offset in CSS pixels, when the shape declares `a:off`. */
6985
- y?: number;
6986
- /** Width in CSS pixels, when the shape declares `a:ext`. */
6987
- width?: number;
6988
- /** Height in CSS pixels, when the shape declares `a:ext`. */
6989
- height?: number;
6990
- }
6991
- /**
6992
- * Parsed notes master from `ppt/notesMasters/notesMaster1.xml`.
6993
- *
6994
- * @example
6995
- * ```ts
6996
- * const notes: PptxNotesMaster = {
6997
- * path: "ppt/notesMasters/notesMaster1.xml",
6998
- * backgroundColor: "#FFFFFF",
6999
- * placeholders: [{ type: "body" }, { type: "sldImg" }],
7000
- * };
7001
- * // => satisfies PptxNotesMaster
7002
- * ```
7003
- */
7004
- interface PptxNotesMaster {
7005
- /** File path within the PPTX archive. */
7006
- path: string;
7007
- /** Background colour of the notes master. */
7008
- backgroundColor?: string;
7009
- /** Background image data URL. */
7010
- backgroundImage?: string;
7011
- /** Crop, tiling and image effects authored on the background blip fill. */
7012
- backgroundImageProperties?: PptxImageProperties;
7013
- /** Placeholder shapes found on the notes master. */
7014
- placeholders?: PptxPlaceholderFrame[];
7015
- /** Editable elements on the notes master (header, footer, date, page number, slide image, notes body). */
7016
- elements?: PptxElement[];
7017
- /** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
7018
- headerFooter?: PptxHeaderFooterFlags;
7019
- /** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
7020
- clrMap?: Record<string, string>;
7021
- /**
7022
- * Notes text defaults from `<p:notesStyle>` (`CT_TextListStyle`, ECMA-376
7023
- * §19.3.1.34): the same `a:defPPr` + `a:lvl1pPr`..`a:lvl9pPr` shape as
7024
- * {@link PptxMasterTextStyles}'s per-category styles, keyed 0-8 with the
7025
- * default at `-1`. Governs the notes body placeholder's font size, indent
7026
- * levels, and bullet style wherever a notes slide does not override them.
7027
- * Parsed read-only for the render cascade; the save side preserves the
7028
- * original `<p:notesStyle>` XML verbatim rather than re-serialising this.
7029
- */
7030
- notesStyle?: PptxTextStyleLevels;
7031
- }
7032
- /**
7033
- * Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
7034
- *
7035
- * @example
7036
- * ```ts
7037
- * const handout: PptxHandoutMaster = {
7038
- * path: "ppt/handoutMasters/handoutMaster1.xml",
7039
- * slidesPerPage: 6,
7040
- * };
7041
- * // => satisfies PptxHandoutMaster
7042
- * ```
7043
- */
7044
- interface PptxHandoutMaster {
7045
- /** File path within the PPTX archive. */
7046
- path: string;
7047
- /** Background colour of the handout master. */
7048
- backgroundColor?: string;
7049
- /** Background image data URL. */
7050
- backgroundImage?: string;
7051
- /** Crop, tiling and image effects authored on the background blip fill. */
7052
- backgroundImageProperties?: PptxImageProperties;
7053
- /** Placeholder shapes found on the handout master. */
7054
- placeholders?: PptxPlaceholderFrame[];
7055
- /** Editable elements on the handout master (header, footer, date, page number, slide placeholders). */
7056
- elements?: PptxElement[];
7057
- /** Number of slides per page for handout print layout (1, 2, 3, 4, 6, or 9). */
7058
- slidesPerPage?: number;
7059
- /** Header/footer flags from `<p:hf>` on the handout master (P-H3). */
7060
- headerFooter?: PptxHeaderFooterFlags;
7061
- /** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
7062
- clrMap?: Record<string, string>;
7063
- }
7064
- /**
7065
- * Active tab within the master view sidebar.
7066
- *
7067
- * @example
7068
- * ```ts
7069
- * const tab: MasterViewTab = "slides";
7070
- * // => "slides" — one of: "slides" | "notes" | "handout"
7071
- * ```
7072
- */
7073
- type MasterViewTab = 'slides' | 'notes' | 'handout';
7074
- /**
7075
- * Structured slide master data.
7076
- *
7077
- * @example
7078
- * ```ts
7079
- * const master: PptxSlideMaster = {
7080
- * path: "ppt/slideMasters/slideMaster1.xml",
7081
- * name: "Office Theme",
7082
- * backgroundColor: "#FFFFFF",
7083
- * themePath: "ppt/theme/theme1.xml",
7084
- * };
7085
- * // => satisfies PptxSlideMaster
7086
- * ```
7087
- */
7088
- interface PptxSlideMaster {
7089
- /** File path within the PPTX archive. */
7090
- path: string;
7091
- /** Human-readable name if available. */
7092
- name?: string;
7093
- /** Background colour of the slide master. */
7094
- backgroundColor?: string;
7095
- /** Background image data URL for the slide master. */
7096
- backgroundImage?: string;
7097
- /** Crop, tiling and image effects authored on the background blip fill. */
7098
- backgroundImageProperties?: PptxImageProperties;
7099
- /** Theme file path this master references. */
7100
- themePath?: string;
7101
- /** Layout paths associated with this master. */
7102
- layoutPaths?: string[];
7103
- /** Placeholder shapes on the master. */
7104
- placeholders?: PptxPlaceholderFrame[];
7105
- /** Parsed element shapes on the master slide (for master view rendering). */
7106
- elements?: PptxElement[];
7107
- /** Parsed slide layout objects associated with this master. */
7108
- layouts?: PptxSlideLayout[];
7109
- /** Text styles from `p:txStyles` — title, body, and other text defaults. */
7110
- txStyles?: PptxMasterTextStyles;
7111
- /** Header/footer flags from `<p:hf>` on this master (P-H3). */
7112
- headerFooter?: PptxHeaderFooterFlags;
7113
- /**
7114
- * Colour map from `<p:clrMap>` (12 alias attributes: bg1/tx1/bg2/tx2,
7115
- * accent1-6, hlink, folHlink). Applied at save time when present.
7116
- */
7117
- clrMap?: Record<string, string>;
7118
- /**
7119
- * Whether the master is marked as preserved (prevent auto-deletion,
7120
- * `@preserve`). Mirrors {@link PptxSlideLayout.preserve}: PowerPoint
7121
- * silently drops an unused master unless this is set.
7122
- *
7123
- * ECMA-376 §19.3.1.38 (CT_SlideMaster).
7124
- */
7125
- preserve?: boolean;
7126
- }
7127
- /**
7128
- * Per-level paragraph properties for a text style category.
7129
- * Each entry maps a 0-based level index to its style defaults.
7130
- */
7131
- type PptxTextStyleLevels = Record<number, PlaceholderTextLevelStyle>;
7132
- /**
7133
- * Text styles parsed from `p:txStyles` on a slide master.
7134
- * Provides cascading defaults for title, body, and other text.
7135
- */
7136
- interface PptxMasterTextStyles {
7137
- /** Title text style (`p:titleStyle`). */
7138
- titleStyle?: PptxTextStyleLevels;
7139
- /** Body text style (`p:bodyStyle`). */
7140
- bodyStyle?: PptxTextStyleLevels;
7141
- /** Other text style (`p:otherStyle`). */
7142
- otherStyle?: PptxTextStyleLevels;
7143
- }
7144
- /**
7145
- * Per-part header/footer flags from `<p:hf>` (CT_HeaderFooter, ECMA-376
7146
- * §19.3.1.21). Defaults are "all true" — fields are only set on the typed
7147
- * model when they were explicitly read, so callers can distinguish "unset"
7148
- * (preserve original XML) from "false" (override).
7149
- */
7150
- interface PptxHeaderFooterFlags {
7151
- /** `@hdr` — show header placeholder. Spec default: `true`. */
7152
- hasHeader?: boolean;
7153
- /** `@ftr` — show footer placeholder. Spec default: `true`. */
7154
- hasFooter?: boolean;
7155
- /** `@dt` — show date/time placeholder. Spec default: `true`. */
7156
- hasDateTime?: boolean;
7157
- /** `@sldNum` — show slide-number placeholder. Spec default: `true`. */
7158
- hasSlideNumber?: boolean;
7159
- }
7160
- /**
7161
- * A slide layout associated with a slide master.
7162
- *
7163
- * @example
7164
- * ```ts
7165
- * const layout: PptxSlideLayout = {
7166
- * path: "ppt/slideLayouts/slideLayout2.xml",
7167
- * name: "Title and Content",
7168
- * };
7169
- * // => satisfies PptxSlideLayout
7170
- * ```
7171
- */
7172
- interface PptxSlideLayout {
7173
- /** File path within the PPTX archive. */
7174
- path: string;
7175
- /** Human-readable layout name. */
7176
- name?: string;
7177
- /** Background colour of the layout. */
7178
- backgroundColor?: string;
7179
- /** Background image data URL for the layout. */
7180
- backgroundImage?: string;
7181
- /** Crop, tiling and image effects authored on the background blip fill. */
7182
- backgroundImageProperties?: PptxImageProperties;
7183
- /** Parsed element shapes on the layout. */
7184
- elements?: PptxElement[];
7185
- /** Placeholder shapes on the layout. */
7186
- placeholders?: PptxPlaceholderFrame[];
7187
- /** Matching name attribute for layout identification (`@matchingName`). */
7188
- matchingName?: string;
7189
- /** Whether the layout is marked as preserved (prevent deletion, `@preserve`). */
7190
- preserve?: boolean;
7191
- /** Whether master placeholder animations should play (`@showMasterPhAnim`). */
7192
- showMasterPhAnim?: boolean;
7193
- /** Whether this layout is user-drawn (`@userDrawn`). */
7194
- userDrawn?: boolean;
7195
- /** Colour map override from `p:clrMapOvr`. */
7196
- clrMapOverride?: Record<string, string>;
7197
- /** Header/footer flags from `<p:hf>` on this layout (P-H3). */
7198
- headerFooter?: PptxHeaderFooterFlags;
7199
- }
7200
- /**
7201
- * Rendered content of a single layout, used to draw gallery thumbnails.
7202
- *
7203
- * Produced on demand rather than during load: materialising every layout's
7204
- * artwork (and decoding its images) up front costs a noticeable amount of time
7205
- * on decks with many masters, and most sessions never open the layout gallery
7206
- * at all.
7207
- *
7208
- * @example
7209
- * ```ts
7210
- * const preview: PptxLayoutPreview = {
7211
- * path: "ppt/slideLayouts/slideLayout2.xml",
7212
- * width: 960,
7213
- * height: 540,
7214
- * elements: [],
7215
- * placeholders: [{ type: "title" }],
7216
- * };
7217
- * // => satisfies PptxLayoutPreview
7218
- * ```
7219
- */
7220
- interface PptxLayoutPreview {
7221
- /** ZIP path of the layout this preview belongs to. */
7222
- path: string;
7223
- /** Slide width in CSS pixels, so a thumbnail can compute its own scale. */
7224
- width: number;
7225
- /** Slide height in CSS pixels. */
7226
- height: number;
7227
- /** Background resolved from the layout, falling back to its master's. */
7228
- backgroundColor?: string;
7229
- /** Background image data URL, when the layout or master declares one. */
7230
- backgroundImage?: string;
7231
- /** Crop, tiling and image effects authored on the resolved background image. */
7232
- backgroundImageProperties?: PptxImageProperties;
7233
- /** The layout's own artwork (pictures, shapes and static text). */
7234
- elements: PptxElement[];
7235
- /** Placeholder slots, drawn as outlined frames in the gallery. */
7236
- placeholders: PptxPlaceholderFrame[];
7237
- }
7238
- /**
7239
- * A theme part available in the presentation package.
7240
- *
7241
- * @example
7242
- * ```ts
7243
- * const opt: PptxThemeOption = {
7244
- * path: "ppt/theme/theme1.xml",
7245
- * name: "Office Theme",
7246
- * };
7247
- * // => satisfies PptxThemeOption
7248
- * ```
7249
- */
7250
- interface PptxThemeOption {
7251
- /** File path within the PPTX archive (e.g. `ppt/theme/theme2.xml`). */
7252
- path: string;
7253
- /** Human-readable theme name from `a:theme/@name`, when present. */
7254
- name?: string;
7255
- }
7256
- //#endregion
7257
- //#region pptx/core/types/embedded-font.d.ts
7258
- interface PptxEmbeddedFontDataId {
7259
- /** Required relationship identifier from `r:id`. */
7260
- relationshipId?: string | null;
7261
- /** Original leaf retained for unknown attribute preservation. */
7262
- rawXml?: XmlObject;
7263
- }
7264
- interface PptxEmbeddedFontDescriptor {
7265
- typeface?: string | null;
7266
- panose?: string | null;
7267
- pitchFamily?: string | null;
7268
- charset?: string | null;
7269
- rawXml?: XmlObject;
7270
- }
7271
- interface PptxEmbeddedFontListEntry {
7272
- font: PptxEmbeddedFontDescriptor;
7273
- regular?: PptxEmbeddedFontDataId | null;
7274
- bold?: PptxEmbeddedFontDataId | null;
7275
- italic?: PptxEmbeddedFontDataId | null;
7276
- boldItalic?: PptxEmbeddedFontDataId | null;
7277
- rawXml?: XmlObject;
7278
- }
7279
- interface PptxEmbeddedFontList {
7280
- fonts: PptxEmbeddedFontListEntry[];
7281
- /** Original list retained for unknown attribute and child preservation. */
7282
- rawXml?: XmlObject;
7283
- }
7284
- //#endregion
7285
- //#region pptx/core/types/presentation-print-properties.d.ts
7286
- type PptxPrintOutput = 'slides' | 'handouts1' | 'handouts2' | 'handouts3' | 'handouts4' | 'handouts6' | 'handouts9' | 'notes' | 'outline';
7287
- type PptxPrintColorMode = 'bw' | 'gray' | 'clr';
7288
- /** PresentationML `CT_PrintProperties` (`p:prnPr`). */
7289
- interface PptxPresentationPrintProperties {
7290
- printWhat?: PptxPrintOutput | null;
7291
- colorMode?: PptxPrintColorMode | null;
7292
- hiddenSlides?: boolean | null;
7293
- scaleToFitPaper?: boolean | null;
7294
- frameSlides?: boolean | null;
7295
- /** Original subtree retained for unknown attributes and `p:extLst`. */
7296
- rawXml?: XmlObject;
7297
- }
7298
- //#endregion
7299
- //#region pptx/core/types/view-properties.d.ts
7300
- /**
7301
- * View properties types parsed from `ppt/viewProps.xml`.
7302
- *
7303
- * Models the `p:viewPr` element and its child views:
7304
- * normalViewPr, slideViewPr, outlineViewPr, notesTextViewPr,
7305
- * sorterViewPr, notesViewPr.
7306
- *
7307
- * @module pptx-types/view-properties
7308
- */
7309
- /**
7310
- * Scale factor for a view (numerator / denominator percentage).
7311
- */
7312
- interface PptxViewScale {
7313
- /** Numerator of the scale percentage (e.g. 100 for 100%). */
7314
- n: number;
7315
- /** Denominator of the scale percentage (e.g. 100 for 100%). */
7316
- d: number;
7317
- /** Optional independent vertical scale. When absent, the X scale is used. */
7318
- sy?: {
7319
- n: number;
7320
- d: number;
7321
- };
7322
- }
7323
- /**
7324
- * Origin point for a view (x, y in twips or EMU).
7325
- */
7326
- interface PptxViewOrigin {
7327
- x: number;
7328
- y: number;
7329
- }
7330
- /** A horizontal or vertical drawing guide in slide coordinates. */
7331
- interface PptxViewGuide {
7332
- orientation?: 'horz' | 'vert';
7333
- position?: number;
7334
- }
7335
- /** Positive grid spacing from `p:gridSpacing`. */
7336
- interface PptxGridSpacing {
7337
- cx: number;
7338
- cy: number;
7339
- }
7340
- /**
7341
- * Restored region dimensions for normal view splitter.
7342
- * Represents `p:restoredLeft` or `p:restoredTop`.
7343
- */
7344
- interface PptxRestoredRegion {
7345
- /** Size as a percentage of the available space (thousandths of a percent). */
7346
- sz: number;
7347
- /** Whether auto-adjust is enabled. */
7348
- autoAdjust?: boolean;
7349
- }
7350
- /**
7351
- * Normal view properties (`p:normalViewPr`).
7352
- * Controls the splitter positions in normal (editing) view.
7353
- */
7354
- interface PptxNormalViewProperties {
7355
- /** Whether to show outline icons in the slide panel. */
7356
- showOutlineIcons?: boolean;
7357
- /** Whether the outline/slide panel is snapped closed. */
7358
- snapVertSplitter?: boolean;
7359
- /** Vertical splitter bar state: 'minimized' | 'maximized' | 'restored'. */
7360
- vertBarState?: string;
7361
- /** Horizontal splitter bar state. */
7362
- horzBarState?: string;
7363
- /** Whether to prefer single-slide view in the panel. */
7364
- preferSingleView?: boolean;
7365
- /** Restored left region (slide panel width). */
7366
- restoredLeft?: PptxRestoredRegion;
7367
- /** Restored top region (notes panel height). */
7368
- restoredTop?: PptxRestoredRegion;
7369
- }
7370
- /**
7371
- * Common slide view properties shared by slideViewPr, outlineViewPr,
7372
- * notesTextViewPr, and notesViewPr.
7373
- */
7374
- interface PptxCommonSlideViewProperties {
7375
- /** Whether snap-to-grid is enabled. */
7376
- snapToGrid?: boolean;
7377
- /** Whether snap-to-objects is enabled. */
7378
- snapToObjects?: boolean;
7379
- /** Whether drawing guides are shown. */
7380
- showGuides?: boolean;
7381
- /** Whether the application may vary the scale automatically. */
7382
- variableScale?: boolean;
7383
- /** Drawing guides shown in this slide view. */
7384
- guides?: PptxViewGuide[];
7385
- /** View origin (scroll position). */
7386
- origin?: PptxViewOrigin;
7387
- /** View scale. */
7388
- scale?: PptxViewScale;
7389
- }
7390
- /**
7391
- * Full view properties from `ppt/viewProps.xml`.
7392
- */
7393
- interface PptxViewProperties {
7394
- /** Last used view type (`p:viewPr/@lastView`). */
7395
- lastView?: string;
7396
- /** Whether comments are shown (`p:viewPr/@showComments`). */
7397
- showComments?: boolean;
7398
- /** Normal view properties (splitter positions). */
7399
- normalViewPr?: PptxNormalViewProperties;
7400
- /** Slide view properties. */
7401
- slideViewPr?: PptxCommonSlideViewProperties;
7402
- /** Outline view properties. */
7403
- outlineViewPr?: PptxCommonSlideViewProperties;
7404
- /** Notes text view properties. */
7405
- notesTextViewPr?: PptxCommonSlideViewProperties;
7406
- /** Sorter view scale. */
7407
- sorterViewPr?: {
7408
- scale?: PptxViewScale;
7409
- };
7410
- /** Notes view properties. */
7411
- notesViewPr?: PptxCommonSlideViewProperties;
7412
- /** Grid spacing in positive DrawingML coordinates. */
7413
- gridSpacing?: PptxGridSpacing;
7414
- /** Raw XML preserved for lossless round-trip of unparsed attributes. */
7415
- rawXml?: Record<string, unknown>;
7416
- }
7417
- //#endregion
7418
- //#region pptx/core/types/presentation.d.ts
7419
- /**
7420
- * A customer data reference from `p:custDataLst / p:custData`.
7421
- *
7422
- * Enterprise add-ins and integrations store custom data parts in the
7423
- * package and reference them via relationship IDs in the slide or
7424
- * presentation XML.
7425
- *
7426
- * @see ECMA-376 Part 1, §19.2.1.3 (custDataLst), §19.3.1.6 (custData)
7427
- */
7428
- interface PptxCustomerData {
7429
- /** Resolved part path inside the package (e.g. `customXml/item1.xml`). */
7430
- id?: string;
7431
- /** Relationship ID referencing the custom data part. */
7432
- relId?: string;
7433
- /** Raw string content of the custom data part (if resolvable). */
7434
- data?: string;
7435
- /** OPC content type for the custom data part. */
7436
- contentType?: string;
7437
- /** Raw `p:custData` XML retained for unknown-node preservation. */
7438
- rawXml?: XmlObject;
7439
- }
7440
- /**
7441
- * An ActiveX control reference from `p:controls / p:control`.
7442
- *
7443
- * ActiveX form controls (buttons, text boxes, check boxes, combo boxes, etc.)
7444
- * are embedded via OLE parts and referenced by relationship ID in the slide XML.
7445
- *
7446
- * @see ECMA-376 Part 1, §19.3.1.3 (controls), §19.3.1.2 (control)
7447
- */
7448
- interface PptxActiveXControl {
7449
- /** Relationship ID referencing the ActiveX binary part. */
7450
- relId: string;
7451
- /** Control name from @name attribute. */
7452
- name?: string;
7453
- /** Shape ID this control is linked to (from @spid). */
7454
- shapeId?: string;
7455
- /**
7456
- * `p:control/@showAsIcon` (CT_Control, ECMA-376 S19.3.1.2): whether the
7457
- * control renders as its static icon rather than its live appearance.
7458
- * `undefined` when the source authored no explicit value (schema default
7459
- * `false`).
7460
- */
7461
- showAsIcon?: boolean;
7462
- /**
7463
- * `p:control/@imgW` in EMU (ST_PositiveCoordinate32): the width the host
7464
- * reserves for the control's icon/preview image. Distinct from
7465
- * {@link width}, which is the fallback `p:pic`'s own `a:ext/@cx` in px;
7466
- * `imgW`/`imgH` are direct attributes on `p:control` itself.
7467
- */
7468
- imgWidthEmu?: number;
7469
- /** `p:control/@imgH` in EMU (ST_PositiveCoordinate32). @see imgWidthEmu */
7470
- imgHeightEmu?: number;
7471
- /** X position (px) of the control's fallback picture, if present. */
7472
- x?: number;
7473
- /** Y position (px) of the control's fallback picture, if present. */
7474
- y?: number;
7475
- /** Width (px) of the control's fallback picture, if present. */
7476
- width?: number;
7477
- /** Height (px) of the control's fallback picture, if present. */
7478
- height?: number;
7479
- /**
7480
- * Relationship ID of the control's static fallback picture
7481
- * (`mc:AlternateContent > mc:Fallback > p:pic > p:blipFill > a:blip@r:embed`).
7482
- * Renderers resolve this to an image so a control shows its last static
7483
- * frame instead of a blank area (the live ActiveX cannot run in a viewer).
7484
- */
7485
- fallbackImageRelId?: string;
7486
- /** Raw XML for round-trip preservation. */
7487
- rawXml?: XmlObject;
7488
- }
7489
- /**
7490
- * Pattern fill on a slide background.
7491
- *
7492
- * Mirrors the `<a:pattFill>` choice inside `<p:bgPr>`. Renderers should
7493
- * draw a 2-colour preset pattern (e.g. `dkDnDiag`, `pct50`).
7494
- *
7495
- * ECMA-376 §20.1.8.47.
7496
- *
7497
- * @example
7498
- * ```ts
7499
- * const pattern: PptxSlideBackgroundPattern = {
7500
- * preset: "ltDnDiag",
7501
- * fgColor: "#4472C4",
7502
- * bgColor: "#FFFFFF",
7503
- * };
7504
- * // => satisfies PptxSlideBackgroundPattern
7505
- * ```
7506
- */
7507
- interface PptxSlideBackgroundPattern {
7508
- /** DrawingML preset pattern token (`@_prst`). */
7509
- preset: string;
7510
- /** Foreground colour resolved to `#RRGGBB`. */
7511
- fgColor?: string;
7512
- /** Background colour resolved to `#RRGGBB`. */
7513
- bgColor?: string;
7514
- }
7515
- /**
7516
- * A single slide in a parsed PPTX presentation.
7517
- *
7518
- * Contains the element tree, background settings, notes, comments,
7519
- * transition / animation data, and metadata like layout path and section.
7520
- *
7521
- * @example
7522
- * ```ts
7523
- * const slide: PptxSlide = {
7524
- * id: "slide1",
7525
- * rId: "rId2",
7526
- * slideNumber: 1,
7527
- * elements: [titleTextBox, subtitleTextBox],
7528
- * backgroundColor: "#FFFFFF",
7529
- * notes: "Remember to mention quarterly goals.",
7530
- * };
7531
- * // => satisfies PptxSlide
7532
- * ```
7533
- */
7534
- interface PptxSlide {
7535
- id: string;
7536
- rId: string;
7537
- /**
7538
- * `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
7539
- * that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
7540
- * name slides by.
7541
- *
7542
- * It lives in `presentation.xml`, NOT in the slide part, so it cannot be
7543
- * recovered from `rawXml`. Without it on the model, code that writes a
7544
- * section's membership has nothing correct to write and falls back to the
7545
- * slide NUMBER, which is 1-based and therefore never matches a real deck's
7546
- * ids: the section reloads with no slides in it.
7547
- */
7548
- slideId?: string;
7549
- sourceSlideId?: string;
7550
- /**
7551
- * The slide name, `p:cSld/@name`: loaded from the part, written back on
7552
- * save (an empty string clears the attribute), and settable via
7553
- * `SlideBuilder.setName`.
7554
- */
7555
- name?: string;
7556
- layoutPath?: string;
7557
- layoutName?: string;
7558
- slideNumber: number;
7559
- hidden?: boolean;
7560
- sectionName?: string;
7561
- sectionId?: string;
7562
- elements: PptxElement[];
7563
- backgroundColor?: string;
7564
- backgroundImage?: string;
7565
- /** Crop, tiling and image effects authored on the background blip fill. */
7566
- backgroundImageProperties?: PptxImageProperties;
7567
- backgroundGradient?: string;
7568
- /**
7569
- * Pattern fill on the slide background (`<a:pattFill>` inside `<p:bgPr>`).
7570
- *
7571
- * When present, renderers should draw a real two-colour pattern using
7572
- * the named DrawingML preset (e.g. `"ltDnDiag"`, `"pct50"`). The flat
7573
- * `backgroundColor` field is left set to the foreground colour for
7574
- * fallback rendering paths that don't understand patterns.
7575
- *
7576
- * ECMA-376 §20.1.8.47.
7577
- */
7578
- backgroundPattern?: PptxSlideBackgroundPattern;
7579
- /**
7580
- * `<p:bgPr/@shadeToTitle>`: boolean flag instructing the renderer to
7581
- * anchor the background gradient on the title placeholder as a
7582
- * rectangular path gradient (COM-measured against real PowerPoint;
7583
- * it does NOT recolour toward the title's text colour, despite the
7584
- * attribute's name). Parsed and round-tripped here on the core model;
7585
- * the actual visual effect is applied by `pptx-viewer-shared`'s
7586
- * `getSlideBackgroundStyle` (see `render/background-shade-to-title.ts`),
7587
- * consumed by all five bindings, not by core itself. Legacy PowerPoint
7588
- * 97-2003 hint, not observed in any real-world corpus file this project
7589
- * has collected and not settable from any modern PowerPoint UI; see
7590
- * `docs/guide/limitations.md`.
7591
- *
7592
- * ECMA-376 §19.3.1.2 (CT_BackgroundProperties).
7593
- */
7594
- backgroundShadeToTitle?: boolean;
7595
- transition?: PptxSlideTransition;
7596
- animations?: PptxElementAnimation[];
7597
- /**
7598
- * Read-only anchors for the deck's own (non-editor-authored) effect
7599
- * groups, merged with `animations` by the authoring UI so drag-to-reorder
7600
- * can target any position in the full sequence. See
7601
- * {@link PptxAnimationTimelineAnchor}.
7602
- */
7603
- animationTimelineAnchors?: PptxAnimationTimelineAnchor[];
7604
- /** Native OOXML animation data parsed from `p:timing`. */
7605
- nativeAnimations?: PptxNativeAnimation[];
7606
- /** Preserved raw `p:timing` XML for lossless round-trip of native animations. */
7607
- rawTiming?: XmlObject;
7608
- notes?: string;
7609
- /** Rich text segments for the slide notes (preserves formatting). */
7610
- notesSegments?: TextSegment[];
7611
- /**
7612
- * Parsed shapes from the notes slide's `<p:cSld>/<p:spTree>` so the full
7613
- * notes-page shape tree can be inspected and mutated, not just the body
7614
- * placeholder text. When undefined, the existing notes XML is left
7615
- * untouched on save and only `notes` / `notesSegments` are written.
7616
- */
7617
- notesShapes?: PptxElement[];
7618
- /**
7619
- * Per-notes-slide colour map override parsed from `<p:notes>/<p:clrMapOvr>`.
7620
- * Captured for lossless round-trip of the notes-slide's colour scheme.
7621
- */
7622
- notesClrMapOverride?: Record<string, string>;
7623
- /** Optional `<p:cSld @name>` value of the notes slide, for round-trip. */
7624
- notesCSldName?: string;
7625
- comments?: PptxComment[];
7626
- /** Source package metadata for an Office 2021 p188 comment part. */
7627
- modernCommentPart?: PptxModernCommentPart;
7628
- warnings?: PptxCompatibilityWarning[];
7629
- rawXml?: XmlObject;
7630
- /** Per-slide colour map override parsed from `p:clrMapOvr`. */
7631
- clrMapOverride?: Record<string, string>;
7632
- /** Whether background animations should play (`p:bg/@showAnimation`). */
7633
- backgroundShowAnimation?: boolean;
7634
- /** Whether master slide shapes should be shown on this slide (`p:sld/@showMasterSp`). */
7635
- showMasterShapes?: boolean;
7636
- /**
7637
- * Whether inherited master placeholder animations should replay on this
7638
- * slide (`p:sld/@showMasterPhAnim`). Distinct from {@link showMasterShapes}:
7639
- * this governs animation timing, not shape visibility. Mirrors
7640
- * `p:sldLayout/@showMasterPhAnim`, ECMA-376 §19.3.1.38.
7641
- */
7642
- showMasterPhAnim?: boolean;
7643
- /** Drawing guides parsed from slide extension list. */
7644
- guides?: PptxDrawingGuide[];
7645
- /** When explicitly `false`, the slide is unmodified and save can skip re-serialization. */
7646
- isDirty?: boolean;
7647
- /** Customer data references from `p:custDataLst` on this slide. */
7648
- customerData?: PptxCustomerData[];
7649
- /** ActiveX control references from `p:controls` on this slide. */
7650
- activeXControls?: PptxActiveXControl[];
7651
- /**
7652
- * Shapes parsed from a referenced legacy VML drawing part
7653
- * (`ppt/drawings/vmlDrawing*.vml`, linked via a `legacyDrawing`
7654
- * relationship). These are read-only render hints: the VML part itself is
7655
- * preserved verbatim on save, so this field is not re-serialized.
7656
- */
7657
- legacyVmlElements?: PptxElement[];
7658
- /** Per-slide header/footer flags from `<p:hf>` (P-H3). */
7659
- headerFooterFlags?: PptxHeaderFooterFlags;
7660
- /** Server-backed slide synchronization metadata stored in a related OPC part. */
7661
- slideSynchronization?: PptxSlideSyncProperties;
7662
- }
7663
- interface PptxModernCommentPart {
7664
- path: string;
7665
- relationshipId: string;
7666
- /** Original p188:cmLst root, including unknown attributes and extensions. */
7667
- rawXml?: XmlObject;
7668
- }
7669
- /** Metadata from a `p:sldSyncPr` slide synchronization data part. */
7670
- interface PptxSlideSyncProperties {
7671
- serverSlideId: string;
7672
- serverSlideModifiedTime: string;
7673
- clientInsertedTime: string;
7674
- extensionList?: XmlObject;
7675
- rawXml?: XmlObject;
7676
- partPath?: string;
7677
- relationshipId?: string;
7678
- }
7679
- /**
7680
- * A slide layout available in the loaded presentation.
7681
- *
7682
- * Each entry maps to a `<p:sldLayout>` inside `ppt/slideLayouts/`.
7683
- *
7684
- * @example
7685
- * ```ts
7686
- * const layout: PptxLayoutOption = {
7687
- * path: "ppt/slideLayouts/slideLayout2.xml",
7688
- * name: "Title and Content",
7689
- * };
7690
- * // => satisfies PptxLayoutOption
7691
- * ```
7692
- */
7693
- interface PptxLayoutOption {
7694
- path: string;
7695
- name: string;
7696
- /** Standard layout type from `p:sldLayout/@type` (e.g. "obj", "twoColTx", "blank"). */
7697
- type?: string;
7698
- /** ZIP path of the slide master this layout belongs to. */
7699
- masterPath?: string;
7700
- }
7701
- /**
7702
- * Header, footer, date-time, and slide-number placeholders.
7703
- *
7704
- * Parsed from `ppt/presProps.xml` and individual slide layouts.
7705
- *
7706
- * @example
7707
- * ```ts
7708
- * const hf: PptxHeaderFooter = {
7709
- * hasFooter: true,
7710
- * footerText: "Confidential",
7711
- * hasSlideNumber: true,
7712
- * };
7713
- * // => satisfies PptxHeaderFooter
7714
- * ```
7715
- */
7716
- interface PptxHeaderFooter {
7717
- hasHeader?: boolean;
7718
- headerText?: string;
7719
- hasFooter?: boolean;
7720
- footerText?: string;
7721
- hasDateTime?: boolean;
7722
- dateTimeText?: string;
7723
- dateTimeAuto?: boolean;
7724
- /**
7725
- * The master date placeholder's own `a:fld/@type` (e.g. "datetime2"), NOT a
7726
- * format pattern. It is one of the predefined OOXML datetime field types
7727
- * (`datetime1`-`datetime13`); the display pattern for each is resolved by
7728
- * `resolveFieldDateText` in `packages/shared/src/render/text-field-substitution.ts`.
7729
- */
7730
- dateFormat?: string;
7731
- hasSlideNumber?: boolean;
7732
- }
7733
- /**
7734
- * Presentation-level properties parsed from `presentationPr.xml`.
7735
- *
7736
- * Controls slideshow behaviour, print settings, custom colours, and grid.
7737
- *
7738
- * @example
7739
- * ```ts
7740
- * const props: PptxPresentationProperties = {
7741
- * showType: "presented",
7742
- * loopContinuously: false,
7743
- * advanceMode: "useTimings",
7744
- * };
7745
- * // => satisfies PptxPresentationProperties
7746
- * ```
7747
- */
7748
- interface PptxPresentationProperties {
7749
- /** Show type: presented, browsed, kiosk. */
7750
- showType?: 'presented' | 'browsed' | 'kiosk';
7751
- /** Whether to loop the slideshow continuously. */
7752
- loopContinuously?: boolean;
7753
- /** Whether to show without narration. */
7754
- showWithNarration?: boolean;
7755
- /** Whether to show without animation. */
7756
- showWithAnimation?: boolean;
7757
- /** Advance slides mode: manual click or use stored timings. */
7758
- advanceMode?: 'manual' | 'useTimings';
7759
- /** Show slides: 'all', a custom show id, or a from-to range. */
7760
- showSlidesMode?: 'all' | 'customShow' | 'range';
7761
- /** Custom show id to use when showSlidesMode is 'customShow'. */
7762
- showSlidesCustomShowId?: string;
7763
- /** Slide range start (1-based) when showSlidesMode is 'range'. */
7764
- showSlidesFrom?: number;
7765
- /** Slide range end (1-based) when showSlidesMode is 'range'. */
7766
- showSlidesTo?: number;
7767
- /** Whether to show subtitles/captions during presentation mode. */
7768
- showSubtitles?: boolean;
7769
- /** Typed `p:prnPr` settings. Set to null during save to remove the element. */
7770
- printProperties?: PptxPresentationPrintProperties | null;
7771
- /** Most-recently-used colours from the presentation palette. */
7772
- mruColors?: string[];
7773
- /**
7774
- * Pen colour for presentation mode annotations (from `p:showPr/p:penClr`).
7775
- * `p:penClr` is a full `EG_ColorChoice` (P1-G2): a scheme/preset/system
7776
- * swatch resolves to a hex string here just like a direct `a:srgbClr`.
7777
- */
7778
- penColor?: string;
7779
- /**
7780
- * The resolved hex value {@link penColor} had at parse time, and the
7781
- * original `p:penClr` colour-choice XML node, preserved so a save that
7782
- * never touches the pen colour re-emits the original scheme/preset
7783
- * reference verbatim instead of flattening it to a baked `a:srgbClr`.
7784
- * Internal round-trip bookkeeping; not meant to be set by API callers.
7785
- */
7786
- penColorOriginal?: string;
7787
- /** @see penColorOriginal */
7788
- penColorXml?: XmlObject;
7789
- /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
7790
- kioskRestartTime?: number;
7791
- /**
7792
- * `p:showPr/p:browse/@showScrollbar` (CT_ShowInfoBrowse §19.2.1.10 /
7793
- * §19.3.1.43), the "Show scrollbar" checkbox in PowerPoint's Set Up Show
7794
- * dialog. Only meaningful when `showType` is `"browsed"`; the schema
7795
- * default is `true`. `undefined` means the source authored no explicit
7796
- * value (or `showType` is not `"browsed"`).
7797
- */
7798
- showScrollbar?: boolean;
7799
- }
7800
- /**
7801
- * Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
7802
- *
7803
- * @example
7804
- * ```ts
7805
- * const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
7806
- * // => satisfies PptxSlideSize
7807
- * ```
7808
- */
7809
- interface PptxSlideSize {
7810
- /** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
7811
- widthEmu?: number;
7812
- /** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
7813
- heightEmu?: number;
7814
- /**
7815
- * `@type` (ST_SlideSizeType). The schema default is `custom`, which is
7816
- * why PowerPoint omits the attribute for a non-preset size.
7817
- */
7818
- type?: string;
7819
- }
7820
- /**
7821
- * A named custom slide show (`p:custShowLst / p:custShow`).
7822
- *
7823
- * Custom shows define ordered subsets of slides that can be presented
7824
- * independently of the full deck.
7825
- *
7826
- * @example
7827
- * ```ts
7828
- * const show: PptxCustomShow = {
7829
- * name: "Executive Summary",
7830
- * id: "0",
7831
- * slideRIds: ["rId2", "rId5", "rId8"],
7832
- * };
7833
- * // => satisfies PptxCustomShow
7834
- * ```
7835
- */
7836
- interface PptxCustomShow {
7837
- /** Custom show name. */
7838
- name: string;
7839
- /** Custom show id. */
7840
- id: string;
7841
- /** Ordered list of slide relationship IDs included in this custom show. */
7842
- slideRIds: string[];
7843
- /** Original `p:custShow` subtree used to preserve unmodelled attributes and extensions. */
7844
- rawXml?: XmlObject;
7845
- }
7846
- /**
7847
- * An ordered section in the presentation (from `p:sectionLst` / `p14:sectionLst`).
7848
- *
7849
- * Sections group consecutive slides under a named heading (visible
7850
- * in the PowerPoint slide sorter).
7851
- *
7852
- * @example
7853
- * ```ts
7854
- * const section: PptxSection = {
7855
- * id: "sec_1",
7856
- * name: "Introduction",
7857
- * slideIds: ["256", "257"],
7858
- * };
7859
- * // => satisfies PptxSection
7860
- * ```
7861
- */
7862
- interface PptxSection {
7863
- /** Section unique identifier (GUID or synthetic). */
7864
- id: string;
7865
- /** Human-readable section name. */
7866
- name: string;
7867
- /** Ordered list of numeric slide IDs that belong to this section. */
7868
- slideIds: string[];
7869
- /** Whether the section is collapsed in the slide sorter (from p15:sectionPr). */
7870
- collapsed?: boolean;
7871
- /** Section highlight color hex (from p15:sectionPr/@clr). */
7872
- color?: string;
7873
- /** Original section subtree used to preserve unmodelled attributes and extensions. */
7874
- rawXml?: XmlObject;
7875
- }
7876
- /**
7877
- * Write-protection hash data parsed from `p:modifyVerifier` in `presentation.xml`.
7878
- *
7879
- * When present, the presentation is marked as "read-only recommended" or
7880
- * write-protected with a password hash. The hash parameters follow the
7881
- * ECMA-376 Part 1, section 19.2.1.22 specification.
7882
- *
7883
- * @example
7884
- * ```ts
7885
- * const verifier: PptxModifyVerifier = {
7886
- * algorithmName: "SHA-512",
7887
- * hashData: "base64EncodedHash==",
7888
- * saltData: "base64EncodedSalt==",
7889
- * spinValue: 100000,
7890
- * };
7891
- * // => satisfies PptxModifyVerifier
7892
- * ```
7893
- */
7894
- interface PptxModifyVerifier {
7895
- /** Hash algorithm name (e.g. "SHA-512", "SHA-1"). */
7896
- algorithmName?: string;
7897
- /** Base64-encoded hash value. */
7898
- hashData?: string;
7899
- /** Base64-encoded salt value. */
7900
- saltData?: string;
7901
- /** Number of hash iterations (spin count). */
7902
- spinValue?: number;
7903
- /** Legacy algorithm ID extension. */
7904
- algIdExt?: string;
7905
- /** Legacy algorithm ID. */
7906
- cryptAlgorithmSid?: number;
7907
- /** Cryptographic algorithm type (e.g. "typeAny"). */
7908
- cryptAlgorithmType?: string;
7909
- /** Cryptographic provider name. */
7910
- cryptProvider?: string;
7911
- /** Cryptographic provider type (e.g. "providerTypeRsaFull"). */
7912
- cryptProviderType?: string;
7913
- /** Cryptographic algorithm class (e.g. "hash"). */
7914
- cryptAlgorithmClass?: string;
7915
- }
7916
- /**
7917
- * Photo album metadata from `p:photoAlbum` in `presentation.xml`.
7918
- *
7919
- * Stores settings for presentations created via Insert > Photo Album.
7920
- *
7921
- * @see ECMA-376 Part 1, §19.2.1.27
7922
- */
7923
- interface PptxPhotoAlbum {
7924
- /** Whether photos are displayed in black-and-white. */
7925
- bw?: boolean;
7926
- /** Whether captions are shown below each photo. */
7927
- showCaptions?: boolean;
7928
- /** Photo album layout (e.g. "1pic", "2pic", "4pic", "fitToSlide"). */
7929
- layout?: string;
7930
- /** Frame style applied to each photo (e.g. "frameStyle1"). */
7931
- frame?: string;
7932
- /**
7933
- * `p:photoAlbum/@isPhoto` (ECMA-376 S19.2.1.27, CT_PhotoAlbum): whether
7934
- * the pictures placed by the album wizard are real photographs, as
7935
- * opposed to clip art or other embedded images. `undefined` when the
7936
- * source authored no explicit value (schema default `false`); this is a
7937
- * purely declarative wizard-provenance flag, not something this library
7938
- * gates any layout/frame behaviour on.
7939
- */
7940
- isPhoto?: boolean;
7941
- }
7942
- /**
7943
- * A recognizer-owned `p:smartTags` reference from `presentation.xml`
7944
- * (CT_SmartTags, ECMA-376 S19.2.1.42): a bare relationship id pointing at a
7945
- * legacy Office "Smart Tags" recognizer part, distinct from the
7946
- * user-authored `p:tags` construct (see {@link PptxTagCollection}).
7947
- *
7948
- * This library has no data model for recognizer part CONTENT (there is no
7949
- * way to create, inspect, or edit one through the public API), so this type
7950
- * only captures enough to preserve an authored reference losslessly: the
7951
- * relationship id and, when resolvable, the target part path.
7952
- */
7953
- interface PptxSmartTagsReference {
7954
- /** Relationship id from `p:smartTags/@r:id`. */
7955
- relId: string;
7956
- /** Resolved ZIP path of the referenced recognizer part, when resolvable. */
7957
- targetPath?: string;
7958
- /** Raw `p:smartTags` XML retained for lossless round-trip. */
7959
- rawXml?: XmlObject;
7960
- }
7961
- /**
7962
- * East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
7963
- *
7964
- * Defines forbidden start/end characters for a given language so that
7965
- * line-breaking follows East Asian typographic rules.
7966
- *
7967
- * @see ECMA-376 Part 1, §19.2.1.17
7968
- */
7969
- interface PptxKinsoku {
7970
- /** Language code (e.g. "ja-JP", "zh-CN"). */
7971
- lang?: string | null;
7972
- /** Characters that cannot begin a line. */
7973
- invalStChars?: string;
7974
- /** Characters that cannot end a line. */
7975
- invalEndChars?: string;
7976
- /** Original leaf retained for unknown attribute preservation. */
7977
- rawXml?: XmlObject;
7978
- }
7979
- /**
7980
- * Root data structure returned by {@link PptxHandlerCore.load}.
7981
- *
7982
- * Contains every slide, canvas dimensions, theme data, layout options,
7983
- * metadata, and optional features (custom shows, sections, macros,
7984
- * digital signatures, embedded fonts).
7985
- *
7986
- * @example
7987
- * ```ts
7988
- * const data: PptxData = await handler.load(buffer);
7989
- * console.log(`${data.slides.length} slides, ${data.width}×${data.height}`);
7990
- * // => e.g. "24 slides, 960×540"
7991
- * ```
7992
- */
7993
- interface PptxData {
7994
- slides: PptxSlide[];
7995
- width: number;
7996
- height: number;
7997
- /** Slide width in EMU (for save round-trip). */
7998
- widthEmu?: number;
7999
- /** Slide height in EMU (for save round-trip). */
8000
- heightEmu?: number;
8001
- /** Slide size type from `p:sldSz/@type` (e.g. "screen4x3", "screen16x9", "custom"). */
8002
- slideSizeType?: string;
8003
- /** Notes page width in EMU (from `p:notesSz`). */
8004
- notesWidthEmu?: number;
8005
- /** Notes page height in EMU (from `p:notesSz`). */
8006
- notesHeightEmu?: number;
8007
- layoutOptions?: PptxLayoutOption[];
8008
- headerFooter?: PptxHeaderFooter;
8009
- /** Presentation-level properties parsed from `presentationPr.xml`. */
8010
- presentationProperties?: PptxPresentationProperties;
8011
- /** Named custom slide shows from `p:custShowLst`. */
8012
- customShows?: PptxCustomShow[];
8013
- /** Ordered presentation sections from `p:sectionLst` / `p14:sectionLst`. */
8014
- sections?: PptxSection[];
8015
- warnings?: PptxCompatibilityWarning[];
8016
- /** Map of theme colour scheme keys to resolved hex values. */
8017
- themeColorMap?: Record<string, string>;
8018
- /** Full parsed theme object with colours, fonts, and name. */
8019
- theme?: PptxTheme;
8020
- /** Available theme parts discovered in `ppt/theme/`. */
8021
- themeOptions?: PptxThemeOption[];
8022
- /** Parsed table style definitions from `ppt/tableStyles.xml`. */
8023
- tableStyleMap?: ParsedTableStyleMap;
8024
- /**
8025
- * The current default table style GUID (`ppt/tableStyles.xml`'s
8026
- * `a:tblStyleLst/@def`): the style PowerPoint applies to a newly inserted
8027
- * table. Matches `PptxSaveOptions.tableStylesDefaultId` so a save call
8028
- * that omits it can fall back to what was loaded.
8029
- */
8030
- tableStylesDefaultId?: string;
8031
- /** Whether the presentation is password-protected. */
8032
- isPasswordProtected?: boolean;
8033
- /** Embedded font data (name + binary data URL) extracted from the presentation. */
8034
- embeddedFonts?: PptxEmbeddedFont[];
8035
- /** Typed `p:embeddedFontLst` package metadata, including unresolved variants. */
8036
- embeddedFontList?: PptxEmbeddedFontList;
8037
- /**
8038
- * `p:presentation/@embedTrueTypeFonts` (ECMA-376 §19.2.1.26): the author's
8039
- * saved preference that TrueType fonts referenced by the deck be embedded.
8040
- * `undefined` when the attribute is absent (spec default `false`).
8041
- *
8042
- * This is purely declarative in this library: fonts are only ever embedded
8043
- * when the caller explicitly supplies `embeddedFontList`/`embeddedFonts`
8044
- * (there is no automatic embed-on-save), so toggling this flag does not
8045
- * gate any embedding behaviour of its own here - it only round-trips the
8046
- * author's stated preference, the same way real PowerPoint reads it back
8047
- * as a checkbox state rather than a trigger. See `@saveSubsetFonts`,
8048
- * which is a separate, deliberately unimplemented flag (no glyph
8049
- * subsetting) that does not interact with this one.
8050
- */
8051
- embedTrueTypeFonts?: boolean;
8052
- /**
8053
- * `p:presentation/@firstSlideNum`: a `slidenum` field on slide `i` (0-based)
8054
- * shows `firstSlideNumber + i`. Absent means the spec default, 1.
8055
- */
8056
- firstSlideNumber?: number;
8057
- /**
8058
- * Presentation-level default text style (`p:defaultTextStyle`): the
8059
- * last-resort paragraph/run-property fallback for every shape (placeholder
8060
- * or not) whose local and inherited cascade leaves a field undefined.
8061
- * Keyed the same way as {@link PptxMasterTextStyles} categories: `-1` is
8062
- * `a:defPPr`, `0`-`8` are `a:lvl1pPr`-`a:lvl9pPr`.
8063
- */
8064
- defaultTextStyle?: PptxTextStyleLevels;
8065
- /** Most-recently-used colour list from presentation properties. */
8066
- mruColors?: string[];
8067
- /** Parsed notes master data if present in the PPTX. */
8068
- notesMaster?: PptxNotesMaster;
8069
- /** Parsed handout master data if present in the PPTX. */
8070
- handoutMaster?: PptxHandoutMaster;
8071
- /** Structured slide master data for each master in the presentation. */
8072
- slideMasters?: PptxSlideMaster[];
8073
- /** Parsed tag collections attached to the presentation or slides. */
8074
- tags?: PptxTagCollection[];
8075
- /** Custom document properties from `docProps/custom.xml`. */
8076
- customProperties?: PptxCustomProperty[];
8077
- /** Core document properties from `docProps/core.xml`. */
8078
- coreProperties?: PptxCoreProperties;
8079
- /** Extended (application) properties from `docProps/app.xml`. */
8080
- appProperties?: PptxAppProperties;
8081
- /** Whether the presentation contains VBA macros (is a .pptm file). */
8082
- hasMacros?: boolean;
8083
- /** Whether the presentation contains digital signatures (`_xmlsignatures/` parts). */
8084
- hasDigitalSignatures?: boolean;
8085
- /** Number of digital signatures found. */
8086
- digitalSignatureCount?: number;
8087
- /** Presentation-level drawing guides from `p:extLst`. */
8088
- presentationGuides?: PptxDrawingGuide[];
8089
- /** View properties from `ppt/viewProps.xml`. */
8090
- viewProperties?: PptxViewProperties;
8091
- /** Write-protection verifier from `p:modifyVerifier` in `presentation.xml`. */
8092
- modifyVerifier?: PptxModifyVerifier;
8093
- /** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
8094
- photoAlbum?: PptxPhotoAlbum;
8095
- /**
8096
- * Legacy Smart Tags recognizer reference from `p:smartTags` in
8097
- * `presentation.xml`. Read-only: there is no data model for the
8098
- * recognizer part's own content, so this exists to make the reference
8099
- * inspectable and to prove it survives a save (the owning part and its
8100
- * relationship are preserved passively, like any other unmodelled part).
8101
- */
8102
- smartTags?: PptxSmartTagsReference;
8103
- /** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
8104
- kinsoku?: PptxKinsoku;
8105
- /** Custom XML data parts from `customXml/` in the OPC package. */
8106
- customXmlParts?: PptxCustomXmlPart[];
8107
- /** Customer data references from `p:custDataLst` in `presentation.xml`. */
8108
- customerData?: PptxCustomerData[];
8109
- /** Thumbnail image binary data from `docProps/thumbnail.{jpeg,png}`. */
8110
- thumbnailData?: Uint8Array;
8111
- /** Comment authors parsed from `ppt/commentAuthors.xml` for round-trip preservation. */
8112
- commentAuthors?: PptxCommentAuthor[];
8113
- /** Office 2021 p188 authors from the modern Author part. */
8114
- modernCommentAuthors?: PptxModernCommentAuthor[];
8115
- /**
8116
- * OOXML conformance class of the loaded file.
8117
- * - `'strict'` -- ISO/IEC 29500 Strict (uses `purl.oclc.org` namespace URIs)
8118
- * - `'transitional'` -- ECMA-376 Transitional (uses `schemas.openxmlformats.org` URIs)
8119
- *
8120
- * When saving, if the save option `conformance` is `'preserve'` (default),
8121
- * the file will be saved using the same conformance class as the original.
8122
- */
8123
- conformance?: 'strict' | 'transitional';
8124
- }
8125
- /**
8126
- * Target format for slide export.
8127
- *
8128
- * @see {@link PptxExportOptions}
8129
- */
8130
- type PptxExportFormat = 'pdf' | 'png' | 'svg';
8131
- /**
8132
- * Options controlling slide export to raster or vector formats.
8133
- *
8134
- * @example
8135
- * ```ts
8136
- * const opts: PptxExportOptions = {
8137
- * format: "png",
8138
- * slideIndices: [0, 2, 4],
8139
- * dpi: 300,
8140
- * };
8141
- * // => satisfies PptxExportOptions
8142
- * ```
8143
- */
8144
- interface PptxExportOptions {
8145
- /** Target format. */
8146
- format: PptxExportFormat;
8147
- /** Slide indices to export (0-based). If omitted, all slides are exported. */
8148
- slideIndices?: number[];
8149
- /** Output width in pixels (for PNG). Height is derived from aspect ratio. */
8150
- width?: number;
8151
- /** DPI for raster export (default 150). */
8152
- dpi?: number;
8153
- /** Whether to include hidden slides. */
8154
- includeHidden?: boolean;
8155
- }
8156
- /**
8157
- * Embedded font data extracted from a PPTX file.
8158
- *
8159
- * Used to register `@font-face` rules so the renderer can display
8160
- * the correct typeface even when the system font is missing.
8161
- *
8162
- * @example
8163
- * ```ts
8164
- * const font: PptxEmbeddedFont = {
8165
- * name: "CustomSans",
8166
- * dataUrl: "data:font/truetype;base64,AAEAK...",
8167
- * format: "truetype",
8168
- * };
8169
- * // => satisfies PptxEmbeddedFont
8170
- * ```
8171
- */
8172
- /**
8173
- * A single Custom XML Data Part stored in `customXml/` within the OPC package.
8174
- *
8175
- * These parts are used by add-ins, data-binding, and enterprise templates
8176
- * to store structured data alongside the presentation.
8177
- *
8178
- * @see ECMA-376 Part 1, §15.2.5
8179
- */
8180
- interface PptxCustomXmlPart {
8181
- /** Item number (e.g. "1" for `customXml/item1.xml`). */
8182
- id: string;
8183
- /** Raw XML string content of the custom XML item. */
8184
- data: string;
8185
- /** Schema target namespace URI from `itemProps` (ds:schemaRef/@ds:uri). */
8186
- schemaUri?: string;
8187
- /** Raw XML string content of the associated `itemProps` file. */
8188
- properties?: string;
8189
- /** Raw XML string content of the OPC relationship file (`customXml/_rels/item{id}.xml.rels`). */
8190
- rels?: string;
8191
- }
8192
- interface PptxEmbeddedFont {
8193
- name: string;
8194
- dataUrl: string;
8195
- bold?: boolean;
8196
- italic?: boolean;
8197
- /** CSS font format hint (e.g. "truetype", "opentype"). */
8198
- format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
8199
- /**
8200
- * Deobfuscated (clear-text) font binary data preserved from load
8201
- * for round-trip re-embedding on save. When present, the save
8202
- * pipeline will re-obfuscate and write this data back into the ZIP.
8203
- */
8204
- rawFontData?: Uint8Array;
8205
- /**
8206
- * Original ZIP path of the font part (e.g. `ppt/fonts/{GUID}.fntdata`).
8207
- * Preserved from load for round-trip.
8208
- */
8209
- partPath?: string;
8210
- /**
8211
- * The GUID used for obfuscation, either from the `fontKey` attribute
8212
- * or extracted from the part path. Preserved from load for round-trip.
8213
- */
8214
- fontGuid?: string;
8215
- /**
8216
- * Relationship ID (e.g. `rId21`) of the font part in
8217
- * `ppt/_rels/presentation.xml.rels`. Preserved from load so the save
8218
- * pipeline can reuse the original part/rel instead of minting a new
8219
- * GUID-named copy alongside the stale original.
8220
- */
8221
- originalRId?: string;
8222
- /**
8223
- * Raw bytes of the original obfuscated font part exactly as they were
8224
- * stored in the source ZIP. When the loader could not determine a
8225
- * usable GUID (e.g. EOT extraction path), the save pipeline preserves
8226
- * these bytes verbatim under the original path/rel.
8227
- */
8228
- originalPartBytes?: Uint8Array;
8229
- }
8230
- //#endregion
8231
- //#region pptx/core/builders/sdk/merge-operations.d.ts
8232
- /**
8233
- * Options controlling how slides are merged from source into target.
8234
- */
8235
- interface MergeOptions {
8236
- /** Which slides to take from source (0-based indices). Default: all */
8237
- slideIndices?: number[];
8238
- /** Where to insert in target (0-based). Default: end */
8239
- insertAt?: number;
8240
- /** Whether to keep source theme (false = use target theme). Default: false */
8241
- keepSourceTheme?: boolean;
8242
- }
8243
- /**
8244
- * Merge slides from a source presentation into a target.
8245
- *
8246
- * This is a data-level merge that operates on {@link PptxData} objects.
8247
- * Slides are deep-cloned from the source, re-numbered to avoid ID
8248
- * conflicts, and inserted into the target's slides array.
8249
- *
8250
- * Media embedded as data URLs (imageData, mediaData, backgroundImage,
8251
- * posterFrameData) travel with the cloned elements automatically.
8252
- *
8253
- * @param targetData - The target presentation data (will be modified in place).
8254
- * @param sourceData - The source presentation data (read-only — slides are cloned).
8255
- * @param options - Merge configuration.
8256
- * @returns Number of slides merged.
8257
- *
8258
- * @example
8259
- * ```ts
8260
- * const target = await handler.load(targetBuffer);
8261
- * const source = await handler.load(sourceBuffer);
8262
- *
8263
- * const count = mergePresentation(target, source, {
8264
- * slideIndices: [0, 2],
8265
- * insertAt: 1,
8266
- * });
8267
- * console.log(`Merged ${count} slides`);
8268
- * ```
8269
- */
8270
- declare function mergePresentation(targetData: PptxData, sourceData: PptxData, options?: MergeOptions): number;
8271
- //#endregion
8272
- //#region pptx/core/builders/sdk/text-operations.d.ts
8273
- /**
8274
- * A single text match result returned by {@link findText}.
8275
- */
8276
- interface FindResult {
8277
- /** 0-based slide index. */
8278
- slideIndex: number;
8279
- /** ID of the element containing the match. */
8280
- elementId: string;
8281
- /** Index of the text segment within the element. */
8282
- segmentIndex: number;
8283
- /** The matched text. */
8284
- text: string;
8285
- /** Character offset within the segment where the match starts. */
8286
- matchIndex: number;
8287
- }
8288
- /**
8289
- * Search for text across all slides in the presentation.
8290
- *
8291
- * Searches through all text segments in all elements (including
8292
- * group children recursively). Supports both plain string and
8293
- * RegExp patterns.
8294
- *
8295
- * @param slides - Array of slides to search.
8296
- * @param search - Plain string or RegExp to search for.
8297
- * @returns Array of match results with location information.
8298
- *
8299
- * @example
8300
- * ```ts
8301
- * const results = findText(data.slides, /Q[1-4] \d{4}/);
8302
- * console.log(`Found ${results.length} date references`);
8303
- * ```
8304
- */
8305
- declare function findText(slides: PptxSlide[], search: string | RegExp): FindResult[];
8306
- /**
8307
- * Replace all occurrences of a search pattern in a single slide's elements.
8308
- *
8309
- * Mutates the slide's elements in place. Searches through all
8310
- * text segments including group children recursively.
8311
- *
8312
- * @param slide - The slide to perform replacements on.
8313
- * @param search - Plain string or RegExp to search for.
8314
- * @param replacement - The replacement string (supports `$1`, `$&` etc. for RegExp).
8315
- * @returns The number of replacements made.
8316
- *
8317
- * @example
8318
- * ```ts
8319
- * const count = replaceTextInSlide(data.slides[0], "2025", "2026");
8320
- * console.log(`Updated ${count} occurrences on slide 1`);
8321
- * ```
8322
- */
8323
- declare function replaceTextInSlide(slide: PptxSlide, search: string | RegExp, replacement: string): number;
8324
- /**
8325
- * Replace all occurrences of a search pattern across all slides.
8326
- *
8327
- * Mutates slides' elements in place. Searches through all text
8328
- * segments including group children recursively.
8329
- *
8330
- * @param slides - Array of slides to perform replacements on.
8331
- * @param search - Plain string or RegExp to search for.
8332
- * @param replacement - The replacement string.
8333
- * @returns The total number of replacements made across all slides.
8334
- *
8335
- * @example
8336
- * ```ts
8337
- * const count = replaceText(data.slides, "Acme Corp", "NewCo Inc");
8338
- * console.log(`Rebranded ${count} occurrences`);
8339
- * ```
8340
- */
8341
- declare function replaceText(slides: PptxSlide[], search: string | RegExp, replacement: string): number;
8342
- //#endregion
8343
- export { PptxThemeOption as $, ResolvedStyleMatrix as $i, PptxSplitDirection as $n, PptxChartFilteredSeries as $r, PptxCustomProperty as $t, PptxNormalViewProperties as A, PptxChartUserShapeParagraph as Ai, PptxAttributeAnimation as An, TableStyleSectionPatch as Ar, PptxPictureNonVisualProperties as At, PptxEmbeddedFontDescriptor as B, PptxChartPivotFormat as Bi, PptxTextBuildType as Bn, PptxChartData as Br, Model3DSceneData as Bt, PptxSlide as C, PptxChartWaterfallOptions as Ci, PptxAnimationPreset as Cn, PptxTableCellStyle as Cr, PptxElement as Ct, PptxSmartTagsReference as D, PptxChartUserShape as Di, PptxAnimationTimelineAnchor as Dn, CreateTableStyleOptions as Dr, PptxGraphicFrameExtension as Dt, PptxSlideSyncProperties as E, PptxExternalData as Ei, PptxAnimationTarget as En, PptxTableRow as Er, PptxElementWithText as Et, PptxViewScale as F, PptxChartPageMargins as Fi, PptxMediaBookmarkTarget as Fn, PptxChartAxisNumFmt as Fr, TextPptxElement as Ft, PptxHeaderFooterFlags as G, PptxChartTickMark as Gi, PptxAnimRotBehavior as Gn, PptxChartDataPoint as Gr, PptxElementBase as Gt, PptxEmbeddedFontListEntry as H, PptxChartDataPointPicture as Hi, PptxAnimBehavior as Hn, PptxChartDataLabelOptions as Hr, Model3DVec3 as Ht, PptxPresentationPrintProperties as I, PptxChartPageSetup as Ii, PptxNativeAnimation as In, PptxChartBandFmt as Ir, UnknownPptxElement as It, PptxNotesMaster as J, PptxCropShape as Ji, PptxAnimationBehaviorTiming as Jn, PptxChartDisplayUnitsLabel as Jr, PptxAppProperties as Jt, PptxLayoutPreview as K, PptxBackgroundRemoval as Ki, PptxAnimScaleBehavior as Kn, PptxChartDataTable as Kr, PptxShapeProperties as Kt, PptxPrintColorMode as L, PptxChartPrintHeaderFooter as Li, PptxNativeAnimationKind as Ln, PptxChartBarDirection as Lr, ZoomPptxElement as Lt, PptxViewGuide as M, ResolvedChartStyleDefinition as Mi, PptxElementAnimation as Mn, PptxBubbleChartOptions as Mr, SmartArtPptxElement as Mt, PptxViewOrigin as N, ResolvedChartStyleEntry as Ni, PptxGraphicBuild as Nn, PptxChart3DSurface as Nr, SummaryZoomTarget as Nt, PptxCommonSlideViewProperties as O, PptxChartUserShapeGroupChild as Oi, PptxAnimationTimingCurve as On, ParsedTableFillRef as Or, PptxImageLikeElement as Ot, PptxViewProperties as P, PptxChartProtection as Pi, PptxHslColorDelta as Pn, PptxChartAxisFormatting as Pr, TablePptxElement as Pt, PptxTextStyleLevels as Q, PptxCustomDashSegment as Qi, PptxSlideTransition as Qn, PptxChartErrValType as Qr, PptxCoreProperties as Qt, PptxPrintOutput as R, PptxChartPrintSettings as Ri, PptxSetAnimation as Rn, PptxChartBoxWhiskerOptions as Rr, Model3DCamera as Rt, PptxSection as S, PptxChartView3D as Si, PptxAnimationOleChartElementTarget as Sn, PptxTableCellParagraph as Sr, PptxAccessibilityProperties as St, PptxSlideSize as T, PptxEmbeddedWorkbookData as Ti, PptxAnimationSequence as Tn, PptxTableData as Tr, PptxElementWithShapeStyle as Tt, MasterViewTab as U, PptxChartPictureFormat as Ui, PptxAnimEffectBehavior as Un, PptxChartDataLabelPosition as Ur, PlaceholderDefaults as Ut, PptxEmbeddedFontList as V, PptxChartPivotFormats as Vi, PptxTimingTemplate as Vn, PptxChartDataLabel as Vr, Model3DTransformData as Vt, PptxHandoutMaster as W, PptxChartAxisLabelFormatting as Wi, PptxAnimMotionBehavior as Wn, PptxChartDataLabelsRange as Wr, PlaceholderTextLevelStyle as Wt, PptxSlideLayout as X, PptxImagePrerenderedCorrections as Xi, PptxSetBehavior as Xn, PptxChartErrBarType as Xr, PptxCommentAuthor as Xt, PptxPlaceholderFrame as Y, PptxImageEffects as Yi, PptxBehaviorPoint as Yn, PptxChartErrBarDir as Yr, PptxComment as Yt, PptxSlideMaster as Z, PptxImageProperties as Zi, PptxMorphOption as Zn, PptxChartErrBars as Zr, PptxCompatibilityWarning as Zt, PptxLayoutOption as _, PptxChartTrendline as _i, PptxAnimationDirection as _n, ParsedTableStyleMap as _r, MediaPptxElement as _t, MergeOptions as a, PptxChartLineStyle as ai, ElementAction as an, PptxTransitionType as ar, PptxThemeFontScheme as at, PptxPhotoAlbum as b, PptxChartType as bi, PptxAnimationIterate as bn, PptxTableCell as br, OlePptxElement as bt, PptxCustomShow as c, PptxChartMarkerSymbol as ci, MediaBookmark as cn, TRANSITION_VALID_DIRECTIONS as cr, PptxThemeObjectDefaults as ct, PptxData as d, PptxChartRegionMapOptions as di, PptxAudioCdPosition as dn, ParsedTableStyleBorders as dr, ConnectorPptxElement as dt, ShapeStyle as ea, PptxChartGradientFill as ei, PptxModernCommentAuthor as en, PptxSplitOrientation as er, PptxTheme as et, PptxEmbeddedFont as f, PptxChartScatterStyle as fi, PptxMediaReferenceKind as fn, ParsedTableStyleEntry as fr, ContentPartInkStroke as ft, PptxKinsoku as g, PptxChartTreemapOptions as gi, PptxAfterAnimationAction as gn, ParsedTableStyleImage as gr, InkPptxElement as gt, PptxHeaderFooter as h, PptxChartStyle as hi, AnimationConditionEvent as hn, ParsedTableStyleGradientStop as hr, ImagePptxElement as ht, replaceTextInSlide as i, PptxChartLegendTextStyle as ii, ActionButtonPreset as in, PptxTransitionSpeed as ir, PptxThemeFontGroup as it, PptxRestoredRegion as j, PptxChartTitleRun as ji, PptxColorAnimation as jn, PptxBar3DShape as jr, ShapePptxElement as jt, PptxGridSpacing as k, PptxChartUserShapeGroupTransform as ki, PptxAnimationTrigger as kn, ParsedTableStyleEffect as kr, PptxNonVisualDescription as kt, PptxCustomXmlPart as l, PptxChartOfPieOptions as li, MediaCaptionTrack as ln, ParsedTableBackground as lr, THEME_COLOR_SCHEME_KEYS as lt, PptxExportOptions as m, PptxChartShapeProps as mi, AnimationCondition as mn, ParsedTableStyleGradient as mr, GroupPptxElement as mt, findText as n, PptxChartLayouts as ni, PptxTagCollection as nn, PptxTransitionDirection4 as nr, PptxThemeEffectStyle as nt, mergePresentation as o, PptxChartManualLayout as oi, ElementActionType as on, TRANSITION_PATTERN_OPTIONS as or, PptxThemeFormatScheme as ot, PptxExportFormat as p, PptxChartSeries as pi, PptxMediaType as pn, ParsedTableStyleFill as pr, ContentPartPptxElement as pt, PptxMasterTextStyles as q, PptxBackgroundRemovalMark as qi, PptxAnimationBehavior as qn, PptxChartDateCategories as qr, PptxTextProperties as qt, replaceText as r, PptxChartLegendEntry as ri, PptxCommentMention as rn, PptxTransitionDirection8 as rr, PptxThemeFillStyle as rt, PptxActiveXControl as s, PptxChartMarker as si, PptxAction as sn, TRANSITION_THRUBLK_TYPES as sr, PptxThemeLineStyle as st, FindResult as t, PptxChartHistogramOptions as ti, PptxTag as tn, PptxStripDirection as tr, PptxThemeColorScheme as tt, PptxCustomerData as u, PptxChartParentLabelLayout as ui, MediaMetadata as un, ParsedTableStyleBorder as ur, ChartPptxElement as ut, PptxModernCommentPart as v, PptxChartTrendlineLabel as vi, PptxAnimationEffectFilter as vn, ParsedTableStylePattern as vr, Model3DPptxElement as vt, PptxSlideBackgroundPattern as w, PptxCxValueColorPosition as wi, PptxAnimationRepeatMode as wn, PptxTableCellTextRun as wr, PptxElementType as wt, PptxPresentationProperties as x, PptxChartUpDownBars as xi, PptxAnimationKeyframe as xn, PptxTableCell3D as xr, PicturePptxElement as xt, PptxModifyVerifier as y, PptxChartTrendlineType as yi, PptxAnimationGraphicElementTarget as yn, ParsedTableStyleText as yr, OleObjectType as yt, PptxEmbeddedFontDataId as z, PptxChartPivotSource as zi, PptxTextAnimationTarget as zn, PptxChartChrome as zr, Model3DLightData as zt };
8344
- //# sourceMappingURL=text-operations-BqHmLaLA.d.ts.map
5098
+ export { ParsedTableStyleFill as $, PptxChartSeries as $t, Model3DLightData as A, PptxChartAxisLabelFormatting as An, PptxChartDataLabelsRange as At, ElementAction as B, ShapeStyle as Bn, PptxChartGradientFill as Bt, SmartArtPptxElement as C, PptxChartPrintHeaderFooter as Cn, PptxChartBarDirection as Ct, UnknownPptxElement as D, PptxChartPivotFormats as Dn, PptxChartDataLabel as Dt, TextPptxElement as E, PptxChartPivotFormat as En, PptxChartData as Et, PlaceholderTextLevelStyle as F, PptxImageEffects as Fn, PptxChartErrBarDir as Ft, MediaMetadata as G, PptxChartLineStyle as Gt, PptxAction as H, PptxChartLayouts as Ht, PptxElementBase as I, PptxImagePrerenderedCorrections as In, PptxChartErrBarType as It, PptxMediaType as J, PptxChartMarkerSymbol as Jt, PptxAudioCdPosition as K, PptxChartManualLayout as Kt, PptxShapeProperties as L, PptxImageProperties as Ln, PptxChartErrBars as Lt, Model3DTransformData as M, PptxBackgroundRemoval as Mn, PptxChartDataTable as Mt, Model3DVec3 as N, PptxBackgroundRemovalMark as Nn, PptxChartDateCategories as Nt, ZoomPptxElement as O, PptxChartDataPointPicture as On, PptxChartDataLabelOptions as Ot, PlaceholderDefaults as P, PptxCropShape as Pn, PptxChartDisplayUnitsLabel as Pt, ParsedTableStyleEntry as Q, PptxChartScatterStyle as Qt, PptxTextProperties as R, PptxCustomDashSegment as Rn, PptxChartErrValType as Rt, ShapePptxElement as S, PptxChartPageSetup as Sn, PptxChartBandFmt as St, TablePptxElement as T, PptxChartPivotSource as Tn, PptxChartChrome as Tt, MediaBookmark as U, PptxChartLegendEntry as Ut, ElementActionType as V, PptxChartHistogramOptions as Vt, MediaCaptionTrack as W, PptxChartLegendTextStyle as Wt, ParsedTableStyleBorder as X, PptxChartParentLabelLayout as Xt, ParsedTableBackground as Y, PptxChartOfPieOptions as Yt, ParsedTableStyleBorders as Z, PptxChartRegionMapOptions as Zt, PptxElementWithText as _, PptxChartTitleRun as _n, PptxBar3DShape as _t, GroupPptxElement as a, PptxChartTrendlineType as an, ParsedTableStyleText as at, PptxNonVisualDescription as b, PptxChartProtection as bn, PptxChartAxisFormatting as bt, MediaPptxElement as c, PptxChartView3D as cn, PptxTableCellParagraph as ct, OlePptxElement as d, PptxEmbeddedWorkbookData as dn, PptxTableData as dt, PptxChartShapeProps as en, ParsedTableStyleGradient as et, PicturePptxElement as f, PptxExternalData as fn, PptxTableRow as ft, PptxElementWithShapeStyle as g, PptxChartUserShapeParagraph as gn, TableStyleSectionPatch as gt, PptxElementType as h, PptxChartUserShapeGroupTransform as hn, ParsedTableStyleEffect as ht, ContentPartPptxElement as i, PptxChartTrendlineLabel as in, ParsedTableStylePattern as it, Model3DSceneData as j, PptxChartTickMark as jn, PptxChartDataPoint as jt, Model3DCamera as k, PptxChartPictureFormat as kn, PptxChartDataLabelPosition as kt, Model3DPptxElement as l, PptxChartWaterfallOptions as ln, PptxTableCellStyle as lt, PptxElement as m, PptxChartUserShapeGroupChild as mn, ParsedTableFillRef as mt, ConnectorPptxElement as n, PptxChartTreemapOptions as nn, ParsedTableStyleImage as nt, ImagePptxElement as o, PptxChartType as on, PptxTableCell as ot, PptxAccessibilityProperties as p, PptxChartUserShape as pn, CreateTableStyleOptions as pt, PptxMediaReferenceKind as q, PptxChartMarker as qt, ContentPartInkStroke as r, PptxChartTrendline as rn, ParsedTableStyleMap as rt, InkPptxElement as s, PptxChartUpDownBars as sn, PptxTableCell3D as st, ChartPptxElement as t, PptxChartStyle as tn, ParsedTableStyleGradientStop as tt, OleObjectType as u, PptxCxValueColorPosition as un, PptxTableCellTextRun as ut, PptxGraphicFrameExtension as v, ResolvedChartStyleDefinition as vn, PptxBubbleChartOptions as vt, SummaryZoomTarget as w, PptxChartPrintSettings as wn, PptxChartBoxWhiskerOptions as wt, PptxPictureNonVisualProperties as x, PptxChartPageMargins as xn, PptxChartAxisNumFmt as xt, PptxImageLikeElement as y, ResolvedChartStyleEntry as yn, PptxChart3DSurface as yt, ActionButtonPreset as z, ResolvedStyleMatrix as zn, PptxChartFilteredSeries as zt };
5099
+ //# sourceMappingURL=elements-DD3UGOMd.d.ts.map