@shbernal/ts-pptx 3.4.0 → 3.6.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/dist/{autopage-BYlTzX-l.js → autopage-DkjYZUFD.js} +3 -3
- package/dist/{autopage-BYlTzX-l.js.map → autopage-DkjYZUFD.js.map} +1 -1
- package/dist/browser.d.ts +5 -5
- package/dist/browser.js +4 -4
- package/dist/browser.js.map +1 -1
- package/dist/{diagnostics-B0OmTOoz.d.ts → diagnostics-Du_s75MT.d.ts} +20 -5
- package/dist/diagnostics-Du_s75MT.d.ts.map +1 -0
- package/dist/{errors-fB1KDJKQ.d.ts → errors-PflMPWBn.d.ts} +3 -3
- package/dist/{errors-fB1KDJKQ.d.ts.map → errors-PflMPWBn.d.ts.map} +1 -1
- package/dist/{fit-TjpNbMru.js → fit-BKs0zxMI.js} +3 -3
- package/dist/{fit-TjpNbMru.js.map → fit-BKs0zxMI.js.map} +1 -1
- package/dist/{html-dom-yUSdCExA.js → html-dom-B0I0QSbU.js} +4 -4
- package/dist/{html-dom-yUSdCExA.js.map → html-dom-B0I0QSbU.js.map} +1 -1
- package/dist/html.d.ts +3 -3
- package/dist/html.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/inspect.d.ts +28 -4
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +42 -11
- package/dist/inspect.js.map +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/measure.d.ts +2 -2
- package/dist/measure.js +1 -1
- package/dist/{namespaces-Sy_m7Nhd.js → namespaces-BVnNu7sg.js} +77 -3
- package/dist/namespaces-BVnNu7sg.js.map +1 -0
- package/dist/node.d.ts +5 -5
- package/dist/node.js +3 -3
- package/dist/{notes-bWApshah.js → notes-RLCwdlTE.js} +289 -313
- package/dist/{notes-bWApshah.js.map → notes-RLCwdlTE.js.map} +1 -1
- package/dist/{pres-Dybf7ZUl.d.ts → pres-C5__xkDh.d.ts} +2 -2
- package/dist/{pres-Dybf7ZUl.d.ts.map → pres-C5__xkDh.d.ts.map} +1 -1
- package/dist/{presentation-3rAKKRfm.js → presentation-Cp7vzlAw.js} +566 -519
- package/dist/presentation-Cp7vzlAw.js.map +1 -0
- package/dist/{presentation-types-D7cgT-eG.d.ts → presentation-types-DP_8jog7.d.ts} +514 -276
- package/dist/presentation-types-DP_8jog7.d.ts.map +1 -0
- package/dist/read.d.ts +31 -48
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +3 -3
- package/dist/script.d.ts +2 -2
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +84 -75
- package/dist/script.js.map +1 -1
- package/dist/{shapes-Dyw5bxwO.js → shapes-BemroU-z.js} +1010 -306
- package/dist/shapes-BemroU-z.js.map +1 -0
- package/dist/{slide-B_aInw3N.d.ts → slide-js0QpRV-.d.ts} +1278 -1254
- package/dist/slide-js0QpRV-.d.ts.map +1 -0
- package/dist/{text-DSN3anEh.js → text-CyetbF6p.js} +2039 -1417
- package/dist/text-CyetbF6p.js.map +1 -0
- package/dist/units-1kRzYShk.js +231 -0
- package/dist/units-1kRzYShk.js.map +1 -0
- package/dist/units-internal-Dg95w_YD.js +753 -0
- package/dist/units-internal-Dg95w_YD.js.map +1 -0
- package/dist/zip.d.ts +1 -1
- package/package.json +2 -1
- package/dist/diagnostics-B0OmTOoz.d.ts.map +0 -1
- package/dist/diagnostics-CPVADSL1.js +0 -90
- package/dist/diagnostics-CPVADSL1.js.map +0 -1
- package/dist/namespaces-Sy_m7Nhd.js.map +0 -1
- package/dist/presentation-3rAKKRfm.js.map +0 -1
- package/dist/presentation-types-D7cgT-eG.d.ts.map +0 -1
- package/dist/shapes-Dyw5bxwO.js.map +0 -1
- package/dist/slide-B_aInw3N.d.ts.map +0 -1
- package/dist/text-DSN3anEh.js.map +0 -1
- package/dist/units-internal-DNvK2I6o.js +0 -896
- package/dist/units-internal-DNvK2I6o.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ct as ColorMapToken, ft as ThemeColorSlot } from "./slide-js0QpRV-.js";
|
|
2
|
+
import { t as CustomPropertyValue } from "./pres-C5__xkDh.js";
|
|
2
3
|
import { a as Part, i as Relationships, n as OpcPackage, o as Element, t as OpcInput } from "./package-CaOLXSNi.js";
|
|
3
4
|
//#region src/embedded-fonts.d.ts
|
|
4
5
|
/**
|
|
@@ -83,6 +84,28 @@ interface ThemeContext extends ColorContext {
|
|
|
83
84
|
defaultTextStyle?: Element | null;
|
|
84
85
|
}
|
|
85
86
|
//#endregion
|
|
87
|
+
//#region src/read/oxml/color-transform.d.ts
|
|
88
|
+
/** A colour-transform modifier in its read-model form: tag local-name + raw `@val`. */
|
|
89
|
+
interface ColorTransform {
|
|
90
|
+
name: string;
|
|
91
|
+
value: string | null;
|
|
92
|
+
}
|
|
93
|
+
/** The effective colour after applying transforms: final sRGB hex, plus opacity when an `alpha*` modifier was present. */
|
|
94
|
+
interface EffectiveColor {
|
|
95
|
+
hex: string;
|
|
96
|
+
alpha?: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Apply an ordered list of DrawingML colour transforms to a base sRGB hex,
|
|
100
|
+
* returning the effective sRGB hex (and opacity, when an `alpha*` modifier set
|
|
101
|
+
* it). Pure: no DOM, no theme lookup — the caller has already resolved the base
|
|
102
|
+
* colour and extracted each modifier's `{ name, value }`.
|
|
103
|
+
*
|
|
104
|
+
* An unparseable base hex is returned unchanged (with no transforms applied); an
|
|
105
|
+
* unparseable/`null` modifier value is skipped.
|
|
106
|
+
*/
|
|
107
|
+
declare function applyColorTransforms(baseHex: string, transforms: ColorTransform[]): EffectiveColor;
|
|
108
|
+
//#endregion
|
|
86
109
|
//#region src/read/api/theme-context.d.ts
|
|
87
110
|
/** Identifies a placeholder by its `p:ph` `type`/`idx` for inheritance lookups. */
|
|
88
111
|
interface PlaceholderRef {
|
|
@@ -114,16 +137,14 @@ interface ResolvedFrame {
|
|
|
114
137
|
*/
|
|
115
138
|
interface ResolvedColor {
|
|
116
139
|
hex: string;
|
|
117
|
-
transforms:
|
|
118
|
-
name: string;
|
|
119
|
-
value: string | null;
|
|
120
|
-
}[];
|
|
140
|
+
transforms: ColorTransform[];
|
|
121
141
|
effectiveHex: string;
|
|
122
142
|
alpha?: number;
|
|
123
143
|
}
|
|
124
144
|
/**
|
|
125
|
-
* Resolve a DrawingML colour *element* (`a:
|
|
126
|
-
* against `ctx` into a full
|
|
145
|
+
* Resolve a DrawingML colour *element* (every `a:EG_ColorChoice` member except
|
|
146
|
+
* `a:scrgbClr` — see `read/oxml/theme.ts`) against `ctx` into a full
|
|
147
|
+
* {@link ResolvedColor} — base hex, raw transform list,
|
|
127
148
|
* and the `effectiveHex`/`alpha` after applying those transforms. `null` when the
|
|
128
149
|
* element cannot be made literal (unmapped token, or a colour model we do not
|
|
129
150
|
* resolve). Shared by the solid-fill and gradient-stop colour reads.
|
|
@@ -142,19 +163,47 @@ interface StyleFontRef {
|
|
|
142
163
|
interface GradientStop {
|
|
143
164
|
/** Stop offset along the gradient, 0–1 (from `@pos`, thousandths of a percent), or `null` if unset. */
|
|
144
165
|
position: number | null;
|
|
145
|
-
/** Explicit RGB colour as 6-hex (`a:srgbClr/@val`), or `null` when the stop uses
|
|
166
|
+
/** Explicit RGB colour as 6-hex (`a:srgbClr/@val`), or `null` when the stop uses another colour model. */
|
|
146
167
|
color: string | null;
|
|
147
|
-
/** Theme colour token (`a:schemeClr/@val`, e.g. `accent1`), or `null` when the stop uses
|
|
168
|
+
/** Theme colour token (`a:schemeClr/@val`, e.g. `accent1`), or `null` when the stop uses another colour model. */
|
|
148
169
|
schemeColor: string | null;
|
|
170
|
+
/**
|
|
171
|
+
* Preset colour name (`a:prstClr/@val`, e.g. `black`/`cornflowerBlue` — the
|
|
172
|
+
* ECMA-376 §20.1.10.47 table), or `null` when the stop uses another colour
|
|
173
|
+
* model. The same raw/resolved split {@link import('./shapes/types.js').RecolorColor}
|
|
174
|
+
* uses; {@link import('../oxml/preset-color.js').presetColorHex}, exported from
|
|
175
|
+
* `ts-pptx/read`, makes one literal.
|
|
176
|
+
*
|
|
177
|
+
* These three raw fields name three of the five colour models the reader
|
|
178
|
+
* resolves. A stop written as `a:sysClr` or `a:hslClr` leaves all three `null`
|
|
179
|
+
* and is reported through {@link resolvedColor} alone, which is the only place
|
|
180
|
+
* its colour appears; `a:scrgbClr`, which the reader deliberately does not
|
|
181
|
+
* resolve, leaves {@link resolvedColor} `null` too.
|
|
182
|
+
*/
|
|
183
|
+
presetColor: string | null;
|
|
184
|
+
/**
|
|
185
|
+
* The stop's colour as a full {@link ResolvedColor} — base `hex`, the raw
|
|
186
|
+
* `transforms` list (`lumMod`/`shade`/…) in document order, and the
|
|
187
|
+
* `effectiveHex`/`alpha` after applying them — exactly what a solid fill's
|
|
188
|
+
* `resolvedFill` gives. `null` when the colour cannot be made literal (an
|
|
189
|
+
* unmapped token, or a colour model we do not resolve).
|
|
190
|
+
*
|
|
191
|
+
* This is the field to read when re-authoring a stop against a *different*
|
|
192
|
+
* theme: {@link effectiveHex} alone is one theme baked in, so carrying it
|
|
193
|
+
* forward as a literal silently stops the stop tracking the theme it came from.
|
|
194
|
+
* `transforms` is what says whether there was anything to track, and an empty
|
|
195
|
+
* list here means the stop stated none — not that the reader could not see them.
|
|
196
|
+
*/
|
|
197
|
+
resolvedColor: ResolvedColor | null;
|
|
149
198
|
/**
|
|
150
199
|
* The stop's colour resolved against the slide theme **with its colour
|
|
151
|
-
* transforms applied** — the final rendered hex
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* not resolve).
|
|
200
|
+
* transforms applied** — the final rendered hex, i.e. exactly
|
|
201
|
+
* `resolvedColor?.effectiveHex ?? null`, kept as a flat field because painting a
|
|
202
|
+
* gradient is what most callers want. `null` when the colour cannot be made
|
|
203
|
+
* literal (an unmapped token, or a colour model we do not resolve).
|
|
155
204
|
*/
|
|
156
205
|
effectiveHex: string | null;
|
|
157
|
-
/** The stop's opacity (0–1) when an `alpha*` transform set one, else `undefined`. */
|
|
206
|
+
/** The stop's opacity (0–1) when an `alpha*` transform set one, else `undefined`. Mirrors `resolvedColor.alpha`. */
|
|
158
207
|
alpha?: number;
|
|
159
208
|
}
|
|
160
209
|
/**
|
|
@@ -454,7 +503,7 @@ interface Reflection {
|
|
|
454
503
|
/** End position along the reflection 0–1 (`@endPos` ÷ 100000). */
|
|
455
504
|
endPos?: number;
|
|
456
505
|
/** Offset distance in points (`@dist` ÷ 12700). */
|
|
457
|
-
|
|
506
|
+
offsetPt?: number;
|
|
458
507
|
/** Offset direction in degrees (`@dir` ÷ 60000). */
|
|
459
508
|
angleDeg?: number;
|
|
460
509
|
/** Fade direction in degrees (`@fadeDir` ÷ 60000). */
|
|
@@ -745,6 +794,12 @@ declare class Run {
|
|
|
745
794
|
* for non-placeholder runs. Called lazily.
|
|
746
795
|
*/
|
|
747
796
|
private readonly inheritedBold?;
|
|
797
|
+
/**
|
|
798
|
+
* Resolves whether this run inherits italic from the same chain when it sets no
|
|
799
|
+
* own `@i`. Built by the owning {@link Paragraph} for placeholder text; absent
|
|
800
|
+
* for non-placeholder runs. Called lazily.
|
|
801
|
+
*/
|
|
802
|
+
private readonly inheritedItalic?;
|
|
748
803
|
/**
|
|
749
804
|
* The owning part's relationships, used to resolve a run hyperlink's `@r:id`
|
|
750
805
|
* to its external URL or internal target partname. Absent when the run was
|
|
@@ -787,6 +842,12 @@ declare class Run {
|
|
|
787
842
|
* for non-placeholder runs. Called lazily.
|
|
788
843
|
*/
|
|
789
844
|
inheritedBold?: (() => boolean | null) | undefined,
|
|
845
|
+
/**
|
|
846
|
+
* Resolves whether this run inherits italic from the same chain when it sets no
|
|
847
|
+
* own `@i`. Built by the owning {@link Paragraph} for placeholder text; absent
|
|
848
|
+
* for non-placeholder runs. Called lazily.
|
|
849
|
+
*/
|
|
850
|
+
inheritedItalic?: (() => boolean | null) | undefined,
|
|
790
851
|
/**
|
|
791
852
|
* The owning part's relationships, used to resolve a run hyperlink's `@r:id`
|
|
792
853
|
* to its external URL or internal target partname. Absent when the run was
|
|
@@ -909,6 +970,17 @@ declare class Run {
|
|
|
909
970
|
* resolved counterpart of {@link bold}, which reports only the run's own value.
|
|
910
971
|
*/
|
|
911
972
|
get resolvedBold(): boolean | null;
|
|
973
|
+
/**
|
|
974
|
+
* Whether this run effectively renders italic. It is the run's own `@i`
|
|
975
|
+
* ({@link italic}) when set; otherwise, for a run inside a placeholder, the italic
|
|
976
|
+
* state it inherits from the placeholder/list-style chain (paragraph `a:defRPr` →
|
|
977
|
+
* slide `a:lstStyle` → layout → master placeholder `a:lstStyle` → master
|
|
978
|
+
* `p:txStyles`). `null` when the run sets no `@i` and inherits none — the
|
|
979
|
+
* resolved counterpart of {@link italic}, and the twin of {@link resolvedBold}:
|
|
980
|
+
* `@b` and `@i` are siblings a master text style states together, so a deck that
|
|
981
|
+
* can be authored with an inherited italic can be read back with one.
|
|
982
|
+
*/
|
|
983
|
+
get resolvedItalic(): boolean | null;
|
|
912
984
|
/** Escape hatch: the underlying `a:r` element. After mutating it call {@link markDirty}, or `save()` writes the original bytes. */
|
|
913
985
|
get element_(): Element;
|
|
914
986
|
/** Mark the owning part dirty so `save()` reserializes it. Call after mutating {@link element_}. */
|
|
@@ -990,6 +1062,13 @@ declare class Paragraph {
|
|
|
990
1062
|
* document order, with each line break (`a:br`) rendered as `\n`.
|
|
991
1063
|
*/
|
|
992
1064
|
get text(): string;
|
|
1065
|
+
/**
|
|
1066
|
+
* Replace **this paragraph's** content with a single run, preserving the character
|
|
1067
|
+
* formatting (`a:rPr`) of its first existing run and leaving its `a:pPr` (level,
|
|
1068
|
+
* alignment, bullet) alone. Sibling paragraphs are untouched — the difference from
|
|
1069
|
+
* {@link TextFrame.text}, which collapses the whole body to one paragraph.
|
|
1070
|
+
*/
|
|
1071
|
+
set text(value: string);
|
|
993
1072
|
/** Escape hatch: the underlying `a:p` element. After mutating it call {@link markDirty}, or `save()` writes the original bytes. */
|
|
994
1073
|
get element_(): Element;
|
|
995
1074
|
/** Mark the owning part dirty so `save()` reserializes it. Call after mutating {@link element_}. */
|
|
@@ -2017,6 +2096,60 @@ interface DiagramConnection {
|
|
|
2017
2096
|
/** The layout preset this edge belongs to (`@presId`), set on generated edges only. */
|
|
2018
2097
|
presentationId: string | null;
|
|
2019
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Where a point's text is drawn in the fallback drawing part — the second copy of every
|
|
2101
|
+
* string a diagram carries, and the only one a renderer without a SmartArt layout engine
|
|
2102
|
+
* paints. See {@link DiagramPoint.drawnShape} for how a point reaches it.
|
|
2103
|
+
*/
|
|
2104
|
+
interface DiagramDrawnShape {
|
|
2105
|
+
/** The drawing part (`/ppt/diagrams/drawing{N}.xml`) the shape lives in. */
|
|
2106
|
+
readonly part: Part;
|
|
2107
|
+
/** The `pres` point this shape draws (`dsp:sp/@modelId`) — never the authored point's own id. */
|
|
2108
|
+
readonly modelId: string;
|
|
2109
|
+
/** Which paragraph of {@link textFrame} carries this point's text (the `presOf` edge's `@destOrd`). */
|
|
2110
|
+
readonly paragraphIndex: number;
|
|
2111
|
+
/**
|
|
2112
|
+
* The shape's `dsp:txBody`, bound to the **drawing** part rather than the data part, so
|
|
2113
|
+
* an edit made through it marks the part that actually changed.
|
|
2114
|
+
*
|
|
2115
|
+
* One shape commonly draws several points — three of them in `mixed.pptx` — so writing
|
|
2116
|
+
* `textFrame.text` here would delete the siblings' text. Replace paragraph
|
|
2117
|
+
* {@link paragraphIndex} instead, which is what {@link DiagramPoint.text}'s setter does.
|
|
2118
|
+
*/
|
|
2119
|
+
readonly textFrame: TextFrame;
|
|
2120
|
+
/** Escape hatch: the underlying `dsp:sp`. After mutating it call `part.markDirty()`. */
|
|
2121
|
+
readonly element_: Element;
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* The node → drawn-shape index of one diagram: the `presOf` edges of the data model and the
|
|
2125
|
+
* `dsp:sp` elements of the drawing part, both keyed for lookup.
|
|
2126
|
+
*
|
|
2127
|
+
* Built once per {@link Diagram}, and only when a point is actually asked what draws it — the
|
|
2128
|
+
* drawing part is a second XML DOM and a consumer reading node text should not pay to parse
|
|
2129
|
+
* it. The consequence of that memo: a consumer who *adds* or *removes* shapes in the drawing
|
|
2130
|
+
* part through the escape hatches must re-reach the diagram to see them here.
|
|
2131
|
+
*/
|
|
2132
|
+
declare class DrawingIndex {
|
|
2133
|
+
#private;
|
|
2134
|
+
private readonly drawingPart;
|
|
2135
|
+
private readonly themeContext?;
|
|
2136
|
+
constructor(root: Element | null, drawingPart: Part | null, themeContext?: ThemeContext | undefined);
|
|
2137
|
+
/**
|
|
2138
|
+
* Resolve one authored point to the `pres` point that presents it and to the drawn
|
|
2139
|
+
* paragraph carrying its text.
|
|
2140
|
+
*
|
|
2141
|
+
* A point commonly has **several** `presOf` arms — an org-chart node's box and the
|
|
2142
|
+
* connector beneath it are two presentations of one node — so the arm is chosen by what it
|
|
2143
|
+
* reaches rather than by its `@srcOrd`: the first, in `@srcOrd` order, whose `pres` point
|
|
2144
|
+
* draws a `dsp:sp` that has a `dsp:txBody`. That selector produced a unique hit for all 90
|
|
2145
|
+
* authored points measured across five layout families, and it degrades to "no arm" rather
|
|
2146
|
+
* than to "the wrong arm" on a layout that was not.
|
|
2147
|
+
*/
|
|
2148
|
+
resolve(modelId: string | null): {
|
|
2149
|
+
presentationId: string | null;
|
|
2150
|
+
drawnShape: DiagramDrawnShape | null;
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2020
2153
|
/** One point (`dgm:pt`) of a diagram's data model. */
|
|
2021
2154
|
declare class DiagramPoint {
|
|
2022
2155
|
#private;
|
|
@@ -2025,9 +2158,13 @@ declare class DiagramPoint {
|
|
|
2025
2158
|
private readonly part;
|
|
2026
2159
|
private readonly themeContext?;
|
|
2027
2160
|
private readonly relationships?;
|
|
2161
|
+
/** The owning diagram's drawing index, built on first use; absent when reached without one. */
|
|
2162
|
+
private readonly drawing?;
|
|
2028
2163
|
constructor(pt: Element,
|
|
2029
2164
|
/** The diagram data part, so a text edit marks the right part dirty. */
|
|
2030
|
-
part: Part, themeContext?: ThemeContext | undefined, relationships?: Relationships | undefined
|
|
2165
|
+
part: Part, themeContext?: ThemeContext | undefined, relationships?: Relationships | undefined,
|
|
2166
|
+
/** The owning diagram's drawing index, built on first use; absent when reached without one. */
|
|
2167
|
+
drawing?: (() => DrawingIndex) | undefined);
|
|
2031
2168
|
/** This point's id (`@modelId`), which connections reference. */
|
|
2032
2169
|
get modelId(): string | null;
|
|
2033
2170
|
/** What kind of point this is (`@type`); `node` when absent, its schema default. */
|
|
@@ -2049,13 +2186,87 @@ declare class DiagramPoint {
|
|
|
2049
2186
|
* This point's text body (`dgm:t`) as a {@link TextFrame}, or `null` when the point
|
|
2050
2187
|
* carries none. It is an `a:CT_TextBody` like any other, so `paragraphs`, `runs` and the
|
|
2051
2188
|
* `resolved*` getters all apply.
|
|
2189
|
+
*
|
|
2190
|
+
* **Writing through this edits the data model only**, and leaves the drawing cache
|
|
2191
|
+
* holding the old string — which is what PowerPoint-less renderers draw. It is the escape
|
|
2192
|
+
* hatch for run-level formatting, so it does exactly what it is told and nothing more;
|
|
2193
|
+
* {@link text}'s setter is the path that mirrors.
|
|
2052
2194
|
*/
|
|
2053
2195
|
get textFrame(): TextFrame | null;
|
|
2196
|
+
/**
|
|
2197
|
+
* The generated `pres` point that presents this one (`dgm:cxn[@type="presOf"]/@destId`),
|
|
2198
|
+
* or `null` when nothing presents it — the normal state of an unlabelled transition point.
|
|
2199
|
+
*
|
|
2200
|
+
* Where a point has several `presOf` arms the one named here is the arm that draws text;
|
|
2201
|
+
* see {@link drawnShape}, which resolves both.
|
|
2202
|
+
*/
|
|
2203
|
+
get presentationId(): string | null;
|
|
2204
|
+
/**
|
|
2205
|
+
* The paragraph of the fallback drawing part (`dsp:drawing`) that carries this point's
|
|
2206
|
+
* text, or `null` when nothing draws it.
|
|
2207
|
+
*
|
|
2208
|
+
* The mapping runs through the `pres` point rather than directly: a `dsp:sp/@modelId` is
|
|
2209
|
+
* always a `pres` point's id, so a lookup keyed on the authored point's own id finds
|
|
2210
|
+
* nothing at all. It is many-to-one in both directions — one shape draws several points
|
|
2211
|
+
* (`@destOrd` says which paragraph is whose, and it can contradict document order), and
|
|
2212
|
+
* one point has several presentations, of which at most one holds text.
|
|
2213
|
+
*
|
|
2214
|
+
* `null` is a defined outcome, not a failure, and covers four real cases: the package
|
|
2215
|
+
* carries no drawing part; the point has no `presOf` edge (every unlabelled
|
|
2216
|
+
* `parTrans`/`sibTrans`); the `pres` point draws no `dsp:sp`; and the shape it draws has
|
|
2217
|
+
* no `dsp:txBody` (a connector, or a picture node's filled rectangle).
|
|
2218
|
+
*/
|
|
2219
|
+
get drawnShape(): DiagramDrawnShape | null;
|
|
2054
2220
|
/** This point's text, paragraphs joined by `\n`; `''` when it carries none. */
|
|
2055
2221
|
get text(): string;
|
|
2222
|
+
/**
|
|
2223
|
+
* Replace this point's text, in the data model **and** in the drawing cache.
|
|
2224
|
+
*
|
|
2225
|
+
* A diagram stores every string twice. `dgm:t` is what PowerPoint reads, and it recomputes
|
|
2226
|
+
* the drawing from the data model on open; the `dsp:drawing` part is what every other
|
|
2227
|
+
* renderer paints, and none of them recompute anything. Writing only the first is an edit
|
|
2228
|
+
* that is invisible in LibreOffice, Google Slides, thumbnailers and web previews until
|
|
2229
|
+
* someone opens the deck in PowerPoint and saves it.
|
|
2230
|
+
*
|
|
2231
|
+
* The data-model write always happens. The mirror is best-effort: when the point resolves
|
|
2232
|
+
* to no drawn paragraph (see {@link drawnShape} for the four ways that occurs) the cache
|
|
2233
|
+
* keeps the old string and a `diagram/drawing-cache-not-updated` diagnostic says so.
|
|
2234
|
+
* Throwing instead would make the common case unusable in order to report the rare one,
|
|
2235
|
+
* and returning a status would be a shape no other text setter here has.
|
|
2236
|
+
*
|
|
2237
|
+
* Two things it deliberately does not do. It does **not** recompute geometry: the drawn
|
|
2238
|
+
* shape keeps its cached position and size, so a much longer string overflows its box in
|
|
2239
|
+
* those same renderers until PowerPoint re-lays the diagram out. And it does not *create*
|
|
2240
|
+
* a place to draw text — a transition point whose layout has no label slot has no
|
|
2241
|
+
* `dsp:sp`, and PowerPoint strips text put on one, so the honest outcome is the
|
|
2242
|
+
* diagnostic. Like every other `text` setter here it collapses the point to one run,
|
|
2243
|
+
* keeping the first run's `a:rPr`; use {@link textFrame} for run-level work.
|
|
2244
|
+
*/
|
|
2245
|
+
set text(value: string);
|
|
2056
2246
|
/** Escape hatch: the underlying `dgm:pt` element. After mutating it call {@link Diagram.markDirty}. */
|
|
2057
2247
|
get element_(): Element;
|
|
2058
2248
|
}
|
|
2249
|
+
/**
|
|
2250
|
+
* One user-authored point in its place in the diagram's tree — a `node` or an `asst`, never a
|
|
2251
|
+
* generated `pres` point or a transition label. See {@link Diagram.nodes}.
|
|
2252
|
+
*/
|
|
2253
|
+
declare class DiagramNode {
|
|
2254
|
+
/** The point itself: its text, its type, and its link to what is drawn for it. */
|
|
2255
|
+
readonly point: DiagramPoint;
|
|
2256
|
+
/** The parent node, or `null` for a root. */
|
|
2257
|
+
readonly parent: DiagramNode | null;
|
|
2258
|
+
/** Depth below the root, `0` for a root. */
|
|
2259
|
+
readonly level: number;
|
|
2260
|
+
/** Child nodes, ordered by their `parOf` edge's `@srcOrd`. Empty for a leaf. */
|
|
2261
|
+
readonly children: DiagramNode[];
|
|
2262
|
+
constructor(
|
|
2263
|
+
/** The point itself: its text, its type, and its link to what is drawn for it. */
|
|
2264
|
+
point: DiagramPoint,
|
|
2265
|
+
/** The parent node, or `null` for a root. */
|
|
2266
|
+
parent: DiagramNode | null,
|
|
2267
|
+
/** Depth below the root, `0` for a root. */
|
|
2268
|
+
level: number);
|
|
2269
|
+
}
|
|
2059
2270
|
/** A SmartArt graphic frame's diagram, backed by its `dgm:dataModel` part. */
|
|
2060
2271
|
declare class Diagram {
|
|
2061
2272
|
#private;
|
|
@@ -2079,9 +2290,31 @@ declare class Diagram {
|
|
|
2079
2290
|
/**
|
|
2080
2291
|
* Every point (`dgm:ptLst/dgm:pt`) in document order, unfiltered — generated `pres`
|
|
2081
2292
|
* points and the `doc` root included. Filter on {@link DiagramPoint.type} for the user's
|
|
2082
|
-
* nodes; {@link text} is the shortcut for the common case.
|
|
2293
|
+
* nodes; {@link text} is the shortcut for the common case, {@link nodes} the structured one.
|
|
2294
|
+
*
|
|
2295
|
+
* Built per access like every other read proxy (`docs/reference/pptx-read.md`, "Object
|
|
2296
|
+
* model"), so `points[0] !== points[0]` while both wrap the same `dgm:pt`. Key a `Map`
|
|
2297
|
+
* on {@link DiagramPoint.modelId}, not on the point.
|
|
2083
2298
|
*/
|
|
2084
2299
|
get points(): DiagramPoint[];
|
|
2300
|
+
/**
|
|
2301
|
+
* The authored tree — every `node` and `asst` point in its place, roots in `@srcOrd`
|
|
2302
|
+
* order — as a view over {@link points} and {@link connections} rather than a replacement
|
|
2303
|
+
* for either.
|
|
2304
|
+
*
|
|
2305
|
+
* A root is a content point whose `parOf` parent is not itself content, which in a
|
|
2306
|
+
* PowerPoint-authored model means the `doc` point. Transition points are not members; see
|
|
2307
|
+
* this module's header for that decision and the two beside it.
|
|
2308
|
+
*
|
|
2309
|
+
* @throws PackageReadError `diagram/parent-edge-cycle` when the `parOf` edges make a
|
|
2310
|
+
* point its own ancestor, which is a corrupt model rather than a diagram shape.
|
|
2311
|
+
*/
|
|
2312
|
+
get nodes(): DiagramNode[];
|
|
2313
|
+
/**
|
|
2314
|
+
* The point with this `@modelId`, or `null` — the lookup every connection getter implies,
|
|
2315
|
+
* since a `DiagramConnection` names its ends by id and nothing else resolves them.
|
|
2316
|
+
*/
|
|
2317
|
+
point(modelId: string): DiagramPoint | null;
|
|
2085
2318
|
/** Every edge (`dgm:cxnLst/dgm:cxn`) in document order. */
|
|
2086
2319
|
get connections(): DiagramConnection[];
|
|
2087
2320
|
/**
|
|
@@ -2213,7 +2446,26 @@ interface CellBorder {
|
|
|
2213
2446
|
widthPt: number | null;
|
|
2214
2447
|
/** Dash style (`a:prstDash/@val`, e.g. `solid`/`sysDash`), or `null` when unset. */
|
|
2215
2448
|
dash: string | null;
|
|
2216
|
-
/**
|
|
2449
|
+
/**
|
|
2450
|
+
* The stroke colour as a full {@link ResolvedColor} — base `hex`, the raw
|
|
2451
|
+
* `transforms` list (`lumMod`/`shade`/…) in document order, and the
|
|
2452
|
+
* `effectiveHex`/`alpha` after applying them — the same object a shape's
|
|
2453
|
+
* `resolvedLine` gives. `null` when the edge carries no solid fill, or the
|
|
2454
|
+
* colour cannot be made literal.
|
|
2455
|
+
*
|
|
2456
|
+
* This is the field to read when re-authoring a border against a *different*
|
|
2457
|
+
* theme: {@link color} alone is one theme baked in, so a `lumMod`-darkened
|
|
2458
|
+
* accent carried forward as a literal hex silently stops tracking the theme it
|
|
2459
|
+
* came from. `transforms` is what says whether there was anything to track, and
|
|
2460
|
+
* an empty list here means the edge stated none — not that the reader could not
|
|
2461
|
+
* see them.
|
|
2462
|
+
*/
|
|
2463
|
+
resolvedColor: ResolvedColor | null;
|
|
2464
|
+
/**
|
|
2465
|
+
* The stroke colour resolved against the table theme to a literal hex — exactly
|
|
2466
|
+
* `resolvedColor?.effectiveHex ?? null`, kept as a flat field because painting a
|
|
2467
|
+
* rule is what most callers want. `null` when the edge has no resolvable colour.
|
|
2468
|
+
*/
|
|
2217
2469
|
color: string | null;
|
|
2218
2470
|
/** Raw `schemeClr` token of the stroke (`a:solidFill/a:schemeClr/@val`), or `null` for an srgb/absent colour. */
|
|
2219
2471
|
schemeColor: string | null;
|
|
@@ -2636,7 +2888,8 @@ declare class TableCell {
|
|
|
2636
2888
|
/**
|
|
2637
2889
|
* The cell's edge borders (`a:tcPr/a:lnL|lnR|lnT|lnB|lnTlToBr|lnBlToTr`), or
|
|
2638
2890
|
* `null` when the cell defines none. Each present edge decodes to a
|
|
2639
|
-
* {@link CellBorder} (width / dash / resolved + raw
|
|
2891
|
+
* {@link CellBorder} (width / dash / resolved colour + its raw token and transform
|
|
2892
|
+
* list / suppressed flag);
|
|
2640
2893
|
* absent edges are `null`. Cell borders are the biggest visible table gap — a
|
|
2641
2894
|
* replica built only from geometry and fill draws every cell edge-to-edge with
|
|
2642
2895
|
* no rule, so this surfaces the per-side stroke the writer's `border` option emits.
|
|
@@ -2819,187 +3072,7 @@ declare function isGraphicFrame(shape: Shape): shape is GraphicFrame;
|
|
|
2819
3072
|
/** Narrow a shape to a {@link GroupShape} (`p:grpSp`). */
|
|
2820
3073
|
declare function isGroupShape(shape: Shape): shape is GroupShape;
|
|
2821
3074
|
//#endregion
|
|
2822
|
-
//#region src/read/api/notes.d.ts
|
|
2823
|
-
/**
|
|
2824
|
-
* One placeholder shape (`p:sp`) of a notes slide. A notes slide holds a fixed set:
|
|
2825
|
-
* the slide thumbnail (`type="sldImg"`), the notes body (`type="body"`), and the
|
|
2826
|
-
* slide number (`type="sldNum"`). Geometry getters read the placeholder's *own*
|
|
2827
|
-
* `a:xfrm` and are `null` when it inherits geometry from the notesMaster (the case
|
|
2828
|
-
* on an authored deck, whose `sldImg`/`sldNum` carry an empty `p:spPr`).
|
|
2829
|
-
*/
|
|
2830
|
-
declare class NotesPlaceholder {
|
|
2831
|
-
#private;
|
|
2832
|
-
private readonly sp;
|
|
2833
|
-
private readonly part;
|
|
2834
|
-
/** The notes theme context (notesMaster → `theme2.xml`), threaded to {@link textFrame}. */
|
|
2835
|
-
private readonly themeContext;
|
|
2836
|
-
/** The notes part's relationships, threaded to {@link textFrame} for hyperlink resolution. */
|
|
2837
|
-
private readonly relationships;
|
|
2838
|
-
constructor(sp: Element, part: Part,
|
|
2839
|
-
/** The notes theme context (notesMaster → `theme2.xml`), threaded to {@link textFrame}. */
|
|
2840
|
-
themeContext: ThemeContext,
|
|
2841
|
-
/** The notes part's relationships, threaded to {@link textFrame} for hyperlink resolution. */
|
|
2842
|
-
relationships: Relationships);
|
|
2843
|
-
/** Placeholder type (`p:ph/@type`: `sldImg` | `body` | `sldNum`), or `null` when absent. */
|
|
2844
|
-
get type(): string | null;
|
|
2845
|
-
/** Placeholder index (`p:ph/@idx`), or `null` when unset. */
|
|
2846
|
-
get idx(): string | null;
|
|
2847
|
-
/** Shape name (`p:cNvPr/@name`), or `''` when unnamed. */
|
|
2848
|
-
get name(): string;
|
|
2849
|
-
/** Drawing id (`p:cNvPr/@id`), or `null` when absent. */
|
|
2850
|
-
get id(): number | null;
|
|
2851
|
-
/** Left edge in EMU (`a:off/@x`), or `null` when geometry is inherited (no own `a:xfrm`). */
|
|
2852
|
-
get left(): number | null;
|
|
2853
|
-
/** Top edge in EMU (`a:off/@y`), or `null` when geometry is inherited. */
|
|
2854
|
-
get top(): number | null;
|
|
2855
|
-
/** Width in EMU (`a:ext/@cx`), or `null` when geometry is inherited. */
|
|
2856
|
-
get width(): number | null;
|
|
2857
|
-
/** Height in EMU (`a:ext/@cy`), or `null` when geometry is inherited. */
|
|
2858
|
-
get height(): number | null;
|
|
2859
|
-
/**
|
|
2860
|
-
* The placeholder's text as a navigable {@link TextFrame} (`p:txBody`), or `null`
|
|
2861
|
-
* when it carries no text body (the `sldImg` thumbnail). The body placeholder's
|
|
2862
|
-
* runs round-trip a slide's authored notes; the `sldNum` placeholder's frame
|
|
2863
|
-
* holds the slide-number `a:fld`, whose value surfaces through `TextFrame.text`.
|
|
2864
|
-
*/
|
|
2865
|
-
get textFrame(): TextFrame | null;
|
|
2866
|
-
/** The placeholder's flattened text (paragraphs joined by `\n`), or `''` when it has no text body. */
|
|
2867
|
-
get text(): string;
|
|
2868
|
-
/** Escape hatch: the underlying `p:sp` element. After mutating it call {@link markDirty}, or `save()` writes the original bytes. */
|
|
2869
|
-
get element_(): Element;
|
|
2870
|
-
/** Mark the owning notes-slide part dirty so `save()` reserializes it. Call after mutating {@link element_}. */
|
|
2871
|
-
markDirty(): void;
|
|
2872
|
-
}
|
|
2873
|
-
/**
|
|
2874
|
-
* A slide's speaker-notes slide (`notesSlideN.xml`) as a modeled object — the deep
|
|
2875
|
-
* companion to {@link import('./slide.js').Slide.notesText}. Exposes the notes
|
|
2876
|
-
* shape tree as {@link NotesPlaceholder}s ({@link body}/{@link slideImage}/
|
|
2877
|
-
* {@link slideNumber}) plus the body {@link textFrame} the older getters flatten.
|
|
2878
|
-
*
|
|
2879
|
-
* The theme context (notesMaster → `theme2.xml`) is resolved once and shared across
|
|
2880
|
-
* every placeholder's text frame.
|
|
2881
|
-
*/
|
|
2882
|
-
declare class NotesSlide {
|
|
2883
|
-
#private;
|
|
2884
|
-
private readonly opc;
|
|
2885
|
-
/** The notes slide's OPC part (`/ppt/notesSlides/notesSlideN.xml`). */
|
|
2886
|
-
readonly part: Part;
|
|
2887
|
-
constructor(opc: OpcPackage,
|
|
2888
|
-
/** The notes slide's OPC part (`/ppt/notesSlides/notesSlideN.xml`). */
|
|
2889
|
-
part: Part);
|
|
2890
|
-
/** Partname of the notes slide part. */
|
|
2891
|
-
get partName(): string;
|
|
2892
|
-
/**
|
|
2893
|
-
* The notes theme context, resolved through the notesMaster → `theme2.xml` chain
|
|
2894
|
-
* and cached. Backs {@link NotesPlaceholder.textFrame}'s `Run.resolvedColor`.
|
|
2895
|
-
*/
|
|
2896
|
-
themeContext(): ThemeContext;
|
|
2897
|
-
/** The placeholders (`p:sp`) in the notes shape tree, in document order. */
|
|
2898
|
-
get placeholders(): NotesPlaceholder[];
|
|
2899
|
-
/** The notes body placeholder (`p:ph type="body"`), or `null` when the notes slide has none. */
|
|
2900
|
-
get body(): NotesPlaceholder | null;
|
|
2901
|
-
/** The slide-thumbnail placeholder (`p:ph type="sldImg"`), or `null` when absent. */
|
|
2902
|
-
get slideImage(): NotesPlaceholder | null;
|
|
2903
|
-
/** The slide-number placeholder (`p:ph type="sldNum"`, carrying the slide-number field), or `null`. */
|
|
2904
|
-
get slideNumber(): NotesPlaceholder | null;
|
|
2905
|
-
/** The notes body as a navigable {@link TextFrame}, or `null` when there is no body text frame. */
|
|
2906
|
-
get textFrame(): TextFrame | null;
|
|
2907
|
-
/** The notes body text flattened (paragraphs joined by `\n`), or `''` when the body is empty/absent. */
|
|
2908
|
-
get text(): string;
|
|
2909
|
-
}
|
|
2910
|
-
//#endregion
|
|
2911
|
-
//#region src/read/api/comments.d.ts
|
|
2912
|
-
/** One entry of the deck-wide comment-author registry (`p:cmAuthor`). */
|
|
2913
|
-
interface CommentAuthor {
|
|
2914
|
-
/** Author id (`@id`), referenced by each comment's `@authorId`. */
|
|
2915
|
-
id: number | null;
|
|
2916
|
-
/** Display name (`@name`). */
|
|
2917
|
-
name: string;
|
|
2918
|
-
/** Initials shown in the comment marker (`@initials`). */
|
|
2919
|
-
initials: string;
|
|
2920
|
-
/** Highest per-author comment index used (`@lastIdx`). */
|
|
2921
|
-
lastIdx: number | null;
|
|
2922
|
-
/** Author colour slot (`@clrIdx`). */
|
|
2923
|
-
clrIdx: number | null;
|
|
2924
|
-
}
|
|
2925
|
-
/** One legacy review comment (`p:cm`), with its author resolved via the registry. */
|
|
2926
|
-
interface Comment {
|
|
2927
|
-
/** Resolved author display name (via `@authorId` → `commentAuthors.xml`), or `null` when unresolved. */
|
|
2928
|
-
author: string | null;
|
|
2929
|
-
/** Resolved author initials, or `null` when unresolved. */
|
|
2930
|
-
authorInitials: string | null;
|
|
2931
|
-
/** The comment's `@authorId`, or `null` when absent/unparseable. */
|
|
2932
|
-
authorId: number | null;
|
|
2933
|
-
/** The comment's per-author 1-based index (`@idx`), or `null` when absent. */
|
|
2934
|
-
idx: number | null;
|
|
2935
|
-
/** The comment body text (`p:text`). */
|
|
2936
|
-
text: string;
|
|
2937
|
-
/** Marker X position in EMU (`p:pos/@x`), or `null` when absent. */
|
|
2938
|
-
x: number | null;
|
|
2939
|
-
/** Marker Y position in EMU (`p:pos/@y`), or `null` when absent. */
|
|
2940
|
-
y: number | null;
|
|
2941
|
-
/** Authored timestamp (`@dt`, ISO-8601 as written), or `null` when absent. */
|
|
2942
|
-
date: string | null;
|
|
2943
|
-
}
|
|
2944
|
-
/** One entry of the modern deck-wide author registry (`p188:author`). */
|
|
2945
|
-
interface ModernCommentAuthor {
|
|
2946
|
-
/** Author id (`@id`) — a GUID string like `{E8A64ABA-…}`, referenced by each comment's `@authorId`. */
|
|
2947
|
-
id: string | null;
|
|
2948
|
-
/** Display name (`@name`). */
|
|
2949
|
-
name: string;
|
|
2950
|
-
/** Initials (`@initials`). */
|
|
2951
|
-
initials: string;
|
|
2952
|
-
/** Account identifier (`@userId`, e.g. an email), or `null`. */
|
|
2953
|
-
userId: string | null;
|
|
2954
|
-
/** Identity provider (`@providerId`, e.g. `Windows Live`), or `null`. */
|
|
2955
|
-
providerId: string | null;
|
|
2956
|
-
}
|
|
2957
|
-
/** One modern comment or reply (`p188:cm` / `p188:reply`), with its author resolved via the registry. */
|
|
2958
|
-
interface ModernComment {
|
|
2959
|
-
/** The comment's own GUID id (`@id`), or `null` when absent. */
|
|
2960
|
-
id: string | null;
|
|
2961
|
-
/** Resolved author display name (via `@authorId` → `authors.xml`), or `null` when unresolved. */
|
|
2962
|
-
author: string | null;
|
|
2963
|
-
/** Resolved author initials, or `null` when unresolved. */
|
|
2964
|
-
authorInitials: string | null;
|
|
2965
|
-
/** The comment's `@authorId` GUID, or `null` when absent. */
|
|
2966
|
-
authorId: string | null;
|
|
2967
|
-
/** Creation timestamp (`@created`, ISO-8601 as written), or `null` when absent. */
|
|
2968
|
-
created: string | null;
|
|
2969
|
-
/** The comment body text; multiple paragraphs are joined with `\n`. */
|
|
2970
|
-
text: string;
|
|
2971
|
-
/** Marker X position in EMU (`p188:pos/@x`), or `null` (replies carry no position). */
|
|
2972
|
-
x: number | null;
|
|
2973
|
-
/** Marker Y position in EMU (`p188:pos/@y`), or `null` (replies carry no position). */
|
|
2974
|
-
y: number | null;
|
|
2975
|
-
/** Nested replies in thread order; each is itself a {@link ModernComment} with no further replies. */
|
|
2976
|
-
replies: ModernComment[];
|
|
2977
|
-
}
|
|
2978
|
-
/** Which comment schema a deck carries. `'none'` when it has neither part. */
|
|
2979
|
-
type CommentSchema = 'legacy' | 'modern' | 'none';
|
|
2980
|
-
//#endregion
|
|
2981
|
-
//#region src/read/api/tags.d.ts
|
|
2982
|
-
/** One programmatic tag (`p:tag`) — a name/value string pair. */
|
|
2983
|
-
interface Tag {
|
|
2984
|
-
/** The tag's `@name`. */
|
|
2985
|
-
name: string;
|
|
2986
|
-
/** The tag's `@val`. */
|
|
2987
|
-
val: string;
|
|
2988
|
-
}
|
|
2989
|
-
/**
|
|
2990
|
-
* Read every tag referenced by `ownerPartName` (a slide part or the presentation
|
|
2991
|
-
* part), resolving the owner's `tags` relationship(s) to their `ppt/tags/tagN.xml`
|
|
2992
|
-
* part(s) and flattening each part's `p:tag` children into `{ name, val }`. `[]`
|
|
2993
|
-
* when the owner references no tag part. Rel-driven rather than walking
|
|
2994
|
-
* `p:custDataLst`, so it is robust to element ordering in the owner.
|
|
2995
|
-
*/
|
|
2996
|
-
declare function readTagsForPart(opc: OpcPackage, ownerPartName: string): Tag[];
|
|
2997
|
-
//#endregion
|
|
2998
3075
|
//#region src/read/api/chrome.d.ts
|
|
2999
|
-
/** The 12 theme colour-scheme slots (`a:clrScheme` children), in schema order. */
|
|
3000
|
-
type ThemeColorSlot = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink';
|
|
3001
|
-
/** The 12 colour-map tokens (`p:clrMap` attributes), each pointing at a {@link ThemeColorSlot}. */
|
|
3002
|
-
type ColorMapToken = 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink';
|
|
3003
3076
|
/**
|
|
3004
3077
|
* One theme font family (`a:majorFont` or `a:minorFont`): the primary Latin face
|
|
3005
3078
|
* plus the East-Asian and complex-script faces. Each is `null` when the theme
|
|
@@ -3074,14 +3147,20 @@ declare class Theme {
|
|
|
3074
3147
|
*/
|
|
3075
3148
|
declare class Placeholder {
|
|
3076
3149
|
#private;
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
/** The
|
|
3080
|
-
|
|
3150
|
+
/** The placeholder's `p:sp`. `protected` so {@link NotesPlaceholder} can read it. */
|
|
3151
|
+
protected readonly sp: Element;
|
|
3152
|
+
/** The part the `p:sp` lives in — a master, a layout, or a notes slide. */
|
|
3153
|
+
protected readonly part: Part;
|
|
3154
|
+
/** The owning part's theme context, threaded to {@link textFrame}. */
|
|
3155
|
+
protected readonly themeContext: ThemeContext;
|
|
3081
3156
|
/** The owning part's relationships, threaded to {@link textFrame} for hyperlink resolution. */
|
|
3082
|
-
|
|
3083
|
-
constructor(
|
|
3084
|
-
/** The
|
|
3157
|
+
protected readonly relationships: Relationships;
|
|
3158
|
+
constructor(
|
|
3159
|
+
/** The placeholder's `p:sp`. `protected` so {@link NotesPlaceholder} can read it. */
|
|
3160
|
+
sp: Element,
|
|
3161
|
+
/** The part the `p:sp` lives in — a master, a layout, or a notes slide. */
|
|
3162
|
+
part: Part,
|
|
3163
|
+
/** The owning part's theme context, threaded to {@link textFrame}. */
|
|
3085
3164
|
themeContext: ThemeContext,
|
|
3086
3165
|
/** The owning part's relationships, threaded to {@link textFrame} for hyperlink resolution. */
|
|
3087
3166
|
relationships: Relationships);
|
|
@@ -3109,33 +3188,86 @@ declare class Placeholder {
|
|
|
3109
3188
|
get textFrame(): TextFrame | null;
|
|
3110
3189
|
/** Escape hatch: the underlying `p:sp` element. After mutating it call {@link markDirty}, or `save()` writes the original bytes. */
|
|
3111
3190
|
get element_(): Element;
|
|
3112
|
-
/** Mark the owning
|
|
3191
|
+
/** Mark the owning part dirty so `save()` reserializes it. Call after mutating {@link element_}. */
|
|
3113
3192
|
markDirty(): void;
|
|
3114
3193
|
}
|
|
3115
3194
|
/**
|
|
3116
|
-
*
|
|
3117
|
-
*
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3120
|
-
*
|
|
3195
|
+
* The shared body of a slide master and a slide layout — the two template tiers a slide
|
|
3196
|
+
* inherits from.
|
|
3197
|
+
*
|
|
3198
|
+
* Both are an OPC part holding a `p:cSld` with a shape tree and a resolvable theme context, and
|
|
3199
|
+
* both were written out in full, member for member: `partName`, `relationships`, `name`,
|
|
3200
|
+
* `shapes`, `shapeByIdDeep`, `placeholders`, `themeContext` and the two DOM lookups behind them
|
|
3201
|
+
* were character-for-character identical in the two classes. Nothing about that was broken, but
|
|
3202
|
+
* it meant every accessor added to a template tier had to be added twice, and the ones meant to
|
|
3203
|
+
* agree could quietly stop agreeing.
|
|
3204
|
+
*
|
|
3205
|
+
* What genuinely differs stays on the subclasses. `theme` differs because a layout has to walk
|
|
3206
|
+
* to its master first. `background` differs in the tier label it decodes with and in where it
|
|
3207
|
+
* finds the theme part. And the context itself differs, which is why {@link resolveThemeContext}
|
|
3208
|
+
* is abstract: a master resolves its own `p:clrMap` + theme, a layout walks layout → master →
|
|
3209
|
+
* theme. The caching around it is shared, so a subclass supplies the walk and nothing else.
|
|
3210
|
+
*
|
|
3211
|
+
* `Slide` deliberately does not extend this. It is a shape host too, but it is constructed from
|
|
3212
|
+
* a `Presentation` rather than an `OpcPackage`, reaches its relationships through that, and
|
|
3213
|
+
* reports an unnamed slide as `null` where a template tier reports `''` — three differences in
|
|
3214
|
+
* the same handful of members, which is more contortion than the sharing is worth.
|
|
3121
3215
|
*/
|
|
3122
|
-
declare class
|
|
3216
|
+
declare abstract class TemplatePart implements ShapeHost {
|
|
3123
3217
|
#private;
|
|
3124
|
-
/** The package
|
|
3218
|
+
/** The package this part belongs to, for reaching related parts (theme, master, media). */
|
|
3125
3219
|
readonly opc: OpcPackage;
|
|
3126
|
-
/**
|
|
3220
|
+
/** This tier's OPC part. */
|
|
3127
3221
|
readonly part: Part;
|
|
3128
3222
|
constructor(
|
|
3129
|
-
/** The package
|
|
3223
|
+
/** The package this part belongs to, for reaching related parts (theme, master, media). */
|
|
3130
3224
|
opc: OpcPackage,
|
|
3131
|
-
/**
|
|
3225
|
+
/** This tier's OPC part. */
|
|
3132
3226
|
part: Part);
|
|
3133
|
-
/** Partname of
|
|
3227
|
+
/** Partname of this part. */
|
|
3134
3228
|
get partName(): string;
|
|
3135
|
-
/** This
|
|
3229
|
+
/** This part's relationships (its theme or master, image embeds, hyperlinks, …). */
|
|
3136
3230
|
get relationships(): Relationships;
|
|
3137
|
-
/** The
|
|
3231
|
+
/** The authoring name (`p:cSld/@name`), or `''` when unnamed. */
|
|
3138
3232
|
get name(): string;
|
|
3233
|
+
/**
|
|
3234
|
+
* Every shape in this tier's `p:cSld/p:spTree`, in document order — the same `AnyShape`
|
|
3235
|
+
* union `Slide.shapes` returns, so shape-walking code applies unchanged.
|
|
3236
|
+
*
|
|
3237
|
+
* {@link placeholders} is the filtered view of the same tree.
|
|
3238
|
+
*/
|
|
3239
|
+
get shapes(): AnyShape[];
|
|
3240
|
+
/** The shape anywhere in this tier's tree with the given drawing id, or `undefined`. */
|
|
3241
|
+
shapeByIdDeep(id: number): AnyShape | undefined;
|
|
3242
|
+
/** This tier's placeholder shapes (`p:sp` carrying a `p:ph`), in document order. */
|
|
3243
|
+
get placeholders(): Placeholder[];
|
|
3244
|
+
/** This tier's colour/font context, resolved once and cached. Backs each {@link Placeholder}'s text frame. */
|
|
3245
|
+
themeContext(): ThemeContext;
|
|
3246
|
+
/** The theme this tier resolves against, or `null` when the chain is incomplete. */
|
|
3247
|
+
abstract get theme(): Theme | null;
|
|
3248
|
+
/** This tier's *own* background (`p:cSld/p:bg`), decoded, or `null` when it defines none. */
|
|
3249
|
+
abstract get background(): SlideBackground | null;
|
|
3250
|
+
/** Walk this tier's colour/font chain. Called once; {@link themeContext} caches the result. */
|
|
3251
|
+
protected abstract resolveThemeContext(): ThemeContext;
|
|
3252
|
+
/** The `p:cSld` of this part, or `null`. */
|
|
3253
|
+
protected cSld(): Element | null;
|
|
3254
|
+
/** The `p:cSld/p:spTree` of this part, or `null`. */
|
|
3255
|
+
protected spTree(): Element | null;
|
|
3256
|
+
/** The part this one's first relationship of `type` points at, or `null`. */
|
|
3257
|
+
protected relTarget(type: string): Part | null;
|
|
3258
|
+
}
|
|
3259
|
+
/**
|
|
3260
|
+
* A deck's slide master (`slideMasterN.xml`) as a modeled object. Exposes the
|
|
3261
|
+
* property tiers a bound slide inherits: the {@link colorMap} (token → theme slot),
|
|
3262
|
+
* its {@link theme}, its `shapes` and the `placeholders` subset of them, its own
|
|
3263
|
+
* {@link background}, and the {@link layouts} that build on it. Reachable from
|
|
3264
|
+
* {@link SlideLayout.master} and `Slide.master`.
|
|
3265
|
+
*
|
|
3266
|
+
* `shapes` is where a template's non-placeholder furniture lives: the header band, the
|
|
3267
|
+
* rule under the title, the logo. Whether a given slide draws them is
|
|
3268
|
+
* `Slide.showMasterSp` (and, for a layout, {@link SlideLayout.showMasterSp}).
|
|
3269
|
+
*/
|
|
3270
|
+
declare class SlideMaster extends TemplatePart {
|
|
3139
3271
|
/** The master's theme (via its `theme` relationship), or `null` when absent. */
|
|
3140
3272
|
get theme(): Theme | null;
|
|
3141
3273
|
/**
|
|
@@ -3145,20 +3277,6 @@ declare class SlideMaster implements ShapeHost {
|
|
|
3145
3277
|
* A token the map omits reads `null`.
|
|
3146
3278
|
*/
|
|
3147
3279
|
get colorMap(): Record<ColorMapToken, string | null>;
|
|
3148
|
-
/**
|
|
3149
|
-
* Every shape in the master's `p:cSld/p:spTree`, in document order — the same
|
|
3150
|
-
* `AnyShape` union `Slide.shapes` returns, so shape-walking code applies
|
|
3151
|
-
* unchanged. This is where a template's non-placeholder furniture lives: the
|
|
3152
|
-
* header band, the rule under the title, the logo. Whether a given slide draws
|
|
3153
|
-
* them is `Slide.showMasterSp` (and, for a layout, {@link SlideLayout.showMasterSp}).
|
|
3154
|
-
*
|
|
3155
|
-
* {@link placeholders} is the filtered view of the same tree.
|
|
3156
|
-
*/
|
|
3157
|
-
get shapes(): AnyShape[];
|
|
3158
|
-
/** The shape anywhere in the master's tree with the given drawing id, or `undefined`. */
|
|
3159
|
-
shapeByIdDeep(id: number): AnyShape | undefined;
|
|
3160
|
-
/** The master's placeholder shapes (`p:sp` carrying a `p:ph`), in document order. */
|
|
3161
|
-
get placeholders(): Placeholder[];
|
|
3162
3280
|
/** The layouts built on this master (via `p:sldLayoutIdLst` → its relationships), in list order. */
|
|
3163
3281
|
get layouts(): SlideLayout[];
|
|
3164
3282
|
/**
|
|
@@ -3167,36 +3285,21 @@ declare class SlideMaster implements ShapeHost {
|
|
|
3167
3285
|
* resolved through the slide → layout → master chain, is `Slide.background`.
|
|
3168
3286
|
*/
|
|
3169
3287
|
get background(): SlideBackground | null;
|
|
3170
|
-
/**
|
|
3171
|
-
|
|
3172
|
-
* cached. Backs each {@link Placeholder}'s text frame.
|
|
3173
|
-
*/
|
|
3174
|
-
themeContext(): ThemeContext;
|
|
3288
|
+
/** A master's context is its own `p:clrMap` plus its theme — no walk beyond this part. */
|
|
3289
|
+
protected resolveThemeContext(): ThemeContext;
|
|
3175
3290
|
}
|
|
3176
3291
|
/**
|
|
3177
3292
|
* A deck's slide layout (`slideLayoutN.xml`) as a modeled object — the gallery entry
|
|
3178
3293
|
* a slide binds to. Exposes its {@link name}, its {@link type} (import-only; the
|
|
3179
3294
|
* writer authors none), its {@link master} (and, through it, the {@link theme}), its
|
|
3180
|
-
*
|
|
3181
|
-
*
|
|
3295
|
+
* `shapes` and the `placeholders` subset of them, and its own {@link background}.
|
|
3296
|
+
* Reachable from `Slide.layout` and {@link SlideMaster.layouts}.
|
|
3297
|
+
*
|
|
3298
|
+
* The write API authors non-placeholder shapes into a layout: every
|
|
3299
|
+
* `defineSlideMaster({ objects })` member that is not a `placeholder` — a `rect`, a
|
|
3300
|
+
* `line`, an `image`, a `chart`, a `text` box — lands in this tier's tree.
|
|
3182
3301
|
*/
|
|
3183
|
-
declare class SlideLayout
|
|
3184
|
-
#private;
|
|
3185
|
-
/** The package the layout belongs to, for reaching its master, theme, and media. */
|
|
3186
|
-
readonly opc: OpcPackage;
|
|
3187
|
-
/** The layout's OPC part (`/ppt/slideLayouts/slideLayoutN.xml`). */
|
|
3188
|
-
readonly part: Part;
|
|
3189
|
-
constructor(
|
|
3190
|
-
/** The package the layout belongs to, for reaching its master, theme, and media. */
|
|
3191
|
-
opc: OpcPackage,
|
|
3192
|
-
/** The layout's OPC part (`/ppt/slideLayouts/slideLayoutN.xml`). */
|
|
3193
|
-
part: Part);
|
|
3194
|
-
/** Partname of the layout part. */
|
|
3195
|
-
get partName(): string;
|
|
3196
|
-
/** This layout part's relationships (its master, image embeds, hyperlinks, …). */
|
|
3197
|
-
get relationships(): Relationships;
|
|
3198
|
-
/** The layout's authoring name (`p:cSld/@name`, e.g. `Title and Content`), or `''` when unnamed. */
|
|
3199
|
-
get name(): string;
|
|
3302
|
+
declare class SlideLayout extends TemplatePart {
|
|
3200
3303
|
/**
|
|
3201
3304
|
* The layout type (`p:sldLayout/@type`, e.g. `title` | `obj` | `blank`), or `null`
|
|
3202
3305
|
* when the layout declares none. Import-only: the writer authors no `@type`, so an
|
|
@@ -3216,20 +3319,6 @@ declare class SlideLayout implements ShapeHost {
|
|
|
3216
3319
|
get master(): SlideMaster | null;
|
|
3217
3320
|
/** The theme this layout resolves against, via its {@link master}, or `null`. */
|
|
3218
3321
|
get theme(): Theme | null;
|
|
3219
|
-
/**
|
|
3220
|
-
* Every shape in the layout's `p:cSld/p:spTree`, in document order — the same
|
|
3221
|
-
* `AnyShape` union `Slide.shapes` returns, so shape-walking code applies
|
|
3222
|
-
* unchanged. The write API authors non-placeholder shapes here: every
|
|
3223
|
-
* `defineSlideMaster({ objects })` member that is not a `placeholder` (a `rect`,
|
|
3224
|
-
* a `line`, an `image`, a `chart`, a `text` box) lands in this tree.
|
|
3225
|
-
*
|
|
3226
|
-
* {@link placeholders} is the filtered view of the same tree.
|
|
3227
|
-
*/
|
|
3228
|
-
get shapes(): AnyShape[];
|
|
3229
|
-
/** The shape anywhere in the layout's tree with the given drawing id, or `undefined`. */
|
|
3230
|
-
shapeByIdDeep(id: number): AnyShape | undefined;
|
|
3231
|
-
/** The layout's placeholder shapes (`p:sp` carrying a `p:ph`), in document order. */
|
|
3232
|
-
get placeholders(): Placeholder[];
|
|
3233
3322
|
/**
|
|
3234
3323
|
* The layout's *own* background (`p:cSld/p:bg`), decoded, or `null` when it defines
|
|
3235
3324
|
* none. A layout usually authors one — an explicit fill (`p:bgPr`) or a
|
|
@@ -3237,12 +3326,161 @@ declare class SlideLayout implements ShapeHost {
|
|
|
3237
3326
|
* `Slide.background`.
|
|
3238
3327
|
*/
|
|
3239
3328
|
get background(): SlideBackground | null;
|
|
3329
|
+
/** A layout's context is walked layout → master → theme, which is why it is not the master's. */
|
|
3330
|
+
protected resolveThemeContext(): ThemeContext;
|
|
3331
|
+
}
|
|
3332
|
+
//#endregion
|
|
3333
|
+
//#region src/read/api/notes.d.ts
|
|
3334
|
+
/**
|
|
3335
|
+
* One placeholder shape (`p:sp`) of a notes slide. A notes slide holds a fixed set:
|
|
3336
|
+
* the slide thumbnail (`type="sldImg"`), the notes body (`type="body"`), and the
|
|
3337
|
+
* slide number (`type="sldNum"`). Geometry getters read the placeholder's *own*
|
|
3338
|
+
* `a:xfrm` and are `null` when it inherits geometry from the notesMaster (the case
|
|
3339
|
+
* on an authored deck, whose `sldImg`/`sldNum` carry an empty `p:spPr`).
|
|
3340
|
+
*
|
|
3341
|
+
* A notes placeholder IS a {@link Placeholder} — identity, geometry and the escape hatch are
|
|
3342
|
+
* the same twelve members read off the same `p:sp`, down to `p:ph` being found the same way —
|
|
3343
|
+
* so it extends one rather than repeating it. Two things are its own: the flattened
|
|
3344
|
+
* {@link text} convenience, and a {@link textFrame} that threads the notesMaster inheritance
|
|
3345
|
+
* context onto the body frame.
|
|
3346
|
+
*/
|
|
3347
|
+
declare class NotesPlaceholder extends Placeholder {
|
|
3240
3348
|
/**
|
|
3241
|
-
* The
|
|
3242
|
-
*
|
|
3349
|
+
* The placeholder's text as a navigable {@link TextFrame} (`p:txBody`), or `null`
|
|
3350
|
+
* when it carries no text body (the `sldImg` thumbnail). The body placeholder's
|
|
3351
|
+
* runs round-trip a slide's authored notes; the `sldNum` placeholder's frame
|
|
3352
|
+
* holds the slide-number `a:fld`, whose value surfaces through `TextFrame.text`.
|
|
3353
|
+
*
|
|
3354
|
+
* Overrides {@link Placeholder.textFrame} for the inheritance context alone — see below.
|
|
3355
|
+
*/
|
|
3356
|
+
get textFrame(): TextFrame | null;
|
|
3357
|
+
/** The placeholder's flattened text (paragraphs joined by `\n`), or `''` when it has no text body. */
|
|
3358
|
+
get text(): string;
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* A slide's speaker-notes slide (`notesSlideN.xml`) as a modeled object — the deep
|
|
3362
|
+
* companion to {@link import('./slide.js').Slide.notesText}. Exposes the notes
|
|
3363
|
+
* shape tree as {@link NotesPlaceholder}s ({@link body}/{@link slideImage}/
|
|
3364
|
+
* {@link slideNumber}) plus the body {@link textFrame} the older getters flatten.
|
|
3365
|
+
*
|
|
3366
|
+
* The theme context (notesMaster → `theme2.xml`) is resolved once and shared across
|
|
3367
|
+
* every placeholder's text frame.
|
|
3368
|
+
*/
|
|
3369
|
+
declare class NotesSlide {
|
|
3370
|
+
#private;
|
|
3371
|
+
private readonly opc;
|
|
3372
|
+
/** The notes slide's OPC part (`/ppt/notesSlides/notesSlideN.xml`). */
|
|
3373
|
+
readonly part: Part;
|
|
3374
|
+
constructor(opc: OpcPackage,
|
|
3375
|
+
/** The notes slide's OPC part (`/ppt/notesSlides/notesSlideN.xml`). */
|
|
3376
|
+
part: Part);
|
|
3377
|
+
/** Partname of the notes slide part. */
|
|
3378
|
+
get partName(): string;
|
|
3379
|
+
/**
|
|
3380
|
+
* The notes theme context, resolved through the notesMaster → `theme2.xml` chain
|
|
3381
|
+
* and cached. Backs {@link NotesPlaceholder.textFrame}'s `Run.resolvedColor`.
|
|
3243
3382
|
*/
|
|
3244
3383
|
themeContext(): ThemeContext;
|
|
3384
|
+
/** The placeholders (`p:sp`) in the notes shape tree, in document order. */
|
|
3385
|
+
get placeholders(): NotesPlaceholder[];
|
|
3386
|
+
/** The notes body placeholder (`p:ph type="body"`), or `null` when the notes slide has none. */
|
|
3387
|
+
get body(): NotesPlaceholder | null;
|
|
3388
|
+
/** The slide-thumbnail placeholder (`p:ph type="sldImg"`), or `null` when absent. */
|
|
3389
|
+
get slideImage(): NotesPlaceholder | null;
|
|
3390
|
+
/** The slide-number placeholder (`p:ph type="sldNum"`, carrying the slide-number field), or `null`. */
|
|
3391
|
+
get slideNumber(): NotesPlaceholder | null;
|
|
3392
|
+
/** The notes body as a navigable {@link TextFrame}, or `null` when there is no body text frame. */
|
|
3393
|
+
get textFrame(): TextFrame | null;
|
|
3394
|
+
/** The notes body text flattened (paragraphs joined by `\n`), or `''` when the body is empty/absent. */
|
|
3395
|
+
get text(): string;
|
|
3396
|
+
}
|
|
3397
|
+
//#endregion
|
|
3398
|
+
//#region src/read/api/comments.d.ts
|
|
3399
|
+
/** One entry of the deck-wide comment-author registry (`p:cmAuthor`). */
|
|
3400
|
+
interface CommentAuthor {
|
|
3401
|
+
/** Author id (`@id`), referenced by each comment's `@authorId`. */
|
|
3402
|
+
id: number | null;
|
|
3403
|
+
/** Display name (`@name`). */
|
|
3404
|
+
name: string;
|
|
3405
|
+
/** Initials shown in the comment marker (`@initials`). */
|
|
3406
|
+
initials: string;
|
|
3407
|
+
/** Highest per-author comment index used (`@lastIdx`). */
|
|
3408
|
+
lastIdx: number | null;
|
|
3409
|
+
/** Author colour slot (`@clrIdx`). */
|
|
3410
|
+
clrIdx: number | null;
|
|
3411
|
+
}
|
|
3412
|
+
/** One legacy review comment (`p:cm`), with its author resolved via the registry. */
|
|
3413
|
+
interface Comment {
|
|
3414
|
+
/** Resolved author display name (via `@authorId` → `commentAuthors.xml`), or `null` when unresolved. */
|
|
3415
|
+
author: string | null;
|
|
3416
|
+
/** Resolved author initials, or `null` when unresolved. */
|
|
3417
|
+
authorInitials: string | null;
|
|
3418
|
+
/** The comment's `@authorId`, or `null` when absent/unparseable. */
|
|
3419
|
+
authorId: number | null;
|
|
3420
|
+
/** The comment's per-author 1-based index (`@idx`), or `null` when absent. */
|
|
3421
|
+
idx: number | null;
|
|
3422
|
+
/** The comment body text (`p:text`). */
|
|
3423
|
+
text: string;
|
|
3424
|
+
/** Marker X position in EMU (`p:pos/@x`), or `null` when absent. */
|
|
3425
|
+
x: number | null;
|
|
3426
|
+
/** Marker Y position in EMU (`p:pos/@y`), or `null` when absent. */
|
|
3427
|
+
y: number | null;
|
|
3428
|
+
/** Authored timestamp (`@dt`, ISO-8601 as written), or `null` when absent. */
|
|
3429
|
+
date: string | null;
|
|
3245
3430
|
}
|
|
3431
|
+
/** One entry of the modern deck-wide author registry (`p188:author`). */
|
|
3432
|
+
interface ModernCommentAuthor {
|
|
3433
|
+
/** Author id (`@id`) — a GUID string like `{E8A64ABA-…}`, referenced by each comment's `@authorId`. */
|
|
3434
|
+
id: string | null;
|
|
3435
|
+
/** Display name (`@name`). */
|
|
3436
|
+
name: string;
|
|
3437
|
+
/** Initials (`@initials`). */
|
|
3438
|
+
initials: string;
|
|
3439
|
+
/** Account identifier (`@userId`, e.g. an email), or `null`. */
|
|
3440
|
+
userId: string | null;
|
|
3441
|
+
/** Identity provider (`@providerId`, e.g. `Windows Live`), or `null`. */
|
|
3442
|
+
providerId: string | null;
|
|
3443
|
+
}
|
|
3444
|
+
/** One modern comment or reply (`p188:cm` / `p188:reply`), with its author resolved via the registry. */
|
|
3445
|
+
interface ModernComment {
|
|
3446
|
+
/** The comment's own GUID id (`@id`), or `null` when absent. */
|
|
3447
|
+
id: string | null;
|
|
3448
|
+
/** Resolved author display name (via `@authorId` → `authors.xml`), or `null` when unresolved. */
|
|
3449
|
+
author: string | null;
|
|
3450
|
+
/** Resolved author initials, or `null` when unresolved. */
|
|
3451
|
+
authorInitials: string | null;
|
|
3452
|
+
/** The comment's `@authorId` GUID, or `null` when absent. */
|
|
3453
|
+
authorId: string | null;
|
|
3454
|
+
/** Creation timestamp (`@created`, ISO-8601 as written), or `null` when absent. */
|
|
3455
|
+
created: string | null;
|
|
3456
|
+
/** The comment body text; multiple paragraphs are joined with `\n`. */
|
|
3457
|
+
text: string;
|
|
3458
|
+
/** Marker X position in EMU (`p188:pos/@x`), or `null` (replies carry no position). */
|
|
3459
|
+
x: number | null;
|
|
3460
|
+
/** Marker Y position in EMU (`p188:pos/@y`), or `null` (replies carry no position). */
|
|
3461
|
+
y: number | null;
|
|
3462
|
+
/** Nested replies in thread order; each is itself a {@link ModernComment} with no further replies. */
|
|
3463
|
+
replies: ModernComment[];
|
|
3464
|
+
}
|
|
3465
|
+
/** Which comment schema a deck carries. `'none'` when it has neither part. */
|
|
3466
|
+
type CommentSchema = 'legacy' | 'modern' | 'none';
|
|
3467
|
+
//#endregion
|
|
3468
|
+
//#region src/read/api/tags.d.ts
|
|
3469
|
+
/** One programmatic tag (`p:tag`) — a name/value string pair. */
|
|
3470
|
+
interface Tag {
|
|
3471
|
+
/** The tag's `@name`. */
|
|
3472
|
+
name: string;
|
|
3473
|
+
/** The tag's `@val`. */
|
|
3474
|
+
val: string;
|
|
3475
|
+
}
|
|
3476
|
+
/**
|
|
3477
|
+
* Read every tag referenced by `ownerPartName` (a slide part or the presentation
|
|
3478
|
+
* part), resolving the owner's `tags` relationship(s) to their `ppt/tags/tagN.xml`
|
|
3479
|
+
* part(s) and flattening each part's `p:tag` children into `{ name, val }`. `[]`
|
|
3480
|
+
* when the owner references no tag part. Rel-driven rather than walking
|
|
3481
|
+
* `p:custDataLst`, so it is robust to element ordering in the owner.
|
|
3482
|
+
*/
|
|
3483
|
+
declare function readTagsForPart(opc: OpcPackage, ownerPartName: string): Tag[];
|
|
3246
3484
|
//#endregion
|
|
3247
3485
|
//#region src/read/api/transition.d.ts
|
|
3248
3486
|
/** `ST_TransitionSpeed` — the coarse speed bucket (`spd`), default `fast`. */
|
|
@@ -4630,5 +4868,5 @@ interface FromTemplateOptions {
|
|
|
4630
4868
|
keepTemplateContentType?: boolean;
|
|
4631
4869
|
}
|
|
4632
4870
|
//#endregion
|
|
4633
|
-
export {
|
|
4634
|
-
//# sourceMappingURL=presentation-types-
|
|
4871
|
+
export { TableCell as $, ShapeType as $t, CommentSchema as A, AutofitMode as At, ThemeFontScheme as B, ChildFrame as Bt, TransitionInfo as C, ChartLine as Ct, readTagsForPart as D, AutoShape as Dt, Tag as E, Picture as Et, Placeholder as F, Paragraph as Ft, isGraphicFrame as G, Glow as Gt, GroupShape as H, CustomGeometry as Ht, SlideLayout as I, Run as It, GraphicFrame as J, LineEnds as Jt, isGroupShape as K, InnerShadow as Kt, SlideMaster as L, RunHyperlink as Lt, ModernCommentAuthor as M, BulletDetail as Mt, NotesPlaceholder as N, BulletStyle as Nt, Comment as O, Shape as Ot, NotesSlide as P, LineSpacing as Pt, Table as Q, Reflection as Qt, Theme as R, TextFrame as Rt, Slide as S, ChartLegend as St, TransitionSpeed as T, Connector as Tt, isAutoShape as U, CustomGeometryPath as Ut, AnyShape as V, ConnectionSite as Vt, isConnector as W, GeometryCommand as Wt, CellBorders as X, Recolor as Xt, CellBorder as Y, OuterShadow as Yt, CellThreeD as Z, RecolorColor as Zt, CustomProperty as _, AxisNumberFormat as _t, ExtractedSlides as a, FillRect as an, Diagram as at, AddPictureOptions as b, ChartDataLabels as bt, ImportSlideMastersOptions as c, GradientFill as cn, DiagramDrawnShape as ct, ImportedSlideMaster as d, resolveColorElement as dn, DiagramPointType as dt, SoftEdge as en, TableCellBorderEdit as et, LayoutHandle as f, ColorTransform as fn, ChartEx as ft, CoreProperties as g, EmbeddedFontSlot as gn, ChartExSeries as gt, Presentation as h, ColorContext as hn, ChartExLegend as ht, ExtractedSlide as i, SlideBackground as in, TableCellEdge as it, ModernComment as j, BodyProperties as jt, CommentAuthor as k, ShapeHost as kt, ImportSlideOptions as l, GradientStop as ln, DiagramNode as lt, SlideSource as m, applyColorTransforms as mn, ChartExDataLabels as mt, EmbeddedFontFaceInfo as n, BackgroundFill as nn, ResolvedTableStyle as nt, FromTemplateOptions as o, PictureFill as on, DiagramConnection as ot, SlideSize as p, EffectiveColor as pn, ChartExAxis as pt, isPicture as q, LineEnd as qt, EmbeddedFontInfo as r, BackgroundSource as rn, TableConditionFlags as rt, ImportShapeOptions as s, PictureFillTile as sn, DiagramConnectionType as st, AppendSlidesOptions as t, PatternFill as tn, TableRow as tt, ImportSlidesRequest as u, ResolvedColor as un, DiagramPoint as ut, readCoreProperties as v, Chart as vt, TransitionInput as w, ChartSeries as wt, AddTextBoxOptions as x, ChartFill as xt, readCustomProperties as y, ChartAxis as yt, ThemeFontFace as z, AbsoluteFrame as zt };
|
|
4872
|
+
//# sourceMappingURL=presentation-types-DP_8jog7.d.ts.map
|