@shbernal/ts-pptx 4.1.0 → 4.2.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/README.md +11 -11
- package/dist/anim-presets-Qbgh8uut.js +55 -0
- package/dist/anim-presets-Qbgh8uut.js.map +1 -0
- package/dist/{autopage-D4kyVp11.js → autopage-DqZ37VpL.js} +11 -12
- package/dist/autopage-DqZ37VpL.js.map +1 -0
- package/dist/{binary-string-CKVAYI3M.js → binary-string-Ba8VM3b9.js} +3 -4
- package/dist/binary-string-Ba8VM3b9.js.map +1 -0
- package/dist/{body-insets-kVHmjGc6.js → body-insets-BDHymJvz.js} +7 -9
- package/dist/body-insets-BDHymJvz.js.map +1 -0
- package/dist/browser.d.ts +24 -16
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +19 -19
- package/dist/browser.js.map +1 -1
- package/dist/{image-size-DwDbakcl.js → chart-metadata-CwiTTcJq.js} +576 -538
- package/dist/chart-metadata-CwiTTcJq.js.map +1 -0
- package/dist/{clip-DHDlnHUq.d.ts → clip-ISfCMtWA.d.ts} +6 -10
- package/dist/clip-ISfCMtWA.d.ts.map +1 -0
- package/dist/{notes-BcT571R4.js → comments-CKIZYRbZ.js} +517 -389
- package/dist/comments-CKIZYRbZ.js.map +1 -0
- package/dist/{diagnostics-DiMmBU8P.d.ts → diagnostics-MoA4MBq5.d.ts} +52 -50
- package/dist/diagnostics-MoA4MBq5.d.ts.map +1 -0
- package/dist/{embedded-fonts-CI_YGW2d.d.ts → embedded-fonts-U7HIIhPO.d.ts} +4 -6
- package/dist/embedded-fonts-U7HIIhPO.d.ts.map +1 -0
- package/dist/{entry-compose-6hF9aTmT.d.ts → entry-compose-CiakSt-f.d.ts} +53 -74
- package/dist/entry-compose-CiakSt-f.d.ts.map +1 -0
- package/dist/{errors-Da2nXCJm.js → entry-errors-JMthgJ2g.js} +41 -25
- package/dist/entry-errors-JMthgJ2g.js.map +1 -0
- package/dist/{table-cell-margins-PDshga8T.js → enums-BP9wsb9Q.js} +42 -45
- package/dist/enums-BP9wsb9Q.js.map +1 -0
- package/dist/{enums-DQRpVOLh.d.ts → enums-PcXr3o3J.d.ts} +11 -12
- package/dist/{enums-DQRpVOLh.d.ts.map → enums-PcXr3o3J.d.ts.map} +1 -1
- package/dist/families.d.ts +24 -26
- package/dist/families.d.ts.map +1 -1
- package/dist/families.js +3 -4
- package/dist/{fit-CcXbg__l.js → fit-Bpmzep6O.js} +60 -52
- package/dist/fit-Bpmzep6O.js.map +1 -0
- package/dist/{font-metrics-CBGmhLo0.d.ts → font-metrics-DTppw4t3.d.ts} +61 -37
- package/dist/font-metrics-DTppw4t3.d.ts.map +1 -0
- package/dist/{grid-9B2w5EaY.js → grid-DUIMxjfl.js} +23 -26
- package/dist/grid-DUIMxjfl.js.map +1 -0
- package/dist/{html-dom-DvJmuHt2.js → html-dom-LZCgntnJ.js} +42 -43
- package/dist/html-dom-LZCgntnJ.js.map +1 -0
- package/dist/html.d.ts +53 -9
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +12 -13
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +21 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +14 -16
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +18 -19
- package/dist/inspect.js.map +1 -1
- package/dist/{text-anchor-BgLPbwbL.js → lock-attrs-CSQnFDHP.js} +62 -12
- package/dist/lock-attrs-CSQnFDHP.js.map +1 -0
- package/dist/math.d.ts +2 -4
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +12 -13
- package/dist/math.js.map +1 -1
- package/dist/measure.d.ts +23 -12
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +3 -3
- package/dist/node.d.ts +21 -13
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +12 -12
- package/dist/node.js.map +1 -1
- package/dist/{options-internal-WqgMf720.js → options-internal-BWgmLPdx.js} +4 -5
- package/dist/options-internal-BWgmLPdx.js.map +1 -0
- package/dist/{package-KoEgVwII.d.ts → package-CANBWuSm.d.ts} +4 -12
- package/dist/package-CANBWuSm.d.ts.map +1 -0
- package/dist/{playbtn-CUqQdoDf.js → playbtn-BQZFJir9.js} +4 -5
- package/dist/playbtn-BQZFJir9.js.map +1 -0
- package/dist/{pres-BA9_lJbY.d.ts → pres-BkEkUAEM.d.ts} +383 -230
- package/dist/pres-BkEkUAEM.d.ts.map +1 -0
- package/dist/{presentation-Cyl74rq2.js → presentation-4Ggq0_Xa.js} +408 -288
- package/dist/presentation-4Ggq0_Xa.js.map +1 -0
- package/dist/{presentation-types-B3VQH4Bz.d.ts → presentation-types-BgnZR-0a.d.ts} +1104 -457
- package/dist/presentation-types-BgnZR-0a.d.ts.map +1 -0
- package/dist/read.d.ts +18 -13
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +4 -4
- package/dist/script.d.ts +116 -65
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +2697 -777
- package/dist/script.js.map +1 -1
- package/dist/{shapes-BcyFdZpp.js → shapes-CAPOjU0Q.js} +1556 -487
- package/dist/shapes-CAPOjU0Q.js.map +1 -0
- package/dist/{slide-BqPtyKmb.d.ts → slide-BmT4kMoO.d.ts} +94 -86
- package/dist/slide-BmT4kMoO.d.ts.map +1 -0
- package/dist/{slide-size-BalTjFuv.js → slide-size-SkScz1ig.js} +2 -3
- package/dist/{slide-size-BalTjFuv.js.map → slide-size-SkScz1ig.js.map} +1 -1
- package/dist/{table-dom-CVbvUfgh.js → table-dom-BYga4FYY.js} +3 -4
- package/dist/{table-dom-CVbvUfgh.js.map → table-dom-BYga4FYY.js.map} +1 -1
- package/dist/{text-BvFFMMFQ.js → text-CU08xJGs.js} +365 -318
- package/dist/text-CU08xJGs.js.map +1 -0
- package/dist/{transition-speed-kUEWDWTx.js → transition-speed-CNJ0fSpQ.js} +2 -3
- package/dist/{transition-speed-kUEWDWTx.js.map → transition-speed-CNJ0fSpQ.js.map} +1 -1
- package/dist/{units-internal-DFcUYjh3.js → units-internal-BR3a4cIi.js} +26 -29
- package/dist/units-internal-BR3a4cIi.js.map +1 -0
- package/dist/{zip-CYZ0F6BV.js → zip-7JTh61LX.js} +8 -10
- package/dist/zip-7JTh61LX.js.map +1 -0
- package/dist/{zip-CTll_dr0.d.ts → zip-uUjs9Cqx.d.ts} +4 -6
- package/dist/zip-uUjs9Cqx.d.ts.map +1 -0
- package/dist/zip.d.ts +3 -3
- package/dist/zip.js +3 -3
- package/dist/{zoom-BoNyOlPm.js → zoom-CSSeOwM8.js} +1153 -583
- package/dist/zoom-CSSeOwM8.js.map +1 -0
- package/package.json +20 -21
- package/skills/{ts-pptx-upstream → pptx-ts-upstream}/SKILL.md +27 -74
- package/dist/autopage-D4kyVp11.js.map +0 -1
- package/dist/binary-string-CKVAYI3M.js.map +0 -1
- package/dist/body-insets-kVHmjGc6.js.map +0 -1
- package/dist/clip-DHDlnHUq.d.ts.map +0 -1
- package/dist/diagnostics-DiMmBU8P.d.ts.map +0 -1
- package/dist/embedded-fonts-CI_YGW2d.d.ts.map +0 -1
- package/dist/entry-compose-6hF9aTmT.d.ts.map +0 -1
- package/dist/errors-Da2nXCJm.js.map +0 -1
- package/dist/fit-CcXbg__l.js.map +0 -1
- package/dist/font-metrics-CBGmhLo0.d.ts.map +0 -1
- package/dist/grid-9B2w5EaY.js.map +0 -1
- package/dist/html-dom-DvJmuHt2.js.map +0 -1
- package/dist/image-size-DwDbakcl.js.map +0 -1
- package/dist/notes-BcT571R4.js.map +0 -1
- package/dist/options-internal-WqgMf720.js.map +0 -1
- package/dist/package-KoEgVwII.d.ts.map +0 -1
- package/dist/playbtn-CUqQdoDf.js.map +0 -1
- package/dist/pres-BA9_lJbY.d.ts.map +0 -1
- package/dist/presentation-Cyl74rq2.js.map +0 -1
- package/dist/presentation-types-B3VQH4Bz.d.ts.map +0 -1
- package/dist/shapes-BcyFdZpp.js.map +0 -1
- package/dist/slide-BqPtyKmb.d.ts.map +0 -1
- package/dist/table-cell-margins-PDshga8T.js.map +0 -1
- package/dist/text-BvFFMMFQ.js.map +0 -1
- package/dist/text-anchor-BgLPbwbL.js.map +0 -1
- package/dist/units-internal-DFcUYjh3.js.map +0 -1
- package/dist/zip-CTll_dr0.d.ts.map +0 -1
- package/dist/zip-CYZ0F6BV.js.map +0 -1
- package/dist/zoom-BoNyOlPm.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { c as PLACEHOLDER_TYPE, d as SHAPE_NAME, i as CHART_NAME, v as WRITE_OUTPUT_TYPE } from "./enums-
|
|
2
|
-
//#region src/ooxml/st-enums.d.ts
|
|
1
|
+
import { c as PLACEHOLDER_TYPE, d as SHAPE_NAME, i as CHART_NAME, v as WRITE_OUTPUT_TYPE } from "./enums-PcXr3o3J.js";
|
|
3
2
|
/**
|
|
4
3
|
* `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the
|
|
5
4
|
* TypeScript union a caller is checked against and the runtime list a value is validated against.
|
|
@@ -12,7 +11,7 @@ import { c as PLACEHOLDER_TYPE, d as SHAPE_NAME, i as CHART_NAME, v as WRITE_OUT
|
|
|
12
11
|
* which is harmless, but nothing would have caught a divergence in *content*.
|
|
13
12
|
*
|
|
14
13
|
* **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via
|
|
15
|
-
* `(typeof X)[number]`. Widening the tuple widens the union in the same edit
|
|
14
|
+
* `(typeof X)[number]`. Widening the tuple widens the union in the same edit, so they cannot drift.
|
|
16
15
|
* This is the idiom `EXTRA_SHAPE_PRESETS` already used; this module brings the stragglers onto it,
|
|
17
16
|
* and holds a few closed schema lists that are not `ST_` types, such as `EMBEDDED_FONT_SLOTS`.
|
|
18
17
|
*
|
|
@@ -30,19 +29,19 @@ import { c as PLACEHOLDER_TYPE, d as SHAPE_NAME, i as CHART_NAME, v as WRITE_OUT
|
|
|
30
29
|
* unfinished for a while. `src/types/chart.ts`
|
|
31
30
|
* hand-wrote four of those unions beside the option that takes them and typed the other three as
|
|
32
31
|
* bare `string`, so `barDir` carried no compile-time check at all, and `dataLabelPosition`'s
|
|
33
|
-
* hand-written union was missing `inBase
|
|
32
|
+
* hand-written union was missing `inBase`, a value the validator accepts on a stacked bar, so
|
|
34
33
|
* the two spellings had already diverged in content. Both are gone: for every option here, the
|
|
35
34
|
* type a caller is checked against and the tuple the validator checks are one declaration.
|
|
36
35
|
*/
|
|
37
|
-
/** `ST_TextAutonumberScheme
|
|
36
|
+
/** `ST_TextAutonumberScheme`: the numbering an auto-numbered bullet counts in (`a:buAutoNum/@type`). */
|
|
38
37
|
declare const TEXT_AUTONUM_SCHEMES: readonly ['alphaLcParenBoth', 'alphaUcParenBoth', 'alphaLcParenR', 'alphaUcParenR', 'alphaLcPeriod', 'alphaUcPeriod', 'arabicParenBoth', 'arabicParenR', 'arabicPeriod', 'arabicPlain', 'romanLcParenBoth', 'romanUcParenBoth', 'romanLcParenR', 'romanUcParenR', 'romanLcPeriod', 'romanUcPeriod', 'circleNumDbPlain', 'circleNumWdBlackPlain', 'circleNumWdWhitePlain', 'arabicDbPeriod', 'arabicDbPlain', 'ea1ChsPeriod', 'ea1ChsPlain', 'ea1ChtPeriod', 'ea1ChtPlain', 'ea1JpnChsDbPeriod', 'ea1JpnKorPlain', 'ea1JpnKorPeriod', 'arabic1Minus', 'arabic2Minus', 'hebrew2Minus', 'thaiAlphaPeriod', 'thaiAlphaParenR', 'thaiAlphaParenBoth', 'thaiNumPeriod', 'thaiNumParenR', 'thaiNumParenBoth', 'hindiAlphaPeriod', 'hindiNumPeriod', 'hindiNumParenR', 'hindiAlpha1Period'];
|
|
39
|
-
/** `ST_TextStrikeType
|
|
38
|
+
/** `ST_TextStrikeType`: a run's strikethrough (`a:rPr/@strike`). */
|
|
40
39
|
declare const TEXT_STRIKE_TYPES: readonly ['noStrike', 'sngStrike', 'dblStrike'];
|
|
41
|
-
/** `ST_TextCapsType
|
|
40
|
+
/** `ST_TextCapsType`: a run's capitalization (`a:rPr/@cap`). */
|
|
42
41
|
declare const TEXT_CAPS_TYPES: readonly ['none', 'small', 'all'];
|
|
43
|
-
/** `ST_TextUnderlineType
|
|
42
|
+
/** `ST_TextUnderlineType`: a run's underline (`a:rPr/@u`). */
|
|
44
43
|
declare const TEXT_UNDERLINE_TYPES: readonly ['none', 'words', 'sng', 'dbl', 'heavy', 'dotted', 'dottedHeavy', 'dash', 'dashHeavy', 'dashLong', 'dashLongHeavy', 'dotDash', 'dotDashHeavy', 'dotDotDash', 'dotDotDashHeavy', 'wavy', 'wavyHeavy', 'wavyDbl'];
|
|
45
|
-
/** `ST_TextTabAlignType
|
|
44
|
+
/** `ST_TextTabAlignType`: a tab stop's alignment (`a:tab/@algn`). */
|
|
46
45
|
declare const TEXT_TAB_ALIGN_TYPES: readonly ['l', 'ctr', 'r', 'dec'];
|
|
47
46
|
/**
|
|
48
47
|
* The base slide transitions: the `p:` type elements of `CT_SlideTransition`'s choice, in its
|
|
@@ -53,47 +52,47 @@ declare const TEXT_TAB_ALIGN_TYPES: readonly ['l', 'ctr', 'r', 'dec'];
|
|
|
53
52
|
*/
|
|
54
53
|
declare const TRANSITION_TYPES: readonly ['blinds', 'checker', 'circle', 'dissolve', 'comb', 'cover', 'cut', 'diamond', 'fade', 'newsflash', 'plus', 'pull', 'push', 'random', 'randomBar', 'split', 'strips', 'wedge', 'wheel', 'wipe', 'zoom'];
|
|
55
54
|
/**
|
|
56
|
-
* `ST_BevelPresetType
|
|
55
|
+
* `ST_BevelPresetType`: the bevel profile applied to a 3-D edge.
|
|
57
56
|
* @see ECMA-376 Part 1 §20.1.10.9
|
|
58
57
|
*/
|
|
59
58
|
declare const BEVEL_PRESETS: readonly ['relaxedInset', 'circle', 'slope', 'cross', 'angle', 'softRound', 'convex', 'coolSlant', 'divot', 'riblet', 'hardEdge', 'artDeco'];
|
|
60
59
|
type BevelPresetType = (typeof BEVEL_PRESETS)[number];
|
|
61
60
|
/**
|
|
62
|
-
* `ST_PresetMaterialType
|
|
61
|
+
* `ST_PresetMaterialType`: how a 3-D surface responds to light.
|
|
63
62
|
* @see ECMA-376 Part 1 §20.1.10.50
|
|
64
63
|
*/
|
|
65
64
|
declare const PRESET_MATERIALS: readonly ['legacyMatte', 'legacyPlastic', 'legacyMetal', 'legacyWireframe', 'matte', 'plastic', 'metal', 'warmMatte', 'translucentPowder', 'powder', 'dkEdge', 'softEdge', 'clear', 'flat', 'softmetal'];
|
|
66
65
|
type PresetMaterialType = (typeof PRESET_MATERIALS)[number];
|
|
67
66
|
/**
|
|
68
|
-
* `ST_LightRigType
|
|
67
|
+
* `ST_LightRigType`: the preset lighting scene.
|
|
69
68
|
* @see ECMA-376 Part 1 §20.1.10.35
|
|
70
69
|
*/
|
|
71
70
|
declare const LIGHT_RIGS: readonly ['legacyFlat1', 'legacyFlat2', 'legacyFlat3', 'legacyFlat4', 'legacyNormal1', 'legacyNormal2', 'legacyNormal3', 'legacyNormal4', 'legacyHarsh1', 'legacyHarsh2', 'legacyHarsh3', 'legacyHarsh4', 'threePt', 'balanced', 'soft', 'harsh', 'flood', 'contrasting', 'morning', 'sunrise', 'sunset', 'chilly', 'freezing', 'flat', 'twoPt', 'glow', 'brightRoom'];
|
|
72
71
|
type LightRigType = (typeof LIGHT_RIGS)[number];
|
|
73
72
|
/**
|
|
74
|
-
* `ST_LightRigDirection
|
|
73
|
+
* `ST_LightRigDirection`: where the light rig sits relative to the scene.
|
|
75
74
|
* @see ECMA-376 Part 1 §20.1.10.33
|
|
76
75
|
*/
|
|
77
76
|
declare const LIGHT_RIG_DIRECTIONS: readonly ['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br'];
|
|
78
77
|
type LightRigDirection = (typeof LIGHT_RIG_DIRECTIONS)[number];
|
|
79
78
|
/**
|
|
80
|
-
* `ST_TextHorzOverflowType
|
|
79
|
+
* `ST_TextHorzOverflowType`: `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.
|
|
81
80
|
* @see ECMA-376 Part 1 §20.1.10.68
|
|
82
81
|
*/
|
|
83
82
|
declare const TEXT_HORZ_OVERFLOW: readonly ['clip', 'overflow'];
|
|
84
83
|
type TextHorzOverflowType = (typeof TEXT_HORZ_OVERFLOW)[number];
|
|
85
84
|
/**
|
|
86
|
-
* `ST_PresetPatternVal
|
|
85
|
+
* `ST_PresetPatternVal`: `a:pattFill/@prst`, the hatch a pattern fill draws.
|
|
87
86
|
*/
|
|
88
87
|
declare const PATTERN_PRESETS: readonly ['pct5', 'pct10', 'pct20', 'pct25', 'pct30', 'pct40', 'pct50', 'pct60', 'pct70', 'pct75', 'pct80', 'pct90', 'horz', 'vert', 'ltHorz', 'ltVert', 'dkHorz', 'dkVert', 'narHorz', 'narVert', 'dashHorz', 'dashVert', 'cross', 'dnDiag', 'upDiag', 'ltDnDiag', 'ltUpDiag', 'dkDnDiag', 'dkUpDiag', 'wdDnDiag', 'wdUpDiag', 'dashDnDiag', 'dashUpDiag', 'diagCross', 'smCheck', 'lgCheck', 'smGrid', 'lgGrid', 'dotGrid', 'smConfetti', 'lgConfetti', 'horzBrick', 'diagBrick', 'solidDmnd', 'openDmnd', 'dotDmnd', 'plaid', 'sphere', 'weave', 'divot', 'shingle', 'wave', 'trellis', 'zigZag'];
|
|
89
88
|
/**
|
|
90
|
-
* `ST_TextVerticalType
|
|
89
|
+
* `ST_TextVerticalType`: `a:bodyPr/@vert` and `a:tcPr/@vert`.
|
|
91
90
|
* @see ECMA-376 Part 1 §20.1.10.83
|
|
92
91
|
*/
|
|
93
92
|
declare const TEXT_VERTICAL: readonly ['horz', 'vert', 'vert270', 'wordArtVert', 'eaVert', 'mongolianVert', 'wordArtVertRtl'];
|
|
94
93
|
type TextVerticalType = (typeof TEXT_VERTICAL)[number];
|
|
95
94
|
/**
|
|
96
|
-
* `ST_LineEndType
|
|
95
|
+
* `ST_LineEndType`: the arrowhead at either end of a stroke (`a:headEnd/@type`,
|
|
97
96
|
* `a:tailEnd/@type`).
|
|
98
97
|
* @see ECMA-376 Part 1 §20.1.10.33
|
|
99
98
|
*/
|
|
@@ -109,17 +108,24 @@ declare const LINE_END_TYPES: readonly ['none', 'triangle', 'stealth', 'diamond'
|
|
|
109
108
|
declare const EMBEDDED_FONT_SLOTS: readonly ['regular', 'bold', 'italic', 'boldItalic'];
|
|
110
109
|
type LineEndType = (typeof LINE_END_TYPES)[number];
|
|
111
110
|
/**
|
|
112
|
-
* `
|
|
111
|
+
* `ST_PlaceholderType`: the kind of placeholder a `p:ph` fills (`p:ph/@type`). Absent, it means
|
|
112
|
+
* `obj`.
|
|
113
|
+
* @see ECMA-376 Part 1 §19.7.10
|
|
114
|
+
*/
|
|
115
|
+
declare const PLACEHOLDER_TYPES: readonly ['title', 'body', 'ctrTitle', 'subTitle', 'dt', 'sldNum', 'ftr', 'hdr', 'obj', 'chart', 'tbl', 'clipArt', 'dgm', 'media', 'sldImg', 'pic'];
|
|
116
|
+
type PlaceholderXmlType = (typeof PLACEHOLDER_TYPES)[number];
|
|
117
|
+
/**
|
|
118
|
+
* `ST_TextShapeType`: the preset path text is bent along (`a:prstTxWarp/@prst`), which
|
|
113
119
|
* PowerPoint calls WordArt.
|
|
114
120
|
*
|
|
115
121
|
* `textNoShape` is the identity member: it is legal, and it warps nothing. The library does not
|
|
116
|
-
* narrow this set
|
|
122
|
+
* narrow this set: every member is a shape PowerPoint draws.
|
|
117
123
|
* @see ECMA-376 Part 1 §20.1.10.76
|
|
118
124
|
*/
|
|
119
125
|
declare const TEXT_SHAPE_TYPES: readonly ['textNoShape', 'textPlain', 'textStop', 'textTriangle', 'textTriangleInverted', 'textChevron', 'textChevronInverted', 'textRingInside', 'textRingOutside', 'textArchUp', 'textArchDown', 'textCircle', 'textButton', 'textArchUpPour', 'textArchDownPour', 'textCirclePour', 'textButtonPour', 'textCurveUp', 'textCurveDown', 'textCanUp', 'textCanDown', 'textWave1', 'textWave2', 'textDoubleWave1', 'textWave4', 'textInflate', 'textDeflate', 'textInflateBottom', 'textDeflateBottom', 'textInflateTop', 'textDeflateTop', 'textDeflateInflate', 'textDeflateInflateDeflate', 'textFadeRight', 'textFadeLeft', 'textFadeUp', 'textFadeDown', 'textSlantUp', 'textSlantDown', 'textCascadeUp', 'textCascadeDown'];
|
|
120
126
|
type TextShapeType = (typeof TEXT_SHAPE_TYPES)[number];
|
|
121
127
|
/**
|
|
122
|
-
* `ST_PresetLineDashVal
|
|
128
|
+
* `ST_PresetLineDashVal`: the dash pattern of a line or border (`a:prstDash/@val`).
|
|
123
129
|
*
|
|
124
130
|
* The `sys*` members are the "system" dashes whose exact dot/gap ratio the renderer picks; the
|
|
125
131
|
* rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept
|
|
@@ -129,26 +135,26 @@ type TextShapeType = (typeof TEXT_SHAPE_TYPES)[number];
|
|
|
129
135
|
declare const PRESET_LINE_DASHES: readonly ['solid', 'dot', 'dash', 'lgDash', 'dashDot', 'lgDashDot', 'lgDashDotDot', 'sysDash', 'sysDot', 'sysDashDot', 'sysDashDotDot'];
|
|
130
136
|
type PresetLineDashVal = (typeof PRESET_LINE_DASHES)[number];
|
|
131
137
|
/**
|
|
132
|
-
* `ST_BarDir
|
|
138
|
+
* `ST_BarDir`: whether a bar/column plot runs horizontally or vertically (`c:barDir/@val`).
|
|
133
139
|
* @see ECMA-376 Part 1 §21.2.3.3
|
|
134
140
|
*/
|
|
135
141
|
declare const BAR_DIRECTIONS: readonly ['bar', 'col'];
|
|
136
142
|
type BarDirection = (typeof BAR_DIRECTIONS)[number];
|
|
137
143
|
/**
|
|
138
|
-
* `ST_BarGrouping
|
|
144
|
+
* `ST_BarGrouping`: how a bar/column plot stacks its series (`c:grouping/@val` inside
|
|
139
145
|
* `c:barChart`/`c:bar3DChart`).
|
|
140
146
|
* @see ECMA-376 Part 1 §21.2.3.4
|
|
141
147
|
*/
|
|
142
148
|
declare const BAR_GROUPINGS: readonly ['percentStacked', 'clustered', 'standard', 'stacked'];
|
|
143
149
|
type BarGrouping = (typeof BAR_GROUPINGS)[number];
|
|
144
150
|
/**
|
|
145
|
-
* `ST_Shape
|
|
151
|
+
* `ST_Shape`: the solid a 3-D bar is drawn as (`c:shape/@val`).
|
|
146
152
|
* @see ECMA-376 Part 1 §21.2.3.35
|
|
147
153
|
*/
|
|
148
154
|
declare const BAR_3D_SHAPES: readonly ['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'];
|
|
149
155
|
type Bar3DShape = (typeof BAR_3D_SHAPES)[number];
|
|
150
156
|
/**
|
|
151
|
-
* `ST_RadarStyle
|
|
157
|
+
* `ST_RadarStyle`: how a radar plot is drawn (`c:radarStyle/@val`).
|
|
152
158
|
* @see ECMA-376 Part 1 §21.2.3.33
|
|
153
159
|
*/
|
|
154
160
|
declare const RADAR_STYLES: readonly ['standard', 'marker', 'filled'];
|
|
@@ -160,8 +166,8 @@ type RadarStyle = (typeof RADAR_STYLES)[number];
|
|
|
160
166
|
* what made the other two read as typos rather than as a second vocabulary.
|
|
161
167
|
*
|
|
162
168
|
* Both spellings are accepted on the public option and normalized to the wire one at definition
|
|
163
|
-
* time. Before that, `radarStyle: 'marker'`
|
|
164
|
-
* reading a chart part
|
|
169
|
+
* time. Before that, `radarStyle: 'marker'` (the schema's word, and the obvious guess for anyone
|
|
170
|
+
* reading a chart part) failed the enum check and silently fell back to `standard`, so a caller
|
|
165
171
|
* asking for markers got a plain radar.
|
|
166
172
|
*/
|
|
167
173
|
declare const RADAR_STYLE_ALIASES: {
|
|
@@ -170,21 +176,21 @@ declare const RADAR_STYLE_ALIASES: {
|
|
|
170
176
|
};
|
|
171
177
|
type RadarStyleAlias = keyof typeof RADAR_STYLE_ALIASES;
|
|
172
178
|
/**
|
|
173
|
-
* `ST_LegendPos
|
|
179
|
+
* `ST_LegendPos`: where the legend sits relative to the plot area (`c:legendPos/@val`).
|
|
174
180
|
* @see ECMA-376 Part 1 §21.2.3.24
|
|
175
181
|
*/
|
|
176
182
|
declare const LEGEND_POSITIONS: readonly ['b', 'tr', 'l', 'r', 't'];
|
|
177
183
|
type LegendPosition = (typeof LEGEND_POSITIONS)[number];
|
|
178
184
|
/**
|
|
179
|
-
* `ST_DispBlanksAs
|
|
185
|
+
* `ST_DispBlanksAs`: what a plot draws where a value is missing (`c:dispBlanksAs/@val`).
|
|
180
186
|
* @see ECMA-376 Part 1 §21.2.3.10
|
|
181
187
|
*/
|
|
182
188
|
declare const DISPLAY_BLANKS_AS: readonly ['span', 'gap', 'zero'];
|
|
183
189
|
type DisplayBlanksAs = (typeof DISPLAY_BLANKS_AS)[number];
|
|
184
190
|
/**
|
|
185
|
-
* `ST_DLblPos
|
|
191
|
+
* `ST_DLblPos`: where a data label sits relative to its point (`c:dLblPos/@val`).
|
|
186
192
|
*
|
|
187
|
-
* The whole set is legal on the attribute, but only a subset of it is legal *per plot type
|
|
193
|
+
* The whole set is legal on the attribute, but only a subset of it is legal *per plot type*:
|
|
188
194
|
* PowerPoint offers a pie chart `bestFit`/`ctr`/`inEnd`/`outEnd` and nothing else. Those subsets
|
|
189
195
|
* are a fact about the chart types rather than about the attribute, so they live beside the
|
|
190
196
|
* chart definer that applies them; this is the value space they are drawn from.
|
|
@@ -197,43 +203,43 @@ type DataLabelPosition = (typeof DATA_LABEL_POSITIONS)[number];
|
|
|
197
203
|
*
|
|
198
204
|
* The schema also has `plus`, `star`, `x`, `picture` and `auto`. Neither PowerPoint 2013 nor
|
|
199
205
|
* PowerPoint Online draws the first three, `picture` needs a `c:spPr` blip this API has no
|
|
200
|
-
* spelling for, and `auto` is what leaving the option off already means
|
|
206
|
+
* spelling for, and `auto` is what leaving the option off already means, so the accepted set is
|
|
201
207
|
* deliberately smaller than the type. Widen it only with evidence that the member renders.
|
|
202
208
|
* @see ECMA-376 Part 1 §21.2.3.27
|
|
203
209
|
*/
|
|
204
210
|
declare const LINE_DATA_SYMBOLS: readonly ['circle', 'dash', 'diamond', 'dot', 'none', 'square', 'triangle'];
|
|
205
211
|
type LineDataSymbol = (typeof LINE_DATA_SYMBOLS)[number];
|
|
206
|
-
/** `ST_TickLblPos
|
|
212
|
+
/** `ST_TickLblPos`: where an axis draws its tick labels (`c:tickLblPos/@val`). */
|
|
207
213
|
declare const TICK_LABEL_POSITIONS: readonly ['high', 'low', 'nextTo', 'none'];
|
|
208
214
|
type TickLabelPosition = (typeof TICK_LABEL_POSITIONS)[number];
|
|
209
|
-
/** `ST_Orientation
|
|
215
|
+
/** `ST_Orientation`: which way an axis runs (`c:orientation/@val`). */
|
|
210
216
|
declare const AXIS_ORIENTATIONS: readonly ['maxMin', 'minMax'];
|
|
211
217
|
type AxisOrientation = (typeof AXIS_ORIENTATIONS)[number];
|
|
212
|
-
/** `ST_TickMark
|
|
218
|
+
/** `ST_TickMark`: an axis' major or minor tick marks (`c:majorTickMark/@val`, `c:minorTickMark/@val`). */
|
|
213
219
|
declare const TICK_MARKS: readonly ['cross', 'in', 'none', 'out'];
|
|
214
220
|
type TickMark = (typeof TICK_MARKS)[number];
|
|
215
|
-
/** `ST_CrossBetween
|
|
221
|
+
/** `ST_CrossBetween`: whether a value axis crosses its category axis between or on categories (`c:crossBetween/@val`). */
|
|
216
222
|
declare const CROSS_BETWEEN: readonly ['between', 'midCat'];
|
|
217
223
|
type CrossBetween = (typeof CROSS_BETWEEN)[number];
|
|
218
|
-
/** `ST_BuiltInUnit
|
|
224
|
+
/** `ST_BuiltInUnit`: the unit a value axis displays its labels in (`c:builtInUnit/@val`). */
|
|
219
225
|
declare const BUILT_IN_UNITS: readonly ['hundreds', 'thousands', 'tenThousands', 'hundredThousands', 'millions', 'tenMillions', 'hundredMillions', 'billions', 'trillions'];
|
|
220
226
|
type BuiltInUnit = (typeof BUILT_IN_UNITS)[number];
|
|
221
|
-
/** `ST_TimeUnit
|
|
227
|
+
/** `ST_TimeUnit`: a date axis' base, major or minor time unit (`c:baseTimeUnit/@val` and its two siblings). */
|
|
222
228
|
declare const TIME_UNITS: readonly ['days', 'months', 'years'];
|
|
223
229
|
type TimeUnit = (typeof TIME_UNITS)[number];
|
|
224
|
-
/** `ST_ErrDir
|
|
230
|
+
/** `ST_ErrDir`: the axis an error bar measures along (`c:errDir/@val`). */
|
|
225
231
|
declare const ERROR_BAR_DIRECTIONS: readonly ['x', 'y'];
|
|
226
232
|
type ErrorBarDirection = (typeof ERROR_BAR_DIRECTIONS)[number];
|
|
227
|
-
/** `ST_ErrBarType
|
|
233
|
+
/** `ST_ErrBarType`: which sides of a point draw an error bar (`c:errBarType/@val`). */
|
|
228
234
|
declare const ERROR_BAR_TYPES: readonly ['both', 'minus', 'plus'];
|
|
229
235
|
type ErrorBarType = (typeof ERROR_BAR_TYPES)[number];
|
|
230
|
-
/** `ST_ErrValType
|
|
236
|
+
/** `ST_ErrValType`: how an error bar's amount is read (`c:errValType/@val`). */
|
|
231
237
|
declare const ERROR_BAR_VALUE_TYPES: readonly ['cust', 'fixedVal', 'percentage', 'stdDev', 'stdErr'];
|
|
232
238
|
type ErrorBarValueType = (typeof ERROR_BAR_VALUE_TYPES)[number];
|
|
233
239
|
/**
|
|
234
240
|
* The twelve theme colour slots (`a:clrScheme` children) a `p:clrMap` token can point at.
|
|
235
241
|
*
|
|
236
|
-
* Not an `ST_` type
|
|
242
|
+
* Not an `ST_` type: these are element names inside `a:CT_ColorScheme`, which the schema
|
|
237
243
|
* declares as a fixed sequence rather than an enumeration. The effect is the same: a closed,
|
|
238
244
|
* ordered set of twelve names, in the order the scheme declares them.
|
|
239
245
|
* @see ECMA-376 Part 1 §20.1.6.2
|
|
@@ -245,13 +251,11 @@ type ThemeColorSlot = (typeof THEME_COLOR_SLOTS)[number];
|
|
|
245
251
|
*
|
|
246
252
|
* A slide's `schemeClr val="tx1"` names a *token*, not a slot: the master's `p:clrMap` is the
|
|
247
253
|
* indirection that sends it to a {@link ThemeColorSlot}. Which is why the two lists look alike
|
|
248
|
-
* and are not the same list
|
|
254
|
+
* and are not the same list: `bg1`/`tx1` are tokens, `lt1`/`dk1` are slots.
|
|
249
255
|
* @see ECMA-376 Part 1 §19.3.1.6
|
|
250
256
|
*/
|
|
251
257
|
declare const COLOR_MAP_TOKENS: readonly ['bg1', 'tx1', 'bg2', 'tx2', 'accent1', 'accent2', 'accent3', 'accent4', 'accent5', 'accent6', 'hlink', 'folHlink'];
|
|
252
258
|
type ColorMapToken = (typeof COLOR_MAP_TOKENS)[number];
|
|
253
|
-
//#endregion
|
|
254
|
-
//#region src/types/shape.d.ts
|
|
255
259
|
/**
|
|
256
260
|
* A single preset-geometry adjustment guide (`<a:gd>` inside `<a:avLst>`).
|
|
257
261
|
* - `name` is the guide name the preset defines, e.g. `'adj'`, `'adj1'`, `'adj2'`.
|
|
@@ -270,12 +274,12 @@ interface ShapeAdjustValue {
|
|
|
270
274
|
* A geometry guide (`<a:gd>` inside a `custGeom`'s `<a:gdLst>`): a named construction formula
|
|
271
275
|
* that connection sites, adjust handles, and the text rect can reference by name.
|
|
272
276
|
* - `name` is a `ST_GeomGuideName` token, e.g. `'w2'`.
|
|
273
|
-
* - `formula` is a `ST_GeomGuideFormula
|
|
277
|
+
* - `formula` is a `ST_GeomGuideFormula`: a space-delimited op + args string emitted verbatim,
|
|
274
278
|
* e.g. the multiply-divide op `"* / w 1 2"` written without the inner space (w × 1 ÷ 2), or
|
|
275
279
|
* `'val 10800'`. This is an advanced escape hatch: the arguments are not interpreted, only
|
|
276
280
|
* escaped. The leading operation *is* checked against the 17 ECMA-376 §20.1.9.11 operations
|
|
277
281
|
* (multiply-divide, add-subtract, add-divide, if-else, `abs`, `at2`, `cat2`, `cos`, `max`,
|
|
278
|
-
* `min`, `mod`, `pin`, `sat2`, `sin`, `sqrt`, `tan`, `val
|
|
282
|
+
* `min`, `mod`, `pin`, `sat2`, `sin`, `sqrt`, `tan`, `val`; see `GEOM_GUIDE_OPS` in
|
|
279
283
|
* `src/gen/drawingml/geometry.ts` for the literal tokens), because an unknown one emits
|
|
280
284
|
* schema-shaped but semantically dead geometry that PowerPoint answers with a repair prompt;
|
|
281
285
|
* such a guide is warned about and skipped.
|
|
@@ -297,7 +301,7 @@ interface ShapeConnectionSite {
|
|
|
297
301
|
/** Y in the object's own space (like `points`), or a guide-name string emitted verbatim. */
|
|
298
302
|
y: Coord | string;
|
|
299
303
|
}
|
|
300
|
-
/** An XY adjust handle (`<a:ahXY>`)
|
|
304
|
+
/** An XY adjust handle (`<a:ahXY>`): a draggable handle, optionally bound to guides. */
|
|
301
305
|
interface ShapeAdjustHandleXY {
|
|
302
306
|
x: Coord | string;
|
|
303
307
|
y: Coord | string;
|
|
@@ -308,7 +312,7 @@ interface ShapeAdjustHandleXY {
|
|
|
308
312
|
minY?: Coord | string;
|
|
309
313
|
maxY?: Coord | string;
|
|
310
314
|
}
|
|
311
|
-
/** A polar adjust handle (`<a:ahPolar>`)
|
|
315
|
+
/** A polar adjust handle (`<a:ahPolar>`): radius/angle rather than XY. */
|
|
312
316
|
interface ShapeAdjustHandlePolar {
|
|
313
317
|
x: Coord | string;
|
|
314
318
|
y: Coord | string;
|
|
@@ -382,7 +386,7 @@ interface ShapeProps extends PositionProps, ObjectNameProps {
|
|
|
382
386
|
line?: ShapeLineProps;
|
|
383
387
|
/**
|
|
384
388
|
* Points (only for ShapeType.custGeom)
|
|
385
|
-
* - type: 'arc' (no end point
|
|
389
|
+
* - type: 'arc' (no end point; it is computed from the pen position, radii and sweep)
|
|
386
390
|
* - `hR` Shape Arc Height Radius
|
|
387
391
|
* - `wR` Shape Arc Width Radius
|
|
388
392
|
* - `stAng` Shape Arc Start Angle (degrees, not wrapped into 0..360)
|
|
@@ -392,20 +396,20 @@ interface ShapeProps extends PositionProps, ObjectNameProps {
|
|
|
392
396
|
*/
|
|
393
397
|
points?: GeometryPoint[];
|
|
394
398
|
/**
|
|
395
|
-
* Geometry guides (`<a:gdLst>`) for a `custGeom` shape
|
|
399
|
+
* Geometry guides (`<a:gdLst>`) for a `custGeom` shape: named construction formulas that
|
|
396
400
|
* connection sites / adjust handles can reference. Advanced: each `formula` is emitted verbatim.
|
|
397
401
|
* @example [{ name: 'w2', formula: 'val 10800' }]
|
|
398
402
|
*/
|
|
399
403
|
guides?: ShapeGuide[];
|
|
400
404
|
/**
|
|
401
|
-
* Connection sites (`<a:cxnLst>`) for a `custGeom` shape
|
|
405
|
+
* Connection sites (`<a:cxnLst>`) for a `custGeom` shape: the points a connector can attach to.
|
|
402
406
|
* Positions are absolute in the object's own space (like `points`); a `startShapeIdx`/`endShapeIdx`
|
|
403
407
|
* on an `addConnector` indexes into this list.
|
|
404
408
|
* @example [{ ang: 0, x: 1, y: 0 }, { ang: 180, x: 0, y: 1 }]
|
|
405
409
|
*/
|
|
406
410
|
connectionSites?: ShapeConnectionSite[];
|
|
407
411
|
/**
|
|
408
|
-
* Adjust handles (`<a:ahLst>`) for a `custGeom` shape
|
|
412
|
+
* Adjust handles (`<a:ahLst>`) for a `custGeom` shape: draggable handles (XY or polar),
|
|
409
413
|
* optionally bound to guides via `gdRef*`.
|
|
410
414
|
*/
|
|
411
415
|
adjustHandles?: ShapeAdjustHandle[];
|
|
@@ -428,16 +432,14 @@ interface ShapeProps extends PositionProps, ObjectNameProps {
|
|
|
428
432
|
*/
|
|
429
433
|
shadow?: ShadowProps;
|
|
430
434
|
}
|
|
431
|
-
//#endregion
|
|
432
|
-
//#region src/types/media.d.ts
|
|
433
435
|
type MediaType = 'audio' | 'online' | 'video';
|
|
434
|
-
interface ImageBaseProps extends
|
|
436
|
+
interface ImageBaseProps extends PlaceholderPositionProps, ObjectNameProps {
|
|
435
437
|
/**
|
|
436
|
-
* Sizing note (`w`/`h` inherited from {@link
|
|
438
|
+
* Sizing note (`w`/`h` inherited from {@link PlaceholderPositionProps}):
|
|
437
439
|
* - When a `data` (base64) image is supplied and `w`/`h` are omitted, the natural pixel
|
|
438
440
|
* size is read from the image header (PNG/JPEG/GIF/BMP/WebP) and used at 96 DPI
|
|
439
441
|
* (natural pixels / 96 = inches).
|
|
440
|
-
* - When only one of `w`/`h` is given, the other is derived from the natural aspect ratio
|
|
442
|
+
* - When only one of `w`/`h` is given, the other is derived from the natural aspect ratio,
|
|
441
443
|
* for an SVG too, from its `width`/`height` or `viewBox`.
|
|
442
444
|
* - A `path` image is measured at export time (its bytes are not available synchronously);
|
|
443
445
|
* an omitted dimension falls back to 1 inch if it stays unmeasurable.
|
|
@@ -473,14 +475,17 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
473
475
|
*/
|
|
474
476
|
line?: ShapeLineProps;
|
|
475
477
|
/**
|
|
476
|
-
* Name of a picture placeholder defined on the slide layout/master to populate
|
|
478
|
+
* Name of a picture placeholder defined on the slide layout/master to populate, or a
|
|
479
|
+
* {@link PlaceholderBinding} that states the `p:ph` to write
|
|
477
480
|
* - when it matches a layout/master placeholder, the image inherits that placeholder's
|
|
478
481
|
* position and size for any of `x`/`y`/`w`/`h` not supplied explicitly;
|
|
479
482
|
* explicit values always win
|
|
483
|
+
* - a name that matches none writes no `p:ph`; a binding's `idx` or `type` writes one regardless
|
|
480
484
|
* @example 'picph'
|
|
485
|
+
* @example { type: 'pic', idx: 13 }
|
|
481
486
|
* @see https://docs.microsoft.com/en-us/office/vba/api/powerpoint.ppplaceholdertype
|
|
482
487
|
*/
|
|
483
|
-
placeholder?:
|
|
488
|
+
placeholder?: PlaceholderOption;
|
|
484
489
|
/**
|
|
485
490
|
* Image rotation (degrees)
|
|
486
491
|
* - range: -360 to 360
|
|
@@ -535,8 +540,10 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
535
540
|
/**
|
|
536
541
|
* Crop the source image to a sub-region by percentage edge insets, emitted verbatim
|
|
537
542
|
* as OOXML `<a:srcRect>`.
|
|
538
|
-
* - each value is the percent (
|
|
543
|
+
* - each value is the percent (at most 100) trimmed off that edge of the *source* image, the
|
|
539
544
|
* same model PowerPoint's Picture Format > Crop uses; `l`+`r` and `t`+`b` must each be < 100
|
|
545
|
+
* - a negative value pads that edge with empty space instead, as PowerPoint's Fit crop and
|
|
546
|
+
* `sizing: 'contain'` do
|
|
540
547
|
* - the remaining sub-region is stretched to fill the picture's displayed `w`×`h` box, so this
|
|
541
548
|
* is the faithful way to reproduce a deck that maps several icons out of one composite raster
|
|
542
549
|
* - operates on the source image directly (independent of natural-pixel measurement), so unlike
|
|
@@ -545,13 +552,13 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
545
552
|
* @example { l: 0, t: 0, r: 50, b: 50 } // keep the top-left quadrant of the source image
|
|
546
553
|
*/
|
|
547
554
|
crop?: {
|
|
548
|
-
/** Percent
|
|
555
|
+
/** Percent trimmed from the left edge of the source image; negative pads it. @default 0 */
|
|
549
556
|
l?: number;
|
|
550
|
-
/** Percent
|
|
557
|
+
/** Percent trimmed from the top edge of the source image; negative pads it. @default 0 */
|
|
551
558
|
t?: number;
|
|
552
|
-
/** Percent
|
|
559
|
+
/** Percent trimmed from the right edge of the source image; negative pads it. @default 0 */
|
|
553
560
|
r?: number;
|
|
554
|
-
/** Percent
|
|
561
|
+
/** Percent trimmed from the bottom edge of the source image; negative pads it. @default 0 */
|
|
555
562
|
b?: number;
|
|
556
563
|
};
|
|
557
564
|
/**
|
|
@@ -563,7 +570,7 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
563
570
|
/**
|
|
564
571
|
* Sizing type
|
|
565
572
|
* - `cover` / `contain` fit the image into the `w`×`h` box using the image's *natural*
|
|
566
|
-
* aspect ratio
|
|
573
|
+
* aspect ratio, read from the embedded PNG/JPEG/GIF/BMP/WebP header, or from an SVG's
|
|
567
574
|
* `width`/`height` or `viewBox`. If the natural size cannot be determined (an
|
|
568
575
|
* unrecognized format, or an SVG carrying neither) the displayed `w`/`h` ratio is used
|
|
569
576
|
* as a fallback and a warning is logged.
|
|
@@ -649,7 +656,7 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
649
656
|
};
|
|
650
657
|
/**
|
|
651
658
|
* Recolor the image by mapping one source color to another (`<a:clrChange>`)
|
|
652
|
-
* - every pixel matching `from` is repainted `to
|
|
659
|
+
* - every pixel matching `from` is repainted `to`: the classic "swap the flat background out" recolour
|
|
653
660
|
* (MS-PPT > Format Picture > Picture Color > Set Transparent Color is the single-colour sibling)
|
|
654
661
|
* - colors accept `HexColor` or `ThemeColor`, same as fills / `duotone`
|
|
655
662
|
* @example { from: '000000', to: 'FF0000' } // turn black pixels red
|
|
@@ -710,7 +717,7 @@ interface MediaBaseProps extends PositionProps, ObjectNameProps {
|
|
|
710
717
|
*/
|
|
711
718
|
interface OleObjectBaseProps extends PositionProps, ObjectNameProps {
|
|
712
719
|
/**
|
|
713
|
-
* Picture of the embedded document shown on the slide
|
|
720
|
+
* Picture of the embedded document shown on the slide: a raster image `path` (Node/local)
|
|
714
721
|
* or base64 `data:` URI.
|
|
715
722
|
* - the library is Node-first and cannot render an Office document, so when this is omitted a
|
|
716
723
|
* neutral gray placeholder is embedded; PowerPoint draws the live object over it, but every
|
|
@@ -732,7 +739,7 @@ interface OleObjectBaseProps extends PositionProps, ObjectNameProps {
|
|
|
732
739
|
*/
|
|
733
740
|
extn?: string;
|
|
734
741
|
/**
|
|
735
|
-
* OLE server ProgID
|
|
742
|
+
* OLE server ProgID: what PowerPoint launches on double-click.
|
|
736
743
|
* - defaults from the resolved extension (`xlsx` → `Excel.Sheet.12`, `docx` → `Word.Document.12`,
|
|
737
744
|
* `pptx` → `PowerPoint.Show.12`, anything else → `Package`)
|
|
738
745
|
* @example 'Excel.Sheet.12'
|
|
@@ -767,7 +774,9 @@ type MediaProps = MediaBaseProps & ((DataOrPathRequiredProps & {
|
|
|
767
774
|
*/
|
|
768
775
|
type: Exclude<MediaType, 'online'>;
|
|
769
776
|
/**
|
|
770
|
-
*
|
|
777
|
+
* Not written for embedded media: only `type: 'online'` reads `link`. An embedded
|
|
778
|
+
* clip links its own media part, so an outside link has nowhere to go, and setting
|
|
779
|
+
* it warns `media/option-not-supported`.
|
|
771
780
|
*/
|
|
772
781
|
link?: string;
|
|
773
782
|
}) | (DataOrPathProps & {
|
|
@@ -783,8 +792,6 @@ type MediaProps = MediaBaseProps & ((DataOrPathRequiredProps & {
|
|
|
783
792
|
*/
|
|
784
793
|
link: string;
|
|
785
794
|
}));
|
|
786
|
-
//#endregion
|
|
787
|
-
//#region src/types/text.d.ts
|
|
788
795
|
/**
|
|
789
796
|
* A drawn bullet: the object arm of {@link TextPropsOptions.bullet}.
|
|
790
797
|
*
|
|
@@ -859,7 +866,7 @@ interface TextBaseProps {
|
|
|
859
866
|
* {@link breakLine} is not the only paragraph boundary: two adjacent runs whose `align`
|
|
860
867
|
* differs start a new one, so stating it on the opening run alone splits the paragraph in
|
|
861
868
|
* two. That is the mirror of {@link bullet}, {@link paraMarginLeft} and {@link paraIndent},
|
|
862
|
-
* which are read from the opening run only. Neither mistake changes the run count
|
|
869
|
+
* which are read from the opening run only. Neither mistake changes the run count: the
|
|
863
870
|
* only symptom is a differently shaped paragraph, with no error.
|
|
864
871
|
* @default 'left'
|
|
865
872
|
*/
|
|
@@ -876,7 +883,7 @@ interface TextBaseProps {
|
|
|
876
883
|
breakLine?: boolean;
|
|
877
884
|
/**
|
|
878
885
|
* Preset text warp / WordArt shape (`<a:bodyPr><a:prstTxWarp prst="..">`), which
|
|
879
|
-
* bends the text along a preset path (arch, circle, wave, …)
|
|
886
|
+
* bends the text along a preset path (arch, circle, wave, …): the whole
|
|
880
887
|
* `ST_TextShapeType` set.
|
|
881
888
|
* @example 'textArchUp' // bend text along an upward arch (e.g. a label following a ring/arc)
|
|
882
889
|
* @example 'textCircle'
|
|
@@ -886,22 +893,23 @@ interface TextBaseProps {
|
|
|
886
893
|
* Add standard or custom bullet
|
|
887
894
|
* - use `true` for standard bullet
|
|
888
895
|
* - pass object options for custom bullet
|
|
889
|
-
* - `false`
|
|
890
|
-
*
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
896
|
+
* - `false` is the *explicit off*: it writes `<a:buNone/>` plus `marL="0" indent="0"`,
|
|
897
|
+
* which overrides whatever bullet the layout's or master's list style sets for this level
|
|
898
|
+
* - `'inherit'` states nothing at all (no bullet child and no margin attributes), so
|
|
899
|
+
* the list style keeps reaching the paragraph
|
|
900
|
+
* - omitting the option means `'inherit'` on a placeholder definition
|
|
901
|
+
* (`defineSlideMaster({ objects })`), and on text filling a placeholder the layout
|
|
902
|
+
* defines, which takes the definition's bullet. Anywhere else it means `false`
|
|
895
903
|
*
|
|
896
904
|
* The margins are only a *default* of the bullet state: {@link paraMarginLeft} and
|
|
897
905
|
* {@link paraIndent} state `@marL`/`@indent` independently in any of the three, including
|
|
898
906
|
* an inherited margin under a drawn bullet.
|
|
899
907
|
*
|
|
900
908
|
* When a shape's text is an array of runs, state this on the **opening run only**. A run
|
|
901
|
-
* that draws a bullet starts a new paragraph by itself, so repeating it
|
|
902
|
-
* that {@link align} requires
|
|
909
|
+
* that draws a bullet starts a new paragraph by itself, so repeating it (the placement
|
|
910
|
+
* that {@link align} requires) turns one three-run paragraph into three one-run
|
|
903
911
|
* paragraphs. A paragraph takes its properties from its first run.
|
|
904
|
-
* @default false
|
|
912
|
+
* @default false, or `'inherit'` on a placeholder
|
|
905
913
|
*/
|
|
906
914
|
bullet?: boolean | 'inherit' | TextBulletProps;
|
|
907
915
|
/**
|
|
@@ -928,7 +936,7 @@ interface TextBaseProps {
|
|
|
928
936
|
*
|
|
929
937
|
* Applied to the Latin (`<a:latin>`) and complex-script (`<a:cs>`) font slots, matching
|
|
930
938
|
* how PowerPoint writes a font picked from the UI. The East Asian slot (`<a:ea>`) is left
|
|
931
|
-
* to inherit from the theme unless `fontFaceEA` is set
|
|
939
|
+
* to inherit from the theme unless `fontFaceEA` is set. Forcing a Latin-only face into the
|
|
932
940
|
* East Asian slot duplicates/ghosts text in Office 365.
|
|
933
941
|
* @example 'Arial' // Arial font
|
|
934
942
|
*/
|
|
@@ -936,8 +944,9 @@ interface TextBaseProps {
|
|
|
936
944
|
/**
|
|
937
945
|
* East Asian font face name (`<a:ea>` slot), used to render CJK (Chinese/Japanese/Korean) glyphs
|
|
938
946
|
*
|
|
939
|
-
*
|
|
940
|
-
* theme East Asian font, which is what
|
|
947
|
+
* Independent of `fontFace`: set alone, it writes only `<a:ea>` and the Latin and complex-script
|
|
948
|
+
* slots keep inheriting. When omitted, `<a:ea>` inherits the theme East Asian font, which is what
|
|
949
|
+
* PowerPoint does for Latin fonts.
|
|
941
950
|
* @example '微軟正黑體' // render East Asian glyphs with Microsoft JhengHei
|
|
942
951
|
*/
|
|
943
952
|
fontFaceEA?: string;
|
|
@@ -964,12 +973,12 @@ interface TextBaseProps {
|
|
|
964
973
|
*/
|
|
965
974
|
lang?: string;
|
|
966
975
|
/**
|
|
967
|
-
* First-line indent (points)
|
|
976
|
+
* First-line indent (points): `a:pPr/@indent`, the offset of the paragraph's FIRST line
|
|
968
977
|
* from {@link paraMarginLeft}. Negative hangs the first line to the left of the body, which
|
|
969
978
|
* is what a bulleted paragraph does; positive indents it to the right, the "first line
|
|
970
979
|
* indented" prose form. PowerPoint: Paragraph > Indentation > Special.
|
|
971
980
|
* - `'inherit'` writes no `@indent` at all, so the paragraph takes whatever its list style
|
|
972
|
-
* (`a:lstStyle` → placeholder → layout → master) sets
|
|
981
|
+
* (`a:lstStyle` → placeholder → layout → master) sets: the same third state
|
|
973
982
|
* {@link bullet} spells, on the attribute beside it
|
|
974
983
|
* - omitting the option keeps the bullet-derived default: a drawn bullet hangs the first
|
|
975
984
|
* line by its margin, `bullet: false` writes `indent="0"`, `bullet: 'inherit'` writes
|
|
@@ -983,12 +992,12 @@ interface TextBaseProps {
|
|
|
983
992
|
*/
|
|
984
993
|
paraIndent?: number | 'inherit';
|
|
985
994
|
/**
|
|
986
|
-
* Left margin of the paragraph (points)
|
|
995
|
+
* Left margin of the paragraph (points): `a:pPr/@marL`, where the paragraph's body text
|
|
987
996
|
* starts. This is the paragraph's own margin, not the text frame's internal padding
|
|
988
997
|
* (`margin`) and not the discrete outline level (`indentLevel`, which writes `a:p/@lvl`).
|
|
989
998
|
* PowerPoint: Paragraph > Indentation > Before text.
|
|
990
999
|
* - `'inherit'` writes no `@marL` at all, so the paragraph takes whatever its list style
|
|
991
|
-
* (`a:lstStyle` → placeholder → layout → master) sets
|
|
1000
|
+
* (`a:lstStyle` → placeholder → layout → master) sets, the third state that omission
|
|
992
1001
|
* cannot spell, since omitting it writes the bullet-derived default
|
|
993
1002
|
* - omitting the option keeps that default: a drawn bullet writes its own margin (see
|
|
994
1003
|
* `bullet.indent`), `bullet: false` writes `marL="0"`, `bullet: 'inherit'` writes nothing
|
|
@@ -1035,11 +1044,15 @@ interface TextBaseProps {
|
|
|
1035
1044
|
* - `style` is the full `ST_TextUnderlineType` enumeration (ECMA-376 §20.1.10.81)
|
|
1036
1045
|
* - `'none'` is the *explicit off*: it writes `a:rPr/@u="none"`, which overrides an
|
|
1037
1046
|
* underline the run would otherwise inherit from its list style, placeholder, layout or
|
|
1038
|
-
* master. Omitting the option instead states nothing and lets that inheritance stand
|
|
1039
|
-
*
|
|
1047
|
+
* master. Omitting the option instead states nothing and lets that inheritance stand.
|
|
1048
|
+
* The two are different facts, not two spellings of one.
|
|
1049
|
+
* - `true` is shorthand for `{ style: 'sng' }`, a single line. `false` states nothing, as omitting
|
|
1050
|
+
* the option does, so an inherited underline stands; `{ style: 'none' }` is the explicit off.
|
|
1040
1051
|
* @default (unset) inherit
|
|
1052
|
+
* @example underline: true // single underline
|
|
1053
|
+
* @example underline: { style: 'dbl', color: 'FF0000' } // red double underline
|
|
1041
1054
|
*/
|
|
1042
|
-
underline?: {
|
|
1055
|
+
underline?: boolean | {
|
|
1043
1056
|
style?: (typeof TEXT_UNDERLINE_TYPES)[number];
|
|
1044
1057
|
color?: Color;
|
|
1045
1058
|
};
|
|
@@ -1087,10 +1100,10 @@ interface TextFitShrinkProps {
|
|
|
1087
1100
|
*/
|
|
1088
1101
|
lnSpcReduction?: number;
|
|
1089
1102
|
}
|
|
1090
|
-
interface TextPropsOptions extends
|
|
1103
|
+
interface TextPropsOptions extends PlaceholderPositionProps, DataOrPathProps, TextBaseProps, ObjectNameProps {
|
|
1091
1104
|
/**
|
|
1092
1105
|
* Preset-geometry start/end angles for text frames (`shape` + these build `<a:prstGeom>`
|
|
1093
|
-
* adjustment guides through the shared emitter
|
|
1106
|
+
* adjustment guides through the shared emitter, and `genXmlPresetGeom` reads them whether
|
|
1094
1107
|
* the object is a shape or a styled text frame).
|
|
1095
1108
|
*/
|
|
1096
1109
|
angleRange?: [number, number];
|
|
@@ -1100,11 +1113,28 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1100
1113
|
points?: GeometryPoint[];
|
|
1101
1114
|
/** Preset-geometry adjustment guides for text frames. */
|
|
1102
1115
|
shapeAdjust?: ShapeAdjustValue | ShapeAdjustValue[];
|
|
1116
|
+
/**
|
|
1117
|
+
* Baseline shift (`a:rPr/@baseline`): above zero raises the text, below zero lowers it.
|
|
1118
|
+
*
|
|
1119
|
+
* A percent of the font size, so `30` raises the text by 30% (what `superscript` writes) and
|
|
1120
|
+
* `-40` lowers it by 40% (what `subscript` writes). It is written in thousandths of a percent,
|
|
1121
|
+
* rounded. `0`, like leaving the option out, states no shift. Wins over `superscript` and
|
|
1122
|
+
* `subscript` when both are set.
|
|
1123
|
+
*/
|
|
1103
1124
|
baseline?: number;
|
|
1104
1125
|
/**
|
|
1105
1126
|
* Character spacing
|
|
1106
1127
|
*/
|
|
1107
1128
|
charSpacing?: number;
|
|
1129
|
+
/**
|
|
1130
|
+
* Kerning (`a:rPr/@kern`): the smallest font size, in points, that gets pair kerning. Text at
|
|
1131
|
+
* this size or larger is kerned, smaller text is not, and `0` turns kerning off.
|
|
1132
|
+
* - PowerPoint: Font > Character Spacing > "Kerning for fonts: _ Points and above"
|
|
1133
|
+
* - range: 0-4000
|
|
1134
|
+
* @example 12 // kern text set at 12pt or larger, PowerPoint's own default
|
|
1135
|
+
* @default undefined // no `kern`, except that a non-zero `charSpacing` writes `kern="0"`
|
|
1136
|
+
*/
|
|
1137
|
+
kerning?: number;
|
|
1108
1138
|
/**
|
|
1109
1139
|
* Number of text columns in the text body
|
|
1110
1140
|
* - PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Columns > "Number"
|
|
@@ -1130,7 +1160,7 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1130
1160
|
* - 'resize' = Resize shape to fit text
|
|
1131
1161
|
*
|
|
1132
1162
|
* **Measured fit:** if you register the box's font with
|
|
1133
|
-
* {@link
|
|
1163
|
+
* {@link PptxTs.registerFontMetrics}, both `'shrink'` and `'resize'` are
|
|
1134
1164
|
* **measured at export time**, so the text renders correctly in headless renderers
|
|
1135
1165
|
* and on plain file-open (no edit/resize needed):
|
|
1136
1166
|
* - `'shrink'` computes the largest `fontScale` at which the wrapped text fits and
|
|
@@ -1174,7 +1204,7 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1174
1204
|
glow?: TextGlowProps;
|
|
1175
1205
|
hyperlink?: HyperlinkProps;
|
|
1176
1206
|
/**
|
|
1177
|
-
* Outline level of the paragraph (`a:p/@lvl`)
|
|
1207
|
+
* Outline level of the paragraph (`a:p/@lvl`): which of the list style's nine levels the
|
|
1178
1208
|
* paragraph takes its bullet, indent and typography from.
|
|
1179
1209
|
* - range: 0-8, whole numbers only (`ST_TextIndentLevelType`); anything else is reported
|
|
1180
1210
|
* under `text/invalid-indent-level` and ignored
|
|
@@ -1200,7 +1230,7 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1200
1230
|
*/
|
|
1201
1231
|
lineSpacingMultiple?: number;
|
|
1202
1232
|
/**
|
|
1203
|
-
* Margin (inches)
|
|
1233
|
+
* Margin (inches): the text-frame internal margin/padding
|
|
1204
1234
|
* - PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Left/Right/Top/Bottom margin (shown in inches)
|
|
1205
1235
|
* - array order is `[top, right, bottom, left]`
|
|
1206
1236
|
* - a value `>= 1` is honored as inches but warns once (it is likely a legacy points value; divide by 72)
|
|
@@ -1224,6 +1254,9 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1224
1254
|
* a real `<p:ph type="...">`. Use `placeholder: 'title'` to give a slide an accessible
|
|
1225
1255
|
* title (PowerPoint's accessibility checker otherwise reports "Missing Slide Title")
|
|
1226
1256
|
* - values: 'title' | 'body' | et. al.
|
|
1257
|
+
* - a {@link PlaceholderBinding} states the `p:ph` in full: its `name` binds as the string
|
|
1258
|
+
* does, and its `type` and `idx` are written whether or not a layout placeholder matches,
|
|
1259
|
+
* which is how text fills a placeholder of a layout this deck does not define
|
|
1227
1260
|
*
|
|
1228
1261
|
* **The placeholder supplies, it does not impose.** Every option this bag states wins; the
|
|
1229
1262
|
* layout placeholder fills in the ones it leaves out. So `{ placeholder: 'body' }` alone
|
|
@@ -1236,9 +1269,10 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1236
1269
|
* inheritance runs: a value this library defaults on the way past does not count as the
|
|
1237
1270
|
* caller stating one, and does not beat the layout.
|
|
1238
1271
|
* @example 'title'
|
|
1272
|
+
* @example { type: 'body', idx: 1 }
|
|
1239
1273
|
* @see https://learn.microsoft.com/en-us/office/vba/api/powerpoint.ppplaceholdertype
|
|
1240
1274
|
*/
|
|
1241
|
-
placeholder?:
|
|
1275
|
+
placeholder?: PlaceholderOption;
|
|
1242
1276
|
/**
|
|
1243
1277
|
* Corner radius (inches) of the text box's `shape`, for `'roundRect'` and the other rounded presets
|
|
1244
1278
|
* - resolved against the shorter side of the box and written as the preset's corner guide
|
|
@@ -1262,7 +1296,7 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1262
1296
|
* Shadow options. **Which shadow depends on which bag it is on**, and the two are different
|
|
1263
1297
|
* effects rather than two spellings of one:
|
|
1264
1298
|
*
|
|
1265
|
-
* - on the options passed to `addText`
|
|
1299
|
+
* - on the options passed to `addText` (the *shape's* bag), it is the shape's drop shadow
|
|
1266
1300
|
* (`p:spPr/a:effectLst`), PowerPoint's Shape Effects ▸ Shadow;
|
|
1267
1301
|
* - on a run's own `options` inside the text array, it is the *text* shadow
|
|
1268
1302
|
* (`a:rPr/a:effectLst`), PowerPoint's Text Effects ▸ Shadow.
|
|
@@ -1276,13 +1310,13 @@ interface TextPropsOptions extends PositionProps, DataOrPathProps, TextBaseProps
|
|
|
1276
1310
|
shadow?: ShadowProps;
|
|
1277
1311
|
shape?: SHAPE_NAME;
|
|
1278
1312
|
/**
|
|
1279
|
-
* Strikethrough (`a:rPr/@strike`, `ST_TextStrikeType
|
|
1313
|
+
* Strikethrough (`a:rPr/@strike`, `ST_TextStrikeType`, ECMA-376 §20.1.10.78)
|
|
1280
1314
|
* - `true` is `'sngStrike'`; `'dblStrike'` is the double rule
|
|
1281
1315
|
* - `'noStrike'` is the *explicit off*: it writes `strike="noStrike"`, which overrides a
|
|
1282
1316
|
* strikethrough the run would otherwise inherit from its list style, placeholder, layout
|
|
1283
1317
|
* or master
|
|
1284
1318
|
* - `false`, like leaving the option out, writes no attribute at all and so states
|
|
1285
|
-
* *nothing
|
|
1319
|
+
* *nothing*: the run keeps whatever it inherits. This matches `bold`/`italic`, whose
|
|
1286
1320
|
* falsy arm is likewise an omission; reach for `'noStrike'` when the intent is "not
|
|
1287
1321
|
* struck" rather than "unspecified"
|
|
1288
1322
|
* @default (unset) inherit
|
|
@@ -1324,8 +1358,8 @@ interface TextProps {
|
|
|
1324
1358
|
*/
|
|
1325
1359
|
math?: string;
|
|
1326
1360
|
/**
|
|
1327
|
-
* Emit this item's `math` equation *inline*
|
|
1328
|
-
* between the surrounding plain text runs
|
|
1361
|
+
* Emit this item's `math` equation *inline* (an `<a14:m><m:oMath>` run flowing mid-paragraph
|
|
1362
|
+
* between the surrounding plain text runs) instead of as its own centered display-math
|
|
1329
1363
|
* paragraph. Has no effect unless `math` is set. Pair with the bare-`<m:oMath>` inline form of
|
|
1330
1364
|
* the equation: `latexToOmml(tex, { display: false })` or `mathmlToOmml(mathml)`.
|
|
1331
1365
|
* @example addText([{ text: 'where ' }, { math: latexToOmml('x^2+1=y', { display: false }), inline: true }, { text: ' holds' }])
|
|
@@ -1333,9 +1367,9 @@ interface TextProps {
|
|
|
1333
1367
|
inline?: boolean;
|
|
1334
1368
|
}
|
|
1335
1369
|
/**
|
|
1336
|
-
* Options for layout-time text measurement ({@link
|
|
1337
|
-
* Inches for width, points for type/spacing
|
|
1338
|
-
* measured face must have metrics registered via {@link
|
|
1370
|
+
* Options for layout-time text measurement ({@link PptxTs.measureText}).
|
|
1371
|
+
* Inches for width, points for type/spacing: the consumer-facing units. The
|
|
1372
|
+
* measured face must have metrics registered via {@link PptxTs.registerFontMetrics}
|
|
1339
1373
|
* (a named face without exact metrics uses a conservative heuristic; an unnamed
|
|
1340
1374
|
* theme-default face is unmeasurable).
|
|
1341
1375
|
*/
|
|
@@ -1362,7 +1396,7 @@ interface MeasureTextOptions {
|
|
|
1362
1396
|
insetIn?: number;
|
|
1363
1397
|
}
|
|
1364
1398
|
/**
|
|
1365
|
-
* Result of {@link
|
|
1399
|
+
* Result of {@link PptxTs.measureText}. Heights err **tall** (conservative):
|
|
1366
1400
|
* they match the value the export-time autofit bake uses, so the laid-out height is
|
|
1367
1401
|
* ≥ what PowerPoint/LibreOffice render. Use it to grow a container; for an overflow
|
|
1368
1402
|
* check it may slightly over-report (good for a warning, not a hard gate).
|
|
@@ -1370,10 +1404,10 @@ interface MeasureTextOptions {
|
|
|
1370
1404
|
interface TextMeasurement {
|
|
1371
1405
|
/** Laid-out height in inches at the given `fontSize` (conservative/tall). */
|
|
1372
1406
|
heightIn: number;
|
|
1373
|
-
/** Number of wrapped lines (conservative
|
|
1407
|
+
/** Number of wrapped lines (conservative: the model wraps marginally early). */
|
|
1374
1408
|
lineCount: number;
|
|
1375
1409
|
/**
|
|
1376
|
-
* Width in inches of the widest laid-out line (conservative
|
|
1410
|
+
* Width in inches of the widest laid-out line (conservative: the model wraps
|
|
1377
1411
|
* marginally early, so this errs slightly wide). With an unconstrained `wIn` it
|
|
1378
1412
|
* is the natural single-line width; constrained, it is the widest wrapped line.
|
|
1379
1413
|
* A box set to this width will not re-wrap the text.
|
|
@@ -1383,15 +1417,15 @@ interface TextMeasurement {
|
|
|
1383
1417
|
measurable: boolean;
|
|
1384
1418
|
/**
|
|
1385
1419
|
* The **named** faces laid out with the conservative average-advance heuristic
|
|
1386
|
-
* instead of their real metrics
|
|
1420
|
+
* instead of their real metrics, i.e. faces with no registered metrics. Empty
|
|
1387
1421
|
* when every run was measured exactly (and for an unmeasurable result, which
|
|
1388
1422
|
* guessed nothing). The numbers stay conservative (they err tall/wide), but a
|
|
1389
1423
|
* non-empty list means they are an approximation, not a measurement; register
|
|
1390
|
-
* the face via {@link
|
|
1424
|
+
* the face via {@link PptxTs.registerFontMetrics} for an exact result.
|
|
1391
1425
|
*/
|
|
1392
1426
|
approximatedFaces: string[];
|
|
1393
1427
|
/**
|
|
1394
|
-
* Code points in the measured text
|
|
1428
|
+
* Code points in the measured text (sorted, deduplicated) whose run resolved to a
|
|
1395
1429
|
* **registered** face that has no glyph for them. Empty for fully covered text.
|
|
1396
1430
|
*
|
|
1397
1431
|
* Unlike everything else here, a non-empty list means the numbers are **not reliably
|
|
@@ -1403,7 +1437,7 @@ interface TextMeasurement {
|
|
|
1403
1437
|
* and the text overflow. Register a face that covers them (or set an explicit
|
|
1404
1438
|
* `fontFace` on those runs) before trusting the height.
|
|
1405
1439
|
*
|
|
1406
|
-
* Faces with no registered metrics are not audited
|
|
1440
|
+
* Faces with no registered metrics are not audited: they measure through the
|
|
1407
1441
|
* cmap-less heuristic and are reported in {@link approximatedFaces} instead.
|
|
1408
1442
|
* `String.fromCodePoint(...uncoveredCodepoints)` renders the list.
|
|
1409
1443
|
*/
|
|
@@ -1413,13 +1447,13 @@ interface TextMeasurement {
|
|
|
1413
1447
|
/** The `fontScale` (percent) that fits inner height `hIn`; `100` if it already fits, never below the shrink floor. */
|
|
1414
1448
|
shrinkScaleFor: (hIn: number) => number;
|
|
1415
1449
|
}
|
|
1416
|
-
/** Options for {@link
|
|
1450
|
+
/** Options for {@link PptxTs.overflowsBox}: a measure plus the box inner height to test against. */
|
|
1417
1451
|
interface OverflowBoxOptions extends MeasureTextOptions {
|
|
1418
1452
|
/** Box inner height in inches to test for overflow. */
|
|
1419
1453
|
hIn: number;
|
|
1420
1454
|
}
|
|
1421
1455
|
/**
|
|
1422
|
-
* One cell's computed rectangle from {@link
|
|
1456
|
+
* One cell's computed rectangle from {@link PptxTs.tableLayout}. All values are
|
|
1423
1457
|
* inches; `x`/`y` are absolute (offset from the table's `x`/`y`). For a merged cell,
|
|
1424
1458
|
* `row`/`col` are the top-left origin and `wIn`/`hIn` cover the whole span; the
|
|
1425
1459
|
* cells it covers are not emitted separately.
|
|
@@ -1444,12 +1478,12 @@ interface TableCellLayout {
|
|
|
1444
1478
|
/**
|
|
1445
1479
|
* `true` when `hIn`/`yIn` are pinned by an explicit `rowH` (array or scalar) or
|
|
1446
1480
|
* table `h`; `false` when the row is auto-height and the value is a conservative
|
|
1447
|
-
* (tall) estimate from the same text model as {@link
|
|
1481
|
+
* (tall) estimate from the same text model as {@link PptxTs.measureText}.
|
|
1448
1482
|
*/
|
|
1449
1483
|
heightExact: boolean;
|
|
1450
1484
|
}
|
|
1451
1485
|
/**
|
|
1452
|
-
* Result of {@link
|
|
1486
|
+
* Result of {@link PptxTs.tableLayout}: per-cell geometry plus overall table
|
|
1453
1487
|
* bounds, for placing images/shapes over a table without rendering it. Geometry is
|
|
1454
1488
|
* for a single, un-paginated table laid out at `opts.x`/`y`/`w`; `autoPage` paging
|
|
1455
1489
|
* is not modeled. Widths are exact; auto-height row heights are conservative
|
|
@@ -1467,8 +1501,8 @@ interface TableLayoutResult {
|
|
|
1467
1501
|
}
|
|
1468
1502
|
/**
|
|
1469
1503
|
* Per-run options for a speaker-notes text run.
|
|
1470
|
-
* A focused subset of `TextPropsOptions`: inline formatting plus
|
|
1471
|
-
*
|
|
1504
|
+
* A focused subset of `TextPropsOptions`: inline formatting plus a hyperlink, which takes a
|
|
1505
|
+
* `url`, a `slide` or an `action` as on a slide.
|
|
1472
1506
|
*/
|
|
1473
1507
|
type NotesTextOptions = Pick<TextPropsOptions, 'hyperlink' | 'bold' | 'italic' | 'underline' | 'color' | 'fontSize' | 'fontFace'>;
|
|
1474
1508
|
/** A single speaker-notes text run: text plus optional inline formatting / hyperlink. */
|
|
@@ -1514,18 +1548,29 @@ interface ResolvedCommentAuthor {
|
|
|
1514
1548
|
declare function textRun(text: string | number, options?: TextPropsOptions): TextProps;
|
|
1515
1549
|
/** Wraps a run array so TypeScript accepts it as `TextProps[]` without a cast. */
|
|
1516
1550
|
declare function textRuns(runs: TextProps[]): TextProps[];
|
|
1517
|
-
//#endregion
|
|
1518
|
-
//#region src/types/object.d.ts
|
|
1519
1551
|
/**
|
|
1520
1552
|
* A layout placeholder's options. They reach the slide objects that fill the placeholder as text
|
|
1521
1553
|
* options, so beside the text formatting a placeholder takes the shape `fill` (an image fill
|
|
1522
1554
|
* included) and the `hyperlink` a text box does, and `bullet` through {@link TextBaseProps}.
|
|
1555
|
+
*
|
|
1556
|
+
* A definition states no bullet, left margin or first-line indent unless given one, so the
|
|
1557
|
+
* master's `textStyles` reach its slides; `bullet: false` turns the bullet off on this layout.
|
|
1523
1558
|
*/
|
|
1524
1559
|
interface PlaceholderProps extends PositionProps, TextBaseProps, ObjectNameProps, Pick<TextPropsOptions, 'fill' | 'hyperlink'> {
|
|
1525
1560
|
name: string;
|
|
1526
|
-
type: PLACEHOLDER_TYPE;
|
|
1527
1561
|
/**
|
|
1528
|
-
*
|
|
1562
|
+
* `p:ph/@type`: one of the six friendly types, or any `ST_PlaceholderType` value (`ctrTitle`,
|
|
1563
|
+
* `subTitle`, `obj`, `dt`, `ftr`, `sldNum`, …).
|
|
1564
|
+
*/
|
|
1565
|
+
type: PLACEHOLDER_TYPE | PlaceholderXmlType;
|
|
1566
|
+
/**
|
|
1567
|
+
* `p:ph/@idx`, a non-negative integer a slide object binds to by stating the same `idx`.
|
|
1568
|
+
* Omitted, it is 100 plus the object's position in `objects`. `0` writes none, as PowerPoint
|
|
1569
|
+
* writes for a title.
|
|
1570
|
+
*/
|
|
1571
|
+
idx?: number;
|
|
1572
|
+
/**
|
|
1573
|
+
* margin (inches): text-frame internal margin; a value `>= 1` warns as a likely legacy points value
|
|
1529
1574
|
*/
|
|
1530
1575
|
margin?: Margin;
|
|
1531
1576
|
/**
|
|
@@ -1541,6 +1586,36 @@ interface PlaceholderProps extends PositionProps, TextBaseProps, ObjectNameProps
|
|
|
1541
1586
|
*/
|
|
1542
1587
|
rectRadius?: number;
|
|
1543
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* A slide object's placeholder binding stated in full: the `p:ph` it writes, with or without a
|
|
1591
|
+
* layout placeholder of that name in the same deck.
|
|
1592
|
+
*
|
|
1593
|
+
* The string form of `placeholder` binds only to a placeholder the deck's own layout defines by
|
|
1594
|
+
* name, and takes its `idx` from there. A slide that fills a placeholder of a layout the deck does
|
|
1595
|
+
* not define, such as one from a template it is appended to, needs the `idx` stated, because
|
|
1596
|
+
* PowerPoint matches a slide placeholder to its layout's by `idx`.
|
|
1597
|
+
* @example { idx: 1 } // the content placeholder of PowerPoint's "Title and Content" layout
|
|
1598
|
+
* @example { type: 'ctrTitle' } // the title of a title slide
|
|
1599
|
+
*/
|
|
1600
|
+
interface PlaceholderBinding {
|
|
1601
|
+
/**
|
|
1602
|
+
* Name of a layout placeholder defined in this deck, as the string form takes it. The object
|
|
1603
|
+
* inherits its options and frame, and its `type` and `idx` unless they are stated here too.
|
|
1604
|
+
*/
|
|
1605
|
+
name?: string;
|
|
1606
|
+
/**
|
|
1607
|
+
* `p:ph/@type`. Omitted, it is the named layout placeholder's type, else none, which
|
|
1608
|
+
* PowerPoint reads as `obj`.
|
|
1609
|
+
*/
|
|
1610
|
+
type?: PlaceholderXmlType;
|
|
1611
|
+
/**
|
|
1612
|
+
* `p:ph/@idx`, a non-negative integer. Omitted, it is the named layout placeholder's index,
|
|
1613
|
+
* else none, which PowerPoint reads as `0`.
|
|
1614
|
+
*/
|
|
1615
|
+
idx?: number;
|
|
1616
|
+
}
|
|
1617
|
+
/** A slide object's `placeholder`: a layout placeholder's name, or a {@link PlaceholderBinding}. */
|
|
1618
|
+
type PlaceholderOption = string | PlaceholderBinding;
|
|
1544
1619
|
interface ObjectNameProps {
|
|
1545
1620
|
/**
|
|
1546
1621
|
* Object name
|
|
@@ -1581,6 +1656,8 @@ interface ObjectNameProps {
|
|
|
1581
1656
|
interface ObjectLockProps {
|
|
1582
1657
|
/** Disallow grouping/ungrouping with other objects. (shapes, images, tables) */
|
|
1583
1658
|
noGrp?: boolean;
|
|
1659
|
+
/** Disallow ungrouping the group (`a:grpSpLocks/@noUngrp`). (groups only) */
|
|
1660
|
+
noUngrp?: boolean;
|
|
1584
1661
|
/** Disallow selecting the object. (shapes, images, tables) */
|
|
1585
1662
|
noSelect?: boolean;
|
|
1586
1663
|
/** Disallow moving the object. (shapes, images, tables) */
|
|
@@ -1609,14 +1686,14 @@ interface ObjectLockProps {
|
|
|
1609
1686
|
/**
|
|
1610
1687
|
* The object descriptors a slide master and a group child both accept.
|
|
1611
1688
|
*
|
|
1612
|
-
* Both surfaces take a key-tagged descriptor
|
|
1613
|
-
* options for that kind
|
|
1689
|
+
* Both surfaces take a key-tagged descriptor (one key naming the object kind, its value the
|
|
1690
|
+
* options for that kind), and both accepted the same six. They were written out twice, and the
|
|
1614
1691
|
* doc on `GroupChildProps` said as much in as many words: "Uses the same key-tagged descriptor
|
|
1615
1692
|
* shape as `SlideMasterObject`". That coupling was real and maintained by hand, which meant a
|
|
1616
1693
|
* seventh descriptor added to one was silently missing from the other.
|
|
1617
1694
|
*
|
|
1618
|
-
* Each union is now this plus what is genuinely its own
|
|
1619
|
-
* `placeholder`, a group child adds `group`
|
|
1695
|
+
* Each union is now this plus what is genuinely its own (a master adds `chart` and
|
|
1696
|
+
* `placeholder`, a group child adds `group`), so the difference between them is the part you
|
|
1620
1697
|
* read, and the shared vocabulary is stated once.
|
|
1621
1698
|
*/
|
|
1622
1699
|
type CommonObjectDescriptor = {
|
|
@@ -1647,8 +1724,6 @@ type CommonObjectDescriptor = {
|
|
|
1647
1724
|
options?: TextPropsOptions;
|
|
1648
1725
|
};
|
|
1649
1726
|
};
|
|
1650
|
-
//#endregion
|
|
1651
|
-
//#region src/types/chart.d.ts
|
|
1652
1727
|
/**
|
|
1653
1728
|
* An axis' tick marks (`ST_TickMark`): `in` and `out` of the axis line, `cross` through it, or `none`.
|
|
1654
1729
|
*
|
|
@@ -1765,11 +1840,11 @@ interface ChartErrorBarOptions extends StrokeProps {
|
|
|
1765
1840
|
barType?: ErrorBarType;
|
|
1766
1841
|
/**
|
|
1767
1842
|
* How `value` (or `plusValues`/`minusValues`) is interpreted.
|
|
1768
|
-
* - `'fixedVal'
|
|
1769
|
-
* - `'percentage'
|
|
1770
|
-
* - `'stdDev'
|
|
1771
|
-
* - `'stdErr'
|
|
1772
|
-
* - `'cust'
|
|
1843
|
+
* - `'fixedVal'`: fixed amount in axis units
|
|
1844
|
+
* - `'percentage'`: percent of each value (e.g. `value: 5` → ±5%)
|
|
1845
|
+
* - `'stdDev'`: `value` standard deviations
|
|
1846
|
+
* - `'stdErr'`: standard error (ignores `value`)
|
|
1847
|
+
* - `'cust'`: explicit per-point amounts via `plusValues`/`minusValues`
|
|
1773
1848
|
* @default 'fixedVal'
|
|
1774
1849
|
*/
|
|
1775
1850
|
valueType?: ErrorBarValueType;
|
|
@@ -1814,7 +1889,7 @@ interface OptsChartGridLine extends StrokeProps {
|
|
|
1814
1889
|
*
|
|
1815
1890
|
* `'none'` omits the gridlines entirely and is the same statement as `type: 'none'`;
|
|
1816
1891
|
* `'solid'`, `'dash'` and `'dot'` are `a:prstDash` presets and map onto `dashType`
|
|
1817
|
-
* unchanged
|
|
1892
|
+
* unchanged. Note that this `'dash'` is the literal `dash` preset, where
|
|
1818
1893
|
* {@link StrokeProps.type}`: 'dash'` means `sysDash`.
|
|
1819
1894
|
* @deprecated Use {@link StrokeProps.dashType} (or `type: 'none'`). `dashType` and an
|
|
1820
1895
|
* explicit `type` both win when set.
|
|
@@ -1824,7 +1899,11 @@ interface OptsChartGridLine extends StrokeProps {
|
|
|
1824
1899
|
interface ChartMulti {
|
|
1825
1900
|
type: CHART_NAME;
|
|
1826
1901
|
data: OptsChartData[];
|
|
1827
|
-
|
|
1902
|
+
/**
|
|
1903
|
+
* This subchart's options, merged over the combo chart's own. Omitted, the subchart takes the
|
|
1904
|
+
* chart's options as they are.
|
|
1905
|
+
*/
|
|
1906
|
+
options?: ChartOpts;
|
|
1828
1907
|
}
|
|
1829
1908
|
interface ChartPropsFillLine {
|
|
1830
1909
|
/**
|
|
@@ -1836,16 +1915,17 @@ interface ChartPropsFillLine {
|
|
|
1836
1915
|
* PowerPoint: Format Chart Area/Plot Area > Fill
|
|
1837
1916
|
*
|
|
1838
1917
|
* Omitting `fill` leaves the area transparent (`<a:noFill/>`), as does a `fill` that
|
|
1839
|
-
* states neither a `color` nor a `type
|
|
1918
|
+
* states neither a `color` nor a `type`: `transparency` alone is not a fill, since
|
|
1840
1919
|
* there is no colour for the alpha to apply to.
|
|
1841
1920
|
*
|
|
1842
|
-
* `type: 'image'`
|
|
1843
|
-
*
|
|
1921
|
+
* `type: 'image'` paints a picture, which the chart part references through a relationship of
|
|
1922
|
+
* its own. A chartEx chart (waterfall, funnel, …) writes no area fill at all.
|
|
1844
1923
|
* @example fill: '696969' // hex RGB color value, shorthand for {color: '696969'}
|
|
1845
1924
|
* @example fill: {color: '696969'} // hex RGB color value
|
|
1846
1925
|
* @example fill: {color: SchemeColor.background2} // Theme color value
|
|
1847
1926
|
* @example fill: {color: '696969', transparency: 50} // 50% transparent grey
|
|
1848
1927
|
* @example fill: {type: 'gradient', gradient: {kind: 'linear', angle: 90, stops: [{position: 0, color: '0088CC'}, {position: 100, color: 'FFFFFF'}]}}
|
|
1928
|
+
* @example fill: {type: 'image', image: {path: 'paper.png'}} // a picture, stretched over the area
|
|
1849
1929
|
* @example fill: {type: 'inherit'} // no fill child at all -- take the chart style's fill
|
|
1850
1930
|
*/
|
|
1851
1931
|
fill?: FillOption;
|
|
@@ -1863,7 +1943,7 @@ interface ChartPropsBase {
|
|
|
1863
1943
|
* Series colours, cycled: series (or, on a pie/doughnut, data point) `n` takes
|
|
1864
1944
|
* `chartColors[n % chartColors.length]`, so a shorter list repeats rather than running out.
|
|
1865
1945
|
*
|
|
1866
|
-
* Omitting it, or passing an empty array, both mean the same thing
|
|
1946
|
+
* Omitting it, or passing an empty array, both mean the same thing: the built-in default
|
|
1867
1947
|
* palette for the chart type. Two spellings of "I named no colours"; there is no third state
|
|
1868
1948
|
* that suppresses the fills.
|
|
1869
1949
|
*/
|
|
@@ -1894,7 +1974,7 @@ interface ChartPropsBase {
|
|
|
1894
1974
|
*/
|
|
1895
1975
|
showBubbleSize?: boolean;
|
|
1896
1976
|
/**
|
|
1897
|
-
* Enable data labels, with a meaning that is **overloaded per plot type
|
|
1977
|
+
* Enable data labels, with a meaning that is **overloaded per plot type**. It is not a
|
|
1898
1978
|
* plain duplicate of {@link ChartPropsBase.showValue}:
|
|
1899
1979
|
* - pie / doughnut: shows the **category name** (`c:showCatName`);
|
|
1900
1980
|
* - scatter: turns on the labels {@link ChartPropsDataLabel.dataLabelFormatScatter} describes,
|
|
@@ -1977,7 +2057,7 @@ interface ChartPropsBase {
|
|
|
1977
2057
|
/**
|
|
1978
2058
|
* Per-series style overrides.
|
|
1979
2059
|
*
|
|
1980
|
-
* Element at index N applies to the **Nth series of the chart
|
|
2060
|
+
* Element at index N applies to the **Nth series of the chart**, the same number the series
|
|
1981
2061
|
* carries in `<c:idx>`/`<c:order>`. For most plots that is its position in `data`; on a combo
|
|
1982
2062
|
* it counts across every subchart in order, so a bar(2) + line(1) combo reaches the line at
|
|
1983
2063
|
* index 2. A scatter or bubble series counts one lower than its position, because the X row in
|
|
@@ -2033,9 +2113,9 @@ interface ChartPropsAxisCat {
|
|
|
2033
2113
|
* Show every Nth category label (`c:tickLblSkip`, `ST_Skip`), e.g. `2` for every other one.
|
|
2034
2114
|
* - a whole number of at least 1; anything else warns and leaves the element off
|
|
2035
2115
|
*
|
|
2036
|
-
* Pass a number. The `string` half is a compatibility hangover
|
|
2116
|
+
* Pass a number. The `string` half is a compatibility hangover (this was typed as a
|
|
2037
2117
|
* free-form string and emitted verbatim, which both rejected the natural `2` and let
|
|
2038
|
-
* `'every other'` reach the attribute
|
|
2118
|
+
* `'every other'` reach the attribute), and is read with `Number()` like any other.
|
|
2039
2119
|
*/
|
|
2040
2120
|
catAxisLabelFrequency?: number | string;
|
|
2041
2121
|
catAxisLabelPos?: TickLabelPosition;
|
|
@@ -2118,6 +2198,13 @@ interface ChartPropsAxisCat {
|
|
|
2118
2198
|
catAxisTitleFontSize?: number;
|
|
2119
2199
|
catAxisTitleRotate?: number;
|
|
2120
2200
|
catGridLine?: OptsChartGridLine;
|
|
2201
|
+
/**
|
|
2202
|
+
* Date format for the category labels, which makes the category axis a date axis (`c:dateAx`).
|
|
2203
|
+
* - Example: `'yyyy-mm-dd'`, `'mmm yyyy'`
|
|
2204
|
+
* - labels: ISO dates or date-times (`'2026-01-01'`, `'2026-01-01T12:00'`) or date serial numbers;
|
|
2205
|
+
* ISO ones are written as their serials. A label that is neither warns and the categories stay text.
|
|
2206
|
+
* - PowerPoint: Format Axis > Number > Format Code
|
|
2207
|
+
*/
|
|
2121
2208
|
catLabelFormatCode?: string;
|
|
2122
2209
|
/**
|
|
2123
2210
|
* Whether data should use secondary category axis (instead of primary)
|
|
@@ -2146,7 +2233,7 @@ interface ChartPropsAxisSer {
|
|
|
2146
2233
|
serAxisLabelFrequency?: number | string;
|
|
2147
2234
|
serAxisLabelPos?: TickLabelPosition;
|
|
2148
2235
|
/**
|
|
2149
|
-
* The series axis line, as a stroke
|
|
2236
|
+
* The series axis line, as a stroke: the same {@link StrokeProps} the other two axes and
|
|
2150
2237
|
* every gridline take. See {@link ChartPropsAxisCat.catAxisLine}.
|
|
2151
2238
|
*
|
|
2152
2239
|
* The series axis is the third axis of a 3-D chart, and it was the one axis whose line
|
|
@@ -2222,7 +2309,7 @@ interface ChartPropsAxisVal {
|
|
|
2222
2309
|
valAxisLabelPos?: TickLabelPosition;
|
|
2223
2310
|
valAxisLabelRotate?: number;
|
|
2224
2311
|
/**
|
|
2225
|
-
* The value axis line, as a stroke
|
|
2312
|
+
* The value axis line, as a stroke: the same {@link StrokeProps} the other two axes and
|
|
2226
2313
|
* every gridline take. See {@link ChartPropsAxisCat.catAxisLine}.
|
|
2227
2314
|
*/
|
|
2228
2315
|
valAxisLine?: StrokeProps;
|
|
@@ -2263,7 +2350,7 @@ interface ChartPropsAxisVal {
|
|
|
2263
2350
|
valAxisMaxVal?: number;
|
|
2264
2351
|
valAxisMinorTickMark?: ChartAxisTickMark;
|
|
2265
2352
|
/**
|
|
2266
|
-
* Spacing between minor tick marks on the value axis (`c:minorUnit`)
|
|
2353
|
+
* Spacing between minor tick marks on the value axis (`c:minorUnit`), the sibling
|
|
2267
2354
|
* `valAxisMajorUnit` had had for years, while the category and series axes carried both.
|
|
2268
2355
|
* - PowerPoint: Format Axis > Axis Options > Units > Minor
|
|
2269
2356
|
*/
|
|
@@ -2352,7 +2439,7 @@ interface ChartPropsChartLine {
|
|
|
2352
2439
|
*/
|
|
2353
2440
|
lineDash?: ChartLineDash;
|
|
2354
2441
|
/**
|
|
2355
|
-
* Per-series dash type overrides; index matches the series order in the `data` array
|
|
2442
|
+
* Per-series dash type overrides; index matches the series order in the `data` array, and on a
|
|
2356
2443
|
* combo, the order across every subchart, the same index `seriesOptions` uses.
|
|
2357
2444
|
* - entries shorter than the series count fall back to `lineDash`
|
|
2358
2445
|
* - example: `['solid', 'dash', 'lgDash']` gives each series its own dash pattern
|
|
@@ -2438,7 +2525,7 @@ interface ChartPropsChartWaterfall {
|
|
|
2438
2525
|
* today is which side of each bin interval is closed.
|
|
2439
2526
|
*
|
|
2440
2527
|
* NOTE: explicit bin geometry (fixed bin width / bin count / overflow / underflow) is not yet
|
|
2441
|
-
* supported
|
|
2528
|
+
* supported: PowerPoint desktop rejects the decks those settings produce, so they are deferred.
|
|
2442
2529
|
*/
|
|
2443
2530
|
interface ChartExBinning {
|
|
2444
2531
|
/** Which side of each bin interval is closed: `'r'` (right, the default) or `'l'` (left). */
|
|
@@ -2459,7 +2546,7 @@ interface ChartPropsChartHistogram {
|
|
|
2459
2546
|
*/
|
|
2460
2547
|
interface ChartExStatistics {
|
|
2461
2548
|
/**
|
|
2462
|
-
* How the first/third quartiles are computed: `'exclusive'` (PowerPoint's default
|
|
2549
|
+
* How the first/third quartiles are computed: `'exclusive'` (PowerPoint's default: the median
|
|
2463
2550
|
* is excluded when splitting the halves) or `'inclusive'`.
|
|
2464
2551
|
*/
|
|
2465
2552
|
quartileMethod?: 'inclusive' | 'exclusive';
|
|
@@ -2486,7 +2573,7 @@ interface ChartPropsChartBoxWhisker {
|
|
|
2486
2573
|
* PowerPoint resolves against its Bing-backed geography database when the deck is opened.
|
|
2487
2574
|
*
|
|
2488
2575
|
* These fields tell PowerPoint how to interpret ambiguous region names (e.g. "Georgia" the country
|
|
2489
|
-
* vs. the US state). They do NOT change what pptx-ts writes beyond the `<cx:geography>` hint
|
|
2576
|
+
* vs. the US state). They do NOT change what pptx-ts writes beyond the `<cx:geography>` hint:
|
|
2490
2577
|
* the actual map is resolved and rendered by PowerPoint 2016+/Microsoft 365 at open time, so the
|
|
2491
2578
|
* region names must match PowerPoint's geography database or the map renders blank.
|
|
2492
2579
|
*/
|
|
@@ -2506,12 +2593,12 @@ interface ChartPropsChartRegionMap {
|
|
|
2506
2593
|
}
|
|
2507
2594
|
interface ChartPropsChartStock {
|
|
2508
2595
|
/**
|
|
2509
|
-
* Stock (high-low-close) chart style
|
|
2596
|
+
* Stock (high-low-close) chart style: selects how many value series the chart expects and how
|
|
2510
2597
|
* they are drawn. The data series must be supplied in the exact order implied by the style:
|
|
2511
|
-
* - `'hlc'
|
|
2512
|
-
* - `'ohlc'
|
|
2513
|
-
* - `'vhlc'
|
|
2514
|
-
* - `'vohlc'
|
|
2598
|
+
* - `'hlc'`: High, Low, Close (3 series). The close is marked with a dot.
|
|
2599
|
+
* - `'ohlc'`: Open, High, Low, Close (4 series). Open→close is drawn as up/down bars.
|
|
2600
|
+
* - `'vhlc'`: Volume, High, Low, Close (4 series). Volume is a column on its own axis.
|
|
2601
|
+
* - `'vohlc'`: Volume, Open, High, Low, Close (5 series). Volume column + up/down bars.
|
|
2515
2602
|
*
|
|
2516
2603
|
* `<c:hiLowLines>` connect the high/low of each category in every style.
|
|
2517
2604
|
* @default 'hlc'
|
|
@@ -2665,9 +2752,9 @@ interface ChartPropsTitle extends TextBaseProps {
|
|
|
2665
2752
|
};
|
|
2666
2753
|
titleRotate?: number;
|
|
2667
2754
|
}
|
|
2668
|
-
interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartDoughnut, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartWaterfall, ChartPropsChartHistogram, ChartPropsChartBoxWhisker, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsLegend, ChartPropsTitle, ObjectNameProps,
|
|
2755
|
+
interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartDoughnut, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartWaterfall, ChartPropsChartHistogram, ChartPropsChartBoxWhisker, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsLegend, ChartPropsTitle, ObjectNameProps, PlaceholderPositionProps {
|
|
2669
2756
|
/**
|
|
2670
|
-
* Chart type
|
|
2757
|
+
* Chart type. Required when using the canonical `addChart(data, options)` signature.
|
|
2671
2758
|
* - Omit only for multi-type (combo) charts, where each `ChartMulti` entry carries its own `type`.
|
|
2672
2759
|
*/
|
|
2673
2760
|
type?: CHART_NAME;
|
|
@@ -2676,6 +2763,16 @@ interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxis
|
|
|
2676
2763
|
* - PowerPoint: [right-click on a chart] > "Edit Alt Text..."
|
|
2677
2764
|
*/
|
|
2678
2765
|
altText?: string;
|
|
2766
|
+
/**
|
|
2767
|
+
* Name of a placeholder defined on the slide layout/master to fill, or a
|
|
2768
|
+
* {@link PlaceholderBinding} that states the `p:ph` to write
|
|
2769
|
+
* - when it matches a layout/master placeholder, the chart takes that placeholder's position
|
|
2770
|
+
* and size for any of `x`/`y`/`w`/`h` not supplied explicitly; explicit values always win
|
|
2771
|
+
* - a name that matches none writes no `p:ph`; a binding's `idx` or `type` writes one regardless
|
|
2772
|
+
* @example 'chartph'
|
|
2773
|
+
* @example { type: 'chart', idx: 13 }
|
|
2774
|
+
*/
|
|
2775
|
+
placeholder?: PlaceholderOption;
|
|
2679
2776
|
/**
|
|
2680
2777
|
* Custom chart-level metadata, emitted as a schema-valid extension on the chart space
|
|
2681
2778
|
* (`c:chartSpace/c:extLst`) under a stable pptx-ts vendor GUID.
|
|
@@ -2688,8 +2785,6 @@ interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxis
|
|
|
2688
2785
|
*/
|
|
2689
2786
|
metadata?: Record<string, string>;
|
|
2690
2787
|
}
|
|
2691
|
-
//#endregion
|
|
2692
|
-
//#region src/types/style.d.ts
|
|
2693
2788
|
/**
|
|
2694
2789
|
* A stroke, stated once.
|
|
2695
2790
|
*
|
|
@@ -2699,8 +2794,8 @@ interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxis
|
|
|
2699
2794
|
* paint. This is that vocabulary; {@link BorderProps} is an alias of it, and the chart
|
|
2700
2795
|
* option bag now takes it wherever it used to spell a stroke by hand.
|
|
2701
2796
|
*
|
|
2702
|
-
* Defaults are **per site**, not per interface
|
|
2703
|
-
* chart gridline's is whatever `DEF_CHART_GRIDLINE` says
|
|
2797
|
+
* Defaults are **per site**, not per interface (a table border's absent `width` is 1 pt, a
|
|
2798
|
+
* chart gridline's is whatever `DEF_CHART_GRIDLINE` says), so each consumer documents its own
|
|
2704
2799
|
* rather than this type claiming one for all of them.
|
|
2705
2800
|
*
|
|
2706
2801
|
* {@link ShapeLineProps} is deliberately *not* an alias: a shape stroke is a **paint**, so its
|
|
@@ -2721,7 +2816,7 @@ interface StrokeProps {
|
|
|
2721
2816
|
* onto `sysDash`. Set this to pick the exact `a:prstDash` preset instead:
|
|
2722
2817
|
* `dashType: 'lgDashDot'` emits `<a:prstDash val="lgDashDot"/>`.
|
|
2723
2818
|
*
|
|
2724
|
-
* **Precedence.** When both are set, `dashType` wins over `type` for the dash pattern
|
|
2819
|
+
* **Precedence.** When both are set, `dashType` wins over `type` for the dash pattern:
|
|
2725
2820
|
* `{ type: 'solid', dashType: 'sysDot' }` draws a dotted rule. The one exception is
|
|
2726
2821
|
* `type: 'none'`, which suppresses the stroke entirely and is decided before any dash
|
|
2727
2822
|
* pattern is chosen. An unrecognized value warns and falls back to what `type` implies.
|
|
@@ -2729,7 +2824,7 @@ interface StrokeProps {
|
|
|
2729
2824
|
*/
|
|
2730
2825
|
dashType?: PresetLineDashVal;
|
|
2731
2826
|
/**
|
|
2732
|
-
* Stroke colour
|
|
2827
|
+
* Stroke colour: a 6-digit hex RGB or a `SchemeColor` token.
|
|
2733
2828
|
* @example 'FF3399'
|
|
2734
2829
|
* @example SchemeColor.accent1
|
|
2735
2830
|
*/
|
|
@@ -2764,26 +2859,50 @@ type BorderProps = StrokeProps;
|
|
|
2764
2859
|
* `HyperlinkProps.slide` instead (which emits `ppaction://hlinksldjump`).
|
|
2765
2860
|
*/
|
|
2766
2861
|
type HyperlinkActionJump = 'firstslide' | 'previousslide' | 'nextslide' | 'lastslide' | 'lastslideviewed' | 'endshow';
|
|
2767
|
-
|
|
2862
|
+
/** What every {@link HyperlinkProps} takes beside its one destination. */
|
|
2863
|
+
interface HyperlinkBaseProps {
|
|
2768
2864
|
/**
|
|
2769
|
-
*
|
|
2865
|
+
* Hyperlink Tooltip
|
|
2770
2866
|
*/
|
|
2771
|
-
|
|
2867
|
+
tooltip?: string;
|
|
2868
|
+
}
|
|
2869
|
+
/** A hyperlink to a URL. */
|
|
2870
|
+
interface UrlHyperlinkProps extends HyperlinkBaseProps {
|
|
2772
2871
|
/**
|
|
2773
2872
|
* Url to link to
|
|
2774
2873
|
*/
|
|
2775
|
-
url
|
|
2874
|
+
url: string;
|
|
2875
|
+
slide?: never;
|
|
2876
|
+
action?: never;
|
|
2877
|
+
}
|
|
2878
|
+
/** A hyperlink to another slide of the deck. */
|
|
2879
|
+
interface SlideHyperlinkProps extends HyperlinkBaseProps {
|
|
2776
2880
|
/**
|
|
2777
|
-
*
|
|
2881
|
+
* The 1-based number of the slide to link to. The deck has to have that slide when it is written.
|
|
2778
2882
|
*/
|
|
2779
|
-
|
|
2883
|
+
slide: number;
|
|
2884
|
+
url?: never;
|
|
2885
|
+
action?: never;
|
|
2886
|
+
}
|
|
2887
|
+
/** A slide-show navigation action, such as "next slide". */
|
|
2888
|
+
interface ActionHyperlinkProps extends HyperlinkBaseProps {
|
|
2780
2889
|
/**
|
|
2781
|
-
* Slide-show navigation action
|
|
2782
|
-
* `<a:hlinkClick action="ppaction://hlinkshowjump?jump=…"/>` on the shape
|
|
2890
|
+
* Slide-show navigation action. Emits a relationship-less
|
|
2891
|
+
* `<a:hlinkClick action="ppaction://hlinkshowjump?jump=…"/>` on the shape when the shape states
|
|
2892
|
+
* it (an action button), or on the run when a text run states it, as PowerPoint writes a jump
|
|
2893
|
+
* set on selected text. A shape's action is not repeated on its runs.
|
|
2783
2894
|
* @example hyperlink: { action: 'nextslide' }
|
|
2784
2895
|
*/
|
|
2785
|
-
action
|
|
2896
|
+
action: HyperlinkActionJump;
|
|
2897
|
+
url?: never;
|
|
2898
|
+
slide?: never;
|
|
2786
2899
|
}
|
|
2900
|
+
/**
|
|
2901
|
+
* A click hyperlink, which names exactly one destination: a `url`, a `slide` or an `action`.
|
|
2902
|
+
* @example hyperlink: { url: 'https://github.com', tooltip: 'GitHub' }
|
|
2903
|
+
* @example hyperlink: { slide: 3 }
|
|
2904
|
+
*/
|
|
2905
|
+
type HyperlinkProps = UrlHyperlinkProps | SlideHyperlinkProps | ActionHyperlinkProps;
|
|
2787
2906
|
interface ShadowProps {
|
|
2788
2907
|
/**
|
|
2789
2908
|
* shadow type
|
|
@@ -2837,7 +2956,7 @@ interface ShadowProps {
|
|
|
2837
2956
|
* shorthand for a solid fill in that colour.
|
|
2838
2957
|
*
|
|
2839
2958
|
* `'FF0000'` and `{ color: 'FF0000' }` are the same statement and emit the same
|
|
2840
|
-
* `<a:solidFill
|
|
2959
|
+
* `<a:solidFill>`. The shorthand is lossless, not a lesser spelling, and every other key on
|
|
2841
2960
|
* the object (`transparency`, `gradient`, `pattern`, `image`) is simply one the shorthand has
|
|
2842
2961
|
* no way to say. Reach for the object as soon as you need any of them.
|
|
2843
2962
|
*
|
|
@@ -2871,7 +2990,7 @@ interface ShapeFillProps {
|
|
|
2871
2990
|
* `'none'` and `'inherit'` are different states, and both have to be spelled out
|
|
2872
2991
|
* because omitting `fill` is not one of them: the shape/text-box emitter defaults a
|
|
2873
2992
|
* missing `fill` to `<a:noFill/>`.
|
|
2874
|
-
* - `'none'` emits `<a:noFill
|
|
2993
|
+
* - `'none'` emits `<a:noFill/>`, an explicit transparent interior.
|
|
2875
2994
|
* - `'inherit'` emits no fill child at all, leaving the interior to
|
|
2876
2995
|
* `p:style/a:fillRef` or the placeholder. This is the only way to author that
|
|
2877
2996
|
* state from `addShape`/`addText`.
|
|
@@ -2881,7 +3000,7 @@ interface ShapeFillProps {
|
|
|
2881
3000
|
* inherit, so `'inherit'` is merely the explicit form of the default.
|
|
2882
3001
|
*
|
|
2883
3002
|
* **Omitting `type` is not the same as omitting the fill.** Setting `gradient`,
|
|
2884
|
-
* `pattern` or `image` selects that kind on its own
|
|
3003
|
+
* `pattern` or `image` selects that kind on its own: the sub-object is the statement,
|
|
2885
3004
|
* and `type` is how you say something the sub-objects cannot. Where both are given and
|
|
2886
3005
|
* they disagree, **the explicit `type` wins** and the sub-object is ignored, because
|
|
2887
3006
|
* that is the only rule under which `{ type: 'none', gradient }` can still mean
|
|
@@ -2916,33 +3035,38 @@ interface ShapeFillProps {
|
|
|
2916
3035
|
*
|
|
2917
3036
|
* **A picture stroke is not one of them**, which is why `image` and `type: 'image'` are
|
|
2918
3037
|
* subtracted from the inherited fill props rather than carried. `<a:ln>`'s paint child is
|
|
2919
|
-
* `EG_LineFillProperties`
|
|
2920
|
-
* nothing else
|
|
3038
|
+
* `EG_LineFillProperties` (`a:noFill`, `a:solidFill`, `a:gradFill`, `a:pattFill` and
|
|
3039
|
+
* nothing else), so unlike a shape interior a stroke has no `a:blipFill` slot to put a
|
|
2921
3040
|
* bitmap in, and a package that emitted one is what PowerPoint answers with a repair
|
|
2922
3041
|
* prompt. The interface carried `image` from `ShapeFillProps` regardless, and no call site
|
|
2923
3042
|
* ever registered the media for it, so a picture stroke reached the emitter with no rel and
|
|
2924
3043
|
* painted nothing. It is now spelled out as unsupported: a JS caller who sets it anyway
|
|
2925
3044
|
* gets `line/image-fill-unsupported`.
|
|
2926
3045
|
*
|
|
2927
|
-
* A stroke also does not take the bare-colour shorthand a fill does
|
|
2928
|
-
* for why. Spell it `line: { color: 'FF0000' }`.
|
|
3046
|
+
* A stroke also does not take the bare-colour shorthand a fill does (see {@link FillOption}
|
|
3047
|
+
* for why). Spell it `line: { color: 'FF0000' }`.
|
|
2929
3048
|
*/
|
|
2930
3049
|
interface ShapeLineProps extends Omit<ShapeFillProps, 'type' | 'image'> {
|
|
2931
3050
|
/**
|
|
2932
3051
|
* Stroke paint kind. The same vocabulary as {@link ShapeFillProps.type} minus
|
|
2933
3052
|
* `'image'`, which `<a:ln>` cannot express (see the note on this interface).
|
|
3053
|
+
*
|
|
3054
|
+
* `'inherit'` leaves the whole outline to `p:style/a:lnRef` or the placeholder: no paint,
|
|
3055
|
+
* and no 1pt or solid defaults for `width` and `dashType`. A width, dash, cap or arrowhead
|
|
3056
|
+
* you state is still written over what is inherited.
|
|
3057
|
+
* @example { type: 'inherit' } // an empty <a:ln>: paint, width and dash all inherited
|
|
2934
3058
|
* @default 'solid'
|
|
2935
3059
|
*/
|
|
2936
3060
|
type?: 'none' | 'inherit' | 'solid' | 'gradient' | 'pattern';
|
|
2937
3061
|
/**
|
|
2938
3062
|
* Line width (pt)
|
|
2939
|
-
* @default 1
|
|
3063
|
+
* @default 1, or inherited when `type` is `'inherit'`
|
|
2940
3064
|
*/
|
|
2941
3065
|
width?: number;
|
|
2942
3066
|
/**
|
|
2943
|
-
* Dash type
|
|
3067
|
+
* Dash type: the full `ST_PresetLineDashVal` set, so any dash a source deck can
|
|
2944
3068
|
* carry can also be authored and replicated.
|
|
2945
|
-
* @default 'solid'
|
|
3069
|
+
* @default 'solid', or inherited when `type` is `'inherit'`
|
|
2946
3070
|
*/
|
|
2947
3071
|
dashType?: PresetLineDashVal;
|
|
2948
3072
|
/**
|
|
@@ -2951,11 +3075,11 @@ interface ShapeLineProps extends Omit<ShapeFillProps, 'type' | 'image'> {
|
|
|
2951
3075
|
*/
|
|
2952
3076
|
cap?: LineCap;
|
|
2953
3077
|
/**
|
|
2954
|
-
* Begin arrow type
|
|
3078
|
+
* Begin arrow type: the `ST_LineEndType` set (`a:headEnd/@type`).
|
|
2955
3079
|
*/
|
|
2956
3080
|
beginArrowType?: LineEndType;
|
|
2957
3081
|
/**
|
|
2958
|
-
* End arrow type
|
|
3082
|
+
* End arrow type: the `ST_LineEndType` set (`a:tailEnd/@type`).
|
|
2959
3083
|
*/
|
|
2960
3084
|
endArrowType?: LineEndType;
|
|
2961
3085
|
}
|
|
@@ -2980,7 +3104,7 @@ interface ConnectorProps {
|
|
|
2980
3104
|
/**
|
|
2981
3105
|
* Number of adjustable bends (jogs) for an `elbow` / `curved` connector. Selects the
|
|
2982
3106
|
* preset variant and how many `adj` values it accepts:
|
|
2983
|
-
* - `1` → `bentConnector3` / `curvedConnector3` (one jog)
|
|
3107
|
+
* - `1` → `bentConnector3` / `curvedConnector3` (one jog), the default
|
|
2984
3108
|
* - `2` → `bentConnector4` / `curvedConnector4` (two jogs)
|
|
2985
3109
|
* - `3` → `bentConnector5` / `curvedConnector5` (three jogs)
|
|
2986
3110
|
*
|
|
@@ -3005,13 +3129,13 @@ interface ConnectorProps {
|
|
|
3005
3129
|
* The shape's `objectName` must be set and unique on the slide. `x1`/`y1` remain the static
|
|
3006
3130
|
* fallback geometry (and are used if the name can't be resolved).
|
|
3007
3131
|
*
|
|
3008
|
-
* A shape inside a group is a valid target
|
|
3132
|
+
* A shape inside a group is a valid target: group children are named on the same slide. The
|
|
3009
3133
|
* connector itself is not an {@link Slide.addGroup} child, but {@link Slide.groupObjects} can
|
|
3010
3134
|
* group one that is already on the slide.
|
|
3011
3135
|
*/
|
|
3012
3136
|
startShape?: string;
|
|
3013
3137
|
/**
|
|
3014
|
-
* Connection-site index on `startShape` (0-based; the valid range is preset-dependent
|
|
3138
|
+
* Connection-site index on `startShape` (0-based; the valid range is preset-dependent: a
|
|
3015
3139
|
* shape's `<a:cxnLst>` enumerates its sites). Ignored without `startShape`.
|
|
3016
3140
|
* @default 0
|
|
3017
3141
|
*/
|
|
@@ -3023,7 +3147,7 @@ interface ConnectorProps {
|
|
|
3023
3147
|
* @default 0
|
|
3024
3148
|
*/
|
|
3025
3149
|
endShapeIdx?: number;
|
|
3026
|
-
/** Start point X
|
|
3150
|
+
/** Start point X: inches, or a `Coord` such as `'50%'` / `'2in'` */
|
|
3027
3151
|
x1: Coord;
|
|
3028
3152
|
/** Start point Y */
|
|
3029
3153
|
y1: Coord;
|
|
@@ -3052,10 +3176,8 @@ interface ConnectorProps {
|
|
|
3052
3176
|
/** Accessibility alt text */
|
|
3053
3177
|
altText?: string;
|
|
3054
3178
|
}
|
|
3055
|
-
//#endregion
|
|
3056
|
-
//#region src/types/core.d.ts
|
|
3057
3179
|
/**
|
|
3058
|
-
* Coordinate value. A bare `number` is **always inches
|
|
3180
|
+
* Coordinate value. A bare `number` is **always inches**; there is no magnitude-based unit
|
|
3059
3181
|
* guessing. For other units use an explicit string suffix:
|
|
3060
3182
|
* - `number` → inches (e.g. `10.25`)
|
|
3061
3183
|
* - `"<n>%"` → percentage of the slide axis (e.g. `"75%"`)
|
|
@@ -3102,6 +3224,36 @@ interface PositionProps {
|
|
|
3102
3224
|
*/
|
|
3103
3225
|
w?: Coord;
|
|
3104
3226
|
}
|
|
3227
|
+
/**
|
|
3228
|
+
* {@link PositionProps} for an object that can fill a layout placeholder: text, an image, a table
|
|
3229
|
+
* or a chart. Each axis also takes `null`, which leaves it unstated, as omitting it does. With
|
|
3230
|
+
* `placeholder`, an unstated axis comes from the layout placeholder; without one, it takes the
|
|
3231
|
+
* object's default. `null` is how a computed value says "unset" where `exactOptionalPropertyTypes`
|
|
3232
|
+
* refuses `undefined`.
|
|
3233
|
+
* @example { placeholder: 'body', x: indent ?? null } // the placeholder's left edge unless indented
|
|
3234
|
+
*/
|
|
3235
|
+
interface PlaceholderPositionProps {
|
|
3236
|
+
/**
|
|
3237
|
+
* Horizontal position, as {@link PositionProps.x}. `null` leaves it unstated: the layout
|
|
3238
|
+
* placeholder's, with `placeholder`.
|
|
3239
|
+
*/
|
|
3240
|
+
x?: Coord | null;
|
|
3241
|
+
/**
|
|
3242
|
+
* Vertical position, as {@link PositionProps.y}. `null` leaves it unstated: the layout
|
|
3243
|
+
* placeholder's, with `placeholder`.
|
|
3244
|
+
*/
|
|
3245
|
+
y?: Coord | null;
|
|
3246
|
+
/**
|
|
3247
|
+
* Height, as {@link PositionProps.h}. `null` leaves it unstated: the layout placeholder's, with
|
|
3248
|
+
* `placeholder`.
|
|
3249
|
+
*/
|
|
3250
|
+
h?: Coord | null;
|
|
3251
|
+
/**
|
|
3252
|
+
* Width, as {@link PositionProps.w}. `null` leaves it unstated: the layout placeholder's, with
|
|
3253
|
+
* `placeholder`.
|
|
3254
|
+
*/
|
|
3255
|
+
w?: Coord | null;
|
|
3256
|
+
}
|
|
3105
3257
|
/**
|
|
3106
3258
|
* Reusable optional data/path fields.
|
|
3107
3259
|
* Use `DataOrPathRequiredProps` for APIs that require at least one source.
|
|
@@ -3130,7 +3282,7 @@ type DataOrPathRequiredProps = (DataOrPathProps & {
|
|
|
3130
3282
|
interface BackgroundProps extends DataOrPathProps, ShapeFillProps {}
|
|
3131
3283
|
/**
|
|
3132
3284
|
* What a `background` option accepts: a {@link BackgroundProps} object, or a bare
|
|
3133
|
-
* {@link Color} as shorthand for a solid background in that colour
|
|
3285
|
+
* {@link Color} as shorthand for a solid background in that colour, the same shorthand
|
|
3134
3286
|
* every other fill site takes (see `FillOption`).
|
|
3135
3287
|
* @example background: 'FF3399' // shorthand for { color: 'FF3399' }
|
|
3136
3288
|
*/
|
|
@@ -3212,7 +3364,7 @@ interface RadialGradientFillProps {
|
|
|
3212
3364
|
stops: GradientStopProps[];
|
|
3213
3365
|
}
|
|
3214
3366
|
type GradientFillProps = LinearGradientFillProps | RadialGradientFillProps;
|
|
3215
|
-
/** OOXML ST_PresetPatternVal
|
|
3367
|
+
/** OOXML ST_PresetPatternVal: preset pattern names for `<a:pattFill prst="...">` */
|
|
3216
3368
|
type PatternPreset = (typeof PATTERN_PRESETS)[number];
|
|
3217
3369
|
interface PatternFillProps {
|
|
3218
3370
|
/** OOXML preset pattern (`prst` attribute on `<a:pattFill>`). */
|
|
@@ -3223,7 +3375,7 @@ interface PatternFillProps {
|
|
|
3223
3375
|
bgColor?: Color;
|
|
3224
3376
|
}
|
|
3225
3377
|
/**
|
|
3226
|
-
* Native PPTX picture (image) fill
|
|
3378
|
+
* Native PPTX picture (image) fill: fills a shape's interior with a bitmap
|
|
3227
3379
|
* (`<a:blipFill>`). Provide exactly one of `path` or `data`; raster formats only
|
|
3228
3380
|
* (PNG/JPEG/GIF/BMP/WebP). SVG is not yet supported as a fill source.
|
|
3229
3381
|
*/
|
|
@@ -3235,7 +3387,8 @@ interface ImageFillProps {
|
|
|
3235
3387
|
/**
|
|
3236
3388
|
* Crop the source image to a sub-region by percentage edge insets, emitted as
|
|
3237
3389
|
* DrawingML `<a:srcRect>`.
|
|
3238
|
-
* - each value is the percent (
|
|
3390
|
+
* - each value is the percent (at most 100) trimmed from that edge of the source image;
|
|
3391
|
+
* a negative value pads that edge with empty space instead
|
|
3239
3392
|
* - `l` + `r` and `t` + `b` must each be less than 100
|
|
3240
3393
|
* - omitted edges default to 0
|
|
3241
3394
|
*
|
|
@@ -3244,13 +3397,13 @@ interface ImageFillProps {
|
|
|
3244
3397
|
* clipped by the shape geometry.
|
|
3245
3398
|
*/
|
|
3246
3399
|
crop?: {
|
|
3247
|
-
/** Percent trimmed from the left edge of the source image. @default 0 */
|
|
3400
|
+
/** Percent trimmed from the left edge of the source image; negative pads it. @default 0 */
|
|
3248
3401
|
l?: number;
|
|
3249
|
-
/** Percent trimmed from the top edge of the source image. @default 0 */
|
|
3402
|
+
/** Percent trimmed from the top edge of the source image; negative pads it. @default 0 */
|
|
3250
3403
|
t?: number;
|
|
3251
|
-
/** Percent trimmed from the right edge of the source image. @default 0 */
|
|
3404
|
+
/** Percent trimmed from the right edge of the source image; negative pads it. @default 0 */
|
|
3252
3405
|
r?: number;
|
|
3253
|
-
/** Percent trimmed from the bottom edge of the source image. @default 0 */
|
|
3406
|
+
/** Percent trimmed from the bottom edge of the source image; negative pads it. @default 0 */
|
|
3254
3407
|
b?: number;
|
|
3255
3408
|
};
|
|
3256
3409
|
}
|
|
@@ -3258,7 +3411,7 @@ type Margin = number | [number, number, number, number];
|
|
|
3258
3411
|
type HAlign = 'left' | 'center' | 'right' | 'justify';
|
|
3259
3412
|
type VAlign = 'top' | 'middle' | 'bottom';
|
|
3260
3413
|
/**
|
|
3261
|
-
* Text body `vert` attribute
|
|
3414
|
+
* Text body `vert` attribute: flow/rotation direction of the text within its box.
|
|
3262
3415
|
* Maps to `<a:bodyPr vert="…">` (ECMA-376 `ST_TextVerticalType`).
|
|
3263
3416
|
*/
|
|
3264
3417
|
type TextVertType = TextVerticalType;
|
|
@@ -3270,42 +3423,45 @@ type TextVertType = TextVerticalType;
|
|
|
3270
3423
|
* The `arc` node carries no `x`/`y`: an `<a:arcTo>` has no explicit end point. The renderer
|
|
3271
3424
|
* derives it from the current pen position, the radii and the swept angle, so an end point
|
|
3272
3425
|
* authored here would be discarded (a warning is emitted if one is supplied).
|
|
3426
|
+
*
|
|
3427
|
+
* Any coordinate, radius or angle may instead name a guide, which is written verbatim (the
|
|
3428
|
+
* `ST_AdjCoordinate` / `ST_AdjAngle` string form): one declared in the shape's `guides`, or a
|
|
3429
|
+
* built-in such as `'w'`, `'hc'` or `'cd4'`. A coordinate counts as a name when it starts with a
|
|
3430
|
+
* letter or `_`; an angle, when it is a string at all.
|
|
3273
3431
|
*/
|
|
3274
3432
|
type GeometryPoint = {
|
|
3275
|
-
x: Coord;
|
|
3276
|
-
y: Coord;
|
|
3433
|
+
x: Coord | string;
|
|
3434
|
+
y: Coord | string;
|
|
3277
3435
|
moveTo?: boolean;
|
|
3278
3436
|
} | {
|
|
3279
3437
|
curve: {
|
|
3280
3438
|
type: 'arc';
|
|
3281
|
-
hR: Coord;
|
|
3282
|
-
wR: Coord;
|
|
3283
|
-
stAng: number;
|
|
3284
|
-
swAng: number;
|
|
3439
|
+
hR: Coord | string;
|
|
3440
|
+
wR: Coord | string;
|
|
3441
|
+
stAng: number | string;
|
|
3442
|
+
swAng: number | string;
|
|
3285
3443
|
};
|
|
3286
3444
|
} | {
|
|
3287
|
-
x: Coord;
|
|
3288
|
-
y: Coord;
|
|
3445
|
+
x: Coord | string;
|
|
3446
|
+
y: Coord | string;
|
|
3289
3447
|
curve: {
|
|
3290
3448
|
type: 'cubic';
|
|
3291
|
-
x1: Coord;
|
|
3292
|
-
y1: Coord;
|
|
3293
|
-
x2: Coord;
|
|
3294
|
-
y2: Coord;
|
|
3449
|
+
x1: Coord | string;
|
|
3450
|
+
y1: Coord | string;
|
|
3451
|
+
x2: Coord | string;
|
|
3452
|
+
y2: Coord | string;
|
|
3295
3453
|
};
|
|
3296
3454
|
} | {
|
|
3297
|
-
x: Coord;
|
|
3298
|
-
y: Coord;
|
|
3455
|
+
x: Coord | string;
|
|
3456
|
+
y: Coord | string;
|
|
3299
3457
|
curve: {
|
|
3300
3458
|
type: 'quadratic';
|
|
3301
|
-
x1: Coord;
|
|
3302
|
-
y1: Coord;
|
|
3459
|
+
x1: Coord | string;
|
|
3460
|
+
y1: Coord | string;
|
|
3303
3461
|
};
|
|
3304
3462
|
} | {
|
|
3305
3463
|
close: true;
|
|
3306
3464
|
};
|
|
3307
|
-
//#endregion
|
|
3308
|
-
//#region src/types/theme.d.ts
|
|
3309
3465
|
/**
|
|
3310
3466
|
* Theme color scheme overrides. Each slot maps to one `<a:clrScheme>` entry in `theme1.xml`;
|
|
3311
3467
|
* any slot left unset keeps the default Office value. Provide 6-digit hex (no `#`).
|
|
@@ -3355,28 +3511,28 @@ interface ThemeProps {
|
|
|
3355
3511
|
*/
|
|
3356
3512
|
bodyFontFace?: string;
|
|
3357
3513
|
/**
|
|
3358
|
-
* Headings East Asian font face
|
|
3514
|
+
* Headings East Asian font face: theme `<a:ea>` slot of the major font.
|
|
3359
3515
|
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
3360
3516
|
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
3361
3517
|
* @example 'Yu Gothic'
|
|
3362
3518
|
*/
|
|
3363
3519
|
headFontFaceEA?: string;
|
|
3364
3520
|
/**
|
|
3365
|
-
* Body East Asian font face
|
|
3521
|
+
* Body East Asian font face: theme `<a:ea>` slot of the minor font.
|
|
3366
3522
|
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
3367
3523
|
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
3368
3524
|
* @example 'Yu Gothic'
|
|
3369
3525
|
*/
|
|
3370
3526
|
bodyFontFaceEA?: string;
|
|
3371
3527
|
/**
|
|
3372
|
-
* Headings complex-script font face
|
|
3528
|
+
* Headings complex-script font face: theme `<a:cs>` slot of the major font.
|
|
3373
3529
|
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
3374
3530
|
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
3375
3531
|
* @example 'Arial'
|
|
3376
3532
|
*/
|
|
3377
3533
|
headFontFaceCS?: string;
|
|
3378
3534
|
/**
|
|
3379
|
-
* Body complex-script font face
|
|
3535
|
+
* Body complex-script font face: theme `<a:cs>` slot of the minor font.
|
|
3380
3536
|
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
3381
3537
|
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
3382
3538
|
* @example 'Arial'
|
|
@@ -3390,8 +3546,6 @@ interface ThemeProps {
|
|
|
3390
3546
|
*/
|
|
3391
3547
|
colorScheme?: ThemeColorScheme;
|
|
3392
3548
|
}
|
|
3393
|
-
//#endregion
|
|
3394
|
-
//#region src/types/pres.d.ts
|
|
3395
3549
|
interface WriteBaseProps {
|
|
3396
3550
|
/**
|
|
3397
3551
|
* Whether to DEFLATE-compress the package (PowerPoint itself always compresses;
|
|
@@ -3451,7 +3605,7 @@ interface WriteFileProps extends WriteBaseProps {
|
|
|
3451
3605
|
}
|
|
3452
3606
|
/**
|
|
3453
3607
|
* One emitted OOXML package part: its full slash-path and already-encoded bytes. Returned by
|
|
3454
|
-
* {@link
|
|
3608
|
+
* {@link PptxTs.toParts} for callers that want the raw parts of the `.pptx` OPC package without
|
|
3455
3609
|
* zipping (custom containers, streaming, part-level inspection). The bytes are byte-identical to
|
|
3456
3610
|
* what `write()` would compress for the same part;
|
|
3457
3611
|
* XML parts are UTF-8 (decode with `new TextDecoder().decode(part.data)`), media/font parts are
|
|
@@ -3464,7 +3618,7 @@ interface PackagePart {
|
|
|
3464
3618
|
readonly data: Uint8Array;
|
|
3465
3619
|
}
|
|
3466
3620
|
/**
|
|
3467
|
-
* Options for {@link
|
|
3621
|
+
* Options for {@link PptxTs.toParts}. A deliberately narrow subset of {@link WriteProps}:
|
|
3468
3622
|
* `compression` and `outputType` are zip concerns and do not apply when parts are returned
|
|
3469
3623
|
* unzipped, so only media-error handling is exposed.
|
|
3470
3624
|
*/
|
|
@@ -3539,6 +3693,5 @@ interface PresentationProps {
|
|
|
3539
3693
|
theme: ThemeProps;
|
|
3540
3694
|
title: string;
|
|
3541
3695
|
}
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
//# sourceMappingURL=pres-BA9_lJbY.d.ts.map
|
|
3696
|
+
export { ChartExBinning as $, ImageBaseProps as $t, PositionProps as A, TextShapeType as An, ObjectLockProps as At, HyperlinkActionJump as B, ResolvedCommentAuthor as Bt, HexColor as C, PlaceholderXmlType as Cn, ChartPropsLegend as Ct, PatternFillProps as D, TEXT_AUTONUM_SCHEMES as Dn, OptsChartData as Dt, Margin as E, RadarStyleAlias as En, LineCap as Et, ActionHyperlinkProps as F, CommentProps as Ft, ShapeLineProps as G, TextBulletProps as Gt, HyperlinkProps as H, TableCellLayout as Ht, BorderProps as I, MeasureTextOptions as It, UrlHyperlinkProps as J, TextMeasurement as Jt, SlideHyperlinkProps as K, TextFitShrinkProps as Kt, ConnectorProps as L, NotesProps as Lt, TextVertType as M, TimeUnit as Mn, PlaceholderBinding as Mt, ThemeColor as N, PlaceholderOption as Nt, PatternPreset as O, TRANSITION_TYPES as On, OptsChartGridLine as Ot, VAlign as P, PlaceholderProps as Pt, ChartErrorBarOptions as Q, textRuns as Qt, ConnectorType as R, NotesTextOptions as Rt, HAlign as S, LineDataSymbol as Sn, ChartPropsFillLine as St, LinearGradientFillProps as T, RadarStyle as Tn, ChartSeriesOpts as Tt, ShadowProps as U, TableLayoutResult as Ut, HyperlinkBaseProps as V, SlideComment as Vt, ShapeFillProps as W, TextBaseProps as Wt, ChartAxisTickMark as X, TextPropsOptions as Xt, ChartAreaProps as Y, TextProps as Yt, ChartDataPointStyle as Z, textRun as Zt, DataOrPathProps as _, DisplayBlanksAs as _n, ChartPropsChartStock as _t, PresentationProps as a, ShapeAdjustHandlePolar as an, ChartPropsAxisCat as at, GradientFillProps as b, LightRigDirection as bn, ChartPropsDataLabel as bt, WriteFileProps as c, ShapeConnectionSite as cn, ChartPropsBase as ct, ThemeColorScheme as d, Bar3DShape as dn, ChartPropsChartDoughnut as dt, ImageProps as en, ChartExGeography as et, ThemeProps as f, BarDirection as fn, ChartPropsChartHistogram as ft, Coord as g, DataLabelPosition as gn, ChartPropsChartRegionMap as gt, Color as h, ColorMapToken as hn, ChartPropsChartRadar as ht, PresLayout as i, ShapeAdjustHandle as in, ChartOpts as it, RadialGradientFillProps as j, ThemeColorSlot as jn, ObjectNameProps as jt, PlaceholderPositionProps as k, TextHorzOverflowType as kn, CommonObjectDescriptor as kt, WriteOutputMap as l, ShapeGuide as ln, ChartPropsChartBar as lt, BackgroundProps as m, BevelPresetType as mn, ChartPropsChartPie as mt, PackagePart as n, MediaType as nn, ChartLineDash as nt, SectionProps as o, ShapeAdjustHandleXY as on, ChartPropsAxisSer as ot, BackgroundOption as p, BarGrouping as pn, ChartPropsChartLine as pt, StrokeProps as q, TextGlowProps as qt, PartsProps as r, OleObjectProps as rn, ChartMulti as rt, WriteBaseProps as s, ShapeAdjustValue as sn, ChartPropsAxisVal as st, CustomPropertyValue as t, MediaProps as tn, ChartExStatistics as tt, WriteProps as u, ShapeProps as un, ChartPropsChartBoxWhisker as ut, DataOrPathRequiredProps as v, EMBEDDED_FONT_SLOTS as vn, ChartPropsChartSurface as vt, ImageFillProps as w, PresetMaterialType as wn, ChartPropsTitle as wt, GradientStopProps as x, LightRigType as xn, ChartPropsDataTable as xt, GeometryPoint as y, LegendPosition as yn, ChartPropsChartWaterfall as yt, FillOption as z, OverflowBoxOptions as zt };
|
|
3697
|
+
//# sourceMappingURL=pres-BkEkUAEM.d.ts.map
|