@shbernal/ts-pptx 3.1.0 → 3.3.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 (73) hide show
  1. package/README.md +55 -20
  2. package/dist/{autopage-QQyfRtoK.js → autopage-D1sqK6j7.js} +16 -15
  3. package/dist/{autopage-QQyfRtoK.js.map → autopage-D1sqK6j7.js.map} +1 -1
  4. package/dist/browser.d.ts +6 -6
  5. package/dist/browser.js +5 -6
  6. package/dist/browser.js.map +1 -1
  7. package/dist/{diagnostics-PMINsVP6.d.ts → diagnostics-B2yWpcjB.d.ts} +31 -14
  8. package/dist/{diagnostics-PMINsVP6.d.ts.map → diagnostics-B2yWpcjB.d.ts.map} +1 -1
  9. package/dist/{diagnostics-DYQC7xLV.js → diagnostics-H1QzgRSw.js} +0 -0
  10. package/dist/{diagnostics-DYQC7xLV.js.map → diagnostics-H1QzgRSw.js.map} +1 -1
  11. package/dist/{enums-CoXnxiCI.d.ts → enums-CvRYniUA.d.ts} +13 -3
  12. package/dist/{enums-CoXnxiCI.d.ts.map → enums-CvRYniUA.d.ts.map} +1 -1
  13. package/dist/{errors-BeUEkNWL.d.ts → errors-fB1KDJKQ.d.ts} +5 -5
  14. package/dist/{errors-BeUEkNWL.d.ts.map → errors-fB1KDJKQ.d.ts.map} +1 -1
  15. package/dist/{fit-DhMbQG5O.js → fit-CYJ1jkQI.js} +0 -0
  16. package/dist/fit-CYJ1jkQI.js.map +1 -0
  17. package/dist/{html-dom-DajBuobe.js → html-dom-CzewEdE1.js} +4 -5
  18. package/dist/{html-dom-DajBuobe.js.map → html-dom-CzewEdE1.js.map} +1 -1
  19. package/dist/html.d.ts +3 -3
  20. package/dist/html.js +1 -1
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +5 -6
  23. package/dist/index.js.map +1 -1
  24. package/dist/inspect.d.ts +1 -1
  25. package/dist/inspect.js +4 -4
  26. package/dist/math.d.ts +1 -1
  27. package/dist/measure.d.ts +96 -6
  28. package/dist/measure.d.ts.map +1 -1
  29. package/dist/measure.js +2 -2
  30. package/dist/node.d.ts +6 -6
  31. package/dist/node.js +4 -5
  32. package/dist/node.js.map +1 -1
  33. package/dist/notes-SCvpJz0l.js +1646 -0
  34. package/dist/notes-SCvpJz0l.js.map +1 -0
  35. package/dist/{pres-BgvxhQ_m.d.ts → pres-Cb-1xDne.d.ts} +4 -4
  36. package/dist/{pres-BgvxhQ_m.d.ts.map → pres-Cb-1xDne.d.ts.map} +1 -1
  37. package/dist/{presentation-BP1B8PCF.js → presentation-DeKTJGHf.js} +1096 -440
  38. package/dist/presentation-DeKTJGHf.js.map +1 -0
  39. package/dist/{presentation-DyIRDKkp.d.ts → presentation-types-B50aOUFI.d.ts} +804 -39
  40. package/dist/presentation-types-B50aOUFI.d.ts.map +1 -0
  41. package/dist/read.d.ts +4 -5
  42. package/dist/read.d.ts.map +1 -1
  43. package/dist/read.js +2 -2
  44. package/dist/script.d.ts +32 -4
  45. package/dist/script.d.ts.map +1 -1
  46. package/dist/script.js +0 -0
  47. package/dist/script.js.map +1 -1
  48. package/dist/{shapes-DMThLsZN.js → shapes-BXVgsk0F.js} +81 -63
  49. package/dist/shapes-BXVgsk0F.js.map +1 -0
  50. package/dist/{slide-BRAtT8Dl.d.ts → slide-DWw9UoI6.d.ts} +130 -11
  51. package/dist/slide-DWw9UoI6.d.ts.map +1 -0
  52. package/dist/{st-enums-evQG2A7Z.js → st-enums-bVnezkMJ.js} +33 -12
  53. package/dist/{st-enums-evQG2A7Z.js.map → st-enums-bVnezkMJ.js.map} +1 -1
  54. package/dist/{text-B6PbMFih.js → text-uM-zGton.js} +242 -1611
  55. package/dist/text-uM-zGton.js.map +1 -0
  56. package/dist/{units-internal-CR8s8YQa.js → units-internal-CGf4VrXy.js} +156 -4
  57. package/dist/units-internal-CGf4VrXy.js.map +1 -0
  58. package/dist/zip.d.ts +2 -2
  59. package/package.json +40 -28
  60. package/skills/ts-pptx-upstream/SKILL.md +107 -14
  61. package/dist/embedded-fonts-MaynAHa9.js +0 -94
  62. package/dist/embedded-fonts-MaynAHa9.js.map +0 -1
  63. package/dist/fit-DhMbQG5O.js.map +0 -1
  64. package/dist/presentation-BP1B8PCF.js.map +0 -1
  65. package/dist/presentation-DyIRDKkp.d.ts.map +0 -1
  66. package/dist/presentation-types-Dj4riuDs.d.ts +0 -538
  67. package/dist/presentation-types-Dj4riuDs.d.ts.map +0 -1
  68. package/dist/shapes-DMThLsZN.js.map +0 -1
  69. package/dist/slide-BRAtT8Dl.d.ts.map +0 -1
  70. package/dist/text-B6PbMFih.js.map +0 -1
  71. package/dist/units-C7QM1KgH.js +0 -144
  72. package/dist/units-C7QM1KgH.js.map +0 -1
  73. package/dist/units-internal-CR8s8YQa.js.map +0 -1
@@ -1,6 +1,28 @@
1
- import { t as CustomPropertyValue } from "./pres-BgvxhQ_m.js";
2
- import { c as ImportSlideMastersOptions, d as LayoutHandle, f as SlideSize, l as ImportSlideOptions, o as FromTemplateOptions, p as SlideSource, r as EmbeddedFontInfo, s as ImportShapeOptions, t as AppendSlidesOptions, u as ImportedSlideMaster } from "./presentation-types-Dj4riuDs.js";
1
+ import { t as CustomPropertyValue } from "./pres-Cb-1xDne.js";
3
2
  import { a as Part, i as Relationships, n as OpcPackage, o as Element, t as OpcInput } from "./package-CaOLXSNi.js";
3
+ //#region src/embedded-fonts.d.ts
4
+ /**
5
+ * The four face slots of `CT_EmbeddedFontListEntry`, in schema child order
6
+ * (`font` first, then these). Iterate in this order everywhere so the read- and
7
+ * write-side emitters agree on element order.
8
+ */
9
+ declare const EMBEDDED_FONT_SLOTS: readonly ['regular', 'bold', 'italic', 'boldItalic'];
10
+ type EmbeddedFontSlot = (typeof EMBEDDED_FONT_SLOTS)[number];
11
+ /** One embeddable face: a slot plus the raw font bytes (absent in pure read-side merges). */
12
+ interface EmbeddedFontFace {
13
+ slot: EmbeddedFontSlot;
14
+ bytes?: Uint8Array;
15
+ }
16
+ /** A typeface family with 1..4 embedded faces — one `p:embeddedFont` entry. */
17
+ interface EmbeddedFont {
18
+ /** `p:font/@typeface` — MUST match the family name used in run/`fontFace` typefaces or PowerPoint won't bind it. */
19
+ typeface: string;
20
+ panose?: string;
21
+ pitchFamily?: number;
22
+ charset?: number;
23
+ faces: EmbeddedFontFace[];
24
+ }
25
+ //#endregion
4
26
  //#region src/read/oxml/theme.d.ts
5
27
  /**
6
28
  * The colour-resolution context: the two maps that turn a DrawingML colour
@@ -1084,13 +1106,41 @@ declare class TextFrame {
1084
1106
  markDirty(): void;
1085
1107
  }
1086
1108
  //#endregion
1109
+ //#region src/read/api/shapes/host.d.ts
1110
+ /** The part-level surface a {@link import('./base.js').Shape} resolves against. */
1111
+ interface ShapeHost {
1112
+ /** The OPC part holding the shape tree (`p:sld` / `p:sldLayout` / `p:sldMaster`). */
1113
+ readonly part: Part;
1114
+ /** Partname of {@link part}. */
1115
+ readonly partName: string;
1116
+ /** The package the host belongs to, for reaching a referenced part (image, chart, …). */
1117
+ readonly opc: OpcPackage;
1118
+ /** {@link part}'s relationships — image embeds, hyperlinks, chart references. */
1119
+ readonly relationships: Relationships;
1120
+ /** The host's resolved colour/font context, backing every `resolved*` getter. */
1121
+ themeContext(): ThemeContext;
1122
+ /** The shape anywhere in this host's tree with the given drawing id, or `undefined`. */
1123
+ shapeByIdDeep(id: number): AnyShape | undefined;
1124
+ }
1125
+ //#endregion
1087
1126
  //#region src/read/api/shapes/base.d.ts
