pptx-svelte-viewer 0.8.1 → 0.9.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.
- package/CHANGELOG.md +2 -0
- package/dist/dist-JuzVOe21.js +58408 -0
- package/dist/export-DCrIiPyO.js +36824 -0
- package/dist/index.d.ts +1976 -161
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -16
- package/dist/viewer/compare/compare-controller.svelte.d.ts +15 -0
- package/dist/viewer/compare/compare-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/components/inspector/media-preview.d.ts +3 -0
- package/dist/viewer/components/inspector/media-preview.d.ts.map +1 -0
- package/dist/viewer/components/inspector/table-structure.d.ts +6 -0
- package/dist/viewer/components/inspector/table-structure.d.ts.map +1 -0
- package/dist/viewer/components/props.d.ts +12 -1
- package/dist/viewer/components/props.d.ts.map +1 -1
- package/dist/viewer/components/ribbon/animations/animation-preview-player.d.ts +3 -0
- package/dist/viewer/components/ribbon/animations/animation-preview-player.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/animations/animation-timeline-editing.d.ts +3 -0
- package/dist/viewer/components/ribbon/animations/animation-timeline-editing.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +32 -1
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
- package/dist/viewer/editor/editing-api.d.ts +4 -1
- package/dist/viewer/editor/editing-api.d.ts.map +1 -1
- package/dist/viewer/editor/editor-controller-deps.d.ts +16 -0
- package/dist/viewer/editor/editor-controller-deps.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts +2 -9
- package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-state.d.ts +9 -2
- package/dist/viewer/editor/editor-document-state.d.ts.map +1 -1
- package/dist/viewer/editor/editor-gestures.d.ts +7 -0
- package/dist/viewer/editor/editor-gestures.d.ts.map +1 -1
- package/dist/viewer/editor/editor-presentation-metadata.svelte.d.ts +20 -0
- package/dist/viewer/editor/editor-presentation-metadata.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-section-controller.d.ts +17 -0
- package/dist/viewer/editor/editor-section-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts +15 -3
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/export/export-controller.svelte.d.ts +2 -0
- package/dist/viewer/export/export-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/export/export-print.d.ts +6 -3
- package/dist/viewer/export/export-print.d.ts.map +1 -1
- package/dist/viewer/export/export-svg.d.ts +14 -0
- package/dist/viewer/export/export-svg.d.ts.map +1 -0
- package/dist/viewer/export/export-ui.svelte.d.ts +4 -1
- package/dist/viewer/export/export-ui.svelte.d.ts.map +1 -1
- package/dist/viewer/export/exporting-api.d.ts +1 -0
- package/dist/viewer/export/exporting-api.d.ts.map +1 -1
- package/dist/viewer/export/index.d.ts +3 -0
- package/dist/viewer/export/index.d.ts.map +1 -1
- package/dist/viewer/export/package-sharing.d.ts +3 -0
- package/dist/viewer/export/package-sharing.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +649 -111
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +14 -9
- package/dist/viewer/presentation/animation-playback.svelte.d.ts +2 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -1
- package/dist/viewer/presentation/presentation-annotations.svelte.d.ts +28 -0
- package/dist/viewer/presentation/presentation-annotations.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts +2 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts.map +1 -1
- package/dist/viewer/presentation/rehearse-state.svelte.d.ts +20 -0
- package/dist/viewer/presentation/rehearse-state.svelte.d.ts.map +1 -0
- package/dist/viewer/render/smartart-view.d.ts +2 -0
- package/dist/viewer/render/smartart-view.d.ts.map +1 -1
- package/dist/viewer/render/zoom-view.d.ts +1 -1
- package/dist/viewer/render/zoom-view.d.ts.map +1 -1
- package/dist/viewer/state/autosave.svelte.d.ts +2 -1
- package/dist/viewer/state/autosave.svelte.d.ts.map +1 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts +15 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
- package/dist/viewer/state/viewer-parity-ui.svelte.d.ts +32 -0
- package/dist/viewer/state/viewer-parity-ui.svelte.d.ts.map +1 -0
- package/dist/viewer/types.d.ts +6 -1
- package/dist/viewer/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/component-jr7_yH3a.js +0 -79759
package/dist/index.d.ts
CHANGED
|
@@ -1,130 +1,5 @@
|
|
|
1
1
|
import { Component } from 'svelte';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Theme configuration types for the PowerPoint viewer.
|
|
5
|
-
*
|
|
6
|
-
* All color values accept any valid CSS color string:
|
|
7
|
-
* hex (`#6366f1`), rgb (`rgb(99 102 241)`), hsl (`hsl(239 84% 67%)`),
|
|
8
|
-
* oklch (`oklch(0.585 0.233 277)`), named colors, etc.
|
|
9
|
-
*
|
|
10
|
-
* Framework-agnostic — shared by the React, Vue, and Angular bindings.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Semantic color tokens for the viewer UI.
|
|
14
|
-
*
|
|
15
|
-
* These map to CSS custom properties (`--pptx-<token>`) and drive all
|
|
16
|
-
* UI component colors. The naming follows the shadcn/ui convention so
|
|
17
|
-
* that Tailwind + shadcn users get a familiar experience.
|
|
18
|
-
*/
|
|
19
|
-
interface ViewerThemeColors {
|
|
20
|
-
/** Page / root background */
|
|
21
|
-
background: string;
|
|
22
|
-
/** Default text color */
|
|
23
|
-
foreground: string;
|
|
24
|
-
/** Card / panel surface */
|
|
25
|
-
card: string;
|
|
26
|
-
/** Text on card surfaces */
|
|
27
|
-
cardForeground: string;
|
|
28
|
-
/** Popover / dropdown surface */
|
|
29
|
-
popover: string;
|
|
30
|
-
/** Text inside popovers */
|
|
31
|
-
popoverForeground: string;
|
|
32
|
-
/** Primary action color (buttons, active indicators) */
|
|
33
|
-
primary: string;
|
|
34
|
-
/** Text on primary-colored backgrounds */
|
|
35
|
-
primaryForeground: string;
|
|
36
|
-
/** Secondary / subdued action color */
|
|
37
|
-
secondary: string;
|
|
38
|
-
/** Text on secondary backgrounds */
|
|
39
|
-
secondaryForeground: string;
|
|
40
|
-
/** Muted / disabled surface */
|
|
41
|
-
muted: string;
|
|
42
|
-
/** Text on muted surfaces (also used for secondary text) */
|
|
43
|
-
mutedForeground: string;
|
|
44
|
-
/** Accent / hover-highlight surface */
|
|
45
|
-
accent: string;
|
|
46
|
-
/** Text on accent surfaces */
|
|
47
|
-
accentForeground: string;
|
|
48
|
-
/** Destructive / danger action color */
|
|
49
|
-
destructive: string;
|
|
50
|
-
/** Text on destructive backgrounds */
|
|
51
|
-
destructiveForeground: string;
|
|
52
|
-
/** Default border color */
|
|
53
|
-
border: string;
|
|
54
|
-
/** Input field border color */
|
|
55
|
-
input: string;
|
|
56
|
-
/** Focus ring color */
|
|
57
|
-
ring: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Full viewer theme configuration.
|
|
61
|
-
*
|
|
62
|
-
* Every property is optional — unset values fall back to the built-in
|
|
63
|
-
* dark theme defaults.
|
|
64
|
-
*/
|
|
65
|
-
interface ViewerTheme {
|
|
66
|
-
/** Semantic UI colors. Each key maps to a `--pptx-<key>` CSS custom property. */
|
|
67
|
-
colors?: Partial<ViewerThemeColors>;
|
|
68
|
-
/** Base border-radius value (e.g. `"0.5rem"`, `"8px"`). */
|
|
69
|
-
radius?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Escape hatch: arbitrary CSS custom properties to set on the viewer
|
|
72
|
-
* root element. Keys should include the `--` prefix.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* { "--my-custom-shadow": "0 4px 12px rgba(0,0,0,0.5)" }
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
cssVars?: Record<string, string>;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Default dark-theme color values.
|
|
84
|
-
*
|
|
85
|
-
* These correspond to the built-in dark UI of the PowerPoint viewer and
|
|
86
|
-
* use Tailwind's gray palette as the neutral scale with indigo as the
|
|
87
|
-
* primary accent.
|
|
88
|
-
*/
|
|
89
|
-
declare const defaultThemeColors: ViewerThemeColors;
|
|
90
|
-
/** Default border-radius. */
|
|
91
|
-
declare const defaultRadius = "0.5rem";
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Convert a `ViewerTheme` into a flat `Record<string, string>` of CSS
|
|
95
|
-
* custom properties (including the `--` prefix) ready to be spread onto
|
|
96
|
-
* a `style` attribute.
|
|
97
|
-
*
|
|
98
|
-
* Only properties that differ from the built-in defaults are emitted when
|
|
99
|
-
* `omitDefaults` is true (the default).
|
|
100
|
-
*/
|
|
101
|
-
declare function themeToCssVars(theme: ViewerTheme | undefined, omitDefaults?: boolean): Record<string, string>;
|
|
102
|
-
/**
|
|
103
|
-
* Build the complete set of CSS custom properties with all defaults.
|
|
104
|
-
* Useful for generating a full fallback stylesheet.
|
|
105
|
-
*/
|
|
106
|
-
declare function defaultCssVars(): Record<string, string>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Built-in "vermilion" theme presets.
|
|
110
|
-
*
|
|
111
|
-
* These mirror the pptx-viewer brand used on the documentation site:
|
|
112
|
-
* a warm paper canvas in light mode, a dimmed presenter room in dark
|
|
113
|
-
* mode, and the vermilion accent in both. Pass one to the viewer's
|
|
114
|
-
* `theme` prop (React/Vue) or `provideViewerTheme` (Angular), or spread
|
|
115
|
-
* the color objects to derive your own variant.
|
|
116
|
-
*/
|
|
117
|
-
/** Light "paper" palette: a projection screen in a bright room. */
|
|
118
|
-
declare const vermilionLightColors: ViewerThemeColors;
|
|
119
|
-
/** Dark "presenter" palette: the presenter room with the lights down. */
|
|
120
|
-
declare const vermilionDarkColors: ViewerThemeColors;
|
|
121
|
-
/** Shared border-radius for the vermilion presets (slightly sharper than the default). */
|
|
122
|
-
declare const vermilionRadius = "0.375rem";
|
|
123
|
-
/** Light vermilion theme, ready for the viewer's `theme` prop. */
|
|
124
|
-
declare const vermilionLightTheme: ViewerTheme;
|
|
125
|
-
/** Dark vermilion theme, ready for the viewer's `theme` prop. */
|
|
126
|
-
declare const vermilionDarkTheme: ViewerTheme;
|
|
127
|
-
|
|
128
3
|
/**
|
|
129
4
|
* Action types: hyperlinks, slide jumps, macros, and action buttons.
|
|
130
5
|
*
|
|
@@ -482,6 +357,8 @@ interface CustomGeometryPath {
|
|
|
482
357
|
* and the text rectangle are not lost when a custGeom is edited and saved.
|
|
483
358
|
*/
|
|
484
359
|
interface CustomGeometryRawData {
|
|
360
|
+
/** Raw `a:avLst` XML content (adjustment value list). */
|
|
361
|
+
avLstXml?: unknown;
|
|
485
362
|
/** Raw `a:gdLst` XML content (guide list). */
|
|
486
363
|
gdLstXml?: unknown;
|
|
487
364
|
/** Raw `a:ahLst` XML content (adjustment handles). */
|
|
@@ -622,7 +499,7 @@ interface PptxCustomPathProperties {
|
|
|
622
499
|
pathHeight?: number;
|
|
623
500
|
/** Structured custom geometry paths for editing (maps to a:custGeom/a:pathLst). */
|
|
624
501
|
customGeometryPaths?: CustomGeometryPath[];
|
|
625
|
-
/** Raw
|
|
502
|
+
/** Raw adjustment/guide/handle/connection/text-rectangle XML preserved for serialization. */
|
|
626
503
|
customGeometryRawData?: CustomGeometryRawData;
|
|
627
504
|
/**
|
|
628
505
|
* Typed XY adjustment handles parsed from `a:custGeom/a:ahLst/a:ahXY`.
|
|
@@ -833,6 +710,12 @@ type PptxTextWarpPreset = 'textNoShape' | 'textPlain' | 'textStop' | 'textTriang
|
|
|
833
710
|
* @module pptx-types/shape-style
|
|
834
711
|
*/
|
|
835
712
|
|
|
713
|
+
interface PptxCustomDashSegment {
|
|
714
|
+
/** Dash length as a non-negative percentage in thousandths of one percent. */
|
|
715
|
+
dash: number;
|
|
716
|
+
/** Space length as a non-negative percentage in thousandths of one percent. */
|
|
717
|
+
space: number;
|
|
718
|
+
}
|
|
836
719
|
/**
|
|
837
720
|
* Comprehensive visual style for a shape, connector, or image element.
|
|
838
721
|
*
|
|
@@ -1065,11 +948,12 @@ interface ShapeStyle {
|
|
|
1065
948
|
connectorStartConnection?: ConnectorConnectionPoint;
|
|
1066
949
|
/** Connection point for the end of a connector. */
|
|
1067
950
|
connectorEndConnection?: ConnectorConnectionPoint;
|
|
1068
|
-
/** Custom dash
|
|
1069
|
-
customDashSegments?:
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
951
|
+
/** Custom dash pattern, measured relative to line width in thousandths of one percent. */
|
|
952
|
+
customDashSegments?: PptxCustomDashSegment[];
|
|
953
|
+
/** Original `a:ds` payloads retained by index for lossless edits. */
|
|
954
|
+
customDashSegmentXml?: XmlObject[];
|
|
955
|
+
/** Original `a:custDash` payload retained for lossless edits. */
|
|
956
|
+
customDashXml?: XmlObject;
|
|
1073
957
|
/** 3D scene/camera settings from `a:scene3d`. */
|
|
1074
958
|
scene3d?: Pptx3DScene;
|
|
1075
959
|
/** 3D shape extrusion/bevel from `a:sp3d`. */
|
|
@@ -1181,6 +1065,8 @@ interface ShapeStyle {
|
|
|
1181
1065
|
* ```
|
|
1182
1066
|
*/
|
|
1183
1067
|
interface TextStyle {
|
|
1068
|
+
/** Original `a:rPr` XML retained by projections that share the shape-text model. */
|
|
1069
|
+
runPropertiesXml?: XmlObject;
|
|
1184
1070
|
fontFamily?: string;
|
|
1185
1071
|
fontSize?: number;
|
|
1186
1072
|
/** When true, renderer should shrink text to fit the shape bounds. */
|
|
@@ -1866,6 +1752,47 @@ interface PptxShapeProperties {
|
|
|
1866
1752
|
/** Adjustment handles for interactive shape modification (yellow diamond handles). */
|
|
1867
1753
|
adjustmentHandles?: GeometryAdjustmentHandle[];
|
|
1868
1754
|
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Text styling for a single indent level (0–8) inside a placeholder’s
|
|
1757
|
+
* `a:lstStyle`.
|
|
1758
|
+
*
|
|
1759
|
+
* Used during placeholder inheritance to fill in defaults for font,
|
|
1760
|
+
* bullet, and spacing properties the slide element does not override.
|
|
1761
|
+
*
|
|
1762
|
+
* @example
|
|
1763
|
+
* ```ts
|
|
1764
|
+
* const level0: PlaceholderTextLevelStyle = {
|
|
1765
|
+
* fontSize: 32,
|
|
1766
|
+
* bold: true,
|
|
1767
|
+
* bulletChar: "•",
|
|
1768
|
+
* };
|
|
1769
|
+
* // => satisfies PlaceholderTextLevelStyle
|
|
1770
|
+
* ```
|
|
1771
|
+
*/
|
|
1772
|
+
interface PlaceholderTextLevelStyle {
|
|
1773
|
+
fontFamily?: string;
|
|
1774
|
+
fontSize?: number;
|
|
1775
|
+
bold?: boolean;
|
|
1776
|
+
italic?: boolean;
|
|
1777
|
+
color?: string;
|
|
1778
|
+
bulletChar?: string;
|
|
1779
|
+
bulletAutoNumType?: string;
|
|
1780
|
+
bulletFontFamily?: string;
|
|
1781
|
+
bulletSizePercent?: number;
|
|
1782
|
+
/** Bullet colour from `a:buClr` as hex string. */
|
|
1783
|
+
bulletColor?: string;
|
|
1784
|
+
/** Bullet size in points from `a:buSzPts`. */
|
|
1785
|
+
bulletSizePts?: number;
|
|
1786
|
+
/** True when `a:buNone` is present at this level. */
|
|
1787
|
+
bulletNone?: boolean;
|
|
1788
|
+
marginLeft?: number;
|
|
1789
|
+
indent?: number;
|
|
1790
|
+
alignment?: string;
|
|
1791
|
+
lineSpacing?: number;
|
|
1792
|
+
lineSpacingExactPt?: number;
|
|
1793
|
+
spaceBefore?: number;
|
|
1794
|
+
spaceAfter?: number;
|
|
1795
|
+
}
|
|
1869
1796
|
|
|
1870
1797
|
/** Tick-mark placement from ChartML `ST_TickMark`. */
|
|
1871
1798
|
type PptxChartTickMark = 'cross' | 'in' | 'none' | 'out';
|
|
@@ -1882,10 +1809,104 @@ interface PptxChartAxisLabelFormatting {
|
|
|
1882
1809
|
labelAlignment?: 'ctr' | 'l' | 'r';
|
|
1883
1810
|
/** Category/date label distance, from 0 through 1000 percent. */
|
|
1884
1811
|
labelOffset?: number;
|
|
1812
|
+
/** Number of category/date labels between rendered labels. */
|
|
1813
|
+
tickLabelSkip?: number;
|
|
1814
|
+
/** Number of category/date tick positions between major tick marks. */
|
|
1815
|
+
tickMarkSkip?: number;
|
|
1885
1816
|
/** Suppress multi-level category labels (`c:noMultiLvlLbl`). */
|
|
1886
1817
|
noMultiLevelLabels?: boolean;
|
|
1887
1818
|
}
|
|
1888
1819
|
|
|
1820
|
+
interface PptxChartPivotFormat {
|
|
1821
|
+
index: number;
|
|
1822
|
+
shapePropertiesXml?: XmlObject | null;
|
|
1823
|
+
markerXml?: XmlObject | null;
|
|
1824
|
+
dataLabelXml?: XmlObject | null;
|
|
1825
|
+
extensionListXml?: XmlObject | null;
|
|
1826
|
+
rawXml?: XmlObject;
|
|
1827
|
+
}
|
|
1828
|
+
/** Editable classic ChartML `c:pivotFmts` collection. */
|
|
1829
|
+
interface PptxChartPivotFormats {
|
|
1830
|
+
formats: PptxChartPivotFormat[];
|
|
1831
|
+
rawXml?: XmlObject;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
/** Editable classic ChartML `c:pivotSource` metadata. */
|
|
1835
|
+
interface PptxChartPivotSource {
|
|
1836
|
+
/** Pivot table reference stored as `c:name` text. */
|
|
1837
|
+
name: string;
|
|
1838
|
+
/** Required unsigned format identifier stored in `c:fmtId/@val`. */
|
|
1839
|
+
formatId: number;
|
|
1840
|
+
/** Internal source subtree used to preserve extensions and foreign markup. */
|
|
1841
|
+
rawXml?: XmlObject;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
/** Headers and footers used when a classic ChartML chart is printed. */
|
|
1845
|
+
interface PptxChartPrintHeaderFooter {
|
|
1846
|
+
oddHeader?: string;
|
|
1847
|
+
oddFooter?: string;
|
|
1848
|
+
evenHeader?: string;
|
|
1849
|
+
evenFooter?: string;
|
|
1850
|
+
firstHeader?: string;
|
|
1851
|
+
firstFooter?: string;
|
|
1852
|
+
alignWithMargins?: boolean;
|
|
1853
|
+
differentOddEven?: boolean;
|
|
1854
|
+
differentFirst?: boolean;
|
|
1855
|
+
/** Original subtree retained for foreign attributes and extension children. */
|
|
1856
|
+
rawXml?: unknown;
|
|
1857
|
+
}
|
|
1858
|
+
/** Required page margins from ChartML `c:pageMargins`, measured in inches. */
|
|
1859
|
+
interface PptxChartPageMargins {
|
|
1860
|
+
left: number;
|
|
1861
|
+
right: number;
|
|
1862
|
+
top: number;
|
|
1863
|
+
bottom: number;
|
|
1864
|
+
header: number;
|
|
1865
|
+
footer: number;
|
|
1866
|
+
/** Original leaf retained for foreign attributes. */
|
|
1867
|
+
rawXml?: unknown;
|
|
1868
|
+
}
|
|
1869
|
+
/** Printer page configuration from ChartML `c:pageSetup`. */
|
|
1870
|
+
interface PptxChartPageSetup {
|
|
1871
|
+
paperSize?: number;
|
|
1872
|
+
firstPageNumber?: number;
|
|
1873
|
+
orientation?: 'default' | 'portrait' | 'landscape';
|
|
1874
|
+
blackAndWhite?: boolean;
|
|
1875
|
+
draft?: boolean;
|
|
1876
|
+
useFirstPageNumber?: boolean;
|
|
1877
|
+
horizontalDpi?: number;
|
|
1878
|
+
verticalDpi?: number;
|
|
1879
|
+
copies?: number;
|
|
1880
|
+
/** Original leaf retained for foreign attributes. */
|
|
1881
|
+
rawXml?: unknown;
|
|
1882
|
+
}
|
|
1883
|
+
/** Editable `c:printSettings` content from a classic ChartML chart space. */
|
|
1884
|
+
interface PptxChartPrintSettings {
|
|
1885
|
+
headerFooter?: PptxChartPrintHeaderFooter | null;
|
|
1886
|
+
pageMargins?: PptxChartPageMargins | null;
|
|
1887
|
+
pageSetup?: PptxChartPageSetup | null;
|
|
1888
|
+
/** `null` removes the legacy header/footer drawing relationship element. */
|
|
1889
|
+
legacyDrawingHeaderFooterRelationshipId?: string | null;
|
|
1890
|
+
/** Original subtree retained for unknown and extension content. */
|
|
1891
|
+
rawXml?: unknown;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
/** Editable classic ChartML `c:protection` settings. */
|
|
1895
|
+
interface PptxChartProtection {
|
|
1896
|
+
/** Prevent editing the chart object. */
|
|
1897
|
+
chartObject?: boolean | null;
|
|
1898
|
+
/** Prevent editing the chart data. */
|
|
1899
|
+
data?: boolean | null;
|
|
1900
|
+
/** Prevent editing chart formatting. */
|
|
1901
|
+
formatting?: boolean | null;
|
|
1902
|
+
/** Prevent selecting chart elements. */
|
|
1903
|
+
selection?: boolean | null;
|
|
1904
|
+
/** Prevent chart user-interface operations. */
|
|
1905
|
+
userInterface?: boolean | null;
|
|
1906
|
+
/** Internal source subtree used to preserve foreign markup during edits. */
|
|
1907
|
+
rawXml?: XmlObject;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1889
1910
|
/**
|
|
1890
1911
|
* Chart types: chart categories, series data, style metadata, data tables,
|
|
1891
1912
|
* trendlines, error bars, and the composite `PptxChartData`.
|
|
@@ -2042,6 +2063,7 @@ interface PptxChartUpDownBars {
|
|
|
2042
2063
|
/** Marker appearance on a chart series or data point. */
|
|
2043
2064
|
interface PptxChartMarker {
|
|
2044
2065
|
symbol: PptxChartMarkerSymbol;
|
|
2066
|
+
/** Marker size in points, constrained by ST_MarkerSize to 2 through 72. */
|
|
2045
2067
|
size?: number;
|
|
2046
2068
|
spPr?: PptxChartShapeProps;
|
|
2047
2069
|
}
|
|
@@ -2052,6 +2074,8 @@ interface PptxChartDataPoint {
|
|
|
2052
2074
|
explosion?: number;
|
|
2053
2075
|
invertIfNegative?: boolean;
|
|
2054
2076
|
marker?: PptxChartMarker;
|
|
2077
|
+
/** Render a bubble-chart point with a 3-D appearance. */
|
|
2078
|
+
bubble3D?: boolean;
|
|
2055
2079
|
}
|
|
2056
2080
|
/** Schema values accepted by `c:dLblPos`. */
|
|
2057
2081
|
type PptxChartDataLabelPosition = 'bestFit' | 'b' | 'ctr' | 'inBase' | 'inEnd' | 'l' | 'outEnd' | 'r' | 't';
|
|
@@ -2094,6 +2118,12 @@ interface PptxChartAxisFormatting extends PptxChartAxisLabelFormatting {
|
|
|
2094
2118
|
axisId?: number;
|
|
2095
2119
|
/** Cross-axis identifier — the axis this axis crosses. */
|
|
2096
2120
|
crossAxisId?: number;
|
|
2121
|
+
/** Automatic crossing mode (`c:crosses`). Mutually exclusive with `crossesAt`. */
|
|
2122
|
+
crosses?: 'autoZero' | 'min' | 'max';
|
|
2123
|
+
/** Explicit crossing value (`c:crossesAt`). Units depend on the axis type. */
|
|
2124
|
+
crossesAt?: number;
|
|
2125
|
+
/** Whether a value axis crosses between or at category tick marks. */
|
|
2126
|
+
crossBetween?: 'between' | 'midCat';
|
|
2097
2127
|
numFmt?: PptxChartAxisNumFmt;
|
|
2098
2128
|
titleText?: string;
|
|
2099
2129
|
spPr?: PptxChartShapeProps;
|
|
@@ -2111,6 +2141,8 @@ interface PptxChartAxisFormatting extends PptxChartAxisLabelFormatting {
|
|
|
2111
2141
|
min?: number;
|
|
2112
2142
|
/** Maximum axis value override (c:max/@val). */
|
|
2113
2143
|
max?: number;
|
|
2144
|
+
/** Axis value direction (`c:scaling/c:orientation/@val`). */
|
|
2145
|
+
orientation?: 'minMax' | 'maxMin';
|
|
2114
2146
|
/** Whether the axis is deleted/hidden (c:delete/@val). */
|
|
2115
2147
|
deleted?: boolean;
|
|
2116
2148
|
/**
|
|
@@ -2134,12 +2166,69 @@ interface PptxChartAxisFormatting extends PptxChartAxisLabelFormatting {
|
|
|
2134
2166
|
majorUnit?: number;
|
|
2135
2167
|
/** Minor-unit interval between secondary tick marks (c:minorUnit/@val). */
|
|
2136
2168
|
minorUnit?: number;
|
|
2169
|
+
/** Calendar unit used to interpret date-axis serial values. */
|
|
2170
|
+
baseTimeUnit?: 'days' | 'months' | 'years';
|
|
2171
|
+
majorTimeUnit?: 'days' | 'months' | 'years';
|
|
2172
|
+
minorTimeUnit?: 'days' | 'months' | 'years';
|
|
2137
2173
|
}
|
|
2138
2174
|
/** 3D wall or floor element formatting. */
|
|
2139
2175
|
interface PptxChart3DSurface {
|
|
2140
2176
|
thickness?: number;
|
|
2141
2177
|
spPr?: PptxChartShapeProps;
|
|
2142
2178
|
}
|
|
2179
|
+
/** Office 2016 ChartEx box-and-whisker series layout options. */
|
|
2180
|
+
interface PptxChartBoxWhiskerOptions {
|
|
2181
|
+
quartileMethod?: 'inclusive' | 'exclusive';
|
|
2182
|
+
showMeanLine?: boolean;
|
|
2183
|
+
showMeanMarker?: boolean;
|
|
2184
|
+
/** Show non-outlier (inner) data points. */
|
|
2185
|
+
showInnerPoints?: boolean;
|
|
2186
|
+
showOutlierPoints?: boolean;
|
|
2187
|
+
}
|
|
2188
|
+
/** Office 2016 ChartEx histogram and Pareto series layout options. */
|
|
2189
|
+
interface PptxChartHistogramOptions {
|
|
2190
|
+
/** Maps to `clusteredColumn` for histogram columns or `paretoLine`. */
|
|
2191
|
+
layout?: 'histogram' | 'pareto';
|
|
2192
|
+
/** Exactly one of binSize and binCount is emitted by the ChartEx writer. */
|
|
2193
|
+
binSize?: number;
|
|
2194
|
+
binCount?: number;
|
|
2195
|
+
intervalClosed?: 'l' | 'r';
|
|
2196
|
+
underflow?: number | 'auto';
|
|
2197
|
+
overflow?: number | 'auto';
|
|
2198
|
+
}
|
|
2199
|
+
/** Office 2016 ChartEx waterfall series layout options. */
|
|
2200
|
+
interface PptxChartWaterfallOptions {
|
|
2201
|
+
/** Zero-based data point indexes rendered as absolute subtotal or total bars. */
|
|
2202
|
+
subtotalIndices?: number[];
|
|
2203
|
+
/** Whether connector lines are visible between adjacent bars. */
|
|
2204
|
+
connectorLines?: boolean;
|
|
2205
|
+
}
|
|
2206
|
+
/** Office 2016 ChartEx geographic series dimensions and layout options. */
|
|
2207
|
+
interface PptxChartRegionMapOptions {
|
|
2208
|
+
/** Optional provider entity identifiers aligned with categories and values. */
|
|
2209
|
+
entityIds?: string[];
|
|
2210
|
+
/** Original `cx:pt/@idx` values for category points. */
|
|
2211
|
+
categorySourceIndices?: number[];
|
|
2212
|
+
/** Original `cx:pt/@idx` values for colour-value points. */
|
|
2213
|
+
valueSourceIndices?: number[];
|
|
2214
|
+
/** Original `cx:pt/@idx` values for entity-ID points. */
|
|
2215
|
+
entityIdSourceIndices?: number[];
|
|
2216
|
+
regionLabelLayout?: 'none' | 'bestFitOnly' | 'showAll';
|
|
2217
|
+
projectionType?: 'mercator' | 'miller' | 'robinson' | 'albers';
|
|
2218
|
+
viewedRegionType?: 'dataOnly' | 'postalCode' | 'county' | 'state' | 'countryRegion' | 'countryRegionList' | 'world';
|
|
2219
|
+
cultureLanguage?: string;
|
|
2220
|
+
/** ISO-3166-1 alpha-2 region code. */
|
|
2221
|
+
cultureRegion?: string;
|
|
2222
|
+
attribution?: string;
|
|
2223
|
+
/** Opaque authored provider cache under `cx:geography/cx:geoCache`. */
|
|
2224
|
+
geographyCache?: XmlObject;
|
|
2225
|
+
}
|
|
2226
|
+
/** Layout for parent category labels in a hierarchical ChartEx treemap. */
|
|
2227
|
+
type PptxChartParentLabelLayout = 'none' | 'banner' | 'overlapping';
|
|
2228
|
+
/** Per-series layout options for an Office 2016+ ChartEx treemap. */
|
|
2229
|
+
interface PptxChartTreemapOptions {
|
|
2230
|
+
parentLabelLayout?: PptxChartParentLabelLayout;
|
|
2231
|
+
}
|
|
2143
2232
|
/**
|
|
2144
2233
|
* A single data series within a chart.
|
|
2145
2234
|
*
|
|
@@ -2175,6 +2264,11 @@ interface PptxChartSeries {
|
|
|
2175
2264
|
* series.
|
|
2176
2265
|
*/
|
|
2177
2266
|
seriesChartType?: PptxChartType;
|
|
2267
|
+
boxWhiskerOptions?: PptxChartBoxWhiskerOptions;
|
|
2268
|
+
histogramOptions?: PptxChartHistogramOptions;
|
|
2269
|
+
waterfallOptions?: PptxChartWaterfallOptions;
|
|
2270
|
+
regionMapOptions?: PptxChartRegionMapOptions;
|
|
2271
|
+
treemapOptions?: PptxChartTreemapOptions;
|
|
2178
2272
|
}
|
|
2179
2273
|
/**
|
|
2180
2274
|
* Chart-level data-label options (`c:dLbls` directly under a chart-type
|
|
@@ -2380,6 +2474,16 @@ interface PptxEmbeddedWorkbookData {
|
|
|
2380
2474
|
name: string;
|
|
2381
2475
|
values: number[];
|
|
2382
2476
|
}>;
|
|
2477
|
+
/** Whether the workbook uses the 1904 date system. */
|
|
2478
|
+
date1904?: boolean;
|
|
2479
|
+
}
|
|
2480
|
+
/** Raw numeric category cache used by a classic ChartML date axis. */
|
|
2481
|
+
interface PptxChartDateCategories {
|
|
2482
|
+
values: number[];
|
|
2483
|
+
/** False/default uses Excel's 1900 date system; true uses the 1904 system. */
|
|
2484
|
+
date1904?: boolean;
|
|
2485
|
+
/** Number format copied from the numeric category cache. */
|
|
2486
|
+
formatCode?: string;
|
|
2383
2487
|
}
|
|
2384
2488
|
/**
|
|
2385
2489
|
* Complete parsed chart data for a {@link ChartPptxElement}.
|
|
@@ -2403,6 +2507,13 @@ interface PptxChartData {
|
|
|
2403
2507
|
title?: string;
|
|
2404
2508
|
chartType: PptxChartType;
|
|
2405
2509
|
categories: string[];
|
|
2510
|
+
/**
|
|
2511
|
+
* Hierarchical category levels in source XML order for ChartEx hierarchy charts.
|
|
2512
|
+
* Level 0 contains the leaf labels and remains mirrored by {@link categories}
|
|
2513
|
+
* for consumers that only understand a flat category axis.
|
|
2514
|
+
*/
|
|
2515
|
+
categoryLevels?: string[][];
|
|
2516
|
+
dateCategories?: PptxChartDateCategories;
|
|
2406
2517
|
series: PptxChartSeries[];
|
|
2407
2518
|
/** Chart style/formatting metadata. */
|
|
2408
2519
|
style?: PptxChartStyle;
|
|
@@ -2439,12 +2550,7 @@ interface PptxChartData {
|
|
|
2439
2550
|
* The chart still renders using its cached series data; this field
|
|
2440
2551
|
* is metadata about the data origin, preserved for round-trip fidelity.
|
|
2441
2552
|
*/
|
|
2442
|
-
pivotSource?:
|
|
2443
|
-
/** Pivot table reference name, e.g. "[workbook.xlsx]Sheet1!PivotTable1". */
|
|
2444
|
-
name: string;
|
|
2445
|
-
/** Format identifier from c:fmtId/@val. */
|
|
2446
|
-
formatId?: number;
|
|
2447
|
-
};
|
|
2553
|
+
pivotSource?: PptxChartPivotSource | null;
|
|
2448
2554
|
/**
|
|
2449
2555
|
* Whether only visible cells are plotted (c:plotVisOnly).
|
|
2450
2556
|
* When `true` (the default), hidden cells are excluded from the chart.
|
|
@@ -2467,6 +2573,12 @@ interface PptxChartData {
|
|
|
2467
2573
|
* - `"acrossLinear"` — gradient across series
|
|
2468
2574
|
*/
|
|
2469
2575
|
colorMethod?: 'cycle' | 'withinLinear' | 'acrossLinear';
|
|
2576
|
+
/** Internal source color-style part path used for lossless dirty saves. */
|
|
2577
|
+
colorStylePartPath?: string;
|
|
2578
|
+
/** Internal parsed palette snapshot used to detect actual edits. */
|
|
2579
|
+
colorStyleOriginalPalette?: string[];
|
|
2580
|
+
/** Internal parsed method snapshot used to detect actual edits. */
|
|
2581
|
+
colorStyleOriginalMethod?: 'cycle' | 'withinLinear' | 'acrossLinear';
|
|
2470
2582
|
/**
|
|
2471
2583
|
* Pie-of-pie / Bar-of-pie options (`c:ofPieChart`, CT_OfPieChart).
|
|
2472
2584
|
*
|
|
@@ -2492,6 +2604,10 @@ interface PptxChartData {
|
|
|
2492
2604
|
* source data, so absence does not produce empty `<c:…/>` placeholders.
|
|
2493
2605
|
*/
|
|
2494
2606
|
chartChrome?: PptxChartChrome;
|
|
2607
|
+
/** `c:chartSpace/c:printSettings`; `null` removes the container on save. */
|
|
2608
|
+
printSettings?: PptxChartPrintSettings | null;
|
|
2609
|
+
/** `c:chartSpace/c:protection`; `null` removes the container on save. */
|
|
2610
|
+
protection?: PptxChartProtection | null;
|
|
2495
2611
|
/** Editable manual placement for the title, plot area, and legend. */
|
|
2496
2612
|
layouts?: PptxChartLayouts;
|
|
2497
2613
|
/**
|
|
@@ -2510,7 +2626,8 @@ interface PptxChartData {
|
|
|
2510
2626
|
* for charts whose data originates from a PivotTable. Preserved
|
|
2511
2627
|
* verbatim for round-trip fidelity.
|
|
2512
2628
|
*/
|
|
2513
|
-
|
|
2629
|
+
/** Typed pivot-chart format persistence; `null` removes `c:pivotFmts`. */
|
|
2630
|
+
pivotFormats?: PptxChartPivotFormats | null;
|
|
2514
2631
|
/**
|
|
2515
2632
|
* Color-map override (`c:clrMapOvr`) carrying 12 attributes that
|
|
2516
2633
|
* remap theme colour roles for this chart only. Preserved as a flat
|
|
@@ -2521,7 +2638,7 @@ interface PptxChartData {
|
|
|
2521
2638
|
|
|
2522
2639
|
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
2523
2640
|
type EffectDagContainerType = 'sib' | 'tree';
|
|
2524
|
-
type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagBlur | EffectDagPresetShadow | EffectDagRawLeaf;
|
|
2641
|
+
type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagBlur | EffectDagAlphaOutset | EffectDagPresetShadow | EffectDagRawLeaf;
|
|
2525
2642
|
interface EffectDagContainer {
|
|
2526
2643
|
kind: 'cont';
|
|
2527
2644
|
type: EffectDagContainerType;
|
|
@@ -2554,6 +2671,12 @@ interface EffectDagBlur {
|
|
|
2554
2671
|
grow?: boolean;
|
|
2555
2672
|
xml: XmlObject;
|
|
2556
2673
|
}
|
|
2674
|
+
/** Typed CT_AlphaOutsetEffect with original XML retained for lossless edits. */
|
|
2675
|
+
interface EffectDagAlphaOutset {
|
|
2676
|
+
kind: 'alphaOutset';
|
|
2677
|
+
radiusEmu?: number;
|
|
2678
|
+
xml: XmlObject;
|
|
2679
|
+
}
|
|
2557
2680
|
/** Typed CT_PresetShadowEffect with colour and extension XML retained verbatim. */
|
|
2558
2681
|
interface EffectDagPresetShadow {
|
|
2559
2682
|
kind: 'prstShdw';
|
|
@@ -2593,6 +2716,8 @@ interface PptxImageEffects {
|
|
|
2593
2716
|
duotone?: {
|
|
2594
2717
|
color1: string;
|
|
2595
2718
|
color2: string;
|
|
2719
|
+
/** Original effect XML, retained while the resolved colours are unchanged. */
|
|
2720
|
+
rawXml?: XmlObject;
|
|
2596
2721
|
};
|
|
2597
2722
|
/** Grayscale flag. */
|
|
2598
2723
|
grayscale?: boolean;
|
|
@@ -2607,8 +2732,10 @@ interface PptxImageEffects {
|
|
|
2607
2732
|
artisticEffect?: string;
|
|
2608
2733
|
/** Artistic effect radius/amount. */
|
|
2609
2734
|
artisticRadius?: number;
|
|
2610
|
-
/** Alpha modulation fixed
|
|
2735
|
+
/** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
|
|
2611
2736
|
alphaModFix?: number;
|
|
2737
|
+
/** Original alpha modulation fixed node, including foreign attributes. */
|
|
2738
|
+
alphaModFixRawXml?: XmlObject;
|
|
2612
2739
|
/** Bi-level threshold — converts to 1-bit black/white (0-100). */
|
|
2613
2740
|
biLevel?: number;
|
|
2614
2741
|
/** Colour change — swap one colour range for another (used for transparency keying). */
|
|
@@ -2617,7 +2744,13 @@ interface PptxImageEffects {
|
|
|
2617
2744
|
clrTo: string;
|
|
2618
2745
|
/** Whether the target colour is fully transparent (alpha = 0). */
|
|
2619
2746
|
clrToTransparent?: boolean;
|
|
2747
|
+
/** Original effect XML, including colour transforms and extensions. */
|
|
2748
|
+
rawXml?: XmlObject;
|
|
2620
2749
|
};
|
|
2750
|
+
/** Original grayscale node, including extension or foreign attributes. */
|
|
2751
|
+
grayscaleRawXml?: XmlObject;
|
|
2752
|
+
/** Original bi-level node, including extension or foreign attributes. */
|
|
2753
|
+
biLevelRawXml?: XmlObject;
|
|
2621
2754
|
/**
|
|
2622
2755
|
* Alpha inverse effect (`a:alphaInv`). Inverts the alpha channel; an optional
|
|
2623
2756
|
* colour child shifts the inversion baseline.
|
|
@@ -2625,11 +2758,17 @@ interface PptxImageEffects {
|
|
|
2625
2758
|
alphaInv?: {
|
|
2626
2759
|
/** Optional baseline colour (hex). */
|
|
2627
2760
|
color?: string;
|
|
2761
|
+
/** Original effect XML, including colour transforms and foreign attributes. */
|
|
2762
|
+
rawXml?: XmlObject;
|
|
2628
2763
|
};
|
|
2629
2764
|
/** Alpha ceiling (`a:alphaCeiling`) — clamps any non-zero alpha to fully opaque. Boolean flag. */
|
|
2630
2765
|
alphaCeiling?: boolean;
|
|
2766
|
+
/** Original alpha ceiling node, including foreign attributes. */
|
|
2767
|
+
alphaCeilingRawXml?: XmlObject;
|
|
2631
2768
|
/** Alpha floor (`a:alphaFloor`) — clamps any non-fully-opaque alpha to fully transparent. Boolean flag. */
|
|
2632
2769
|
alphaFloor?: boolean;
|
|
2770
|
+
/** Original alpha floor node, including foreign attributes. */
|
|
2771
|
+
alphaFloorRawXml?: XmlObject;
|
|
2633
2772
|
/**
|
|
2634
2773
|
* Alpha modulate (`a:alphaMod`). The schema requires a single `cont` (effect
|
|
2635
2774
|
* container) child; we preserve the inner XML opaquely for round-trip.
|
|
@@ -2637,11 +2776,17 @@ interface PptxImageEffects {
|
|
|
2637
2776
|
alphaMod?: {
|
|
2638
2777
|
/** Raw opaque XML for the `a:cont` child to preserve on save. */
|
|
2639
2778
|
contRawXml?: Record<string, unknown>;
|
|
2779
|
+
/** Original effect XML, including foreign attributes. */
|
|
2780
|
+
rawXml?: XmlObject;
|
|
2640
2781
|
};
|
|
2641
2782
|
/** Alpha replace (`a:alphaRepl`) — replaces alpha with the given fixed-percent value (0..100). */
|
|
2642
2783
|
alphaRepl?: number;
|
|
2784
|
+
/** Original alpha replace node, including foreign attributes. */
|
|
2785
|
+
alphaReplRawXml?: XmlObject;
|
|
2643
2786
|
/** Alpha bi-level (`a:alphaBiLevel`) — threshold (0..100) above which alpha becomes fully opaque. */
|
|
2644
2787
|
alphaBiLevel?: number;
|
|
2788
|
+
/** Original alpha bi-level node, including foreign attributes. */
|
|
2789
|
+
alphaBiLevelRawXml?: XmlObject;
|
|
2645
2790
|
/**
|
|
2646
2791
|
* Colour replace (`a:clrRepl`) — replaces all colour information in an image
|
|
2647
2792
|
* with the given solid colour. Stores the raw colour child to preserve scheme
|
|
@@ -2784,6 +2929,7 @@ declare module "./index" {
|
|
|
2784
2929
|
*
|
|
2785
2930
|
* @module pptx-types/media
|
|
2786
2931
|
*/
|
|
2932
|
+
|
|
2787
2933
|
/**
|
|
2788
2934
|
* Discriminator for embedded media element types.
|
|
2789
2935
|
*
|
|
@@ -2798,6 +2944,8 @@ type PptxMediaReferenceKind = 'audioCd' | 'wavAudioFile' | 'audioFile' | 'videoF
|
|
|
2798
2944
|
interface PptxAudioCdPosition {
|
|
2799
2945
|
track: number;
|
|
2800
2946
|
time?: number;
|
|
2947
|
+
/** Original `st` or `end` node, retained for lossless edits. */
|
|
2948
|
+
rawXml?: XmlObject;
|
|
2801
2949
|
}
|
|
2802
2950
|
/**
|
|
2803
2951
|
* A named bookmark within a media clip timeline.
|
|
@@ -2875,7 +3023,39 @@ interface MediaCaptionTrack {
|
|
|
2875
3023
|
isDefault?: boolean;
|
|
2876
3024
|
}
|
|
2877
3025
|
|
|
3026
|
+
type PptxSmartArtConstraintRelationship = 'self' | 'ch' | 'des';
|
|
3027
|
+
type PptxSmartArtConstraintOperator = 'none' | 'equ' | 'gte' | 'lte';
|
|
3028
|
+
type PptxSmartArtConstraintPointType = 'all' | 'doc' | 'node' | 'norm' | 'nonNorm' | 'asst' | 'nonAsst' | 'parTrans' | 'pres' | 'sibTrans';
|
|
3029
|
+
interface PptxSmartArtConstraintTarget {
|
|
3030
|
+
for?: PptxSmartArtConstraintRelationship;
|
|
3031
|
+
forName?: string;
|
|
3032
|
+
pointType?: PptxSmartArtConstraintPointType;
|
|
3033
|
+
}
|
|
3034
|
+
/** Editable DiagramML CT_Constraint. */
|
|
3035
|
+
interface PptxSmartArtConstraint extends PptxSmartArtConstraintTarget {
|
|
3036
|
+
type: string;
|
|
3037
|
+
referenceType?: string;
|
|
3038
|
+
referenceFor?: PptxSmartArtConstraintRelationship;
|
|
3039
|
+
referenceForName?: string;
|
|
3040
|
+
referencePointType?: PptxSmartArtConstraintPointType;
|
|
3041
|
+
operator?: PptxSmartArtConstraintOperator;
|
|
3042
|
+
value?: number;
|
|
3043
|
+
factor?: number;
|
|
3044
|
+
/** Original constraint retained for foreign attributes and extension content. */
|
|
3045
|
+
rawXml?: XmlObject;
|
|
3046
|
+
}
|
|
3047
|
+
/** Editable DiagramML CT_NumericRule. */
|
|
3048
|
+
interface PptxSmartArtNumericRule extends PptxSmartArtConstraintTarget {
|
|
3049
|
+
type: string;
|
|
3050
|
+
value?: number;
|
|
3051
|
+
factor?: number;
|
|
3052
|
+
max?: number;
|
|
3053
|
+
/** Original rule retained for foreign attributes and extension content. */
|
|
3054
|
+
rawXml?: XmlObject;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
2878
3057
|
/** Typed, editable metadata from a DiagramML layout-definition part. */
|
|
3058
|
+
|
|
2879
3059
|
interface PptxSmartArtLocalizedText {
|
|
2880
3060
|
value: string;
|
|
2881
3061
|
language?: string;
|
|
@@ -2884,12 +3064,56 @@ interface PptxSmartArtLayoutCategory {
|
|
|
2884
3064
|
type: string;
|
|
2885
3065
|
priority: number;
|
|
2886
3066
|
}
|
|
3067
|
+
interface PptxSmartArtAlgorithmParameter {
|
|
3068
|
+
type: string;
|
|
3069
|
+
value?: string;
|
|
3070
|
+
}
|
|
3071
|
+
/** Typed DiagramML CT_Algorithm data attached to a layout node. */
|
|
3072
|
+
interface PptxSmartArtLayoutAlgorithm {
|
|
3073
|
+
type: string;
|
|
3074
|
+
revision?: number;
|
|
3075
|
+
parameters?: PptxSmartArtAlgorithmParameter[];
|
|
3076
|
+
}
|
|
3077
|
+
interface PptxSmartArtIteratorAttributes {
|
|
3078
|
+
name?: string;
|
|
3079
|
+
reference?: string;
|
|
3080
|
+
axis?: string[];
|
|
3081
|
+
pointTypes?: string[];
|
|
3082
|
+
hideLastTransition?: boolean[];
|
|
3083
|
+
start?: number[];
|
|
3084
|
+
count?: number[];
|
|
3085
|
+
step?: number[];
|
|
3086
|
+
}
|
|
3087
|
+
interface PptxSmartArtForEach extends PptxSmartArtIteratorAttributes {
|
|
3088
|
+
rawXml?: XmlObject;
|
|
3089
|
+
}
|
|
3090
|
+
interface PptxSmartArtWhen extends PptxSmartArtIteratorAttributes {
|
|
3091
|
+
function: string;
|
|
3092
|
+
argument?: string;
|
|
3093
|
+
operator: string;
|
|
3094
|
+
value: string;
|
|
3095
|
+
rawXml?: XmlObject;
|
|
3096
|
+
}
|
|
3097
|
+
interface PptxSmartArtChoose {
|
|
3098
|
+
name?: string;
|
|
3099
|
+
when: PptxSmartArtWhen[];
|
|
3100
|
+
otherwise?: {
|
|
3101
|
+
name?: string;
|
|
3102
|
+
rawXml?: XmlObject;
|
|
3103
|
+
} | null;
|
|
3104
|
+
rawXml?: XmlObject;
|
|
3105
|
+
}
|
|
2887
3106
|
/** Identity and ordering metadata from DiagramML CT_LayoutNode. */
|
|
2888
3107
|
interface PptxSmartArtLayoutNode {
|
|
2889
3108
|
name?: string;
|
|
2890
3109
|
styleLabel?: string;
|
|
2891
3110
|
childOrder?: 'b' | 't';
|
|
2892
3111
|
moveWith?: string;
|
|
3112
|
+
algorithm?: PptxSmartArtLayoutAlgorithm;
|
|
3113
|
+
forEach?: PptxSmartArtForEach[];
|
|
3114
|
+
choose?: PptxSmartArtChoose[];
|
|
3115
|
+
constraints?: PptxSmartArtConstraint[];
|
|
3116
|
+
rules?: PptxSmartArtNumericRule[];
|
|
2893
3117
|
children?: PptxSmartArtLayoutNode[];
|
|
2894
3118
|
}
|
|
2895
3119
|
/** Metadata and root node from DiagramML CT_DiagramDefinition. */
|
|
@@ -2901,6 +3125,8 @@ interface PptxSmartArtLayoutDefinition {
|
|
|
2901
3125
|
descriptions?: PptxSmartArtLocalizedText[];
|
|
2902
3126
|
categories?: PptxSmartArtLayoutCategory[];
|
|
2903
3127
|
rootNode: PptxSmartArtLayoutNode;
|
|
3128
|
+
/** Original definition retained for constraint evaluation and foreign rules. */
|
|
3129
|
+
rawXml?: XmlObject;
|
|
2904
3130
|
}
|
|
2905
3131
|
|
|
2906
3132
|
/**
|
|
@@ -2912,6 +3138,7 @@ interface PptxSmartArtLayoutDefinition {
|
|
|
2912
3138
|
*
|
|
2913
3139
|
* @module pptx-types/smart-art-node
|
|
2914
3140
|
*/
|
|
3141
|
+
|
|
2915
3142
|
/**
|
|
2916
3143
|
* A single run of text inside a SmartArt node, capturing the run text and the
|
|
2917
3144
|
* raw `a:rPr` run-properties object verbatim so per-run formatting (bold,
|
|
@@ -2935,6 +3162,54 @@ interface PptxSmartArtTextRun {
|
|
|
2935
3162
|
* round-trip. Untyped XML, hence the loose record shape.
|
|
2936
3163
|
*/
|
|
2937
3164
|
rPr?: Record<string, unknown>;
|
|
3165
|
+
/** Resolved standard shape-text style derived from {@link rPr}. */
|
|
3166
|
+
style?: TextStyle;
|
|
3167
|
+
/** Raw run XML used to retain unmodelled extension children on save. */
|
|
3168
|
+
rawXml?: Record<string, unknown>;
|
|
3169
|
+
/** Original direct-child order, including unmodelled extension children. */
|
|
3170
|
+
childOrder?: string[];
|
|
3171
|
+
}
|
|
3172
|
+
/** An ordered item within a SmartArt text paragraph. */
|
|
3173
|
+
type PptxSmartArtTextParagraphItem = {
|
|
3174
|
+
kind: 'run';
|
|
3175
|
+
run: PptxSmartArtTextRun;
|
|
3176
|
+
} | {
|
|
3177
|
+
kind: 'break';
|
|
3178
|
+
rPr?: Record<string, unknown>;
|
|
3179
|
+
style?: TextStyle;
|
|
3180
|
+
rawXml?: Record<string, unknown>;
|
|
3181
|
+
childOrder?: string[];
|
|
3182
|
+
} | {
|
|
3183
|
+
kind: 'field';
|
|
3184
|
+
id?: string;
|
|
3185
|
+
fieldType?: string;
|
|
3186
|
+
text: string;
|
|
3187
|
+
rPr?: Record<string, unknown>;
|
|
3188
|
+
style?: TextStyle;
|
|
3189
|
+
pPr?: Record<string, unknown>;
|
|
3190
|
+
rawXml?: Record<string, unknown>;
|
|
3191
|
+
childOrder?: string[];
|
|
3192
|
+
} | {
|
|
3193
|
+
kind: 'tab';
|
|
3194
|
+
rawXml?: Record<string, unknown>;
|
|
3195
|
+
childOrder?: string[];
|
|
3196
|
+
} | {
|
|
3197
|
+
kind: 'raw';
|
|
3198
|
+
name: string;
|
|
3199
|
+
value: unknown;
|
|
3200
|
+
};
|
|
3201
|
+
/** A complete `a:p` paragraph in a SmartArt data-model text body. */
|
|
3202
|
+
interface PptxSmartArtTextParagraph {
|
|
3203
|
+
/** Paragraph properties (`a:pPr`) preserved verbatim. */
|
|
3204
|
+
pPr?: Record<string, unknown>;
|
|
3205
|
+
/** Text children in source order. */
|
|
3206
|
+
items: PptxSmartArtTextParagraphItem[];
|
|
3207
|
+
/** End-paragraph run properties (`a:endParaRPr`) preserved verbatim. */
|
|
3208
|
+
endParaRPr?: Record<string, unknown>;
|
|
3209
|
+
/** Resolved style for the paragraph terminator. */
|
|
3210
|
+
endParaStyle?: TextStyle;
|
|
3211
|
+
/** Raw paragraph XML used to retain unmodelled extension children on save. */
|
|
3212
|
+
rawXml?: Record<string, unknown>;
|
|
2938
3213
|
}
|
|
2939
3214
|
/**
|
|
2940
3215
|
* Per-node visual override for a SmartArt node.
|
|
@@ -3004,6 +3279,11 @@ interface PptxSmartArtNode {
|
|
|
3004
3279
|
* is not flattened. When {@link text} diverges, the runs are ignored.
|
|
3005
3280
|
*/
|
|
3006
3281
|
runs?: PptxSmartArtTextRun[];
|
|
3282
|
+
/**
|
|
3283
|
+
* Complete typed paragraph model. Unlike {@link runs}, this retains every
|
|
3284
|
+
* paragraph and the ordered run, field, break, and tab children within it.
|
|
3285
|
+
*/
|
|
3286
|
+
paragraphs?: PptxSmartArtTextParagraph[];
|
|
3007
3287
|
/**
|
|
3008
3288
|
* Optional per-node visual override (fill / line / font colour, bold /
|
|
3009
3289
|
* italic). Read at parse time from the point's `spPr` / first-run `rPr`, set
|
|
@@ -3167,7 +3447,7 @@ interface PptxSmartArtConnection {
|
|
|
3167
3447
|
* // => satisfies PptxSmartArtDrawingShape
|
|
3168
3448
|
* ```
|
|
3169
3449
|
*/
|
|
3170
|
-
interface PptxSmartArtDrawingShape {
|
|
3450
|
+
interface PptxSmartArtDrawingShape extends PptxCustomPathProperties {
|
|
3171
3451
|
/** Shape ID within the drawing. */
|
|
3172
3452
|
id: string;
|
|
3173
3453
|
/** Preset geometry type (e.g. "roundRect", "ellipse"). */
|
|
@@ -3191,6 +3471,8 @@ interface PptxSmartArtDrawingShape {
|
|
|
3191
3471
|
strokeWidth?: number;
|
|
3192
3472
|
/** Text content of the shape. */
|
|
3193
3473
|
text?: string;
|
|
3474
|
+
/** Standard rich-text segments projected from the associated SmartArt node. */
|
|
3475
|
+
textSegments?: TextSegment[];
|
|
3194
3476
|
/** Font size in points. */
|
|
3195
3477
|
fontSize?: number;
|
|
3196
3478
|
/** Font colour (hex). */
|
|
@@ -3516,6 +3798,126 @@ interface PptxTableData {
|
|
|
3516
3798
|
/** Right-to-left table layout from `a:tblPr/@rtl`. */
|
|
3517
3799
|
rtl?: boolean;
|
|
3518
3800
|
}
|
|
3801
|
+
/**
|
|
3802
|
+
* A single fill reference within a table style section.
|
|
3803
|
+
*
|
|
3804
|
+
* @example
|
|
3805
|
+
* ```ts
|
|
3806
|
+
* const fill: ParsedTableStyleFill = {
|
|
3807
|
+
* schemeColor: "accent1",
|
|
3808
|
+
* tint: 40000, // 40% tint
|
|
3809
|
+
* };
|
|
3810
|
+
* // => satisfies ParsedTableStyleFill
|
|
3811
|
+
* ```
|
|
3812
|
+
*/
|
|
3813
|
+
interface ParsedTableStyleFill {
|
|
3814
|
+
/** Theme colour key (e.g. `accent1`, `dk1`). */
|
|
3815
|
+
schemeColor: string;
|
|
3816
|
+
/** Tint value (0-100 000). */
|
|
3817
|
+
tint?: number;
|
|
3818
|
+
/** Shade value (0-100 000). */
|
|
3819
|
+
shade?: number;
|
|
3820
|
+
}
|
|
3821
|
+
/**
|
|
3822
|
+
* A single entry in the parsed table style map.
|
|
3823
|
+
*
|
|
3824
|
+
* Contains fill colours for whole-table, banded rows/columns, first/last
|
|
3825
|
+
* row, and first/last column sections.
|
|
3826
|
+
*
|
|
3827
|
+
* @example
|
|
3828
|
+
* ```ts
|
|
3829
|
+
* const entry: ParsedTableStyleEntry = {
|
|
3830
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
3831
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
3832
|
+
* accentKey: "accent1",
|
|
3833
|
+
* wholeTblFill: { schemeColor: "accent1", tint: 20000 },
|
|
3834
|
+
* band1HFill: { schemeColor: "accent1", tint: 40000 },
|
|
3835
|
+
* firstRowFill: { schemeColor: "accent1" },
|
|
3836
|
+
* };
|
|
3837
|
+
* // => satisfies ParsedTableStyleEntry
|
|
3838
|
+
* ```
|
|
3839
|
+
*/
|
|
3840
|
+
/** Text properties from a:tcTxStyle in a table style section. */
|
|
3841
|
+
interface ParsedTableStyleText {
|
|
3842
|
+
/** Font bold. */
|
|
3843
|
+
bold?: boolean;
|
|
3844
|
+
/** Font italic. */
|
|
3845
|
+
italic?: boolean;
|
|
3846
|
+
/** Font colour as theme scheme key. */
|
|
3847
|
+
fontSchemeColor?: string;
|
|
3848
|
+
/** Font colour tint (0-100 000). */
|
|
3849
|
+
fontTint?: number;
|
|
3850
|
+
/** Font colour shade (0-100 000). */
|
|
3851
|
+
fontShade?: number;
|
|
3852
|
+
}
|
|
3853
|
+
/**
|
|
3854
|
+
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
3855
|
+
*
|
|
3856
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Currently
|
|
3857
|
+
* captures only the resolved scheme-fill colour (verbatim XML for fill
|
|
3858
|
+
* / effect references is preserved separately by the save path).
|
|
3859
|
+
*/
|
|
3860
|
+
interface ParsedTableBackground {
|
|
3861
|
+
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
3862
|
+
fill?: ParsedTableStyleFill;
|
|
3863
|
+
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
3864
|
+
hasEffectLst?: boolean;
|
|
3865
|
+
}
|
|
3866
|
+
interface ParsedTableStyleEntry {
|
|
3867
|
+
styleId: string;
|
|
3868
|
+
styleName?: string;
|
|
3869
|
+
/** Dominant accent key derived from fills (e.g. `accent1`). */
|
|
3870
|
+
accentKey?: string;
|
|
3871
|
+
/** Table-level background (`<a:tblBg>`). */
|
|
3872
|
+
tableBackground?: ParsedTableBackground;
|
|
3873
|
+
wholeTblFill?: ParsedTableStyleFill;
|
|
3874
|
+
band1HFill?: ParsedTableStyleFill;
|
|
3875
|
+
band2HFill?: ParsedTableStyleFill;
|
|
3876
|
+
band1VFill?: ParsedTableStyleFill;
|
|
3877
|
+
band2VFill?: ParsedTableStyleFill;
|
|
3878
|
+
firstRowFill?: ParsedTableStyleFill;
|
|
3879
|
+
lastRowFill?: ParsedTableStyleFill;
|
|
3880
|
+
firstColFill?: ParsedTableStyleFill;
|
|
3881
|
+
lastColFill?: ParsedTableStyleFill;
|
|
3882
|
+
/** Corner cell fills (`<a:seCell>`, `<a:swCell>`, `<a:neCell>`, `<a:nwCell>`). */
|
|
3883
|
+
seCellFill?: ParsedTableStyleFill;
|
|
3884
|
+
swCellFill?: ParsedTableStyleFill;
|
|
3885
|
+
neCellFill?: ParsedTableStyleFill;
|
|
3886
|
+
nwCellFill?: ParsedTableStyleFill;
|
|
3887
|
+
/** Per-role text styling from a:tcTxStyle. */
|
|
3888
|
+
wholeTblText?: ParsedTableStyleText;
|
|
3889
|
+
firstRowText?: ParsedTableStyleText;
|
|
3890
|
+
lastRowText?: ParsedTableStyleText;
|
|
3891
|
+
firstColText?: ParsedTableStyleText;
|
|
3892
|
+
lastColText?: ParsedTableStyleText;
|
|
3893
|
+
band1HText?: ParsedTableStyleText;
|
|
3894
|
+
band2HText?: ParsedTableStyleText;
|
|
3895
|
+
band1VText?: ParsedTableStyleText;
|
|
3896
|
+
band2VText?: ParsedTableStyleText;
|
|
3897
|
+
seCellText?: ParsedTableStyleText;
|
|
3898
|
+
swCellText?: ParsedTableStyleText;
|
|
3899
|
+
neCellText?: ParsedTableStyleText;
|
|
3900
|
+
nwCellText?: ParsedTableStyleText;
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* Map of GUID → table style entry.
|
|
3904
|
+
*
|
|
3905
|
+
* Parsed from `ppt/tableStyles.xml` and indexed by the style GUID
|
|
3906
|
+
* referenced in `a:tblPr@tblStyle`.
|
|
3907
|
+
*
|
|
3908
|
+
* @example
|
|
3909
|
+
* ```ts
|
|
3910
|
+
* const styles: ParsedTableStyleMap = {
|
|
3911
|
+
* "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}": {
|
|
3912
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
3913
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
3914
|
+
* accentKey: "accent1",
|
|
3915
|
+
* },
|
|
3916
|
+
* };
|
|
3917
|
+
* // => satisfies ParsedTableStyleMap
|
|
3918
|
+
* ```
|
|
3919
|
+
*/
|
|
3920
|
+
type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
|
|
3519
3921
|
|
|
3520
3922
|
/**
|
|
3521
3923
|
* A text box — a plain rectangle containing text, typically with no
|
|
@@ -3768,6 +4170,8 @@ interface MediaPptxElement extends PptxElementBase {
|
|
|
3768
4170
|
mediaMimeType?: string;
|
|
3769
4171
|
mediaReferenceKind?: PptxMediaReferenceKind;
|
|
3770
4172
|
mediaReferenceName?: string;
|
|
4173
|
+
/** Explicit DrawingML `audioFile/@contentType` value when present. */
|
|
4174
|
+
mediaReferenceContentType?: string;
|
|
3771
4175
|
audioCdStart?: PptxAudioCdPosition;
|
|
3772
4176
|
audioCdEnd?: PptxAudioCdPosition;
|
|
3773
4177
|
rawMediaReferenceXml?: XmlObject;
|
|
@@ -3891,6 +4295,10 @@ interface ContentPartPptxElement extends PptxElementBase {
|
|
|
3891
4295
|
type: 'contentPart';
|
|
3892
4296
|
/** Ink strokes contained in this content part. */
|
|
3893
4297
|
inkStrokes?: ContentPartInkStroke[];
|
|
4298
|
+
/** Package path of the related InkML part. */
|
|
4299
|
+
inkPartPath?: string;
|
|
4300
|
+
/** Parsed InkML root retained for unknown-node preservation on dirty save. */
|
|
4301
|
+
inkPartRawXml?: XmlObject;
|
|
3894
4302
|
}
|
|
3895
4303
|
/**
|
|
3896
4304
|
* A Slide Zoom or Section Zoom element (PowerPoint Zoom Object).
|
|
@@ -3911,12 +4319,32 @@ interface ContentPartPptxElement extends PptxElementBase {
|
|
|
3911
4319
|
*/
|
|
3912
4320
|
interface ZoomPptxElement extends PptxElementBase, PptxImageProperties {
|
|
3913
4321
|
type: 'zoom';
|
|
3914
|
-
/** Type of zoom: slide-level or section
|
|
3915
|
-
zoomType: 'slide' | 'section';
|
|
4322
|
+
/** Type of zoom: slide-level, section-level, or a multi-section summary. */
|
|
4323
|
+
zoomType: 'slide' | 'section' | 'summary';
|
|
3916
4324
|
/** Zero-based index of the target slide. */
|
|
3917
4325
|
targetSlideIndex: number;
|
|
3918
4326
|
/** Section ID for section zoom. */
|
|
3919
4327
|
targetSectionId?: string;
|
|
4328
|
+
/** Ordered section tiles in a Summary Zoom container. */
|
|
4329
|
+
summaryTargets?: SummaryZoomTarget[];
|
|
4330
|
+
/** Layout mode authored on the Summary Zoom container. */
|
|
4331
|
+
summaryLayout?: 'grid' | 'fixed';
|
|
4332
|
+
}
|
|
4333
|
+
/** A single section tile within a PowerPoint Summary Zoom container. */
|
|
4334
|
+
interface SummaryZoomTarget extends PptxImageProperties {
|
|
4335
|
+
sectionId: string;
|
|
4336
|
+
targetSlideIndex: number;
|
|
4337
|
+
x: number;
|
|
4338
|
+
y: number;
|
|
4339
|
+
width: number;
|
|
4340
|
+
height: number;
|
|
4341
|
+
title?: string;
|
|
4342
|
+
description?: string;
|
|
4343
|
+
offsetFactorX?: number;
|
|
4344
|
+
offsetFactorY?: number;
|
|
4345
|
+
scaleFactorX?: number;
|
|
4346
|
+
scaleFactorY?: number;
|
|
4347
|
+
rawXml?: XmlObject;
|
|
3920
4348
|
}
|
|
3921
4349
|
/**
|
|
3922
4350
|
* A 3D model object embedded via `p16:model3D` inside an
|
|
@@ -3953,22 +4381,217 @@ interface UnknownPptxElement extends PptxElementBase {
|
|
|
3953
4381
|
* (shape), or `textSegments` (text/shape).
|
|
3954
4382
|
*/
|
|
3955
4383
|
type PptxElement = TextPptxElement | ShapePptxElement | ConnectorPptxElement | ImagePptxElement | PicturePptxElement | TablePptxElement | ChartPptxElement | SmartArtPptxElement | OlePptxElement | MediaPptxElement | GroupPptxElement | InkPptxElement | ContentPartPptxElement | ZoomPptxElement | Model3DPptxElement | UnknownPptxElement;
|
|
4384
|
+
|
|
3956
4385
|
/**
|
|
3957
|
-
*
|
|
3958
|
-
*
|
|
3959
|
-
*
|
|
3960
|
-
*
|
|
4386
|
+
* Master and layout types: notes master, handout master, slide master,
|
|
4387
|
+
* slide layout, and theme options.
|
|
4388
|
+
*
|
|
4389
|
+
* @module pptx-types/masters
|
|
3961
4390
|
*/
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
4391
|
+
|
|
4392
|
+
/**
|
|
4393
|
+
* Parsed notes master from `ppt/notesMasters/notesMaster1.xml`.
|
|
4394
|
+
*
|
|
4395
|
+
* @example
|
|
4396
|
+
* ```ts
|
|
4397
|
+
* const notes: PptxNotesMaster = {
|
|
4398
|
+
* path: "ppt/notesMasters/notesMaster1.xml",
|
|
4399
|
+
* backgroundColor: "#FFFFFF",
|
|
4400
|
+
* placeholders: [{ type: "body" }, { type: "sldImg" }],
|
|
4401
|
+
* };
|
|
4402
|
+
* // => satisfies PptxNotesMaster
|
|
4403
|
+
* ```
|
|
4404
|
+
*/
|
|
4405
|
+
interface PptxNotesMaster {
|
|
4406
|
+
/** File path within the PPTX archive. */
|
|
4407
|
+
path: string;
|
|
4408
|
+
/** Background colour of the notes master. */
|
|
4409
|
+
backgroundColor?: string;
|
|
4410
|
+
/** Background image data URL. */
|
|
4411
|
+
backgroundImage?: string;
|
|
4412
|
+
/** Placeholder shapes found on the notes master. */
|
|
4413
|
+
placeholders?: Array<{
|
|
4414
|
+
type: string;
|
|
4415
|
+
idx?: string;
|
|
4416
|
+
}>;
|
|
4417
|
+
/** Editable elements on the notes master (header, footer, date, page number, slide image, notes body). */
|
|
4418
|
+
elements?: PptxElement[];
|
|
4419
|
+
/** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
|
|
4420
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
4421
|
+
/** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
|
|
4422
|
+
clrMap?: Record<string, string>;
|
|
4423
|
+
}
|
|
4424
|
+
/**
|
|
4425
|
+
* Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
|
|
4426
|
+
*
|
|
4427
|
+
* @example
|
|
4428
|
+
* ```ts
|
|
4429
|
+
* const handout: PptxHandoutMaster = {
|
|
4430
|
+
* path: "ppt/handoutMasters/handoutMaster1.xml",
|
|
4431
|
+
* slidesPerPage: 6,
|
|
4432
|
+
* };
|
|
4433
|
+
* // => satisfies PptxHandoutMaster
|
|
4434
|
+
* ```
|
|
4435
|
+
*/
|
|
4436
|
+
interface PptxHandoutMaster {
|
|
4437
|
+
/** File path within the PPTX archive. */
|
|
4438
|
+
path: string;
|
|
4439
|
+
/** Background colour of the handout master. */
|
|
4440
|
+
backgroundColor?: string;
|
|
4441
|
+
/** Background image data URL. */
|
|
4442
|
+
backgroundImage?: string;
|
|
4443
|
+
/** Placeholder shapes found on the handout master. */
|
|
4444
|
+
placeholders?: Array<{
|
|
4445
|
+
type: string;
|
|
4446
|
+
idx?: string;
|
|
4447
|
+
}>;
|
|
4448
|
+
/** Editable elements on the handout master (header, footer, date, page number, slide placeholders). */
|
|
4449
|
+
elements?: PptxElement[];
|
|
4450
|
+
/** Number of slides per page for handout print layout (1, 2, 3, 4, 6, or 9). */
|
|
4451
|
+
slidesPerPage?: number;
|
|
4452
|
+
/** Header/footer flags from `<p:hf>` on the handout master (P-H3). */
|
|
4453
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
4454
|
+
/** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
|
|
4455
|
+
clrMap?: Record<string, string>;
|
|
4456
|
+
}
|
|
4457
|
+
/**
|
|
4458
|
+
* Structured slide master data.
|
|
4459
|
+
*
|
|
4460
|
+
* @example
|
|
4461
|
+
* ```ts
|
|
4462
|
+
* const master: PptxSlideMaster = {
|
|
4463
|
+
* path: "ppt/slideMasters/slideMaster1.xml",
|
|
4464
|
+
* name: "Office Theme",
|
|
4465
|
+
* backgroundColor: "#FFFFFF",
|
|
4466
|
+
* themePath: "ppt/theme/theme1.xml",
|
|
4467
|
+
* };
|
|
4468
|
+
* // => satisfies PptxSlideMaster
|
|
4469
|
+
* ```
|
|
4470
|
+
*/
|
|
4471
|
+
interface PptxSlideMaster {
|
|
4472
|
+
/** File path within the PPTX archive. */
|
|
4473
|
+
path: string;
|
|
4474
|
+
/** Human-readable name if available. */
|
|
4475
|
+
name?: string;
|
|
4476
|
+
/** Background colour of the slide master. */
|
|
4477
|
+
backgroundColor?: string;
|
|
4478
|
+
/** Background image data URL for the slide master. */
|
|
4479
|
+
backgroundImage?: string;
|
|
4480
|
+
/** Theme file path this master references. */
|
|
4481
|
+
themePath?: string;
|
|
4482
|
+
/** Layout paths associated with this master. */
|
|
4483
|
+
layoutPaths?: string[];
|
|
4484
|
+
/** Placeholder shapes on the master. */
|
|
4485
|
+
placeholders?: Array<{
|
|
4486
|
+
type: string;
|
|
4487
|
+
idx?: string;
|
|
4488
|
+
}>;
|
|
4489
|
+
/** Parsed element shapes on the master slide (for master view rendering). */
|
|
4490
|
+
elements?: PptxElement[];
|
|
4491
|
+
/** Parsed slide layout objects associated with this master. */
|
|
4492
|
+
layouts?: PptxSlideLayout[];
|
|
4493
|
+
/** Text styles from `p:txStyles` — title, body, and other text defaults. */
|
|
4494
|
+
txStyles?: PptxMasterTextStyles;
|
|
4495
|
+
/** Header/footer flags from `<p:hf>` on this master (P-H3). */
|
|
4496
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
4497
|
+
/**
|
|
4498
|
+
* Colour map from `<p:clrMap>` (12 alias attributes: bg1/tx1/bg2/tx2,
|
|
4499
|
+
* accent1-6, hlink, folHlink). Applied at save time when present.
|
|
4500
|
+
*/
|
|
4501
|
+
clrMap?: Record<string, string>;
|
|
4502
|
+
}
|
|
4503
|
+
/**
|
|
4504
|
+
* Per-level paragraph properties for a text style category.
|
|
4505
|
+
* Each entry maps a 0-based level index to its style defaults.
|
|
4506
|
+
*/
|
|
4507
|
+
type PptxTextStyleLevels = Record<number, PlaceholderTextLevelStyle>;
|
|
4508
|
+
/**
|
|
4509
|
+
* Text styles parsed from `p:txStyles` on a slide master.
|
|
4510
|
+
* Provides cascading defaults for title, body, and other text.
|
|
4511
|
+
*/
|
|
4512
|
+
interface PptxMasterTextStyles {
|
|
4513
|
+
/** Title text style (`p:titleStyle`). */
|
|
4514
|
+
titleStyle?: PptxTextStyleLevels;
|
|
4515
|
+
/** Body text style (`p:bodyStyle`). */
|
|
4516
|
+
bodyStyle?: PptxTextStyleLevels;
|
|
4517
|
+
/** Other text style (`p:otherStyle`). */
|
|
4518
|
+
otherStyle?: PptxTextStyleLevels;
|
|
4519
|
+
}
|
|
4520
|
+
/**
|
|
4521
|
+
* Per-part header/footer flags from `<p:hf>` (CT_HeaderFooter, ECMA-376
|
|
4522
|
+
* §19.3.1.21). Defaults are "all true" — fields are only set on the typed
|
|
4523
|
+
* model when they were explicitly read, so callers can distinguish "unset"
|
|
4524
|
+
* (preserve original XML) from "false" (override).
|
|
4525
|
+
*/
|
|
4526
|
+
interface PptxHeaderFooterFlags {
|
|
4527
|
+
/** `@hdr` — show header placeholder. Spec default: `true`. */
|
|
4528
|
+
hasHeader?: boolean;
|
|
4529
|
+
/** `@ftr` — show footer placeholder. Spec default: `true`. */
|
|
4530
|
+
hasFooter?: boolean;
|
|
4531
|
+
/** `@dt` — show date/time placeholder. Spec default: `true`. */
|
|
3968
4532
|
hasDateTime?: boolean;
|
|
3969
4533
|
/** `@sldNum` — show slide-number placeholder. Spec default: `true`. */
|
|
3970
4534
|
hasSlideNumber?: boolean;
|
|
3971
4535
|
}
|
|
4536
|
+
/**
|
|
4537
|
+
* A slide layout associated with a slide master.
|
|
4538
|
+
*
|
|
4539
|
+
* @example
|
|
4540
|
+
* ```ts
|
|
4541
|
+
* const layout: PptxSlideLayout = {
|
|
4542
|
+
* path: "ppt/slideLayouts/slideLayout2.xml",
|
|
4543
|
+
* name: "Title and Content",
|
|
4544
|
+
* };
|
|
4545
|
+
* // => satisfies PptxSlideLayout
|
|
4546
|
+
* ```
|
|
4547
|
+
*/
|
|
4548
|
+
interface PptxSlideLayout {
|
|
4549
|
+
/** File path within the PPTX archive. */
|
|
4550
|
+
path: string;
|
|
4551
|
+
/** Human-readable layout name. */
|
|
4552
|
+
name?: string;
|
|
4553
|
+
/** Background colour of the layout. */
|
|
4554
|
+
backgroundColor?: string;
|
|
4555
|
+
/** Background image data URL for the layout. */
|
|
4556
|
+
backgroundImage?: string;
|
|
4557
|
+
/** Parsed element shapes on the layout. */
|
|
4558
|
+
elements?: PptxElement[];
|
|
4559
|
+
/** Placeholder shapes on the layout. */
|
|
4560
|
+
placeholders?: Array<{
|
|
4561
|
+
type: string;
|
|
4562
|
+
idx?: string;
|
|
4563
|
+
}>;
|
|
4564
|
+
/** Matching name attribute for layout identification (`@matchingName`). */
|
|
4565
|
+
matchingName?: string;
|
|
4566
|
+
/** Whether the layout is marked as preserved (prevent deletion, `@preserve`). */
|
|
4567
|
+
preserve?: boolean;
|
|
4568
|
+
/** Whether master placeholder animations should play (`@showMasterPhAnim`). */
|
|
4569
|
+
showMasterPhAnim?: boolean;
|
|
4570
|
+
/** Whether this layout is user-drawn (`@userDrawn`). */
|
|
4571
|
+
userDrawn?: boolean;
|
|
4572
|
+
/** Colour map override from `p:clrMapOvr`. */
|
|
4573
|
+
clrMapOverride?: Record<string, string>;
|
|
4574
|
+
/** Header/footer flags from `<p:hf>` on this layout (P-H3). */
|
|
4575
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
4576
|
+
}
|
|
4577
|
+
/**
|
|
4578
|
+
* A theme part available in the presentation package.
|
|
4579
|
+
*
|
|
4580
|
+
* @example
|
|
4581
|
+
* ```ts
|
|
4582
|
+
* const opt: PptxThemeOption = {
|
|
4583
|
+
* path: "ppt/theme/theme1.xml",
|
|
4584
|
+
* name: "Office Theme",
|
|
4585
|
+
* };
|
|
4586
|
+
* // => satisfies PptxThemeOption
|
|
4587
|
+
* ```
|
|
4588
|
+
*/
|
|
4589
|
+
interface PptxThemeOption {
|
|
4590
|
+
/** File path within the PPTX archive (e.g. `ppt/theme/theme2.xml`). */
|
|
4591
|
+
path: string;
|
|
4592
|
+
/** Human-readable theme name from `a:theme/@name`, when present. */
|
|
4593
|
+
name?: string;
|
|
4594
|
+
}
|
|
3972
4595
|
|
|
3973
4596
|
/**
|
|
3974
4597
|
* Animation types: presets, triggers, timing, native parsed animation data,
|
|
@@ -4363,6 +4986,33 @@ interface PptxElementAnimation {
|
|
|
4363
4986
|
stopSound?: boolean;
|
|
4364
4987
|
}
|
|
4365
4988
|
|
|
4989
|
+
interface PptxEmbeddedFontDataId {
|
|
4990
|
+
/** Required relationship identifier from `r:id`. */
|
|
4991
|
+
relationshipId?: string | null;
|
|
4992
|
+
/** Original leaf retained for unknown attribute preservation. */
|
|
4993
|
+
rawXml?: XmlObject;
|
|
4994
|
+
}
|
|
4995
|
+
interface PptxEmbeddedFontDescriptor {
|
|
4996
|
+
typeface?: string | null;
|
|
4997
|
+
panose?: string | null;
|
|
4998
|
+
pitchFamily?: string | null;
|
|
4999
|
+
charset?: string | null;
|
|
5000
|
+
rawXml?: XmlObject;
|
|
5001
|
+
}
|
|
5002
|
+
interface PptxEmbeddedFontListEntry {
|
|
5003
|
+
font: PptxEmbeddedFontDescriptor;
|
|
5004
|
+
regular?: PptxEmbeddedFontDataId | null;
|
|
5005
|
+
bold?: PptxEmbeddedFontDataId | null;
|
|
5006
|
+
italic?: PptxEmbeddedFontDataId | null;
|
|
5007
|
+
boldItalic?: PptxEmbeddedFontDataId | null;
|
|
5008
|
+
rawXml?: XmlObject;
|
|
5009
|
+
}
|
|
5010
|
+
interface PptxEmbeddedFontList {
|
|
5011
|
+
fonts: PptxEmbeddedFontListEntry[];
|
|
5012
|
+
/** Original list retained for unknown attribute and child preservation. */
|
|
5013
|
+
rawXml?: XmlObject;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
4366
5016
|
/**
|
|
4367
5017
|
* Metadata types: slide comments, compatibility warnings, tags,
|
|
4368
5018
|
* custom properties, core/app document properties.
|
|
@@ -4422,6 +5072,49 @@ interface PptxComment {
|
|
|
4422
5072
|
/** Original `p:cm` subtree, retained for unknown child and extension preservation. */
|
|
4423
5073
|
rawXml?: XmlObject;
|
|
4424
5074
|
}
|
|
5075
|
+
/** Office 2021 comment author from the p188 Author part. */
|
|
5076
|
+
interface PptxModernCommentAuthor {
|
|
5077
|
+
id: string;
|
|
5078
|
+
name: string;
|
|
5079
|
+
initials?: string;
|
|
5080
|
+
userId: string;
|
|
5081
|
+
providerId: string;
|
|
5082
|
+
rawXml?: XmlObject;
|
|
5083
|
+
}
|
|
5084
|
+
/**
|
|
5085
|
+
* A comment author from `ppt/commentAuthors.xml`.
|
|
5086
|
+
*
|
|
5087
|
+
* Stores all attributes needed for lossless round-trip serialization
|
|
5088
|
+
* of the `p:cmAuthor` element (id, name, initials, lastIdx, clrIdx).
|
|
5089
|
+
*
|
|
5090
|
+
* @see ECMA-376 Part 1, §19.4.2 (cmAuthor)
|
|
5091
|
+
*
|
|
5092
|
+
* @example
|
|
5093
|
+
* ```ts
|
|
5094
|
+
* const author: PptxCommentAuthor = {
|
|
5095
|
+
* id: "0",
|
|
5096
|
+
* name: "John Doe",
|
|
5097
|
+
* initials: "JD",
|
|
5098
|
+
* lastIdx: 3,
|
|
5099
|
+
* clrIdx: 0,
|
|
5100
|
+
* };
|
|
5101
|
+
* // => satisfies PptxCommentAuthor
|
|
5102
|
+
* ```
|
|
5103
|
+
*/
|
|
5104
|
+
interface PptxCommentAuthor {
|
|
5105
|
+
/** Unique numeric author identifier (`@_id`). */
|
|
5106
|
+
id: string;
|
|
5107
|
+
/** Author display name (`@_name`). */
|
|
5108
|
+
name: string;
|
|
5109
|
+
/** Author initials (`@_initials`). */
|
|
5110
|
+
initials: string;
|
|
5111
|
+
/** Last comment index used by this author (`@_lastIdx`). */
|
|
5112
|
+
lastIdx: number;
|
|
5113
|
+
/** Colour index assigned to this author (`@_clrIdx`). */
|
|
5114
|
+
clrIdx: number;
|
|
5115
|
+
/** Original `p:cmAuthor` subtree, retained for unknown attribute preservation. */
|
|
5116
|
+
rawXml?: XmlObject;
|
|
5117
|
+
}
|
|
4425
5118
|
/**
|
|
4426
5119
|
* A compatibility warning generated during parse or save when the
|
|
4427
5120
|
* file uses features not fully supported by the editor.
|
|
@@ -4448,6 +5141,423 @@ interface PptxCompatibilityWarning {
|
|
|
4448
5141
|
elementId?: string;
|
|
4449
5142
|
xmlPath?: string;
|
|
4450
5143
|
}
|
|
5144
|
+
/**
|
|
5145
|
+
* A single name–value tag from `ppt/tags/*.xml`.
|
|
5146
|
+
*
|
|
5147
|
+
* @example
|
|
5148
|
+
* ```ts
|
|
5149
|
+
* const tag: PptxTag = { name: "CUSTOM_ID", value: "12345" };
|
|
5150
|
+
* // => satisfies PptxTag
|
|
5151
|
+
* ```
|
|
5152
|
+
*/
|
|
5153
|
+
interface PptxTag {
|
|
5154
|
+
name: string;
|
|
5155
|
+
value: string;
|
|
5156
|
+
}
|
|
5157
|
+
/**
|
|
5158
|
+
* A collection of tags from a single tags XML part.
|
|
5159
|
+
*
|
|
5160
|
+
* @example
|
|
5161
|
+
* ```ts
|
|
5162
|
+
* const coll: PptxTagCollection = {
|
|
5163
|
+
* path: "ppt/tags/tag1.xml",
|
|
5164
|
+
* tags: [{ name: "CUSTOM_ID", value: "12345" }],
|
|
5165
|
+
* };
|
|
5166
|
+
* // => satisfies PptxTagCollection
|
|
5167
|
+
* ```
|
|
5168
|
+
*/
|
|
5169
|
+
interface PptxTagCollection {
|
|
5170
|
+
/** File path within the PPTX archive. */
|
|
5171
|
+
path?: string;
|
|
5172
|
+
/** Package owner of the tags relationship. New collections default to presentation. */
|
|
5173
|
+
owner?: 'presentation' | 'slide' | 'part';
|
|
5174
|
+
/** Source OPC part that owns the relationship, e.g. ppt/slides/slide1.xml. */
|
|
5175
|
+
sourcePartPath?: string;
|
|
5176
|
+
/** Durable relationship identifier from the owning part. */
|
|
5177
|
+
relationshipId?: string;
|
|
5178
|
+
/** Tags in this collection. */
|
|
5179
|
+
tags: PptxTag[];
|
|
5180
|
+
/** Parsed tag-list XML retained for unknown-node preservation. */
|
|
5181
|
+
rawXml?: XmlObject;
|
|
5182
|
+
}
|
|
5183
|
+
/**
|
|
5184
|
+
* A custom document property from `docProps/custom.xml`.
|
|
5185
|
+
*
|
|
5186
|
+
* @example
|
|
5187
|
+
* ```ts
|
|
5188
|
+
* const prop: PptxCustomProperty = {
|
|
5189
|
+
* name: "Project",
|
|
5190
|
+
* value: "pptx",
|
|
5191
|
+
* type: "lpwstr",
|
|
5192
|
+
* };
|
|
5193
|
+
* // => satisfies PptxCustomProperty
|
|
5194
|
+
* ```
|
|
5195
|
+
*/
|
|
5196
|
+
interface PptxCustomProperty {
|
|
5197
|
+
/** Property name. */
|
|
5198
|
+
name: string;
|
|
5199
|
+
/** Property value (always stringified). */
|
|
5200
|
+
value: string;
|
|
5201
|
+
/** Original VT type (e.g. "lpwstr", "i4", "bool", "filetime"). */
|
|
5202
|
+
type: string;
|
|
5203
|
+
}
|
|
5204
|
+
/**
|
|
5205
|
+
* Core document properties from `docProps/core.xml` (Dublin Core + OOXML).
|
|
5206
|
+
*
|
|
5207
|
+
* @example
|
|
5208
|
+
* ```ts
|
|
5209
|
+
* const core: PptxCoreProperties = {
|
|
5210
|
+
* title: "Q4 Business Review",
|
|
5211
|
+
* creator: "Alice",
|
|
5212
|
+
* created: "2024-01-15T08:00:00Z",
|
|
5213
|
+
* modified: "2024-06-01T12:30:00Z",
|
|
5214
|
+
* lastModifiedBy: "Bob",
|
|
5215
|
+
* };
|
|
5216
|
+
* // => satisfies PptxCoreProperties
|
|
5217
|
+
* ```
|
|
5218
|
+
*/
|
|
5219
|
+
interface PptxCoreProperties {
|
|
5220
|
+
/** dc:title */
|
|
5221
|
+
title?: string;
|
|
5222
|
+
/** dc:subject */
|
|
5223
|
+
subject?: string;
|
|
5224
|
+
/** dc:creator */
|
|
5225
|
+
creator?: string;
|
|
5226
|
+
/** cp:keywords */
|
|
5227
|
+
keywords?: string;
|
|
5228
|
+
/** dc:description */
|
|
5229
|
+
description?: string;
|
|
5230
|
+
/** cp:lastModifiedBy */
|
|
5231
|
+
lastModifiedBy?: string;
|
|
5232
|
+
/** cp:revision */
|
|
5233
|
+
revision?: string;
|
|
5234
|
+
/** dcterms:created (ISO 8601) */
|
|
5235
|
+
created?: string;
|
|
5236
|
+
/** dcterms:modified (ISO 8601) */
|
|
5237
|
+
modified?: string;
|
|
5238
|
+
/** cp:category */
|
|
5239
|
+
category?: string;
|
|
5240
|
+
/** cp:contentStatus */
|
|
5241
|
+
contentStatus?: string;
|
|
5242
|
+
}
|
|
5243
|
+
/**
|
|
5244
|
+
* Extended (application) properties from `docProps/app.xml`.
|
|
5245
|
+
*
|
|
5246
|
+
* @example
|
|
5247
|
+
* ```ts
|
|
5248
|
+
* const app: PptxAppProperties = {
|
|
5249
|
+
* application: "Microsoft Office PowerPoint",
|
|
5250
|
+
* appVersion: "16.0000",
|
|
5251
|
+
* slides: 24,
|
|
5252
|
+
* words: 1500,
|
|
5253
|
+
* company: "Acme Corp",
|
|
5254
|
+
* };
|
|
5255
|
+
* // => satisfies PptxAppProperties
|
|
5256
|
+
* ```
|
|
5257
|
+
*/
|
|
5258
|
+
interface PptxAppProperties {
|
|
5259
|
+
/** Application name (e.g. "Microsoft Office PowerPoint"). */
|
|
5260
|
+
application?: string;
|
|
5261
|
+
/** Application version string. */
|
|
5262
|
+
appVersion?: string;
|
|
5263
|
+
/** Presentation format (e.g. "On-screen Show (16:9)"). */
|
|
5264
|
+
presentationFormat?: string;
|
|
5265
|
+
/** Total number of slides. */
|
|
5266
|
+
slides?: number;
|
|
5267
|
+
/** Number of hidden slides. */
|
|
5268
|
+
hiddenSlides?: number;
|
|
5269
|
+
/** Number of notes slides. */
|
|
5270
|
+
notes?: number;
|
|
5271
|
+
/** Total editing time in minutes. */
|
|
5272
|
+
totalTime?: number;
|
|
5273
|
+
/** Number of words. */
|
|
5274
|
+
words?: number;
|
|
5275
|
+
/** Number of paragraphs. */
|
|
5276
|
+
paragraphs?: number;
|
|
5277
|
+
/** Company name. */
|
|
5278
|
+
company?: string;
|
|
5279
|
+
/** Manager name. */
|
|
5280
|
+
manager?: string;
|
|
5281
|
+
/** Template name. */
|
|
5282
|
+
template?: string;
|
|
5283
|
+
/** Hyperlink base URL. */
|
|
5284
|
+
hyperlinkBase?: string;
|
|
5285
|
+
}
|
|
5286
|
+
|
|
5287
|
+
type PptxPrintOutput = 'slides' | 'handouts1' | 'handouts2' | 'handouts3' | 'handouts4' | 'handouts6' | 'handouts9' | 'notes' | 'outline';
|
|
5288
|
+
type PptxPrintColorMode = 'bw' | 'gray' | 'clr';
|
|
5289
|
+
/** PresentationML `CT_PrintProperties` (`p:prnPr`). */
|
|
5290
|
+
interface PptxPresentationPrintProperties {
|
|
5291
|
+
printWhat?: PptxPrintOutput | null;
|
|
5292
|
+
colorMode?: PptxPrintColorMode | null;
|
|
5293
|
+
hiddenSlides?: boolean | null;
|
|
5294
|
+
scaleToFitPaper?: boolean | null;
|
|
5295
|
+
frameSlides?: boolean | null;
|
|
5296
|
+
/** Original subtree retained for unknown attributes and `p:extLst`. */
|
|
5297
|
+
rawXml?: XmlObject;
|
|
5298
|
+
}
|
|
5299
|
+
/**
|
|
5300
|
+
* Resolved hex values for the 12 theme colour slots.
|
|
5301
|
+
*
|
|
5302
|
+
* @example
|
|
5303
|
+
* ```ts
|
|
5304
|
+
* const scheme: PptxThemeColorScheme = {
|
|
5305
|
+
* dk1: "#000000", lt1: "#FFFFFF",
|
|
5306
|
+
* dk2: "#1F497D", lt2: "#EEECE1",
|
|
5307
|
+
* accent1: "#4F81BD", accent2: "#C0504D",
|
|
5308
|
+
* accent3: "#9BBB59", accent4: "#8064A2",
|
|
5309
|
+
* accent5: "#4BACC6", accent6: "#F79646",
|
|
5310
|
+
* hlink: "#0000FF", folHlink: "#800080",
|
|
5311
|
+
* };
|
|
5312
|
+
* // => satisfies PptxThemeColorScheme
|
|
5313
|
+
* ```
|
|
5314
|
+
*/
|
|
5315
|
+
interface PptxThemeColorScheme {
|
|
5316
|
+
dk1: string;
|
|
5317
|
+
lt1: string;
|
|
5318
|
+
dk2: string;
|
|
5319
|
+
lt2: string;
|
|
5320
|
+
accent1: string;
|
|
5321
|
+
accent2: string;
|
|
5322
|
+
accent3: string;
|
|
5323
|
+
accent4: string;
|
|
5324
|
+
accent5: string;
|
|
5325
|
+
accent6: string;
|
|
5326
|
+
hlink: string;
|
|
5327
|
+
folHlink: string;
|
|
5328
|
+
}
|
|
5329
|
+
/**
|
|
5330
|
+
* A font-family triplet for major or minor theme fonts.
|
|
5331
|
+
*
|
|
5332
|
+
* Supports Latin, East Asian, and Complex Script font families.
|
|
5333
|
+
*
|
|
5334
|
+
* @example
|
|
5335
|
+
* ```ts
|
|
5336
|
+
* const fonts: PptxThemeFontGroup = {
|
|
5337
|
+
* latin: "Calibri Light",
|
|
5338
|
+
* eastAsia: "MS PGothic",
|
|
5339
|
+
* complexScript: "Arial",
|
|
5340
|
+
* };
|
|
5341
|
+
* // => satisfies PptxThemeFontGroup
|
|
5342
|
+
* ```
|
|
5343
|
+
*/
|
|
5344
|
+
interface PptxThemeFontGroup {
|
|
5345
|
+
latin?: string;
|
|
5346
|
+
eastAsia?: string;
|
|
5347
|
+
complexScript?: string;
|
|
5348
|
+
/**
|
|
5349
|
+
* Per-script typeface overrides (`<a:font script="Hans|Hant|Arab|Hebr|
|
|
5350
|
+
* Thai|Beng|Gujr|Khmr|Knda|…"/>` per ECMA-376 §20.1.4.1.16). Keyed by
|
|
5351
|
+
* the four-letter ISO 15924 script tag from the `script` attribute.
|
|
5352
|
+
*
|
|
5353
|
+
* Phase 4 Stream A / M4.
|
|
5354
|
+
*/
|
|
5355
|
+
byScript?: Record<string, string>;
|
|
5356
|
+
}
|
|
5357
|
+
/**
|
|
5358
|
+
* Theme font scheme — major (headings) and minor (body) font families.
|
|
5359
|
+
*
|
|
5360
|
+
* @example
|
|
5361
|
+
* ```ts
|
|
5362
|
+
* const scheme: PptxThemeFontScheme = {
|
|
5363
|
+
* majorFont: { latin: "Calibri Light" },
|
|
5364
|
+
* minorFont: { latin: "Calibri", eastAsia: "MS PGothic" },
|
|
5365
|
+
* };
|
|
5366
|
+
* // => satisfies PptxThemeFontScheme
|
|
5367
|
+
* ```
|
|
5368
|
+
*/
|
|
5369
|
+
interface PptxThemeFontScheme {
|
|
5370
|
+
majorFont?: PptxThemeFontGroup;
|
|
5371
|
+
minorFont?: PptxThemeFontGroup;
|
|
5372
|
+
}
|
|
5373
|
+
/**
|
|
5374
|
+
* A single fill style entry from the theme format scheme.
|
|
5375
|
+
* Each entry is one of: solid, gradient, pattern, or no fill.
|
|
5376
|
+
* The raw XML node is also stored so that `phClr` substitution can happen
|
|
5377
|
+
* at resolution time.
|
|
5378
|
+
*
|
|
5379
|
+
* @example
|
|
5380
|
+
* ```ts
|
|
5381
|
+
* const solidFill: PptxThemeFillStyle = {
|
|
5382
|
+
* kind: "solid",
|
|
5383
|
+
* color: "#4F81BD",
|
|
5384
|
+
* opacity: 1,
|
|
5385
|
+
* };
|
|
5386
|
+
*
|
|
5387
|
+
* const gradientFill: PptxThemeFillStyle = {
|
|
5388
|
+
* kind: "gradient",
|
|
5389
|
+
* gradientAngle: 90,
|
|
5390
|
+
* gradientType: "linear",
|
|
5391
|
+
* gradientStops: [
|
|
5392
|
+
* { color: "#4F81BD", position: 0 },
|
|
5393
|
+
* { color: "#1F497D", position: 1 },
|
|
5394
|
+
* ],
|
|
5395
|
+
* };
|
|
5396
|
+
* // => satisfies PptxThemeFillStyle
|
|
5397
|
+
* ```
|
|
5398
|
+
*/
|
|
5399
|
+
interface PptxThemeFillStyle {
|
|
5400
|
+
/**
|
|
5401
|
+
* Discriminator for the fill type.
|
|
5402
|
+
*
|
|
5403
|
+
* `'group'` corresponds to `<a:grpFill/>` — a fill that inherits the
|
|
5404
|
+
* containing group shape's fill at render time. Captured for round-trip
|
|
5405
|
+
* preservation in `fmtScheme/fillStyleLst`.
|
|
5406
|
+
*/
|
|
5407
|
+
kind: 'solid' | 'gradient' | 'pattern' | 'none' | 'group';
|
|
5408
|
+
/** Pre-resolved colour (may be `undefined` when `phClr`-dependent). */
|
|
5409
|
+
color?: string;
|
|
5410
|
+
opacity?: number;
|
|
5411
|
+
/** Gradient-specific fields (only present when `kind === "gradient"`). */
|
|
5412
|
+
gradientStops?: Array<{
|
|
5413
|
+
color: string;
|
|
5414
|
+
position: number;
|
|
5415
|
+
opacity?: number;
|
|
5416
|
+
}>;
|
|
5417
|
+
gradientAngle?: number;
|
|
5418
|
+
gradientType?: 'linear' | 'radial';
|
|
5419
|
+
gradientCss?: string;
|
|
5420
|
+
/** Pattern-specific fields (only present when `kind === "pattern"`). */
|
|
5421
|
+
patternPreset?: string;
|
|
5422
|
+
patternBackgroundColor?: string;
|
|
5423
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
5424
|
+
rawNode?: unknown;
|
|
5425
|
+
}
|
|
5426
|
+
/**
|
|
5427
|
+
* A single line style entry from `a:lnStyleLst`.
|
|
5428
|
+
* Provides width, dash, join, cap, and optional fill colour.
|
|
5429
|
+
*
|
|
5430
|
+
* @example
|
|
5431
|
+
* ```ts
|
|
5432
|
+
* const line: PptxThemeLineStyle = {
|
|
5433
|
+
* width: 1.5,
|
|
5434
|
+
* color: "#4F81BD",
|
|
5435
|
+
* dash: "solid",
|
|
5436
|
+
* lineJoin: "round",
|
|
5437
|
+
* lineCap: "flat",
|
|
5438
|
+
* };
|
|
5439
|
+
* // => satisfies PptxThemeLineStyle
|
|
5440
|
+
* ```
|
|
5441
|
+
*/
|
|
5442
|
+
interface PptxThemeLineStyle {
|
|
5443
|
+
/** Line width in pixels (converted from EMU). */
|
|
5444
|
+
width?: number;
|
|
5445
|
+
color?: string;
|
|
5446
|
+
opacity?: number;
|
|
5447
|
+
dash?: string;
|
|
5448
|
+
lineJoin?: 'round' | 'bevel' | 'miter';
|
|
5449
|
+
lineCap?: 'flat' | 'rnd' | 'sq';
|
|
5450
|
+
compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
|
|
5451
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
5452
|
+
rawNode?: unknown;
|
|
5453
|
+
}
|
|
5454
|
+
/**
|
|
5455
|
+
* A single effect style entry from `a:effectStyleLst`.
|
|
5456
|
+
* Each entry may define shadow, glow, soft-edge, reflection, blur,
|
|
5457
|
+
* and optionally a 3-D scene/shape.
|
|
5458
|
+
*
|
|
5459
|
+
* @example
|
|
5460
|
+
* ```ts
|
|
5461
|
+
* const dropShadow: PptxThemeEffectStyle = {
|
|
5462
|
+
* shadowColor: "#000000",
|
|
5463
|
+
* shadowBlur: 4,
|
|
5464
|
+
* shadowOffsetX: 2,
|
|
5465
|
+
* shadowOffsetY: 3,
|
|
5466
|
+
* shadowOpacity: 0.4,
|
|
5467
|
+
* };
|
|
5468
|
+
* // => satisfies PptxThemeEffectStyle
|
|
5469
|
+
* ```
|
|
5470
|
+
*/
|
|
5471
|
+
interface PptxThemeEffectStyle {
|
|
5472
|
+
shadowColor?: string;
|
|
5473
|
+
shadowBlur?: number;
|
|
5474
|
+
shadowOffsetX?: number;
|
|
5475
|
+
shadowOffsetY?: number;
|
|
5476
|
+
shadowOpacity?: number;
|
|
5477
|
+
glowColor?: string;
|
|
5478
|
+
glowRadius?: number;
|
|
5479
|
+
glowOpacity?: number;
|
|
5480
|
+
softEdgeRadius?: number;
|
|
5481
|
+
innerShadowColor?: string;
|
|
5482
|
+
innerShadowOpacity?: number;
|
|
5483
|
+
innerShadowBlur?: number;
|
|
5484
|
+
innerShadowOffsetX?: number;
|
|
5485
|
+
innerShadowOffsetY?: number;
|
|
5486
|
+
reflectionBlurRadius?: number;
|
|
5487
|
+
reflectionStartOpacity?: number;
|
|
5488
|
+
reflectionEndOpacity?: number;
|
|
5489
|
+
reflectionEndPosition?: number;
|
|
5490
|
+
reflectionDirection?: number;
|
|
5491
|
+
reflectionRotation?: number;
|
|
5492
|
+
reflectionDistance?: number;
|
|
5493
|
+
/** 3D scene/camera from `a:scene3d` on the effect style (idx 3 typically). */
|
|
5494
|
+
scene3d?: Pptx3DScene;
|
|
5495
|
+
/** 3D shape extrusion/bevel from `a:sp3d` on the effect style (idx 3 typically). */
|
|
5496
|
+
shape3d?: Pptx3DShape;
|
|
5497
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
5498
|
+
rawNode?: unknown;
|
|
5499
|
+
}
|
|
5500
|
+
/**
|
|
5501
|
+
* The full parsed format scheme from `a:fmtScheme` inside `a:themeElements`.
|
|
5502
|
+
* Contains three fill style lists and one line/effect style list each,
|
|
5503
|
+
* at three intensity levels: subtle (idx 1), moderate (idx 2), intense (idx 3).
|
|
5504
|
+
*
|
|
5505
|
+
* OOXML reference indices:
|
|
5506
|
+
* - fillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1-3)
|
|
5507
|
+
* - lnStyleLst: idx 1-3 (used by `a:lnRef @idx` 1-3)
|
|
5508
|
+
* - effectStyleLst: idx 1-3 (used by `a:effectRef @idx` 1-3)
|
|
5509
|
+
* - bgFillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1001-1003)
|
|
5510
|
+
*
|
|
5511
|
+
* @example
|
|
5512
|
+
* ```ts
|
|
5513
|
+
* const fmt: PptxThemeFormatScheme = {
|
|
5514
|
+
* name: "Office",
|
|
5515
|
+
* fillStyles: [solidFill, gradientFill, intenseFill],
|
|
5516
|
+
* lineStyles: [thinLine, mediumLine, thickLine],
|
|
5517
|
+
* effectStyles: [subtle, moderate, intense],
|
|
5518
|
+
* backgroundFillStyles: [solidBg, gradientBg, intenseBg],
|
|
5519
|
+
* };
|
|
5520
|
+
* // => satisfies PptxThemeFormatScheme
|
|
5521
|
+
* ```
|
|
5522
|
+
*/
|
|
5523
|
+
interface PptxThemeFormatScheme {
|
|
5524
|
+
/** The `@name` attribute of the format scheme. */
|
|
5525
|
+
name?: string;
|
|
5526
|
+
/** Fill styles at indices 1-3 (subtle, moderate, intense). */
|
|
5527
|
+
fillStyles: PptxThemeFillStyle[];
|
|
5528
|
+
/** Line styles at indices 1-3. */
|
|
5529
|
+
lineStyles: PptxThemeLineStyle[];
|
|
5530
|
+
/** Effect styles at indices 1-3. */
|
|
5531
|
+
effectStyles: PptxThemeEffectStyle[];
|
|
5532
|
+
/** Background fill styles at indices 1-3 (referenced via idx 1001-1003). */
|
|
5533
|
+
backgroundFillStyles: PptxThemeFillStyle[];
|
|
5534
|
+
}
|
|
5535
|
+
/**
|
|
5536
|
+
* Full parsed theme object available to renderers.
|
|
5537
|
+
*
|
|
5538
|
+
* @example
|
|
5539
|
+
* ```ts
|
|
5540
|
+
* const theme: PptxTheme = {
|
|
5541
|
+
* name: "Office Theme",
|
|
5542
|
+
* colorScheme: { dk1: "#000", lt1: "#FFF", /* … *\/ },
|
|
5543
|
+
* fontScheme: {
|
|
5544
|
+
* majorFont: { latin: "Calibri Light" },
|
|
5545
|
+
* minorFont: { latin: "Calibri" },
|
|
5546
|
+
* },
|
|
5547
|
+
* };
|
|
5548
|
+
* // => satisfies PptxTheme
|
|
5549
|
+
* ```
|
|
5550
|
+
*/
|
|
5551
|
+
interface PptxTheme {
|
|
5552
|
+
/** Theme name from `a:theme @name`. */
|
|
5553
|
+
name?: string;
|
|
5554
|
+
/** Resolved colour scheme. */
|
|
5555
|
+
colorScheme?: PptxThemeColorScheme;
|
|
5556
|
+
/** Resolved font scheme. */
|
|
5557
|
+
fontScheme?: PptxThemeFontScheme;
|
|
5558
|
+
/** Format scheme — fill, line, effect and background fill style matrices. */
|
|
5559
|
+
formatScheme?: PptxThemeFormatScheme;
|
|
5560
|
+
}
|
|
4451
5561
|
|
|
4452
5562
|
/**
|
|
4453
5563
|
* Slide transition types and the {@link PptxSlideTransition} data structure.
|
|
@@ -4527,6 +5637,124 @@ interface PptxSlideTransition {
|
|
|
4527
5637
|
rawTransition?: XmlObject;
|
|
4528
5638
|
}
|
|
4529
5639
|
|
|
5640
|
+
/**
|
|
5641
|
+
* View properties types parsed from `ppt/viewProps.xml`.
|
|
5642
|
+
*
|
|
5643
|
+
* Models the `p:viewPr` element and its child views:
|
|
5644
|
+
* normalViewPr, slideViewPr, outlineViewPr, notesTextViewPr,
|
|
5645
|
+
* sorterViewPr, notesViewPr.
|
|
5646
|
+
*
|
|
5647
|
+
* @module pptx-types/view-properties
|
|
5648
|
+
*/
|
|
5649
|
+
/**
|
|
5650
|
+
* Scale factor for a view (numerator / denominator percentage).
|
|
5651
|
+
*/
|
|
5652
|
+
interface PptxViewScale {
|
|
5653
|
+
/** Numerator of the scale percentage (e.g. 100 for 100%). */
|
|
5654
|
+
n: number;
|
|
5655
|
+
/** Denominator of the scale percentage (e.g. 100 for 100%). */
|
|
5656
|
+
d: number;
|
|
5657
|
+
/** Optional independent vertical scale. When absent, the X scale is used. */
|
|
5658
|
+
sy?: {
|
|
5659
|
+
n: number;
|
|
5660
|
+
d: number;
|
|
5661
|
+
};
|
|
5662
|
+
}
|
|
5663
|
+
/**
|
|
5664
|
+
* Origin point for a view (x, y in twips or EMU).
|
|
5665
|
+
*/
|
|
5666
|
+
interface PptxViewOrigin {
|
|
5667
|
+
x: number;
|
|
5668
|
+
y: number;
|
|
5669
|
+
}
|
|
5670
|
+
/** A horizontal or vertical drawing guide in slide coordinates. */
|
|
5671
|
+
interface PptxViewGuide {
|
|
5672
|
+
orientation?: 'horz' | 'vert';
|
|
5673
|
+
position?: number;
|
|
5674
|
+
}
|
|
5675
|
+
/** Positive grid spacing from `p:gridSpacing`. */
|
|
5676
|
+
interface PptxGridSpacing {
|
|
5677
|
+
cx: number;
|
|
5678
|
+
cy: number;
|
|
5679
|
+
}
|
|
5680
|
+
/**
|
|
5681
|
+
* Restored region dimensions for normal view splitter.
|
|
5682
|
+
* Represents `p:restoredLeft` or `p:restoredTop`.
|
|
5683
|
+
*/
|
|
5684
|
+
interface PptxRestoredRegion {
|
|
5685
|
+
/** Size as a percentage of the available space (thousandths of a percent). */
|
|
5686
|
+
sz: number;
|
|
5687
|
+
/** Whether auto-adjust is enabled. */
|
|
5688
|
+
autoAdjust?: boolean;
|
|
5689
|
+
}
|
|
5690
|
+
/**
|
|
5691
|
+
* Normal view properties (`p:normalViewPr`).
|
|
5692
|
+
* Controls the splitter positions in normal (editing) view.
|
|
5693
|
+
*/
|
|
5694
|
+
interface PptxNormalViewProperties {
|
|
5695
|
+
/** Whether to show outline icons in the slide panel. */
|
|
5696
|
+
showOutlineIcons?: boolean;
|
|
5697
|
+
/** Whether the outline/slide panel is snapped closed. */
|
|
5698
|
+
snapVertSplitter?: boolean;
|
|
5699
|
+
/** Vertical splitter bar state: 'minimized' | 'maximized' | 'restored'. */
|
|
5700
|
+
vertBarState?: string;
|
|
5701
|
+
/** Horizontal splitter bar state. */
|
|
5702
|
+
horzBarState?: string;
|
|
5703
|
+
/** Whether to prefer single-slide view in the panel. */
|
|
5704
|
+
preferSingleView?: boolean;
|
|
5705
|
+
/** Restored left region (slide panel width). */
|
|
5706
|
+
restoredLeft?: PptxRestoredRegion;
|
|
5707
|
+
/** Restored top region (notes panel height). */
|
|
5708
|
+
restoredTop?: PptxRestoredRegion;
|
|
5709
|
+
}
|
|
5710
|
+
/**
|
|
5711
|
+
* Common slide view properties shared by slideViewPr, outlineViewPr,
|
|
5712
|
+
* notesTextViewPr, and notesViewPr.
|
|
5713
|
+
*/
|
|
5714
|
+
interface PptxCommonSlideViewProperties {
|
|
5715
|
+
/** Whether snap-to-grid is enabled. */
|
|
5716
|
+
snapToGrid?: boolean;
|
|
5717
|
+
/** Whether snap-to-objects is enabled. */
|
|
5718
|
+
snapToObjects?: boolean;
|
|
5719
|
+
/** Whether drawing guides are shown. */
|
|
5720
|
+
showGuides?: boolean;
|
|
5721
|
+
/** Whether the application may vary the scale automatically. */
|
|
5722
|
+
variableScale?: boolean;
|
|
5723
|
+
/** Drawing guides shown in this slide view. */
|
|
5724
|
+
guides?: PptxViewGuide[];
|
|
5725
|
+
/** View origin (scroll position). */
|
|
5726
|
+
origin?: PptxViewOrigin;
|
|
5727
|
+
/** View scale. */
|
|
5728
|
+
scale?: PptxViewScale;
|
|
5729
|
+
}
|
|
5730
|
+
/**
|
|
5731
|
+
* Full view properties from `ppt/viewProps.xml`.
|
|
5732
|
+
*/
|
|
5733
|
+
interface PptxViewProperties {
|
|
5734
|
+
/** Last used view type (`p:viewPr/@lastView`). */
|
|
5735
|
+
lastView?: string;
|
|
5736
|
+
/** Whether comments are shown (`p:viewPr/@showComments`). */
|
|
5737
|
+
showComments?: boolean;
|
|
5738
|
+
/** Normal view properties (splitter positions). */
|
|
5739
|
+
normalViewPr?: PptxNormalViewProperties;
|
|
5740
|
+
/** Slide view properties. */
|
|
5741
|
+
slideViewPr?: PptxCommonSlideViewProperties;
|
|
5742
|
+
/** Outline view properties. */
|
|
5743
|
+
outlineViewPr?: PptxCommonSlideViewProperties;
|
|
5744
|
+
/** Notes text view properties. */
|
|
5745
|
+
notesTextViewPr?: PptxCommonSlideViewProperties;
|
|
5746
|
+
/** Sorter view scale. */
|
|
5747
|
+
sorterViewPr?: {
|
|
5748
|
+
scale?: PptxViewScale;
|
|
5749
|
+
};
|
|
5750
|
+
/** Notes view properties. */
|
|
5751
|
+
notesViewPr?: PptxCommonSlideViewProperties;
|
|
5752
|
+
/** Grid spacing in positive DrawingML coordinates. */
|
|
5753
|
+
gridSpacing?: PptxGridSpacing;
|
|
5754
|
+
/** Raw XML preserved for lossless round-trip of unparsed attributes. */
|
|
5755
|
+
rawXml?: Record<string, unknown>;
|
|
5756
|
+
}
|
|
5757
|
+
|
|
4530
5758
|
/**
|
|
4531
5759
|
* A customer data reference from `p:custDataLst / p:custData`.
|
|
4532
5760
|
*
|
|
@@ -4537,12 +5765,16 @@ interface PptxSlideTransition {
|
|
|
4537
5765
|
* @see ECMA-376 Part 1, §19.2.1.3 (custDataLst), §19.3.1.6 (custData)
|
|
4538
5766
|
*/
|
|
4539
5767
|
interface PptxCustomerData {
|
|
4540
|
-
/** Resolved part path inside the package (e.g. `
|
|
4541
|
-
id
|
|
5768
|
+
/** Resolved part path inside the package (e.g. `customXml/item1.xml`). */
|
|
5769
|
+
id?: string;
|
|
4542
5770
|
/** Relationship ID referencing the custom data part. */
|
|
4543
|
-
relId
|
|
5771
|
+
relId?: string;
|
|
4544
5772
|
/** Raw string content of the custom data part (if resolvable). */
|
|
4545
5773
|
data?: string;
|
|
5774
|
+
/** OPC content type for the custom data part. */
|
|
5775
|
+
contentType?: string;
|
|
5776
|
+
/** Raw `p:custData` XML retained for unknown-node preservation. */
|
|
5777
|
+
rawXml?: XmlObject;
|
|
4546
5778
|
}
|
|
4547
5779
|
/**
|
|
4548
5780
|
* An ActiveX control reference from `p:controls / p:control`.
|
|
@@ -4706,6 +5938,571 @@ interface PptxSlideSyncProperties {
|
|
|
4706
5938
|
partPath?: string;
|
|
4707
5939
|
relationshipId?: string;
|
|
4708
5940
|
}
|
|
5941
|
+
/**
|
|
5942
|
+
* A slide layout available in the loaded presentation.
|
|
5943
|
+
*
|
|
5944
|
+
* Each entry maps to a `<p:sldLayout>` inside `ppt/slideLayouts/`.
|
|
5945
|
+
*
|
|
5946
|
+
* @example
|
|
5947
|
+
* ```ts
|
|
5948
|
+
* const layout: PptxLayoutOption = {
|
|
5949
|
+
* path: "ppt/slideLayouts/slideLayout2.xml",
|
|
5950
|
+
* name: "Title and Content",
|
|
5951
|
+
* };
|
|
5952
|
+
* // => satisfies PptxLayoutOption
|
|
5953
|
+
* ```
|
|
5954
|
+
*/
|
|
5955
|
+
interface PptxLayoutOption {
|
|
5956
|
+
path: string;
|
|
5957
|
+
name: string;
|
|
5958
|
+
/** Standard layout type from `p:sldLayout/@type` (e.g. "obj", "twoColTx", "blank"). */
|
|
5959
|
+
type?: string;
|
|
5960
|
+
/** ZIP path of the slide master this layout belongs to. */
|
|
5961
|
+
masterPath?: string;
|
|
5962
|
+
}
|
|
5963
|
+
/**
|
|
5964
|
+
* Header, footer, date-time, and slide-number placeholders.
|
|
5965
|
+
*
|
|
5966
|
+
* Parsed from `ppt/presProps.xml` and individual slide layouts.
|
|
5967
|
+
*
|
|
5968
|
+
* @example
|
|
5969
|
+
* ```ts
|
|
5970
|
+
* const hf: PptxHeaderFooter = {
|
|
5971
|
+
* hasFooter: true,
|
|
5972
|
+
* footerText: "Confidential",
|
|
5973
|
+
* hasSlideNumber: true,
|
|
5974
|
+
* };
|
|
5975
|
+
* // => satisfies PptxHeaderFooter
|
|
5976
|
+
* ```
|
|
5977
|
+
*/
|
|
5978
|
+
interface PptxHeaderFooter {
|
|
5979
|
+
hasHeader?: boolean;
|
|
5980
|
+
headerText?: string;
|
|
5981
|
+
hasFooter?: boolean;
|
|
5982
|
+
footerText?: string;
|
|
5983
|
+
hasDateTime?: boolean;
|
|
5984
|
+
dateTimeText?: string;
|
|
5985
|
+
dateTimeAuto?: boolean;
|
|
5986
|
+
/** OOXML date format pattern (e.g. "M/d/yyyy", "dddd, MMMM dd, yyyy"). */
|
|
5987
|
+
dateFormat?: string;
|
|
5988
|
+
hasSlideNumber?: boolean;
|
|
5989
|
+
}
|
|
5990
|
+
/**
|
|
5991
|
+
* Presentation-level properties parsed from `presentationPr.xml`.
|
|
5992
|
+
*
|
|
5993
|
+
* Controls slideshow behaviour, print settings, custom colours, and grid.
|
|
5994
|
+
*
|
|
5995
|
+
* @example
|
|
5996
|
+
* ```ts
|
|
5997
|
+
* const props: PptxPresentationProperties = {
|
|
5998
|
+
* showType: "presented",
|
|
5999
|
+
* loopContinuously: false,
|
|
6000
|
+
* advanceMode: "useTimings",
|
|
6001
|
+
* };
|
|
6002
|
+
* // => satisfies PptxPresentationProperties
|
|
6003
|
+
* ```
|
|
6004
|
+
*/
|
|
6005
|
+
interface PptxPresentationProperties {
|
|
6006
|
+
/** Show type: presented, browsed, kiosk. */
|
|
6007
|
+
showType?: 'presented' | 'browsed' | 'kiosk';
|
|
6008
|
+
/** Whether to loop the slideshow continuously. */
|
|
6009
|
+
loopContinuously?: boolean;
|
|
6010
|
+
/** Whether to show without narration. */
|
|
6011
|
+
showWithNarration?: boolean;
|
|
6012
|
+
/** Whether to show without animation. */
|
|
6013
|
+
showWithAnimation?: boolean;
|
|
6014
|
+
/** Advance slides mode: manual click or use stored timings. */
|
|
6015
|
+
advanceMode?: 'manual' | 'useTimings';
|
|
6016
|
+
/** Show slides: 'all', a custom show id, or a from-to range. */
|
|
6017
|
+
showSlidesMode?: 'all' | 'customShow' | 'range';
|
|
6018
|
+
/** Custom show id to use when showSlidesMode is 'customShow'. */
|
|
6019
|
+
showSlidesCustomShowId?: string;
|
|
6020
|
+
/** Slide range start (1-based) when showSlidesMode is 'range'. */
|
|
6021
|
+
showSlidesFrom?: number;
|
|
6022
|
+
/** Slide range end (1-based) when showSlidesMode is 'range'. */
|
|
6023
|
+
showSlidesTo?: number;
|
|
6024
|
+
/** Whether to show subtitles/captions during presentation mode. */
|
|
6025
|
+
showSubtitles?: boolean;
|
|
6026
|
+
/** Typed `p:prnPr` settings. Set to null during save to remove the element. */
|
|
6027
|
+
printProperties?: PptxPresentationPrintProperties | null;
|
|
6028
|
+
/** @deprecated Use `printProperties.printWhat`; retained as a handout compatibility alias. */
|
|
6029
|
+
printSlidesPerPage?: number;
|
|
6030
|
+
/** @deprecated Use `printProperties.frameSlides`. */
|
|
6031
|
+
printFrameSlides?: boolean;
|
|
6032
|
+
/** @deprecated Use `printProperties.colorMode`. */
|
|
6033
|
+
printColorMode?: 'clr' | 'gray' | 'bw';
|
|
6034
|
+
/** Most-recently-used colours from the presentation palette. */
|
|
6035
|
+
mruColors?: string[];
|
|
6036
|
+
/** Grid spacing in EMUs (cx, cy). Default is 914400 / 8 = 114300. */
|
|
6037
|
+
gridSpacing?: {
|
|
6038
|
+
cx: number;
|
|
6039
|
+
cy: number;
|
|
6040
|
+
};
|
|
6041
|
+
/** Pen colour for presentation mode annotations (from `p:showPr/p:penClr`). */
|
|
6042
|
+
penColor?: string;
|
|
6043
|
+
/** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
|
|
6044
|
+
kioskRestartTime?: number;
|
|
6045
|
+
}
|
|
6046
|
+
/**
|
|
6047
|
+
* A named custom slide show (`p:custShowLst / p:custShow`).
|
|
6048
|
+
*
|
|
6049
|
+
* Custom shows define ordered subsets of slides that can be presented
|
|
6050
|
+
* independently of the full deck.
|
|
6051
|
+
*
|
|
6052
|
+
* @example
|
|
6053
|
+
* ```ts
|
|
6054
|
+
* const show: PptxCustomShow = {
|
|
6055
|
+
* name: "Executive Summary",
|
|
6056
|
+
* id: "0",
|
|
6057
|
+
* slideRIds: ["rId2", "rId5", "rId8"],
|
|
6058
|
+
* };
|
|
6059
|
+
* // => satisfies PptxCustomShow
|
|
6060
|
+
* ```
|
|
6061
|
+
*/
|
|
6062
|
+
interface PptxCustomShow {
|
|
6063
|
+
/** Custom show name. */
|
|
6064
|
+
name: string;
|
|
6065
|
+
/** Custom show id. */
|
|
6066
|
+
id: string;
|
|
6067
|
+
/** Ordered list of slide relationship IDs included in this custom show. */
|
|
6068
|
+
slideRIds: string[];
|
|
6069
|
+
/** Original `p:custShow` subtree used to preserve unmodelled attributes and extensions. */
|
|
6070
|
+
rawXml?: XmlObject;
|
|
6071
|
+
}
|
|
6072
|
+
/**
|
|
6073
|
+
* An ordered section in the presentation (from `p:sectionLst` / `p14:sectionLst`).
|
|
6074
|
+
*
|
|
6075
|
+
* Sections group consecutive slides under a named heading (visible
|
|
6076
|
+
* in the PowerPoint slide sorter).
|
|
6077
|
+
*
|
|
6078
|
+
* @example
|
|
6079
|
+
* ```ts
|
|
6080
|
+
* const section: PptxSection = {
|
|
6081
|
+
* id: "sec_1",
|
|
6082
|
+
* name: "Introduction",
|
|
6083
|
+
* slideIds: ["256", "257"],
|
|
6084
|
+
* };
|
|
6085
|
+
* // => satisfies PptxSection
|
|
6086
|
+
* ```
|
|
6087
|
+
*/
|
|
6088
|
+
interface PptxSection {
|
|
6089
|
+
/** Section unique identifier (GUID or synthetic). */
|
|
6090
|
+
id: string;
|
|
6091
|
+
/** Human-readable section name. */
|
|
6092
|
+
name: string;
|
|
6093
|
+
/** Ordered list of numeric slide IDs that belong to this section. */
|
|
6094
|
+
slideIds: string[];
|
|
6095
|
+
/** Whether the section is collapsed in the slide sorter (from p15:sectionPr). */
|
|
6096
|
+
collapsed?: boolean;
|
|
6097
|
+
/** Section highlight color hex (from p15:sectionPr/@clr). */
|
|
6098
|
+
color?: string;
|
|
6099
|
+
/** Original section subtree used to preserve unmodelled attributes and extensions. */
|
|
6100
|
+
rawXml?: XmlObject;
|
|
6101
|
+
}
|
|
6102
|
+
/**
|
|
6103
|
+
* Write-protection hash data parsed from `p:modifyVerifier` in `presentation.xml`.
|
|
6104
|
+
*
|
|
6105
|
+
* When present, the presentation is marked as "read-only recommended" or
|
|
6106
|
+
* write-protected with a password hash. The hash parameters follow the
|
|
6107
|
+
* ECMA-376 Part 1, section 19.2.1.22 specification.
|
|
6108
|
+
*
|
|
6109
|
+
* @example
|
|
6110
|
+
* ```ts
|
|
6111
|
+
* const verifier: PptxModifyVerifier = {
|
|
6112
|
+
* algorithmName: "SHA-512",
|
|
6113
|
+
* hashData: "base64EncodedHash==",
|
|
6114
|
+
* saltData: "base64EncodedSalt==",
|
|
6115
|
+
* spinValue: 100000,
|
|
6116
|
+
* };
|
|
6117
|
+
* // => satisfies PptxModifyVerifier
|
|
6118
|
+
* ```
|
|
6119
|
+
*/
|
|
6120
|
+
interface PptxModifyVerifier {
|
|
6121
|
+
/** Hash algorithm name (e.g. "SHA-512", "SHA-1"). */
|
|
6122
|
+
algorithmName?: string;
|
|
6123
|
+
/** Base64-encoded hash value. */
|
|
6124
|
+
hashData?: string;
|
|
6125
|
+
/** Base64-encoded salt value. */
|
|
6126
|
+
saltData?: string;
|
|
6127
|
+
/** Number of hash iterations (spin count). */
|
|
6128
|
+
spinValue?: number;
|
|
6129
|
+
/** Legacy algorithm ID extension. */
|
|
6130
|
+
algIdExt?: string;
|
|
6131
|
+
/** Legacy algorithm ID. */
|
|
6132
|
+
cryptAlgorithmSid?: number;
|
|
6133
|
+
/** Cryptographic algorithm type (e.g. "typeAny"). */
|
|
6134
|
+
cryptAlgorithmType?: string;
|
|
6135
|
+
/** Cryptographic provider name. */
|
|
6136
|
+
cryptProvider?: string;
|
|
6137
|
+
/** Cryptographic provider type (e.g. "providerTypeRsaFull"). */
|
|
6138
|
+
cryptProviderType?: string;
|
|
6139
|
+
/** Cryptographic algorithm class (e.g. "hash"). */
|
|
6140
|
+
cryptAlgorithmClass?: string;
|
|
6141
|
+
}
|
|
6142
|
+
/**
|
|
6143
|
+
* Photo album metadata from `p:photoAlbum` in `presentation.xml`.
|
|
6144
|
+
*
|
|
6145
|
+
* Stores settings for presentations created via Insert > Photo Album.
|
|
6146
|
+
*
|
|
6147
|
+
* @see ECMA-376 Part 1, §19.2.1.27
|
|
6148
|
+
*/
|
|
6149
|
+
interface PptxPhotoAlbum {
|
|
6150
|
+
/** Whether photos are displayed in black-and-white. */
|
|
6151
|
+
bw?: boolean;
|
|
6152
|
+
/** Whether captions are shown below each photo. */
|
|
6153
|
+
showCaptions?: boolean;
|
|
6154
|
+
/** Photo album layout (e.g. "1pic", "2pic", "4pic", "fitToSlide"). */
|
|
6155
|
+
layout?: string;
|
|
6156
|
+
/** Frame style applied to each photo (e.g. "frameStyle1"). */
|
|
6157
|
+
frame?: string;
|
|
6158
|
+
}
|
|
6159
|
+
/**
|
|
6160
|
+
* East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
|
|
6161
|
+
*
|
|
6162
|
+
* Defines forbidden start/end characters for a given language so that
|
|
6163
|
+
* line-breaking follows East Asian typographic rules.
|
|
6164
|
+
*
|
|
6165
|
+
* @see ECMA-376 Part 1, §19.2.1.17
|
|
6166
|
+
*/
|
|
6167
|
+
interface PptxKinsoku {
|
|
6168
|
+
/** Language code (e.g. "ja-JP", "zh-CN"). */
|
|
6169
|
+
lang?: string | null;
|
|
6170
|
+
/** Characters that cannot begin a line. */
|
|
6171
|
+
invalStChars?: string;
|
|
6172
|
+
/** Characters that cannot end a line. */
|
|
6173
|
+
invalEndChars?: string;
|
|
6174
|
+
/** Original leaf retained for unknown attribute preservation. */
|
|
6175
|
+
rawXml?: XmlObject;
|
|
6176
|
+
}
|
|
6177
|
+
/**
|
|
6178
|
+
* Root data structure returned by {@link PptxHandlerCore.load}.
|
|
6179
|
+
*
|
|
6180
|
+
* Contains every slide, canvas dimensions, theme data, layout options,
|
|
6181
|
+
* metadata, and optional features (custom shows, sections, macros,
|
|
6182
|
+
* digital signatures, embedded fonts).
|
|
6183
|
+
*
|
|
6184
|
+
* @example
|
|
6185
|
+
* ```ts
|
|
6186
|
+
* const data: PptxData = await handler.load(buffer);
|
|
6187
|
+
* console.log(`${data.slides.length} slides, ${data.width}×${data.height}`);
|
|
6188
|
+
* // => e.g. "24 slides, 960×540"
|
|
6189
|
+
* ```
|
|
6190
|
+
*/
|
|
6191
|
+
interface PptxData {
|
|
6192
|
+
slides: PptxSlide[];
|
|
6193
|
+
width: number;
|
|
6194
|
+
height: number;
|
|
6195
|
+
/** Slide width in EMU (for save round-trip). */
|
|
6196
|
+
widthEmu?: number;
|
|
6197
|
+
/** Slide height in EMU (for save round-trip). */
|
|
6198
|
+
heightEmu?: number;
|
|
6199
|
+
/** Slide size type from `p:sldSz/@type` (e.g. "screen4x3", "screen16x9", "custom"). */
|
|
6200
|
+
slideSizeType?: string;
|
|
6201
|
+
/** Notes page width in EMU (from `p:notesSz`). */
|
|
6202
|
+
notesWidthEmu?: number;
|
|
6203
|
+
/** Notes page height in EMU (from `p:notesSz`). */
|
|
6204
|
+
notesHeightEmu?: number;
|
|
6205
|
+
layoutOptions?: PptxLayoutOption[];
|
|
6206
|
+
headerFooter?: PptxHeaderFooter;
|
|
6207
|
+
/** Presentation-level properties parsed from `presentationPr.xml`. */
|
|
6208
|
+
presentationProperties?: PptxPresentationProperties;
|
|
6209
|
+
/** Named custom slide shows from `p:custShowLst`. */
|
|
6210
|
+
customShows?: PptxCustomShow[];
|
|
6211
|
+
/** Ordered presentation sections from `p:sectionLst` / `p14:sectionLst`. */
|
|
6212
|
+
sections?: PptxSection[];
|
|
6213
|
+
warnings?: PptxCompatibilityWarning[];
|
|
6214
|
+
/** Map of theme colour scheme keys to resolved hex values. */
|
|
6215
|
+
themeColorMap?: Record<string, string>;
|
|
6216
|
+
/** Full parsed theme object with colours, fonts, and name. */
|
|
6217
|
+
theme?: PptxTheme;
|
|
6218
|
+
/** Available theme parts discovered in `ppt/theme/`. */
|
|
6219
|
+
themeOptions?: PptxThemeOption[];
|
|
6220
|
+
/** Parsed table style definitions from `ppt/tableStyles.xml`. */
|
|
6221
|
+
tableStyleMap?: ParsedTableStyleMap;
|
|
6222
|
+
/** Whether the presentation is password-protected. */
|
|
6223
|
+
isPasswordProtected?: boolean;
|
|
6224
|
+
/** Embedded font data (name + binary data URL) extracted from the presentation. */
|
|
6225
|
+
embeddedFonts?: PptxEmbeddedFont[];
|
|
6226
|
+
/** Typed `p:embeddedFontLst` package metadata, including unresolved variants. */
|
|
6227
|
+
embeddedFontList?: PptxEmbeddedFontList;
|
|
6228
|
+
/** Most-recently-used colour list from presentation properties. */
|
|
6229
|
+
mruColors?: string[];
|
|
6230
|
+
/** Parsed notes master data if present in the PPTX. */
|
|
6231
|
+
notesMaster?: PptxNotesMaster;
|
|
6232
|
+
/** Parsed handout master data if present in the PPTX. */
|
|
6233
|
+
handoutMaster?: PptxHandoutMaster;
|
|
6234
|
+
/** Structured slide master data for each master in the presentation. */
|
|
6235
|
+
slideMasters?: PptxSlideMaster[];
|
|
6236
|
+
/** Parsed tag collections attached to the presentation or slides. */
|
|
6237
|
+
tags?: PptxTagCollection[];
|
|
6238
|
+
/** Custom document properties from `docProps/custom.xml`. */
|
|
6239
|
+
customProperties?: PptxCustomProperty[];
|
|
6240
|
+
/** Core document properties from `docProps/core.xml`. */
|
|
6241
|
+
coreProperties?: PptxCoreProperties;
|
|
6242
|
+
/** Extended (application) properties from `docProps/app.xml`. */
|
|
6243
|
+
appProperties?: PptxAppProperties;
|
|
6244
|
+
/** Whether the presentation contains VBA macros (is a .pptm file). */
|
|
6245
|
+
hasMacros?: boolean;
|
|
6246
|
+
/** Whether the presentation contains digital signatures (`_xmlsignatures/` parts). */
|
|
6247
|
+
hasDigitalSignatures?: boolean;
|
|
6248
|
+
/** Number of digital signatures found. */
|
|
6249
|
+
digitalSignatureCount?: number;
|
|
6250
|
+
/** Presentation-level drawing guides from `p:extLst`. */
|
|
6251
|
+
presentationGuides?: PptxDrawingGuide[];
|
|
6252
|
+
/** View properties from `ppt/viewProps.xml`. */
|
|
6253
|
+
viewProperties?: PptxViewProperties;
|
|
6254
|
+
/** Write-protection verifier from `p:modifyVerifier` in `presentation.xml`. */
|
|
6255
|
+
modifyVerifier?: PptxModifyVerifier;
|
|
6256
|
+
/** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
|
|
6257
|
+
photoAlbum?: PptxPhotoAlbum;
|
|
6258
|
+
/** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
|
|
6259
|
+
kinsoku?: PptxKinsoku;
|
|
6260
|
+
/** Custom XML data parts from `customXml/` in the OPC package. */
|
|
6261
|
+
customXmlParts?: PptxCustomXmlPart[];
|
|
6262
|
+
/** Customer data references from `p:custDataLst` in `presentation.xml`. */
|
|
6263
|
+
customerData?: PptxCustomerData[];
|
|
6264
|
+
/** Thumbnail image binary data from `docProps/thumbnail.{jpeg,png}`. */
|
|
6265
|
+
thumbnailData?: Uint8Array;
|
|
6266
|
+
/** Comment authors parsed from `ppt/commentAuthors.xml` for round-trip preservation. */
|
|
6267
|
+
commentAuthors?: PptxCommentAuthor[];
|
|
6268
|
+
/** Office 2021 p188 authors from the modern Author part. */
|
|
6269
|
+
modernCommentAuthors?: PptxModernCommentAuthor[];
|
|
6270
|
+
/**
|
|
6271
|
+
* OOXML conformance class of the loaded file.
|
|
6272
|
+
* - `'strict'` -- ISO/IEC 29500 Strict (uses `purl.oclc.org` namespace URIs)
|
|
6273
|
+
* - `'transitional'` -- ECMA-376 Transitional (uses `schemas.openxmlformats.org` URIs)
|
|
6274
|
+
*
|
|
6275
|
+
* When saving, if the save option `conformance` is `'preserve'` (default),
|
|
6276
|
+
* the file will be saved using the same conformance class as the original.
|
|
6277
|
+
*/
|
|
6278
|
+
conformance?: 'strict' | 'transitional';
|
|
6279
|
+
}
|
|
6280
|
+
/**
|
|
6281
|
+
* Embedded font data extracted from a PPTX file.
|
|
6282
|
+
*
|
|
6283
|
+
* Used to register `@font-face` rules so the renderer can display
|
|
6284
|
+
* the correct typeface even when the system font is missing.
|
|
6285
|
+
*
|
|
6286
|
+
* @example
|
|
6287
|
+
* ```ts
|
|
6288
|
+
* const font: PptxEmbeddedFont = {
|
|
6289
|
+
* name: "CustomSans",
|
|
6290
|
+
* dataUrl: "data:font/truetype;base64,AAEAK...",
|
|
6291
|
+
* format: "truetype",
|
|
6292
|
+
* };
|
|
6293
|
+
* // => satisfies PptxEmbeddedFont
|
|
6294
|
+
* ```
|
|
6295
|
+
*/
|
|
6296
|
+
/**
|
|
6297
|
+
* A single Custom XML Data Part stored in `customXml/` within the OPC package.
|
|
6298
|
+
*
|
|
6299
|
+
* These parts are used by add-ins, data-binding, and enterprise templates
|
|
6300
|
+
* to store structured data alongside the presentation.
|
|
6301
|
+
*
|
|
6302
|
+
* @see ECMA-376 Part 1, §15.2.5
|
|
6303
|
+
*/
|
|
6304
|
+
interface PptxCustomXmlPart {
|
|
6305
|
+
/** Item number (e.g. "1" for `customXml/item1.xml`). */
|
|
6306
|
+
id: string;
|
|
6307
|
+
/** Raw XML string content of the custom XML item. */
|
|
6308
|
+
data: string;
|
|
6309
|
+
/** Schema target namespace URI from `itemProps` (ds:schemaRef/@ds:uri). */
|
|
6310
|
+
schemaUri?: string;
|
|
6311
|
+
/** Raw XML string content of the associated `itemProps` file. */
|
|
6312
|
+
properties?: string;
|
|
6313
|
+
/** Raw XML string content of the OPC relationship file (`customXml/_rels/item{id}.xml.rels`). */
|
|
6314
|
+
rels?: string;
|
|
6315
|
+
}
|
|
6316
|
+
interface PptxEmbeddedFont {
|
|
6317
|
+
name: string;
|
|
6318
|
+
dataUrl: string;
|
|
6319
|
+
bold?: boolean;
|
|
6320
|
+
italic?: boolean;
|
|
6321
|
+
/** CSS font format hint (e.g. "truetype", "opentype"). */
|
|
6322
|
+
format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
|
|
6323
|
+
/**
|
|
6324
|
+
* Deobfuscated (clear-text) font binary data preserved from load
|
|
6325
|
+
* for round-trip re-embedding on save. When present, the save
|
|
6326
|
+
* pipeline will re-obfuscate and write this data back into the ZIP.
|
|
6327
|
+
*/
|
|
6328
|
+
rawFontData?: Uint8Array;
|
|
6329
|
+
/**
|
|
6330
|
+
* Original ZIP path of the font part (e.g. `ppt/fonts/{GUID}.fntdata`).
|
|
6331
|
+
* Preserved from load for round-trip.
|
|
6332
|
+
*/
|
|
6333
|
+
partPath?: string;
|
|
6334
|
+
/**
|
|
6335
|
+
* The GUID used for obfuscation, either from the `fontKey` attribute
|
|
6336
|
+
* or extracted from the part path. Preserved from load for round-trip.
|
|
6337
|
+
*/
|
|
6338
|
+
fontGuid?: string;
|
|
6339
|
+
/**
|
|
6340
|
+
* Relationship ID (e.g. `rId21`) of the font part in
|
|
6341
|
+
* `ppt/_rels/presentation.xml.rels`. Preserved from load so the save
|
|
6342
|
+
* pipeline can reuse the original part/rel instead of minting a new
|
|
6343
|
+
* GUID-named copy alongside the stale original.
|
|
6344
|
+
*/
|
|
6345
|
+
originalRId?: string;
|
|
6346
|
+
/**
|
|
6347
|
+
* Raw bytes of the original obfuscated font part exactly as they were
|
|
6348
|
+
* stored in the source ZIP. When the loader could not determine a
|
|
6349
|
+
* usable GUID (e.g. EOT extraction path), the save pipeline preserves
|
|
6350
|
+
* these bytes verbatim under the original path/rel.
|
|
6351
|
+
*/
|
|
6352
|
+
originalPartBytes?: Uint8Array;
|
|
6353
|
+
}
|
|
6354
|
+
|
|
6355
|
+
/**
|
|
6356
|
+
* Headless SVG exporter — converts parsed {@link PptxSlide} data to
|
|
6357
|
+
* SVG XML strings without requiring a browser DOM.
|
|
6358
|
+
*
|
|
6359
|
+
* All output is generated via string concatenation so the exporter
|
|
6360
|
+
* works in any JavaScript runtime (Node, Bun, Deno, Workers, etc.).
|
|
6361
|
+
*
|
|
6362
|
+
* @module converter/SvgExporter
|
|
6363
|
+
*/
|
|
6364
|
+
|
|
6365
|
+
/**
|
|
6366
|
+
* Options controlling SVG export behaviour.
|
|
6367
|
+
*/
|
|
6368
|
+
interface SvgExportOptions {
|
|
6369
|
+
/** Include hidden slides when exporting all. Default `false`. */
|
|
6370
|
+
includeHidden?: boolean;
|
|
6371
|
+
/** Slide indices to export (0-based). If omitted, all slides are exported. */
|
|
6372
|
+
slideIndices?: number[];
|
|
6373
|
+
/** Default font family when the element does not specify one. */
|
|
6374
|
+
defaultFontFamily?: string;
|
|
6375
|
+
/** Default font size in points when the element does not specify one. */
|
|
6376
|
+
defaultFontSize?: number;
|
|
6377
|
+
}
|
|
6378
|
+
|
|
6379
|
+
/** Output format for the save pipeline. */
|
|
6380
|
+
type PptxSaveFormat = 'pptx' | 'ppsx' | 'pptm';
|
|
6381
|
+
|
|
6382
|
+
/**
|
|
6383
|
+
* Theme configuration types for the PowerPoint viewer.
|
|
6384
|
+
*
|
|
6385
|
+
* All color values accept any valid CSS color string:
|
|
6386
|
+
* hex (`#6366f1`), rgb (`rgb(99 102 241)`), hsl (`hsl(239 84% 67%)`),
|
|
6387
|
+
* oklch (`oklch(0.585 0.233 277)`), named colors, etc.
|
|
6388
|
+
*
|
|
6389
|
+
* Framework-agnostic — shared by the React, Vue, and Angular bindings.
|
|
6390
|
+
*/
|
|
6391
|
+
/**
|
|
6392
|
+
* Semantic color tokens for the viewer UI.
|
|
6393
|
+
*
|
|
6394
|
+
* These map to CSS custom properties (`--pptx-<token>`) and drive all
|
|
6395
|
+
* UI component colors. The naming follows the shadcn/ui convention so
|
|
6396
|
+
* that Tailwind + shadcn users get a familiar experience.
|
|
6397
|
+
*/
|
|
6398
|
+
interface ViewerThemeColors {
|
|
6399
|
+
/** Page / root background */
|
|
6400
|
+
background: string;
|
|
6401
|
+
/** Default text color */
|
|
6402
|
+
foreground: string;
|
|
6403
|
+
/** Card / panel surface */
|
|
6404
|
+
card: string;
|
|
6405
|
+
/** Text on card surfaces */
|
|
6406
|
+
cardForeground: string;
|
|
6407
|
+
/** Popover / dropdown surface */
|
|
6408
|
+
popover: string;
|
|
6409
|
+
/** Text inside popovers */
|
|
6410
|
+
popoverForeground: string;
|
|
6411
|
+
/** Primary action color (buttons, active indicators) */
|
|
6412
|
+
primary: string;
|
|
6413
|
+
/** Text on primary-colored backgrounds */
|
|
6414
|
+
primaryForeground: string;
|
|
6415
|
+
/** Secondary / subdued action color */
|
|
6416
|
+
secondary: string;
|
|
6417
|
+
/** Text on secondary backgrounds */
|
|
6418
|
+
secondaryForeground: string;
|
|
6419
|
+
/** Muted / disabled surface */
|
|
6420
|
+
muted: string;
|
|
6421
|
+
/** Text on muted surfaces (also used for secondary text) */
|
|
6422
|
+
mutedForeground: string;
|
|
6423
|
+
/** Accent / hover-highlight surface */
|
|
6424
|
+
accent: string;
|
|
6425
|
+
/** Text on accent surfaces */
|
|
6426
|
+
accentForeground: string;
|
|
6427
|
+
/** Destructive / danger action color */
|
|
6428
|
+
destructive: string;
|
|
6429
|
+
/** Text on destructive backgrounds */
|
|
6430
|
+
destructiveForeground: string;
|
|
6431
|
+
/** Default border color */
|
|
6432
|
+
border: string;
|
|
6433
|
+
/** Input field border color */
|
|
6434
|
+
input: string;
|
|
6435
|
+
/** Focus ring color */
|
|
6436
|
+
ring: string;
|
|
6437
|
+
}
|
|
6438
|
+
/**
|
|
6439
|
+
* Full viewer theme configuration.
|
|
6440
|
+
*
|
|
6441
|
+
* Every property is optional — unset values fall back to the built-in
|
|
6442
|
+
* dark theme defaults.
|
|
6443
|
+
*/
|
|
6444
|
+
interface ViewerTheme {
|
|
6445
|
+
/** Semantic UI colors. Each key maps to a `--pptx-<key>` CSS custom property. */
|
|
6446
|
+
colors?: Partial<ViewerThemeColors>;
|
|
6447
|
+
/** Base border-radius value (e.g. `"0.5rem"`, `"8px"`). */
|
|
6448
|
+
radius?: string;
|
|
6449
|
+
/**
|
|
6450
|
+
* Escape hatch: arbitrary CSS custom properties to set on the viewer
|
|
6451
|
+
* root element. Keys should include the `--` prefix.
|
|
6452
|
+
*
|
|
6453
|
+
* @example
|
|
6454
|
+
* ```ts
|
|
6455
|
+
* { "--my-custom-shadow": "0 4px 12px rgba(0,0,0,0.5)" }
|
|
6456
|
+
* ```
|
|
6457
|
+
*/
|
|
6458
|
+
cssVars?: Record<string, string>;
|
|
6459
|
+
}
|
|
6460
|
+
|
|
6461
|
+
/**
|
|
6462
|
+
* Default dark-theme color values.
|
|
6463
|
+
*
|
|
6464
|
+
* These correspond to the built-in dark UI of the PowerPoint viewer and
|
|
6465
|
+
* use Tailwind's gray palette as the neutral scale with indigo as the
|
|
6466
|
+
* primary accent.
|
|
6467
|
+
*/
|
|
6468
|
+
declare const defaultThemeColors: ViewerThemeColors;
|
|
6469
|
+
/** Default border-radius. */
|
|
6470
|
+
declare const defaultRadius = "0.5rem";
|
|
6471
|
+
|
|
6472
|
+
/**
|
|
6473
|
+
* Convert a `ViewerTheme` into a flat `Record<string, string>` of CSS
|
|
6474
|
+
* custom properties (including the `--` prefix) ready to be spread onto
|
|
6475
|
+
* a `style` attribute.
|
|
6476
|
+
*
|
|
6477
|
+
* Only properties that differ from the built-in defaults are emitted when
|
|
6478
|
+
* `omitDefaults` is true (the default).
|
|
6479
|
+
*/
|
|
6480
|
+
declare function themeToCssVars(theme: ViewerTheme | undefined, omitDefaults?: boolean): Record<string, string>;
|
|
6481
|
+
/**
|
|
6482
|
+
* Build the complete set of CSS custom properties with all defaults.
|
|
6483
|
+
* Useful for generating a full fallback stylesheet.
|
|
6484
|
+
*/
|
|
6485
|
+
declare function defaultCssVars(): Record<string, string>;
|
|
6486
|
+
|
|
6487
|
+
/**
|
|
6488
|
+
* Built-in "vermilion" theme presets.
|
|
6489
|
+
*
|
|
6490
|
+
* These mirror the pptx-viewer brand used on the documentation site:
|
|
6491
|
+
* a warm paper canvas in light mode, a dimmed presenter room in dark
|
|
6492
|
+
* mode, and the vermilion accent in both. Pass one to the viewer's
|
|
6493
|
+
* `theme` prop (React/Vue) or `provideViewerTheme` (Angular), or spread
|
|
6494
|
+
* the color objects to derive your own variant.
|
|
6495
|
+
*/
|
|
6496
|
+
/** Light "paper" palette: a projection screen in a bright room. */
|
|
6497
|
+
declare const vermilionLightColors: ViewerThemeColors;
|
|
6498
|
+
/** Dark "presenter" palette: the presenter room with the lights down. */
|
|
6499
|
+
declare const vermilionDarkColors: ViewerThemeColors;
|
|
6500
|
+
/** Shared border-radius for the vermilion presets (slightly sharper than the default). */
|
|
6501
|
+
declare const vermilionRadius = "0.375rem";
|
|
6502
|
+
/** Light vermilion theme, ready for the viewer's `theme` prop. */
|
|
6503
|
+
declare const vermilionLightTheme: ViewerTheme;
|
|
6504
|
+
/** Dark vermilion theme, ready for the viewer's `theme` prop. */
|
|
6505
|
+
declare const vermilionDarkTheme: ViewerTheme;
|
|
4709
6506
|
|
|
4710
6507
|
/**
|
|
4711
6508
|
* Framework-agnostic public types shared by the viewer bindings.
|
|
@@ -5002,8 +6799,9 @@ interface ExportGifOptions {
|
|
|
5002
6799
|
* settings, `computeSlideIndices` / `computeColorFilter` resolve the range and
|
|
5003
6800
|
* colour mode, the `build*Html` helpers produce the escaped body markup, and
|
|
5004
6801
|
* `buildPrintHtmlDocument` sanitises + assembles the final document. This
|
|
5005
|
-
* module (the Svelte counterpart of Vue's `usePrint`)
|
|
5006
|
-
*
|
|
6802
|
+
* module (the Svelte counterpart of Vue's `usePrint`) exports direct slide
|
|
6803
|
+
* pages as vector SVG, rasterises notes/handout thumbnails, and opens the
|
|
6804
|
+
* print surface.
|
|
5007
6805
|
*
|
|
5008
6806
|
* **Print surface / popup-blocker caveats:** the default opener renders the
|
|
5009
6807
|
* document into a hidden same-origin `<iframe srcdoc>` and calls
|
|
@@ -5077,6 +6875,19 @@ type Translator = (key: string, params?: Record<string, string | number>) => str
|
|
|
5077
6875
|
*/
|
|
5078
6876
|
declare function registerTranslations(locale: string, dictionary: TranslationDictionary): void;
|
|
5079
6877
|
|
|
6878
|
+
type SvgExportSingleSlideOptions = SvgExportOptions;
|
|
6879
|
+
type SvgExportAllOptions = SvgExportOptions;
|
|
6880
|
+
/** Export one parsed slide as self-contained SVG markup. */
|
|
6881
|
+
declare function exportSlideToSvg(slide: PptxSlide, width: number, height: number, options?: SvgExportSingleSlideOptions): string;
|
|
6882
|
+
/** Export one parsed slide as an SVG Blob. */
|
|
6883
|
+
declare function exportSlideToSvgBlob(slide: PptxSlide, width: number, height: number, options?: SvgExportSingleSlideOptions): Blob;
|
|
6884
|
+
/** Export one parsed slide as an SVG download. */
|
|
6885
|
+
declare function exportSlideAsSvg(slide: PptxSlide, slideIndex: number, width: number, height: number, options?: SvgExportSingleSlideOptions): void;
|
|
6886
|
+
/** Export the selected presentation slides as SVG strings. */
|
|
6887
|
+
declare function exportAllSlidesToSvg(data: PptxData, options?: SvgExportAllOptions): string[];
|
|
6888
|
+
/** Export the selected presentation slides as SVG Blobs. */
|
|
6889
|
+
declare function exportAllSlidesToSvgBlobs(data: PptxData, options?: SvgExportAllOptions): Blob[];
|
|
6890
|
+
|
|
5080
6891
|
/** Payload for the `onload` callback. */
|
|
5081
6892
|
interface ViewerLoadDetail {
|
|
5082
6893
|
/** Number of slides in the loaded presentation. */
|
|
@@ -5224,7 +7035,9 @@ interface PowerPointViewerApi extends PowerPointViewerAPI {
|
|
|
5224
7035
|
/** The selected top-level element id, or null. */
|
|
5225
7036
|
getSelectedElementId(): string | null;
|
|
5226
7037
|
/** Serialize the edited slides to `.pptx` bytes via the core handler. */
|
|
5227
|
-
save(): Promise<Uint8Array>;
|
|
7038
|
+
save(format?: PptxSaveFormat): Promise<Uint8Array>;
|
|
7039
|
+
downloadAs(format: PptxSaveFormat, fileName?: string): Promise<void>;
|
|
7040
|
+
packageForSharing(fileName?: string): Promise<void>;
|
|
5228
7041
|
/** Save + trigger a browser download of the `.pptx` (default name). */
|
|
5229
7042
|
downloadPptx(fileName?: string): Promise<void>;
|
|
5230
7043
|
/**
|
|
@@ -5233,6 +7046,8 @@ interface PowerPointViewerApi extends PowerPointViewerAPI {
|
|
|
5233
7046
|
* (dynamically imported), so the first call pays a one-time load cost.
|
|
5234
7047
|
*/
|
|
5235
7048
|
exportSlidePng(index?: number): Promise<void>;
|
|
7049
|
+
/** Copy a slide to the system clipboard as a PNG image. */
|
|
7050
|
+
copySlideAsImage(index?: number): Promise<void>;
|
|
5236
7051
|
/**
|
|
5237
7052
|
* Export every slide as a multi-page PDF download (one slide per page).
|
|
5238
7053
|
* `jspdf` is dynamically imported on first use.
|
|
@@ -5303,5 +7118,5 @@ declare const PowerPointViewer: Component<PowerPointViewerProps, PowerPointViewe
|
|
|
5303
7118
|
*/
|
|
5304
7119
|
type AutosaveStatus = 'idle' | 'disabled' | 'saving' | 'saved' | 'error';
|
|
5305
7120
|
|
|
5306
|
-
export { PowerPointViewer, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, getAutosaveSnapshot, listAutosaveSnapshots, loadPresentationDeck, parsePresentationSessionId, registerTranslations, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
|
|
5307
|
-
export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, PowerPointViewerApi, PowerPointViewerProps, PrintOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors };
|
|
7121
|
+
export { PowerPointViewer, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, exportAllSlidesToSvg, exportAllSlidesToSvgBlobs, exportSlideAsSvg, exportSlideToSvg, exportSlideToSvgBlob, getAutosaveSnapshot, listAutosaveSnapshots, loadPresentationDeck, parsePresentationSessionId, registerTranslations, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
|
|
7122
|
+
export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, PowerPointViewerApi, PowerPointViewerProps, PrintOptions, SvgExportAllOptions, SvgExportSingleSlideOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors };
|