1088
- /** Common base for every shape in a slide's shape tree. */
1127
+ /** Common base for every shape in a shape tree — a slide's, a layout's, or a master's. */
1089
1128
  declare abstract class Shape {
1090
1129
  #private;
1091
1130
  protected readonly element: Element;
1092
- readonly slide: Slide;
1093
- constructor(element: Element, slide: Slide);
1131
+ /**
1132
+ * The part that owns this shape's tree — a `Slide`, a `SlideLayout`, or a
1133
+ * `SlideMaster`. Narrow it with `instanceof` when you need the concrete class;
1134
+ * {@link ShapeHost.partName} tells the tiers apart without one.
1135
+ */
1136
+ readonly host: ShapeHost;
1137
+ constructor(element: Element,
1138
+ /**
1139
+ * The part that owns this shape's tree — a `Slide`, a `SlideLayout`, or a
1140
+ * `SlideMaster`. Narrow it with `instanceof` when you need the concrete class;
1141
+ * {@link ShapeHost.partName} tells the tiers apart without one.
1142
+ */
1143
+ host: ShapeHost);
1094
1144
  /** Which concrete shape kind this is. */
1095
1145
  abstract readonly shapeType: ShapeType;
1096
1146
  /** The transform element (`a:xfrm` or `p:xfrm`) carrying this shape's geometry, or `null` if inherited. */
@@ -1098,7 +1148,7 @@ declare abstract class Shape {
1098
1148
  /** The transform element, creating it (and its container) in document order if absent. */
1099
1149
  protected abstract getOrAddXfrm(): Element;
1100
1150
  /**
1101
- * Mark the owning slide part dirty so `save()` reserializes it. Public
1151
+ * Mark the owning host's part dirty so `save()` reserializes it. Public
1102
1152
  * because {@link element_} hands out the live DOM node: the hatch and the
1103
1153
  * obligation that comes with it belong on the same object.
1104
1154
  */
@@ -1340,20 +1390,20 @@ declare abstract class Shape {
1340
1390
  get lineEnds(): LineEnds | null;
1341
1391
  /**
1342
1392
  * The shape's outer drop shadow (`spPr/a:effectLst/a:outerShdw`), resolved
1343
- * against the slide theme, or `null` when the shape has no outer shadow. The
1393
+ * against the host's theme, or `null` when the shape has no outer shadow. The
1344
1394
  * soft brand shadows the eye reads as "floating" panels live here and are
1345
1395
  * invisible in geometry/fill alone.
1346
1396
  */
1347
1397
  get shadow(): OuterShadow | null;
1348
1398
  /**
1349
1399
  * The shape's **inner** shadow (`spPr/a:effectLst/a:innerShdw`), resolved against
1350
- * the slide theme, or `null` when the shape has no inner shadow. The inset
1400
+ * the host's theme, or `null` when the shape has no inner shadow. The inset
1351
1401
  * counterpart of {@link shadow}: the write-side `shadow: { type: 'inner' }`
1352
1402
  * emits it, and it is invisible in geometry/fill alone.
1353
1403
  */
1354
1404
  get innerShadow(): InnerShadow | null;
1355
1405
  /**
1356
- * The shape's glow halo (`spPr/a:effectLst/a:glow`), resolved against the slide
1406
+ * The shape's glow halo (`spPr/a:effectLst/a:glow`), resolved against the host's
1357
1407
  * theme, or `null` when the shape has no glow. Same element the write-side text
1358
1408
  * glow emits, so its {@link Glow.radiusPt} and colour round-trip.
1359
1409
  */
@@ -1372,7 +1422,7 @@ declare abstract class Shape {
1372
1422
  /**
1373
1423
  * The shape's pattern (hatch) fill (`spPr/a:pattFill`), or `null` when the fill
1374
1424
  * is not a pattern. Surfaces the {@link PatternFill.preset} name and both
1375
- * colours resolved against the slide theme — the pattern counterpart of
1425
+ * colours resolved against the host's theme — the pattern counterpart of
1376
1426
  * {@link resolvedFill}, which reports `null` for a non-solid fill and so drops a
1377
1427
  * hatched surface entirely.
1378
1428
  */
@@ -1388,7 +1438,7 @@ declare abstract class Shape {
1388
1438
  */
1389
1439
  get pictureFill(): PictureFill | null;
1390
1440
  /**
1391
- * The shape's solid fill resolved against the slide's theme
1441
+ * The shape's solid fill resolved against the host's theme
1392
1442
  * ({@link Slide.themeContext}) to a literal hex — the resolved counterpart of
1393
1443
  * {@link fillColor}/{@link fillSchemeColor}, which report the raw reference.
1394
1444
  * `null` when the shape has no `a:solidFill` (a gradient/none/inherited fill)
@@ -1403,7 +1453,7 @@ declare abstract class Shape {
1403
1453
  */
1404
1454
  get resolvedFill(): ResolvedColor | null;
1405
1455
  /**
1406
- * The shape's line/border solid fill resolved against the slide's theme to a
1456
+ * The shape's line/border solid fill resolved against the host's theme to a
1407
1457
  * literal hex — the resolved counterpart of {@link lineColor}/{@link lineSchemeColor}.
1408
1458
  * `null` when the shape has no `a:ln/a:solidFill` or it cannot be made literal.
1409
1459
  * Like {@link resolvedFill}, the result carries `effectiveHex` (the base colour
@@ -1433,8 +1483,8 @@ declare abstract class Shape {
1433
1483
  */
1434
1484
  get placeholder(): PlaceholderRef | null;
1435
1485
  /**
1436
- * Remove this shape from its parent (the slide's shape tree, or an enclosing
1437
- * group) and mark the owning slide part dirty. The proxy is dead afterwards.
1486
+ * Remove this shape from its parent (the host's shape tree, or an enclosing
1487
+ * group) and mark the owning host's part dirty. The proxy is dead afterwards.
1438
1488
  */
1439
1489
  delete(): void;
1440
1490
  /** Escape hatch: the underlying shape element. After mutating it call {@link markDirty}, or `save()` writes the original bytes. */
@@ -1477,12 +1527,12 @@ declare class Picture extends Shape {
1477
1527
  /** Relationship id of the embedded image (`p:blipFill/a:blip/@r:embed`), or `null`. */
1478
1528
  get imageRelId(): string | null;
1479
1529
  /**
1480
- * Repoint the blip at a relationship id already present in the slide's
1530
+ * Repoint the blip at a relationship id already present in the owning part's
1481
1531
  * relationships, without minting a new media part. The caller owns ensuring
1482
1532
  * the id exists and targets an image; use {@link setImage} to add fresh bytes.
1483
1533
  */
1484
1534
  set imageRelId(value: string);
1485
- /** Absolute partname of the embedded image, resolved via the slide's relationships, or `null`. */
1535
+ /** Absolute partname of the embedded image, resolved via the owning part's relationships, or `null`. */
1486
1536
  get imagePartName(): string | null;
1487
1537
  /**
1488
1538
  * Relationship id of the embedded **vector (SVG)** image, read from the
@@ -1493,7 +1543,7 @@ declare class Picture extends Shape {
1493
1543
  * so a reader that wants the real drawn art must consult both.
1494
1544
  */
1495
1545
  get svgRelId(): string | null;
1496
- /** Absolute partname of the embedded SVG image, resolved via the slide's relationships, or `null`. */
1546
+ /** Absolute partname of the embedded SVG image, resolved via the owning part's relationships, or `null`. */
1497
1547
  get svgPartName(): string | null;
1498
1548
  /**
1499
1549
  * Which drawable media this picture carries:
@@ -1548,7 +1598,7 @@ declare class Picture extends Shape {
1548
1598
  /**
1549
1599
  * Replace this picture's image with new bytes. Mints a fresh media part under
1550
1600
  * `/ppt/media/`, registers its content type, wires an `image` relationship
1551
- * from the owning slide, and repoints the blip's `@r:embed` at it.
1601
+ * from the owning part, and repoints the blip's `@r:embed` at it.
1552
1602
  *
1553
1603
  * Copy-on-write: the previous media part is never mutated or removed, so any
1554
1604
  * other picture sharing it (common after `importSlide`/dedup) is unaffected;
@@ -2844,6 +2894,13 @@ declare class Theme {
2844
2894
  * and text style from. Geometry getters read the placeholder's *own* `a:xfrm`,
2845
2895
  * which a master/layout placeholder carries explicitly (so it round-trips, unlike a
2846
2896
  * notes placeholder's inherited geometry).
2897
+ *
2898
+ * This is the identity-and-geometry view. The same `p:sp` also appears in
2899
+ * {@link SlideMaster.shapes} / {@link SlideLayout.shapes} as an `AutoShape`, which
2900
+ * additionally carries the paint surface (`resolvedFill`, `resolvedLine`,
2901
+ * `presetGeometry`, `rotation`, `absoluteFrame`) and reports its `p:ph` through
2902
+ * `AutoShape.placeholder`. Read a placeholder here to *place* it; read it there to
2903
+ * *draw* it.
2847
2904
  */
2848
2905
  declare class Placeholder {
2849
2906
  #private;
@@ -2888,20 +2945,25 @@ declare class Placeholder {
2888
2945
  /**
2889
2946
  * A deck's slide master (`slideMasterN.xml`) as a modeled object. Exposes the
2890
2947
  * property tiers a bound slide inherits: the {@link colorMap} (token → theme slot),
2891
- * its {@link theme}, its {@link placeholders} (with geometry), its own
2892
- * {@link background}, and the {@link layouts} that build on it. Reachable from
2893
- * {@link SlideLayout.master} and `Slide.master`.
2948
+ * its {@link theme}, its {@link shapes} and the {@link placeholders} subset of them,
2949
+ * its own {@link background}, and the {@link layouts} that build on it. Reachable
2950
+ * from {@link SlideLayout.master} and `Slide.master`.
2894
2951
  */
2895
- declare class SlideMaster {
2952
+ declare class SlideMaster implements ShapeHost {
2896
2953
  #private;
2897
- private readonly opc;
2954
+ /** The package the master belongs to, for reaching its layouts, theme, and media. */
2955
+ readonly opc: OpcPackage;
2898
2956
  /** The master's OPC part (`/ppt/slideMasters/slideMasterN.xml`). */
2899
2957
  readonly part: Part;
2900
- constructor(opc: OpcPackage,
2958
+ constructor(
2959
+ /** The package the master belongs to, for reaching its layouts, theme, and media. */
2960
+ opc: OpcPackage,
2901
2961
  /** The master's OPC part (`/ppt/slideMasters/slideMasterN.xml`). */
2902
2962
  part: Part);
2903
2963
  /** Partname of the master part. */
2904
2964
  get partName(): string;
2965
+ /** This master part's relationships (its layouts, its theme, image embeds, …). */
2966
+ get relationships(): Relationships;
2905
2967
  /** The master's authoring name (`p:cSld/@name`), or `''` when unnamed (the writer's default). */
2906
2968
  get name(): string;
2907
2969
  /** The master's theme (via its `theme` relationship), or `null` when absent. */
@@ -2913,6 +2975,18 @@ declare class SlideMaster {
2913
2975
  * A token the map omits reads `null`.
2914
2976
  */
2915
2977
  get colorMap(): Record<ColorMapToken, string | null>;
2978
+ /**
2979
+ * Every shape in the master's `p:cSld/p:spTree`, in document order — the same
2980
+ * `AnyShape` union `Slide.shapes` returns, so shape-walking code applies
2981
+ * unchanged. This is where a template's non-placeholder furniture lives: the
2982
+ * header band, the rule under the title, the logo. Whether a given slide draws
2983
+ * them is `Slide.showMasterSp` (and, for a layout, {@link SlideLayout.showMasterSp}).
2984
+ *
2985
+ * {@link placeholders} is the filtered view of the same tree.
2986
+ */
2987
+ get shapes(): AnyShape[];
2988
+ /** The shape anywhere in the master's tree with the given drawing id, or `undefined`. */
2989
+ shapeByIdDeep(id: number): AnyShape | undefined;
2916
2990
  /** The master's placeholder shapes (`p:sp` carrying a `p:ph`), in document order. */
2917
2991
  get placeholders(): Placeholder[];
2918
2992
  /** The layouts built on this master (via `p:sldLayoutIdLst` → its relationships), in list order. */
@@ -2933,19 +3007,24 @@ declare class SlideMaster {
2933
3007
  * A deck's slide layout (`slideLayoutN.xml`) as a modeled object — the gallery entry
2934
3008
  * a slide binds to. Exposes its {@link name}, its {@link type} (import-only; the
2935
3009
  * writer authors none), its {@link master} (and, through it, the {@link theme}), its
2936
- * {@link placeholders} (with geometry), and its own {@link background}. Reachable
2937
- * from `Slide.layout` and {@link SlideMaster.layouts}.
3010
+ * {@link shapes} and the {@link placeholders} subset of them, and its own
3011
+ * {@link background}. Reachable from `Slide.layout` and {@link SlideMaster.layouts}.
2938
3012
  */
2939
- declare class SlideLayout {
3013
+ declare class SlideLayout implements ShapeHost {
2940
3014
  #private;
2941
- private readonly opc;
3015
+ /** The package the layout belongs to, for reaching its master, theme, and media. */
3016
+ readonly opc: OpcPackage;
2942
3017
  /** The layout's OPC part (`/ppt/slideLayouts/slideLayoutN.xml`). */
2943
3018
  readonly part: Part;
2944
- constructor(opc: OpcPackage,
3019
+ constructor(
3020
+ /** The package the layout belongs to, for reaching its master, theme, and media. */
3021
+ opc: OpcPackage,
2945
3022
  /** The layout's OPC part (`/ppt/slideLayouts/slideLayoutN.xml`). */
2946
3023
  part: Part);
2947
3024
  /** Partname of the layout part. */
2948
3025
  get partName(): string;
3026
+ /** This layout part's relationships (its master, image embeds, hyperlinks, …). */
3027
+ get relationships(): Relationships;
2949
3028
  /** The layout's authoring name (`p:cSld/@name`, e.g. `Title and Content`), or `''` when unnamed. */
2950
3029
  get name(): string;
2951
3030
  /**
@@ -2954,10 +3033,31 @@ declare class SlideLayout {
2954
3033
  * authored deck reads `null`; an imported deck carries PowerPoint's value.
2955
3034
  */
2956
3035
  get type(): string | null;
3036
+ /**
3037
+ * Whether this layout draws the master's non-placeholder shapes
3038
+ * (`p:sldLayout/@showMasterSp`). `xsd:boolean` defaulting to `true`, so an absent
3039
+ * attribute means shown — the layout-tier counterpart of `Slide.showMasterSp`,
3040
+ * and the one PowerPoint actually writes on a section-divider or full-bleed
3041
+ * layout. A renderer resolving what to paint under a slide's own shapes has to
3042
+ * consult both: the slide's flag, then its layout's.
3043
+ */
3044
+ get showMasterSp(): boolean;
2957
3045
  /** The master this layout is built on (via its `slideMaster` relationship), or `null` when absent. */
2958
3046
  get master(): SlideMaster | null;
2959
3047
  /** The theme this layout resolves against, via its {@link master}, or `null`. */
2960
3048
  get theme(): Theme | null;
3049
+ /**
3050
+ * Every shape in the layout's `p:cSld/p:spTree`, in document order — the same
3051
+ * `AnyShape` union `Slide.shapes` returns, so shape-walking code applies
3052
+ * unchanged. The write API authors non-placeholder shapes here: every
3053
+ * `defineSlideMaster({ objects })` member that is not a `placeholder` (a `rect`,
3054
+ * a `line`, an `image`, a `chart`, a `text` box) lands in this tree.
3055
+ *
3056
+ * {@link placeholders} is the filtered view of the same tree.
3057
+ */
3058
+ get shapes(): AnyShape[];
3059
+ /** The shape anywhere in the layout's tree with the given drawing id, or `undefined`. */
3060
+ shapeByIdDeep(id: number): AnyShape | undefined;
2961
3061
  /** The layout's placeholder shapes (`p:sp` carrying a `p:ph`), in document order. */
2962
3062
  get placeholders(): Placeholder[];
2963
3063
  /**
@@ -3060,7 +3160,7 @@ interface AddPictureOptions {
3060
3160
  /** MIME content type (e.g. `image/png`); sniffed alongside `extension` when omitted. */
3061
3161
  contentType?: string;
3062
3162
  }
3063
- declare class Slide {
3163
+ declare class Slide implements ShapeHost {
3064
3164
  #private;
3065
3165
  readonly presentation: Presentation;
3066
3166
  /** The slide's OPC part (`/ppt/slides/slideN.xml`). */
@@ -3089,6 +3189,12 @@ declare class Slide {
3089
3189
  markDirty(): void;
3090
3190
  /** This slide part's relationships (image embeds, layout, hyperlinks, …). */
3091
3191
  get relationships(): Relationships;
3192
+ /**
3193
+ * The deck's OPC package. Convenience for `presentation.opc`, and the member
3194
+ * {@link ShapeHost} names so a shape can reach a referenced part (an image, a
3195
+ * chart) the same way whether it lives on a slide, a layout, or a master.
3196
+ */
3197
+ get opc(): OpcPackage;
3092
3198
  /**
3093
3199
  * The slide's resolved theme context (`clrMap` + `clrScheme` + the theme
3094
3200
  * `fmtScheme` + `fontScheme`, plus the layout/master roots), walked once from
@@ -3117,6 +3223,19 @@ declare class Slide {
3117
3223
  * Marks the slide part dirty.
3118
3224
  */
3119
3225
  set hidden(value: boolean);
3226
+ /**
3227
+ * Whether this slide draws the master's non-placeholder shapes
3228
+ * (`p:sld/@showMasterSp`). `xsd:boolean` defaulting to `true`, so an absent
3229
+ * attribute means shown — the same shape as {@link hidden}.
3230
+ *
3231
+ * This is the switch that decides whether {@link SlideMaster.shapes} belongs on
3232
+ * *this* slide. A slide the author gave a full-bleed image or a section divider
3233
+ * usually sets it to `0`, and a renderer that paints the master's band and logo
3234
+ * anyway puts the template's furniture on top of a slide that deliberately hid
3235
+ * it. Placeholders are unaffected: the flag suppresses only the master's
3236
+ * decorative shapes.
3237
+ */
3238
+ get showMasterSp(): boolean;
3120
3239
  /**
3121
3240
  * The slide's show transition (`p:transition`), decoded into a typed model, or
3122
3241
  * `null` when the slide has none. Handles both PowerPoint forms: the bare
@@ -3338,6 +3457,29 @@ declare class Slide {
3338
3457
  * format is sniffed from the bytes unless `extension`/`contentType` are given.
3339
3458
  */
3340
3459
  addPicture(image: Uint8Array, options: AddPictureOptions): Picture;
3460
+ /**
3461
+ * Give this slide the speaker notes `text`, and return the resulting
3462
+ * {@link NotesSlide}. A `
3463
+ ` starts a new paragraph, matching the write-side
3464
+ * `addNotes`; the runs carry no formatting of their own, so style them
3465
+ * afterwards through {@link notesTextFrame}.
3466
+ *
3467
+ * The counterpart to the read side's `notesText`/`notesTextFrame`/`notesSlide`
3468
+ * getters, and the way to annotate a slide that has **no notes part at all** —
3469
+ * the state an `importSlide` without `{ importNotes: true }` leaves behind, and
3470
+ * the one a `notesTextFrame` edit cannot reach because there is no frame to
3471
+ * hand back. Calling it on a slide that already has notes replaces the body
3472
+ * text and leaves the rest of the part (its geometry, its other two
3473
+ * placeholders) alone.
3474
+ *
3475
+ * Creating the part pulls in what a notes slide must bind to: a `notesMaster`,
3476
+ * of which a presentation may hold at most one. This deck's own is reused when
3477
+ * it has one; otherwise one is installed, bound to a clone of this deck's theme
3478
+ * so it resolves against the destination palette. That is the same
3479
+ * single-master rule `importSlide({ importNotes: true })` and `appendSlides`
3480
+ * follow, so mixing the three cannot produce a second notes master.
3481
+ */
3482
+ addNotes(text: string): NotesSlide;
3341
3483
  /**
3342
3484
  * @internal The slide's shape tree (`p:cSld/p:spTree`), or `null` if absent.
3343
3485
  * Exposed for cross-slide composition (`Presentation.importShape`).
@@ -3512,12 +3654,17 @@ declare class Presentation {
3512
3654
  * Duplicate the slide at `index` and insert the copy at `options.at` (deck
3513
3655
  * order; `0` = first), defaulting to appending at the end when `at` is omitted
3514
3656
  * or out of range. Returns the new slide. The new slide part copies the source
3515
- * bytes verbatim and shares the source's relationship targets (layout, images,
3516
- * …) by copying its `.rels`; a new presentation→slide relationship and a
3517
- * `p:sldId` entry are wired up. Marks the presentation part dirty.
3657
+ * bytes verbatim and shares the source's deck-wide relationship targets
3658
+ * (layout, images, media) by copying its `.rels`; a new presentation→slide
3659
+ * relationship and a `p:sldId` entry are wired up. Marks the presentation part
3660
+ * dirty.
3518
3661
  *
3519
- * Note: relationships are copied as-is, so a source slide that owns a
3520
- * one-to-one part (e.g. a notes slide) would end up shared with the clone.
3662
+ * What the source page *owns* is copied rather than shared: its notes slide,
3663
+ * charts, SmartArt diagrams and OLE embeddings, each with the subtree under it
3664
+ * (a chart's embedded workbook comes along; the image inside its user-shapes
3665
+ * drawing stays shared). PowerPoint refuses to open a deck where two slides
3666
+ * resolve to one chart or diagram, so this is not tidiness — see
3667
+ * `page-owned.ts` for the rule and the evidence behind it.
3521
3668
  */
3522
3669
  cloneSlide(index: number, options?: {
3523
3670
  at?: number;
@@ -3549,7 +3696,10 @@ declare class Presentation {
3549
3696
  * Only the layout(s) actually used by imported slides are copied; the imported
3550
3697
  * master's `p:sldLayoutIdLst` is pruned to exactly those, mirroring how
3551
3698
  * PowerPoint's "Reuse Slides" brings a slide across. Parts shared by repeated
3552
- * imports from the same source deck are copied once and reused.
3699
+ * imports from the same source deck are copied once and reused — every part
3700
+ * except the page itself. Importing the same source slide twice yields two
3701
+ * independent copies over one shared layout/master/theme, which is what lets a
3702
+ * deck show one page twice (verbatim, then edited).
3553
3703
  *
3554
3704
  * With `{ theme: 'preserve' }` the slide's source theme is instead *flattened*
3555
3705
  * into the slide XML and the slide is bound to this deck's existing
@@ -3563,6 +3713,53 @@ declare class Presentation {
3563
3713
  * widths). Source notes are dropped unless you pass `{ importNotes: true }`.
3564
3714
  */
3565
3715
  importSlide(source: Presentation, index: number, options?: ImportSlideOptions): Slide;
3716
+ /**
3717
+ * Import selected pages from one or more loaded source presentations as one
3718
+ * batch. Each imported page lands at its `outputIndex` in the complete
3719
+ * destination slide list after the batch, and the returned array is parallel
3720
+ * to `requests` — `result[i]` is the page `requests[i]` asked for, whatever
3721
+ * order the output positions were given in.
3722
+ *
3723
+ * Everything is checked before a single byte of this deck moves: every request
3724
+ * names an existing source page, final output positions are unique, each source
3725
+ * has this deck's slide size, and a read-only dry run of the copy proves every
3726
+ * part it would reach is present. A batch therefore either applies in full or
3727
+ * leaves this deck byte-identical, where a per-page loop of
3728
+ * {@link importSlide} can leave a half-stitched deck behind.
3729
+ *
3730
+ * The batch also decides what a `slide → slide` link means: an internal link
3731
+ * on a selected page must target another **selected** page (or one this deck
3732
+ * already contains via an earlier import from that source), and is rewritten
3733
+ * to the fresh partname — importing page 3 of 10 does not drag pages 1–2
3734
+ * across as dependencies, and never strands the link. This mirrors
3735
+ * `appendSlides`' `import/unresolved-slide-link`, which the write side already
3736
+ * enforces for generator decks.
3737
+ *
3738
+ * One request is one output page, so naming the same source page in several
3739
+ * requests is how you ask for several independent copies of it — the page part
3740
+ * is the one thing an import never shares, exactly as in {@link importSlide}.
3741
+ * Everything under it (layout, master, theme, media) is still copied once and
3742
+ * shared. Where such a page is the target of a `slide → slide` link, the link
3743
+ * resolves to one of its copies: pages duplicated together are copied in
3744
+ * lockstep and link to their round-mates, and a link into a page requested only
3745
+ * once always lands on that single copy.
3746
+ *
3747
+ * Speaker notes travel per request: `{ importNotes: true }` carries that page's
3748
+ * `notesSlide` part across, wired to the new page and bound to a single
3749
+ * `notesMaster` under the same 0..1 rule {@link importSlide} and
3750
+ * {@link appendSlides} follow — the destination's own master wins when it has
3751
+ * one. Notes are part of the up-front dry run too, so a batch that would fail
3752
+ * carrying them is refused with the deck still byte-identical. A page named in
3753
+ * several requests gets its own copy of its notes each time, as of everything
3754
+ * else that page owns.
3755
+ *
3756
+ * Scope: pages come across under `'copy'` theme semantics (their own layout →
3757
+ * master → theme subgraph, shared parts deduped via the copy registry).
3758
+ * Embedded fonts are not carried, and sizes must match, since there is no batch
3759
+ * spelling for `embedFonts` or `rescale`. Use {@link importSlide} when you need
3760
+ * either of those.
3761
+ */
3762
+ importSlides(requests: readonly ImportSlidesRequest[]): Slide[];
3566
3763
  /**
3567
3764
  * Graft slide master(s) from another open package into this one and return what
3568
3765
  * was copied. Unlike {@link importSlide} — which brings a master across only as
@@ -3627,7 +3824,10 @@ declare class Presentation {
3627
3824
  *
3628
3825
  * Charts and internal slide-to-slide hyperlinks are carried across: chart parts
3629
3826
  * (chart XML + `.rels` + embedded workbook) are injected under fresh names, and a
3630
- * `slide:N` link is repointed at the Nth appended slide's new partname.
3827
+ * `slide:N` link is repointed at the Nth appended slide's new partname. A chartEx
3828
+ * (Office 2016 — waterfall, funnel, treemap, ...) chart carries too, as its own
3829
+ * `chartEx{N}.xml` part behind the MS chartEx rel, with the style and color-style
3830
+ * sidecars PowerPoint requires alongside it.
3631
3831
  *
3632
3832
  * The generator's presentation-level embedded fonts (`pptx.embedFont`) are also
3633
3833
  * carried into this deck and merged into its `p:embeddedFontLst`, de-duped by
@@ -3690,5 +3890,570 @@ declare class Presentation {
3690
3890
  save(): Promise<Uint8Array>;
3691
3891
  }
3692
3892
  //#endregion
3693
- export { Chart as $, GroupShape as A, Recolor as At, Table as B, PictureFill as Bt, CommentAuthor as C, CustomGeometryPath as Ct, NotesPlaceholder as D, LineEnd as Dt, ModernCommentAuthor as E, InnerShadow as Et, isPicture as F, PatternFill as Ft, TableConditionFlags as G, resolveColorElement as Gt, TableCellBorderEdit as H, GradientFill as Ht, GraphicFrame as I, BackgroundFill as It, ChartExAxis as J, TableCellEdge as K, ColorContext as Kt, CellBorder as L, BackgroundSource as Lt, isConnector as M, Reflection as Mt, isGraphicFrame as N, ShapeType as Nt, NotesSlide as O, LineEnds as Ot, isGroupShape as P, SoftEdge as Pt, AxisNumberFormat as Q, CellBorders as R, SlideBackground as Rt, Comment as S, CustomGeometry as St, ModernComment as T, Glow as Tt, TableRow as U, GradientStop as Ut, TableCell as V, PictureFillTile as Vt, ResolvedTableStyle as W, ResolvedColor as Wt, ChartExLegend as X, ChartExDataLabels as Y, ChartExSeries as Z, ThemeColorSlot as _, RunHyperlink as _t, readCustomProperties as a, ChartSeries as at, Tag as b, ChildFrame as bt, Slide as c, AutoShape as ct, TransitionSpeed as d, BodyProperties as dt, ChartAxis as et, ColorMapToken as f, BulletDetail as ft, Theme as g, Run as gt, SlideMaster as h, Paragraph as ht, readCoreProperties as i, ChartLine as it, isAutoShape as j, RecolorColor as jt, AnyShape as k, OuterShadow as kt, TransitionInfo as l, Shape as lt, SlideLayout as m, LineSpacing as mt, CoreProperties as n, ChartFill as nt, AddPictureOptions as o, Connector as ot, Placeholder as p, BulletStyle as pt, ChartEx as q, CustomProperty as r, ChartLegend as rt, AddTextBoxOptions as s, Picture as st, Presentation as t, ChartDataLabels as tt, TransitionInput as u, AutofitMode as ut, ThemeFontFace as v, TextFrame as vt, CommentSchema as w, GeometryCommand as wt, readTagsForPart as x, ConnectionSite as xt, ThemeFontScheme as y, AbsoluteFrame as yt, CellThreeD as z, FillRect as zt };
3694
- //# sourceMappingURL=presentation-DyIRDKkp.d.ts.map
3893
+ //#region src/read/api/presentation-types.d.ts
3894
+ /** Slide dimensions, in both EMU (the OOXML unit) and inches. */
3895
+ interface SlideSize {
3896
+ widthEmu: number;
3897
+ heightEmu: number;
3898
+ widthIn: number;
3899
+ heightIn: number;
3900
+ }
3901
+ /**
3902
+ * One `p:embeddedFont` entry, read from `presentation.xml`'s `p:embeddedFontLst`
3903
+ * (see {@link Presentation.embeddedFonts}). A read-only view: it names the family
3904
+ * and resolves each embedded face's `r:id` to the absolute partname of its binary
3905
+ * `/ppt/fonts/*.fntdata` part, so a consumer can enumerate the embedded faces and
3906
+ * pull their bytes without hand-parsing the presentation part or its rels.
3907
+ */
3908
+ interface EmbeddedFontInfo {
3909
+ /** `p:font/@typeface` — the family name PowerPoint binds the embed to. */
3910
+ typeface: string;
3911
+ /** `p:font/@panose`, or `null` when the entry declares none. */
3912
+ panose: string | null;
3913
+ /** The embedded faces, in `regular, bold, italic, boldItalic` schema order. */
3914
+ faces: EmbeddedFontFaceInfo[];
3915
+ }
3916
+ /** One face of an {@link EmbeddedFontInfo}: which slot it fills and the part its `r:id` resolves to. */
3917
+ interface EmbeddedFontFaceInfo {
3918
+ /** Which weight/style slot this face fills. */
3919
+ slot: 'regular' | 'bold' | 'italic' | 'boldItalic';
3920
+ /** Absolute partname of the face's binary `.fntdata` part (e.g. `/ppt/fonts/font1.fntdata`). */
3921
+ partName: string;
3922
+ }
3923
+ /** Options for {@link Presentation.importSlide}. */
3924
+ interface ImportSlideOptions {
3925
+ /**
3926
+ * How the imported slide relates to themes.
3927
+ *
3928
+ * - `'copy'` (default): bring the slide's own `slideLayout → slideMaster →
3929
+ * theme` subgraph across, so the slide renders byte-for-byte as authored.
3930
+ * A deck stitched from N sources then carries N themes/masters.
3931
+ * - `'preserve'`: *flatten then attach* — bake the source theme's colours and
3932
+ * style-matrix fills into the slide XML (so its pixels do not change), then
3933
+ * bind it to this deck's existing master/layout instead of importing the
3934
+ * source theme. The result is a single-theme file whose imported slides are
3935
+ * theme-independent: it fixes renderers that mis-resolve per-slide scheme
3936
+ * colours against the wrong (first) theme, and tidies the deck for handoff.
3937
+ *
3938
+ * To stay faithful across the rebind, `preserve` also bakes the inheritance
3939
+ * the rebind would otherwise break explicitly onto the slide: the slide's
3940
+ * effective background; each placeholder's *inherited* geometry (`a:xfrm`
3941
+ * from the matching source layout/master placeholder) so it cannot shift or
3942
+ * clip; and each placeholder run's *inherited* colour and size/weight
3943
+ * (`sz`/`b`/`i`) from the source layout/master text styles. Typeface
3944
+ * (`a:latin`) is left to re-bind to the destination theme, like `fontRef`.
3945
+ * By default it does **not** carry decorative graphics that live on the source
3946
+ * master/layout shape tree (logos, accent shapes): those belong to the
3947
+ * master `preserve` deliberately drops. Set {@link carryMasterGraphics} to
3948
+ * bake them onto the slide instead.
3949
+ * - `'restyle'`: re-brand to *this* deck. Rebind the slide to this deck's
3950
+ * master/layout exactly like `preserve` but **skip the flatten** — leave every
3951
+ * `a:schemeClr`, style-matrix ref (`fillRef`/`lnRef`/`effectRef`/`fontRef`),
3952
+ * and `p:bg` `bgRef` symbolic so they re-resolve against the *destination*
3953
+ * theme. The slide keeps its geometry, text, and structure but adopts this
3954
+ * deck's colours/fonts: `preserve` makes it "look the same everywhere",
3955
+ * `restyle` makes it "look like mine". The slide's own `p:clrMapOvr` is dropped
3956
+ * so the destination master's `clrMap` governs the re-brand.
3957
+ *
3958
+ * **Load-bearing limitation:** `restyle` can only recolour what is *symbolic*.
3959
+ * Anything the source authored as a literal `a:srgbClr` has no theme reference
3960
+ * to re-resolve and stays exactly that colour, so a slide with a baked literal
3961
+ * palette re-brands little or nothing. Use `restyle` for slides built against
3962
+ * theme colours/style matrices, not hardcoded RGB — or set {@link remapLiterals}
3963
+ * to force-remap literals and copy table styles. Re-brand is inherently a
3964
+ * visual change (a source `accent1` light-on-dark can invert against a dark
3965
+ * destination `accent1`), so its output needs visual QA. A restyled table
3966
+ * resolves its `@tableStyleId` against the *destination* `tableStyles`; if the
3967
+ * destination lacks that id the table falls back (which {@link remapLiterals}
3968
+ * also addresses by copying the source style across).
3969
+ */
3970
+ theme?: 'copy' | 'preserve' | 'restyle';
3971
+ /**
3972
+ * `restyle` mode only. Push the re-brand past what symbolic references reach, for
3973
+ * slides whose palette is partly hardcoded. When `true` it does two things the
3974
+ * plain re-brand cannot:
3975
+ *
3976
+ * - **Literal colours** — every literal `a:srgbClr` equal to a *source*-theme
3977
+ * `clrScheme` slot is rewritten back to a symbolic `a:schemeClr` (routed through
3978
+ * the source `clrMap`), so it re-resolves against this deck's theme instead of
3979
+ * staying its authored RGB. A literal matching no source slot is left untouched.
3980
+ * - **Table styles** — any `@tableStyleId` the slide references is copied from the
3981
+ * source `tableStyles.xml` into this deck's (same id, idempotent, leaving an id
3982
+ * the destination already defines alone), so a restyled table keeps its style
3983
+ * instead of falling back. The copied definition is itself symbolic, so it
3984
+ * re-brands to this deck's theme.
3985
+ *
3986
+ * Off by default: it deliberately reinterprets authored literals as theme colours,
3987
+ * which is a visual change that needs QA. Ignored unless `theme` is `'restyle'`.
3988
+ */
3989
+ remapLiterals?: boolean;
3990
+ /**
3991
+ * `preserve`/`restyle` modes only. When `true`, bake the source
3992
+ * `slideLayout`/`slideMaster` shape-tree decorations (everything on those shape
3993
+ * trees *except* placeholders — logos, accent curves, footers drawn as shapes)
3994
+ * onto the imported slide, behind its own content, so master/layout branding
3995
+ * survives the rebind to this deck's master. Their media are copied across.
3996
+ *
3997
+ * Under `preserve` the carried decorations' theme references are flattened like
3998
+ * the slide's own content; under `restyle` they are left symbolic and so
3999
+ * re-brand to the destination palette along with the slide — note a carried
4000
+ * source logo could recolour unexpectedly under a different palette.
4001
+ *
4002
+ * Off by default: it raises fidelity for cover/closer/divider slides at the
4003
+ * cost of duplicating shapes that would otherwise live once on the shared
4004
+ * master, so opt in only when that branding actually needs to travel with the
4005
+ * slide. Ignored unless `theme` is `'preserve'` or `'restyle'`.
4006
+ */
4007
+ carryMasterGraphics?: boolean;
4008
+ /**
4009
+ * Zero-based insert position in `p:sldIdLst` (deck order). `0` makes the
4010
+ * imported slide first; an `at` past the current slide count — or omitting it —
4011
+ * appends. Use it to place brand bookends (cover at `0`, closer appended)
4012
+ * around generator-authored interior slides regardless of import order.
4013
+ */
4014
+ at?: number;
4015
+ /**
4016
+ * Carry the *source deck's* embedded fonts (`p:embeddedFontLst` in its
4017
+ * `presentation.xml`) into this deck, so an imported slide that renders with an
4018
+ * embedded face keeps it on machines that lack the font. Off by default —
4019
+ * fonts live on the presentation, not the slide, so they are only worth copying
4020
+ * when you want the embed to travel.
4021
+ *
4022
+ * The font binary parts are copied under fresh `/ppt/fonts/` names (deduped via
4023
+ * the per-source copy registry, so repeated imports copy each face once), the
4024
+ * `application/x-fontdata` Default is added, and entries are merged into this
4025
+ * deck's `p:embeddedFontLst` — de-duplicated by `typeface` + face slot, so a
4026
+ * face this deck already embeds is reused rather than duplicated. The carry is a
4027
+ * whole-deck operation (it copies *all* the source's embedded fonts, not just the
4028
+ * faces this one slide uses), since the source list does not record which slide
4029
+ * uses which face.
4030
+ * @default false
4031
+ */
4032
+ embedFonts?: boolean;
4033
+ /**
4034
+ * What to do when the source slide size differs from this deck's. By default
4035
+ * (`false`) `importSlide` throws on any mismatch. Set it to rescale the imported
4036
+ * geometry onto this deck's canvas instead:
4037
+ *
4038
+ * - `'fit'` (or `true`): uniform scale by `min(sx, sy)` then center, so aspect
4039
+ * ratio is preserved (circles stay circles, rotations hold) and the slack on
4040
+ * the longer axis becomes a centered margin. Matches PowerPoint's "Ensure Fit".
4041
+ * - `'stretch'`: independent per-axis scale so the content fills the canvas;
4042
+ * distorts shapes and cannot faithfully reposition rotated shapes. Matches
4043
+ * "Maximize".
4044
+ *
4045
+ * Only *geometry* is rescaled — every top-level shape/group/graphicFrame
4046
+ * transform (`a:off`/`a:ext`) and table grid (`a:gridCol@w`, `a:tr@h`). Font
4047
+ * sizes, line widths, and other absolute sizes are left as authored, so heavy
4048
+ * down-scaling can leave text overflowing its (now smaller) box. In `copy` mode
4049
+ * the imported layout and master shape trees are rescaled too, so inherited
4050
+ * placeholder and background geometry stays aligned; in `preserve`/`restyle` the
4051
+ * slide rebinds to this deck's master/layout (already the right size), so only
4052
+ * the slide is touched.
4053
+ * @default false
4054
+ */
4055
+ rescale?: boolean | 'fit' | 'stretch';
4056
+ /**
4057
+ * Carry the source slide's speaker notes across. By default (`false`) the
4058
+ * `notesSlide` relationship is dropped, so the imported slide has no notes.
4059
+ *
4060
+ * When set, the source `notesSlide` is copied and wired to the imported slide.
4061
+ * Its `slide` back-relationship is repointed at the new slide (the source slide
4062
+ * is *not* copied). A presentation has at most one `notesMaster`: if this deck
4063
+ * already has one, the imported notes reuse it (the source notesMaster and its
4064
+ * theme are not copied); if it has none, the source notesMaster (and its theme)
4065
+ * are copied and registered. The destination's notes styling therefore wins
4066
+ * when both decks define one.
4067
+ * @default false
4068
+ */
4069
+ importNotes?: boolean;
4070
+ }
4071
+ /** Options for {@link Presentation.importShape} / {@link Presentation.importShapes}. */
4072
+ interface ImportShapeOptions {
4073
+ /**
4074
+ * How the lifted shape relates to themes, mirroring {@link ImportSlideOptions}
4075
+ * but scoped to one shape subtree:
4076
+ *
4077
+ * - `'preserve'` (default): bake the shape's scheme/style-matrix colours (and,
4078
+ * for a lifted placeholder, its inherited geometry/colour/size/anchor/list
4079
+ * style) to literals using the *source* slide's theme, so it keeps its look on
4080
+ * a host slide whose theme differs. A lifted placeholder is also *demoted* to a
4081
+ * plain shape (its `p:ph` stripped) once everything it inherited is baked, so it
4082
+ * neither re-resolves against the host's placeholder of the same type/idx nor
4083
+ * collides with it. The safe default for composing across decks.
4084
+ * - `'restyle'`: leave the shape's theme references symbolic so it re-brands to
4085
+ * the host theme. Only *symbolic* colours re-brand — literal `a:srgbClr` the
4086
+ * source baked in stays put (same limitation as `importSlide` restyle).
4087
+ * - `'copy'`: bring the shape's XML across untouched; only sane when the host
4088
+ * already shares the source theme.
4089
+ *
4090
+ * Unlike a slide import this never runs the slide-scoped background passes — a
4091
+ * background belongs to a slide, not to a composed shape.
4092
+ */
4093
+ theme?: 'preserve' | 'restyle' | 'copy';
4094
+ /** Override left edge (EMU). Omitted axes keep the shape's source `a:off`/`a:ext`. */
4095
+ left?: number;
4096
+ /** Override top edge (EMU). */
4097
+ top?: number;
4098
+ /** Override width (EMU); must be positive. */
4099
+ width?: number;
4100
+ /** Override height (EMU); must be positive. */
4101
+ height?: number;
4102
+ /**
4103
+ * Insert position among the host shape tree's shape children (z-order, 0 =
4104
+ * backmost). Out-of-range or omitted appends on top. A batch inserts in the
4105
+ * given order starting at this position.
4106
+ */
4107
+ at?: number;
4108
+ /**
4109
+ * What to do when the source slide size differs from this deck's. Default
4110
+ * (`false`/omitted) throws on any mismatch. Set it to rescale the lifted
4111
+ * shape's geometry onto this deck's canvas instead (mirrors
4112
+ * {@link ImportSlideOptions.rescale}, scoped to one shape):
4113
+ *
4114
+ * - `'fit'` (or `true`): uniform scale by `min(sx, sy)`, slack centered — the
4115
+ * shape keeps its aspect ratio (circles stay circles, rotations hold) and
4116
+ * lands at the position it would occupy on a centered copy of the source
4117
+ * canvas. Matches PowerPoint's "Ensure Fit".
4118
+ * - `'stretch'`: independent per-axis scale; distorts. Matches "Maximize".
4119
+ *
4120
+ * Only *geometry* is rescaled — the shape/group/graphicFrame transform
4121
+ * (`a:off`/`a:ext`) and any table grid (`a:gridCol@w`, `a:tr@h`). Font sizes,
4122
+ * line widths, and other absolute sizes are left as authored, so heavy
4123
+ * down-scaling can leave text overflowing its (now smaller) box. Explicit
4124
+ * `left`/`top`/`width`/`height` overrides are applied *after* rescale and win.
4125
+ * @default false
4126
+ */
4127
+ rescale?: boolean | 'fit' | 'stretch';
4128
+ /**
4129
+ * Carry the lifted shape's build animation across (default `false`). A shape's
4130
+ * entrance/emphasis/exit build lives in the slide-scoped `p:timing`, not in the
4131
+ * shape subtree, so it is dropped unless opted in. When set, the shape's effect
4132
+ * click-group(s) and `<p:bldP>` are copied into the destination `p:timing`
4133
+ * (created if absent), their `spid` references remapped to the shape's new id and
4134
+ * their `<p:cTn>` ids renumbered to stay collision-free, and appended after any
4135
+ * existing build — mirroring how PowerPoint merges a pasted shape's animation
4136
+ * (see the `import-animation-merge` oracle). @default false
4137
+ */
4138
+ carryAnimation?: boolean;
4139
+ }
4140
+ /** A master brought across by {@link Presentation.importSlideMasters}. */
4141
+ interface ImportedSlideMaster {
4142
+ /** Partname of the copied master in this (destination) package. */
4143
+ partName: string;
4144
+ /** Partnames of the layouts copied under it, in source `p:sldLayoutIdLst` order. */
4145
+ layoutPartNames: string[];
4146
+ }
4147
+ /** Options for {@link Presentation.importSlideMasters}. */
4148
+ interface ImportSlideMastersOptions {
4149
+ /**
4150
+ * Pick which of the source's masters to graft. Receives the master's `p:cSld`
4151
+ * `name` (`''` when unnamed) and its zero-based index in the source's
4152
+ * `p:sldMasterIdLst`. Default: every master.
4153
+ */
4154
+ masters?: (name: string, index: number) => boolean;
4155
+ /**
4156
+ * Pick which layouts under each grafted master to bring. Receives the layout's
4157
+ * `p:cSld` `name` and its zero-based index within that master's
4158
+ * `p:sldLayoutIdLst`. Default: the whole family.
4159
+ */
4160
+ layouts?: (name: string, index: number) => boolean;
4161
+ /**
4162
+ * Require the source and destination slide sizes to match (default `true`).
4163
+ * A grafted master is shipped into the layout gallery, not applied to existing
4164
+ * slides — but a layout authored at a different canvas size shows up mis-scaled
4165
+ * in that gallery, so the guard is on by default. Pass `false` to graft anyway.
4166
+ */
4167
+ requireEqualSize?: boolean;
4168
+ /**
4169
+ * Carry the *source deck's* embedded fonts (`p:embeddedFontLst` in its
4170
+ * `presentation.xml`) into this deck, so a slide later bound to a grafted layout
4171
+ * keeps that layout's embedded faces on machines that lack the font locally.
4172
+ * Off by default — fonts live on the presentation, not the master, and copying
4173
+ * them can add megabytes — so they are only worth carrying when you want the
4174
+ * embed to travel with the gallery.
4175
+ *
4176
+ * Semantics are identical to {@link ImportSlideOptions.embedFonts}: binaries are
4177
+ * copied under fresh `/ppt/fonts/` names (deduped via the per-source copy
4178
+ * registry, so a re-call carries each face once), the `application/x-fontdata`
4179
+ * Default is added, and entries merge into this deck's `p:embeddedFontLst`
4180
+ * de-duplicated by `typeface` + face slot. The carry is a whole-deck operation —
4181
+ * it copies *all* the source's embedded fonts, not only the faces the grafted
4182
+ * masters use, since the source list does not record which face belongs to which
4183
+ * master.
4184
+ * @default false
4185
+ */
4186
+ embedFonts?: boolean;
4187
+ /**
4188
+ * Carry the *source deck's* table styles (`ppt/tableStyles.xml`) into this deck,
4189
+ * so a table inserted on a grafted layout picks up the source's table styling
4190
+ * instead of this deck's. Off by default: it rewrites an existing part rather than
4191
+ * only adding new ones, so it is opt-in like {@link embedFonts}.
4192
+ *
4193
+ * Without it a grafted master's layouts arrive but its table styling does not, and
4194
+ * a new table falls back to whatever default this deck carries — for a generated
4195
+ * deck, a stub whose default is the standard *Medium Style 2 - Accent 1*. The
4196
+ * mismatch is visible: the same table renders in a different accent than it would
4197
+ * in the source deck.
4198
+ *
4199
+ * Styles union by `styleId` (a style this deck already defines wins, so a re-call
4200
+ * is idempotent), while `a:tblStyleLst@def` — the default table style — is
4201
+ * **source-wins**. Carrying the styles without the `def` would not fix the
4202
+ * mismatch: the standard default GUID is one most templates *also* define, so the
4203
+ * default would still resolve to the wrong style. The carry is whole-deck — it
4204
+ * copies *all* the source's table styles, not only those the grafted masters use,
4205
+ * since `tableStyles.xml` does not record which style belongs to which master.
4206
+ * @default false
4207
+ */
4208
+ tableStyles?: boolean;
4209
+ /**
4210
+ * Move the grafted masters to the front of `p:sldMasterIdLst`, ahead of the ones
4211
+ * this deck already had, keeping their import order. Off by default: which master
4212
+ * leads is a statement about what the deck *is*, so it is the caller's call rather
4213
+ * than a side effect of grafting.
4214
+ *
4215
+ * `p:sldMasterIdLst` order is not part of theme resolution — a slide resolves
4216
+ * through its own layout's master, so this changes no existing slide's appearance.
4217
+ * What it changes is the deck's identity in PowerPoint's UI: the list's first entry
4218
+ * becomes `Designs(1)`, which is the theme the Design tab shows and the one
4219
+ * Design ▸ Variants applies. Graft a brand master into a generated deck without
4220
+ * this and the deck still presents as the generator's stock theme, because the
4221
+ * stub master was there first.
4222
+ *
4223
+ * Reordering rewrites nothing but the list: relationships, ids, and every part
4224
+ * outside `presentation.xml` are untouched, and a re-call is a no-op once the
4225
+ * grafted masters already lead.
4226
+ * @default false
4227
+ */
4228
+ primary?: boolean;
4229
+ }
4230
+ /** A layout in this deck's gallery, addressable as an {@link AppendSlidesOptions} target. */
4231
+ interface LayoutHandle {
4232
+ /** Partname of the layout in this package (e.g. `/ppt/slideLayouts/slideLayout2.xml`). */
4233
+ partName: string;
4234
+ /** The layout's `p:cSld@name` (`''` when unnamed). */
4235
+ name: string;
4236
+ /** Partname of the master this layout belongs to. */
4237
+ masterPartName: string;
4238
+ /** Zero-based index of the master in `p:sldMasterIdLst`. */
4239
+ masterIndex: number;
4240
+ /** Zero-based index of the layout within its master's `p:sldLayoutIdLst`. */
4241
+ layoutIndex: number;
4242
+ }
4243
+ /**
4244
+ * One authored slide, extracted from a generator for injection into an existing
4245
+ * package. The slide body XML references its media/hyperlinks by relationship id
4246
+ * only, so {@link Presentation.appendSlides} preserves each `rId` and only
4247
+ * repoints its target — see {@link SlideSource}.
4248
+ */
4249
+ interface ExtractedSlide {
4250
+ /** Standalone `<p:sld>` part body (XML declaration + namespaces included). */
4251
+ xml: string;
4252
+ /** Image media the body references, keyed by the `rId` used in {@link xml}. */
4253
+ media: Array<{
4254
+ rId: number;
4255
+ bytes: Uint8Array;
4256
+ extn: string;
4257
+ contentType: string;
4258
+ }>;
4259
+ /** External hyperlink rels, keyed by the `rId` used in {@link xml}. */
4260
+ hyperlinks: Array<{
4261
+ rId: number;
4262
+ target: string;
4263
+ }>;
4264
+ /**
4265
+ * Charts the body references, keyed by the `rId` used in {@link xml}. Each carries
4266
+ * the chart part XML and its embedded workbook bytes; the chart part's own `.rels`
4267
+ * (workbook reference) is rebuilt by {@link Presentation.appendSlides}.
4268
+ */
4269
+ charts: ExtractedChart[];
4270
+ /** Internal slide-to-slide links: the `rId` used in {@link xml} → 1-based source slide number. */
4271
+ slideLinks: Array<{
4272
+ rId: number;
4273
+ sourceSlideNumber: number;
4274
+ }>;
4275
+ /**
4276
+ * Embedded audio/video the body references. Each item is one media binary backed
4277
+ * by two rels sharing a Target — the ECMA `audio`/`video` rel (`mediaRid`) and the
4278
+ * MS-2007 `media` rel (`msMediaRid`) — plus a separate preview image rel
4279
+ * (`previewRid`). {@link Presentation.appendSlides} reproduces this rel graph.
4280
+ */
4281
+ avMedia: AvMediaItem[];
4282
+ /**
4283
+ * Online (external-link) video the body references. Each item is two *external*
4284
+ * rels sharing one link Target — the ECMA `video` rel (`mediaRid`) and the MS-2007
4285
+ * `media` rel (`msMediaRid`) — with **no** media binary part. The poster frame is a
4286
+ * normal image rel carried by {@link media}. {@link Presentation.appendSlides}
4287
+ * wires the two external rels without reserving a media part or content type.
4288
+ */
4289
+ onlineMedia: OnlineMediaItem[];
4290
+ /**
4291
+ * The slide's speaker notes, or `undefined` when it has none. Carried as a ready
4292
+ * `<p:notes>` part body plus its external hyperlink rels;
4293
+ * {@link Presentation.appendSlides} creates the notes part, wires it to the appended
4294
+ * slide, and binds it to a notes master (see {@link ExtractedSlides.notesMaster}).
4295
+ */
4296
+ notes?: ExtractedNotes;
4297
+ }
4298
+ /** One slide's speaker notes, extracted for {@link Presentation.appendSlides}. */
4299
+ interface ExtractedNotes {
4300
+ /** Standalone `<p:notes>` part body (XML declaration + namespaces included). */
4301
+ xml: string;
4302
+ /**
4303
+ * External hyperlink rels the notes body references, keyed by the `rId` used in
4304
+ * {@link xml}. Notes rels reserve `rId1` for the notes master and `rId2` for the
4305
+ * slide, so these start at `rId3`. Notes support external `url` links only.
4306
+ */
4307
+ hyperlinks: Array<{
4308
+ rId: number;
4309
+ target: string;
4310
+ }>;
4311
+ }
4312
+ /**
4313
+ * One chart extracted for {@link Presentation.appendSlides}, keyed by the `rId` the slide
4314
+ * body uses to reference it.
4315
+ *
4316
+ * A classic (2007, `c:chartSpace`) chart is one part plus its embedded workbook. A chartEx
4317
+ * (Office 2016 — waterfall, funnel, treemap, ...) chart is a different part in a different
4318
+ * namespace, reached through a different relationship type, and PowerPoint reports it as
4319
+ * corrupt without its two style sidecars — so {@link chartEx} carries them and its presence
4320
+ * is what tells the two shapes apart.
4321
+ */
4322
+ interface ExtractedChart {
4323
+ /** Body `rId` of the slide's rel pointing at the chart part. */
4324
+ rId: number;
4325
+ /** The chart part body: `<c:chartSpace>` for a classic chart, `<cx:chartSpace>` for a chartEx one. */
4326
+ chartXml: string;
4327
+ /** The chart's embedded `.xlsx` workbook, the data source PowerPoint opens on edit. */
4328
+ embeddingBytes: Uint8Array;
4329
+ /**
4330
+ * Present only for a chartEx chart, and then always with both sidecars. A chartEx part
4331
+ * *requires* a chart-style and a color-style part or PowerPoint reports the deck as
4332
+ * corrupt (`0x80070570`) — schema-valid but unopenable — so these are not optional and
4333
+ * {@link Presentation.appendSlides} injects them alongside the chart part.
4334
+ */
4335
+ chartEx?: {
4336
+ /** `cs:chartStyle` body for the chart's `style{N}.xml` part. */
4337
+ styleXml: string;
4338
+ /** `cs:colorStyle` body for the chart's `colors{N}.xml` part. */
4339
+ colorsXml: string;
4340
+ };
4341
+ }
4342
+ /** One embedded audio/video item extracted for {@link Presentation.appendSlides}. */
4343
+ interface AvMediaItem {
4344
+ /** Whether the item is `audio` (`<a:audioFile>`) or `video` (`<a:videoFile>`). */
4345
+ mtype: 'audio' | 'video';
4346
+ /** Body `rId` of the ECMA `audio`/`video` rel (`r:link`); points at the media part. */
4347
+ mediaRid: number;
4348
+ /** Body `rId` of the MS-2007 `media` rel (`p14:media r:embed`); shares the media part Target. */
4349
+ msMediaRid: number;
4350
+ /** Body `rId` of the preview image rel (`a:blip r:embed` in the blipFill). */
4351
+ previewRid: number;
4352
+ /** The audio/video binary the media part will hold. */
4353
+ mediaBytes: Uint8Array;
4354
+ /** Media file extension (no dot), e.g. `mp4`, `mp3`. */
4355
+ mediaExtn: string;
4356
+ /** OPC content type for the media part (PowerPoint-authored, e.g. `audio/mpeg`). */
4357
+ mediaContentType: string;
4358
+ /** The preview/poster image bytes. */
4359
+ previewBytes: Uint8Array;
4360
+ /** Preview image extension (no dot), e.g. `png`. */
4361
+ previewExtn: string;
4362
+ /** OPC content type for the preview image part. */
4363
+ previewContentType: string;
4364
+ }
4365
+ /** One online (external-link) video item extracted for {@link Presentation.appendSlides}. */
4366
+ interface OnlineMediaItem {
4367
+ /** Body `rId` of the ECMA `video` rel (`a:videoFile r:link`); External, no part. */
4368
+ mediaRid: number;
4369
+ /** Body `rId` of the MS-2007 `media` rel (`p14:media r:link`); External, shares the link Target. */
4370
+ msMediaRid: number;
4371
+ /** The external video link both rels point at (`TargetMode="External"`). */
4372
+ link: string;
4373
+ }
4374
+ /** A generator's authored slides + canvas size, the input to {@link Presentation.appendSlides}. */
4375
+ interface ExtractedSlides {
4376
+ widthEmu: number;
4377
+ heightEmu: number;
4378
+ slides: ExtractedSlide[];
4379
+ /**
4380
+ * The generator's presentation-level embedded font faces (`pptx.embedFont`),
4381
+ * carried into the destination deck by {@link Presentation.appendSlides}. Each
4382
+ * face carries its raw `bytes`. Empty when the generator embeds no fonts.
4383
+ */
4384
+ embeddedFonts: EmbeddedFont[];
4385
+ /**
4386
+ * A notes master to fall back on, present only when at least one slide carries notes.
4387
+ *
4388
+ * A notes slide must bind to a notes master, and a destination template often has
4389
+ * none — a deck authored without speaker notes carries no `notesMaster` part. So the
4390
+ * generator's own notes master rides along, and {@link Presentation.appendSlides}
4391
+ * installs it (with its theme) **only** when the destination has none. When the
4392
+ * destination already has one, it wins and this is discarded — matching the
4393
+ * `importNotes` policy, where the destination's notes styling also wins.
4394
+ */
4395
+ notesMaster?: {
4396
+ xml: string;
4397
+ themeXml: string;
4398
+ };
4399
+ }
4400
+ /**
4401
+ * Structural view of a slide producer (a `TsPptx` instance satisfies this).
4402
+ * Kept structural so the read subsystem never imports the generator at runtime.
4403
+ */
4404
+ interface SlideSource {
4405
+ extractSlides(opts?: {
4406
+ onMediaError?: 'throw' | 'placeholder';
4407
+ }): Promise<ExtractedSlides>;
4408
+ }
4409
+ /** Options for {@link Presentation.appendSlides}. */
4410
+ interface AppendSlidesOptions {
4411
+ /** Target layout to bind every appended slide to: by `p:cSld@name` or a {@link LayoutHandle}. */
4412
+ layout: string | LayoutHandle;
4413
+ /**
4414
+ * Zero-based `p:sldIdLst` position for the first appended slide; subsequent
4415
+ * slides follow it in order. Omitted/out-of-range appends at the end.
4416
+ */
4417
+ at?: number;
4418
+ /** How `addImage` media errors surface during extraction (default `'throw'`). */
4419
+ onMediaError?: 'throw' | 'placeholder';
4420
+ }
4421
+ /** One selected native source page and its final zero-based destination position. */
4422
+ interface ImportSlidesRequest {
4423
+ /** Already-loaded source presentation whose immutable package bytes own the page. */
4424
+ source: Presentation;
4425
+ /**
4426
+ * Zero-based source slide index. Naming one source page in several requests is
4427
+ * how a batch asks for several independent copies of it.
4428
+ */
4429
+ sourceIndex: number;
4430
+ /** Zero-based position in the complete destination slide list after this batch. */
4431
+ outputIndex: number;
4432
+ /**
4433
+ * Carry this page's speaker notes (`notesSlideN.xml`) across, as
4434
+ * `importSlide`'s {@link ImportSlideOptions.importNotes} does. Default false:
4435
+ * the slide copy drops the `notesSlide` relationship, so the imported page
4436
+ * arrives without notes.
4437
+ *
4438
+ * Per request rather than per batch because a stitch mixes sources — the
4439
+ * notes of a library's cover page are worth carrying where a scratch deck's
4440
+ * are not. The deck-wide half of the policy is not per request: a
4441
+ * presentation holds at most one `notesMaster`, so the destination's own is
4442
+ * reused when it has one and the first carried master is installed when it
4443
+ * has none, exactly as `importSlide` and `appendSlides` do.
4444
+ */
4445
+ importNotes?: boolean;
4446
+ }
4447
+ /** Options for {@link Presentation.fromTemplate}. */
4448
+ interface FromTemplateOptions {
4449
+ /**
4450
+ * Keep a `.potx` main part's `…template.main+xml` content type instead of
4451
+ * normalizing it to the editable `…presentation.main+xml` type. Off by default
4452
+ * (the saved package opens as an editable deck, not a template). No effect on a
4453
+ * `.pptx` input, whose main part is already editable.
4454
+ */
4455
+ keepTemplateContentType?: boolean;
4456
+ }
4457
+ //#endregion
4458
+ export { CellThreeD as $, SlideBackground as $t, Theme as A, Paragraph as At, ModernCommentAuthor as B, Glow as Bt, TransitionInfo as C, Shape as Ct, Placeholder as D, BulletDetail as Dt, ColorMapToken as E, BodyProperties as Et, readTagsForPart as F, ChildFrame as Ft, isAutoShape as G, Recolor as Gt, NotesSlide as H, LineEnd as Ht, Comment as I, ConnectionSite as It, isGroupShape as J, ShapeType as Jt, isConnector as K, RecolorColor as Kt, CommentAuthor as L, CustomGeometry as Lt, ThemeFontFace as M, RunHyperlink as Mt, ThemeFontScheme as N, TextFrame as Nt, SlideLayout as O, BulletStyle as Ot, Tag as P, AbsoluteFrame as Pt, CellBorders as Q, BackgroundSource as Qt, CommentSchema as R, CustomGeometryPath as Rt, Slide as S, AutoShape as St, TransitionSpeed as T, AutofitMode as Tt, AnyShape as U, LineEnds as Ut, NotesPlaceholder as V, InnerShadow as Vt, GroupShape as W, OuterShadow as Wt, GraphicFrame as X, PatternFill as Xt, isPicture as Y, SoftEdge as Yt, CellBorder as Z, BackgroundFill as Zt, CustomProperty as _, ChartLegend as _t, ExtractedSlides as a, ResolvedColor as an, TableConditionFlags as at, AddPictureOptions as b, Connector as bt, ImportSlideMastersOptions as c, EmbeddedFontSlot as cn, ChartExAxis as ct, ImportedSlideMaster as d, ChartExSeries as dt, FillRect as en, Table as et, LayoutHandle as f, AxisNumberFormat as ft, CoreProperties as g, ChartFill as gt, Presentation as h, ChartDataLabels as ht, ExtractedSlide as i, GradientStop as in, ResolvedTableStyle as it, ThemeColorSlot as j, Run as jt, SlideMaster as k, LineSpacing as kt, ImportSlideOptions as l, ChartExDataLabels as lt, SlideSource as m, ChartAxis as mt, EmbeddedFontFaceInfo as n, PictureFillTile as nn, TableCellBorderEdit as nt, FromTemplateOptions as o, resolveColorElement as on, TableCellEdge as ot, SlideSize as p, Chart as pt, isGraphicFrame as q, Reflection as qt, EmbeddedFontInfo as r, GradientFill as rn, TableRow as rt, ImportShapeOptions as s, ColorContext as sn, ChartEx as st, AppendSlidesOptions as t, PictureFill as tn, TableCell as tt, ImportSlidesRequest as u, ChartExLegend as ut, readCoreProperties as v, ChartLine as vt, TransitionInput as w, ShapeHost as wt, AddTextBoxOptions as x, Picture as xt, readCustomProperties as y, ChartSeries as yt, ModernComment as z, GeometryCommand as zt };
4459
+ //# sourceMappingURL=presentation-types-B50aOUFI.d.ts.map