@shbernal/ts-pptx 0.0.1
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/LICENSE +22 -0
- package/README.md +238 -0
- package/dist/autopage-tmfjRzL4.js +420 -0
- package/dist/autopage-tmfjRzL4.js.map +1 -0
- package/dist/browser.d.ts +23 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +103 -0
- package/dist/browser.js.map +1 -0
- package/dist/diagnostics-DYQC7xLV.js +0 -0
- package/dist/diagnostics-DYQC7xLV.js.map +1 -0
- package/dist/diagnostics-DzY9Tyfm.d.ts +693 -0
- package/dist/diagnostics-DzY9Tyfm.d.ts.map +1 -0
- package/dist/embedded-fonts-MaynAHa9.js +94 -0
- package/dist/embedded-fonts-MaynAHa9.js.map +1 -0
- package/dist/enums-D3aF4QGb.d.ts +452 -0
- package/dist/enums-D3aF4QGb.d.ts.map +1 -0
- package/dist/errors-DGE9zh3U.js +93 -0
- package/dist/errors-DGE9zh3U.js.map +1 -0
- package/dist/errors-DRLpOpgQ.d.ts +160 -0
- package/dist/errors-DRLpOpgQ.d.ts.map +1 -0
- package/dist/fit-CbxyHN69.js +0 -0
- package/dist/fit-CbxyHN69.js.map +1 -0
- package/dist/html-dom-wVa3TiG7.js +666 -0
- package/dist/html-dom-wVa3TiG7.js.map +1 -0
- package/dist/html.d.ts +26 -0
- package/dist/html.d.ts.map +1 -0
- package/dist/html.js +60 -0
- package/dist/html.js.map +1 -0
- package/dist/image-size-C5Z1sKof.js +252 -0
- package/dist/image-size-C5Z1sKof.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect.d.ts +173 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +285 -0
- package/dist/inspect.js.map +1 -0
- package/dist/math.d.ts +37 -0
- package/dist/math.d.ts.map +1 -0
- package/dist/math.js +106 -0
- package/dist/math.js.map +1 -0
- package/dist/measure.d.ts +223 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +3 -0
- package/dist/node.d.ts +12 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +60 -0
- package/dist/node.js.map +1 -0
- package/dist/package-CaOLXSNi.d.ts +193 -0
- package/dist/package-CaOLXSNi.d.ts.map +1 -0
- package/dist/pres-5x1bjCzk.d.ts +202 -0
- package/dist/pres-5x1bjCzk.d.ts.map +1 -0
- package/dist/presentation-B0JWdTN1.js +4286 -0
- package/dist/presentation-B0JWdTN1.js.map +1 -0
- package/dist/presentation-RGOiun5P.d.ts +3249 -0
- package/dist/presentation-RGOiun5P.d.ts.map +1 -0
- package/dist/presentation-types-BVw0EknS.d.ts +538 -0
- package/dist/presentation-types-BVw0EknS.d.ts.map +1 -0
- package/dist/read.d.ts +73 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +4 -0
- package/dist/script.d.ts +553 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +0 -0
- package/dist/script.js.map +1 -0
- package/dist/shapes-BZU8UTW2.js +5365 -0
- package/dist/shapes-BZU8UTW2.js.map +1 -0
- package/dist/slide-B6mDaM-P.d.ts +3396 -0
- package/dist/slide-B6mDaM-P.d.ts.map +1 -0
- package/dist/text-WRUbOy2r.js +11238 -0
- package/dist/text-WRUbOy2r.js.map +1 -0
- package/dist/units-B-JUKwCS.js +144 -0
- package/dist/units-B-JUKwCS.js.map +1 -0
- package/dist/units-internal-7JcMfYti.js +723 -0
- package/dist/units-internal-7JcMfYti.js.map +1 -0
- package/dist/zip.d.ts +68 -0
- package/dist/zip.d.ts.map +1 -0
- package/dist/zip.js +163 -0
- package/dist/zip.js.map +1 -0
- package/package.json +214 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-DzY9Tyfm.d.ts","names":[],"sources":["../src/types/zoom.ts","../src/types/internal.ts","../src/runtime/types.ts","../src/units.ts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f;IACA,OAAO,cAAc;IACrB;IACA,QAAQ;MACL;;;;;;;;;;;;;;;;EA6DJ,YAAY,eAAe,aAAa,MAAM,qBAAqB;;;;;;;;;;;EAcnE,aAAa,eAAe,aAAa,MAAM;;;;;;;;;;;;;;;;;;;EAuB/C,YAAY,MAAM,YAAY,MAAM,aAAa;;;;;;EAW3C,OAAO,QAAQ,iBAAiB,iBAAiB,cAAc,OAAO;;;;;;EAYtE,MAAM,QAAQ,aAAa,iBAAiB,cAAc,OAAO;;;;;;;;;;;;;;;;;EAwBjE,QAAQ,QAAQ,aAAa,QAAQ;;;;;;;EAYrC,UAAU,QAAQ,iBAAiB;;;;;;;EAoBzC,kBAAkB,cAAc,OAAO;;;;;;EAUvC,WAAW,SAAS;;;;;;EA+BpB,SAAS,UAAU,gBAAgB;;;;;;EAsEnC,aAAa,QAAQ;;;;;EAwBrB,kBAAkB,OAAO;;;;;;;;;;;;;;;;EAgEzB,iBAAiB,OAAO;;;;;UC/oCR;;WAEP,MAAM;;WAEN;;;;;WAKA,SAAS,SAAS;;;KAIhB,qBAAqB,YAAY;;;;;;;;;;;;;;;;;;;;;iBAgC7B,qBAAqB,MAAM"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region src/embedded-fonts.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared model + serializer for PresentationML embedded fonts, used by both the
|
|
4
|
+
* write side (author-side `pptx.embedFont`, `gen/pres/presentation.ts`) and the read side
|
|
5
|
+
* (`importSlide({ embedFonts: true })`, `src/read/api/ops/embedded-fonts.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Embedded fonts are three coordinated pieces (ECMA-376 transitional):
|
|
8
|
+
* 1. binary font parts `/ppt/fonts/fontN.fntdata` — the **raw** TTF/OTF bytes
|
|
9
|
+
* (PresentationML does not obfuscate embedded fonts), content type
|
|
10
|
+
* `application/x-fontdata` via a single `fntdata` Default extension;
|
|
11
|
+
* 2. one `font` relationship per face from `presentation.xml`;
|
|
12
|
+
* 3. a `p:embeddedFontLst` in `presentation.xml`, at index 7 of the
|
|
13
|
+
* `CT_Presentation` child sequence (after `smartTags`, before `custShowLst`
|
|
14
|
+
* … `defaultTextStyle`).
|
|
15
|
+
*
|
|
16
|
+
* This module owns only the OOXML-shape knowledge; rId allocation and part
|
|
17
|
+
* placement stay with each caller (their packaging models differ).
|
|
18
|
+
*/
|
|
19
|
+
/** Extension for the binary font parts (`/ppt/fonts/fontN.fntdata`). */
|
|
20
|
+
const FONT_DATA_EXTENSION = "fntdata";
|
|
21
|
+
/** Content type for a `.fntdata` part — one `Default` covers every font part. */
|
|
22
|
+
const FONT_DATA_CONTENT_TYPE = "application/x-fontdata";
|
|
23
|
+
/** Relationship type from `presentation.xml` to a font part (one per face). */
|
|
24
|
+
const FONT_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font";
|
|
25
|
+
/**
|
|
26
|
+
* The four face slots of `CT_EmbeddedFontListEntry`, in schema child order
|
|
27
|
+
* (`font` first, then these). Iterate in this order everywhere so the read- and
|
|
28
|
+
* write-side emitters agree on element order.
|
|
29
|
+
*/
|
|
30
|
+
const EMBEDDED_FONT_SLOTS = [
|
|
31
|
+
"regular",
|
|
32
|
+
"bold",
|
|
33
|
+
"italic",
|
|
34
|
+
"boldItalic"
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Flatten `fonts` into one ordered face list, assigning sequential part indices
|
|
38
|
+
* (1-based) and relationship ids (starting at `firstRId`). Faces are emitted in
|
|
39
|
+
* `fonts` order, each font's faces in {@link EMBEDDED_FONT_SLOTS} order. Faces
|
|
40
|
+
* without `bytes` are skipped (nothing to write).
|
|
41
|
+
*/
|
|
42
|
+
function flattenEmbeddedFaces(fonts, firstRId) {
|
|
43
|
+
const flat = [];
|
|
44
|
+
let partIndex = 0;
|
|
45
|
+
let rId = firstRId;
|
|
46
|
+
fonts.forEach((font, fontIndex) => {
|
|
47
|
+
for (const slot of EMBEDDED_FONT_SLOTS) {
|
|
48
|
+
const face = font.faces.find((f) => f.slot === slot);
|
|
49
|
+
if (!face || !face.bytes) continue;
|
|
50
|
+
flat.push({
|
|
51
|
+
fontIndex,
|
|
52
|
+
slot,
|
|
53
|
+
bytes: face.bytes,
|
|
54
|
+
partIndex: ++partIndex,
|
|
55
|
+
rId: rId++
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return flat;
|
|
60
|
+
}
|
|
61
|
+
/** Minimal XML attribute escaper (kept local so this module stays dependency-free). */
|
|
62
|
+
function escapeAttr(value) {
|
|
63
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Serialize a `<p:embeddedFontLst>` from `fonts` and a `(fontIndex, slot) → rId`
|
|
67
|
+
* lookup (typically backed by {@link flattenEmbeddedFaces}). Returns `''` when no
|
|
68
|
+
* font has any face with an allocated rId, so callers can emit nothing. Assumes
|
|
69
|
+
* the enclosing document declares the `p:` and `r:` prefixes (presentation.xml
|
|
70
|
+
* does), so no namespace declarations are emitted here.
|
|
71
|
+
*/
|
|
72
|
+
function serializeEmbeddedFontLst(fonts, rIdForFace) {
|
|
73
|
+
const entries = [];
|
|
74
|
+
fonts.forEach((font, fontIndex) => {
|
|
75
|
+
const faceXml = [];
|
|
76
|
+
for (const slot of EMBEDDED_FONT_SLOTS) {
|
|
77
|
+
const rId = rIdForFace(fontIndex, slot);
|
|
78
|
+
if (rId === void 0) continue;
|
|
79
|
+
faceXml.push(`<p:${slot} r:id="rId${rId}"/>`);
|
|
80
|
+
}
|
|
81
|
+
if (faceXml.length === 0) return;
|
|
82
|
+
let fontAttrs = `typeface="${escapeAttr(font.typeface)}"`;
|
|
83
|
+
if (font.panose !== void 0) fontAttrs += ` panose="${escapeAttr(font.panose)}"`;
|
|
84
|
+
if (font.pitchFamily !== void 0) fontAttrs += ` pitchFamily="${font.pitchFamily}"`;
|
|
85
|
+
if (font.charset !== void 0) fontAttrs += ` charset="${font.charset}"`;
|
|
86
|
+
entries.push(`<p:embeddedFont><p:font ${fontAttrs}/>${faceXml.join("")}</p:embeddedFont>`);
|
|
87
|
+
});
|
|
88
|
+
if (entries.length === 0) return "";
|
|
89
|
+
return `<p:embeddedFontLst>${entries.join("")}</p:embeddedFontLst>`;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { flattenEmbeddedFaces as a, FONT_REL_TYPE as i, FONT_DATA_CONTENT_TYPE as n, serializeEmbeddedFontLst as o, FONT_DATA_EXTENSION as r, EMBEDDED_FONT_SLOTS as t };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=embedded-fonts-MaynAHa9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedded-fonts-MaynAHa9.js","names":[],"sources":["../src/embedded-fonts.ts"],"sourcesContent":["/**\n * Shared model + serializer for PresentationML embedded fonts, used by both the\n * write side (author-side `pptx.embedFont`, `gen/pres/presentation.ts`) and the read side\n * (`importSlide({ embedFonts: true })`, `src/read/api/ops/embedded-fonts.ts`).\n *\n * Embedded fonts are three coordinated pieces (ECMA-376 transitional):\n * 1. binary font parts `/ppt/fonts/fontN.fntdata` — the **raw** TTF/OTF bytes\n * (PresentationML does not obfuscate embedded fonts), content type\n * `application/x-fontdata` via a single `fntdata` Default extension;\n * 2. one `font` relationship per face from `presentation.xml`;\n * 3. a `p:embeddedFontLst` in `presentation.xml`, at index 7 of the\n * `CT_Presentation` child sequence (after `smartTags`, before `custShowLst`\n * … `defaultTextStyle`).\n *\n * This module owns only the OOXML-shape knowledge; rId allocation and part\n * placement stay with each caller (their packaging models differ).\n */\n\n/** Extension for the binary font parts (`/ppt/fonts/fontN.fntdata`). */\nexport const FONT_DATA_EXTENSION = 'fntdata'\n/** Content type for a `.fntdata` part — one `Default` covers every font part. */\nexport const FONT_DATA_CONTENT_TYPE = 'application/x-fontdata'\n/** Relationship type from `presentation.xml` to a font part (one per face). */\nexport const FONT_REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/font'\n\n/**\n * The four face slots of `CT_EmbeddedFontListEntry`, in schema child order\n * (`font` first, then these). Iterate in this order everywhere so the read- and\n * write-side emitters agree on element order.\n */\nexport const EMBEDDED_FONT_SLOTS = ['regular', 'bold', 'italic', 'boldItalic'] as const\nexport type EmbeddedFontSlot = (typeof EMBEDDED_FONT_SLOTS)[number]\n\n/** One embeddable face: a slot plus the raw font bytes (absent in pure read-side merges). */\nexport interface EmbeddedFontFace {\n\tslot: EmbeddedFontSlot\n\tbytes?: Uint8Array\n}\n\n/** A typeface family with 1..4 embedded faces — one `p:embeddedFont` entry. */\nexport interface EmbeddedFont {\n\t/** `p:font/@typeface` — MUST match the family name used in run/`fontFace` typefaces or PowerPoint won't bind it. */\n\ttypeface: string\n\tpanose?: string\n\tpitchFamily?: number\n\tcharset?: number\n\tfaces: EmbeddedFontFace[]\n}\n\n/**\n * One face flattened to its package coordinates. `partIndex` is 1-based and maps\n * to `/ppt/fonts/font${partIndex}.fntdata`; `rId` is the numeric relationship id\n * (use `rId${rId}`). Produced once and shared by the part writer, the rels\n * writer, and the `embeddedFontLst` emitter so all three agree.\n */\nexport interface FlatEmbeddedFace {\n\tfontIndex: number\n\tslot: EmbeddedFontSlot\n\tbytes: Uint8Array\n\tpartIndex: number\n\trId: number\n}\n\n/**\n * Flatten `fonts` into one ordered face list, assigning sequential part indices\n * (1-based) and relationship ids (starting at `firstRId`). Faces are emitted in\n * `fonts` order, each font's faces in {@link EMBEDDED_FONT_SLOTS} order. Faces\n * without `bytes` are skipped (nothing to write).\n */\nexport function flattenEmbeddedFaces(fonts: EmbeddedFont[], firstRId: number): FlatEmbeddedFace[] {\n\tconst flat: FlatEmbeddedFace[] = []\n\tlet partIndex = 0\n\tlet rId = firstRId\n\tfonts.forEach((font, fontIndex) => {\n\t\tfor (const slot of EMBEDDED_FONT_SLOTS) {\n\t\t\tconst face = font.faces.find((f) => f.slot === slot)\n\t\t\tif (!face || !face.bytes) continue\n\t\t\tflat.push({ fontIndex, slot, bytes: face.bytes, partIndex: ++partIndex, rId: rId++ })\n\t\t}\n\t})\n\treturn flat\n}\n\n/** Minimal XML attribute escaper (kept local so this module stays dependency-free). */\nfunction escapeAttr(value: string): string {\n\treturn value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"')\n}\n\n/**\n * Serialize a `<p:embeddedFontLst>` from `fonts` and a `(fontIndex, slot) → rId`\n * lookup (typically backed by {@link flattenEmbeddedFaces}). Returns `''` when no\n * font has any face with an allocated rId, so callers can emit nothing. Assumes\n * the enclosing document declares the `p:` and `r:` prefixes (presentation.xml\n * does), so no namespace declarations are emitted here.\n */\nexport function serializeEmbeddedFontLst(\n\tfonts: EmbeddedFont[],\n\trIdForFace: (fontIndex: number, slot: EmbeddedFontSlot) => number | undefined\n): string {\n\tconst entries: string[] = []\n\tfonts.forEach((font, fontIndex) => {\n\t\tconst faceXml: string[] = []\n\t\tfor (const slot of EMBEDDED_FONT_SLOTS) {\n\t\t\tconst rId = rIdForFace(fontIndex, slot)\n\t\t\tif (rId === undefined) continue\n\t\t\tfaceXml.push(`<p:${slot} r:id=\"rId${rId}\"/>`)\n\t\t}\n\t\tif (faceXml.length === 0) return\n\t\tlet fontAttrs = `typeface=\"${escapeAttr(font.typeface)}\"`\n\t\tif (font.panose !== undefined) fontAttrs += ` panose=\"${escapeAttr(font.panose)}\"`\n\t\tif (font.pitchFamily !== undefined) fontAttrs += ` pitchFamily=\"${font.pitchFamily}\"`\n\t\tif (font.charset !== undefined) fontAttrs += ` charset=\"${font.charset}\"`\n\t\tentries.push(`<p:embeddedFont><p:font ${fontAttrs}/>${faceXml.join('')}</p:embeddedFont>`)\n\t})\n\tif (entries.length === 0) return ''\n\treturn `<p:embeddedFontLst>${entries.join('')}</p:embeddedFontLst>`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAa,sBAAsB;;AAEnC,MA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BAA2B,UAAU,IAAI,QAAQ,KAAK,EAAE,EAAE,kBAAkB;CAC1F,CAAC;CACD,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,OAAO,sBAAsB,QAAQ,KAAK,EAAE,EAAE;AAC/C"}
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
//#region src/enums.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* ts-pptx Enums
|
|
4
|
+
* NOTE: `enum` wont work for objects, so use `Object.freeze`
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Output-type name accepted by the zip/write layer. Derived from the `OutputType`
|
|
8
|
+
* enum (see below) so the two never drift: adding a member to the enum extends this
|
|
9
|
+
* union automatically.
|
|
10
|
+
*/
|
|
11
|
+
type ZIP_OUTPUT_TYPE = `${OutputType}`;
|
|
12
|
+
type WRITE_OUTPUT_TYPE = ZIP_OUTPUT_TYPE | 'STREAM';
|
|
13
|
+
/**
|
|
14
|
+
* Public chart-type name accepted by `addChart()`. Derived from the internal
|
|
15
|
+
* `ChartType` enum (see below) so the two never drift: adding a member to the
|
|
16
|
+
* enum extends this union automatically.
|
|
17
|
+
*/
|
|
18
|
+
type CHART_NAME = `${ChartType}`;
|
|
19
|
+
/**
|
|
20
|
+
* Public scheme-color name. Derived from the `SchemeColor` enum (see below) so the
|
|
21
|
+
* two never drift.
|
|
22
|
+
*/
|
|
23
|
+
type SCHEME_COLORS = `${SchemeColor}`;
|
|
24
|
+
declare enum TextAnchor {
|
|
25
|
+
b = "b",
|
|
26
|
+
ctr = "ctr",
|
|
27
|
+
t = "t"
|
|
28
|
+
}
|
|
29
|
+
declare enum OutputType {
|
|
30
|
+
arraybuffer = "arraybuffer",
|
|
31
|
+
base64 = "base64",
|
|
32
|
+
binarystring = "binarystring",
|
|
33
|
+
blob = "blob",
|
|
34
|
+
nodebuffer = "nodebuffer",
|
|
35
|
+
uint8array = "uint8array"
|
|
36
|
+
}
|
|
37
|
+
declare enum ChartType {
|
|
38
|
+
area = "area",
|
|
39
|
+
bar = "bar",
|
|
40
|
+
bar3d = "bar3D",
|
|
41
|
+
bubble = "bubble",
|
|
42
|
+
bubble3d = "bubble3D",
|
|
43
|
+
doughnut = "doughnut",
|
|
44
|
+
line = "line",
|
|
45
|
+
pie = "pie",
|
|
46
|
+
radar = "radar",
|
|
47
|
+
scatter = "scatter",
|
|
48
|
+
stock = "stock",
|
|
49
|
+
surface = "surface",
|
|
50
|
+
waterfall = "waterfall",
|
|
51
|
+
funnel = "funnel",
|
|
52
|
+
treemap = "treemap",
|
|
53
|
+
sunburst = "sunburst",
|
|
54
|
+
histogram = "histogram",
|
|
55
|
+
pareto = "pareto",
|
|
56
|
+
boxWhisker = "boxWhisker",
|
|
57
|
+
regionMap = "regionMap"
|
|
58
|
+
}
|
|
59
|
+
declare enum ShapeType {
|
|
60
|
+
accentBorderCallout1 = "accentBorderCallout1",
|
|
61
|
+
accentBorderCallout2 = "accentBorderCallout2",
|
|
62
|
+
accentBorderCallout3 = "accentBorderCallout3",
|
|
63
|
+
accentCallout1 = "accentCallout1",
|
|
64
|
+
accentCallout2 = "accentCallout2",
|
|
65
|
+
accentCallout3 = "accentCallout3",
|
|
66
|
+
actionButtonBackPrevious = "actionButtonBackPrevious",
|
|
67
|
+
actionButtonBeginning = "actionButtonBeginning",
|
|
68
|
+
actionButtonBlank = "actionButtonBlank",
|
|
69
|
+
actionButtonDocument = "actionButtonDocument",
|
|
70
|
+
actionButtonEnd = "actionButtonEnd",
|
|
71
|
+
actionButtonForwardNext = "actionButtonForwardNext",
|
|
72
|
+
actionButtonHelp = "actionButtonHelp",
|
|
73
|
+
actionButtonHome = "actionButtonHome",
|
|
74
|
+
actionButtonInformation = "actionButtonInformation",
|
|
75
|
+
actionButtonMovie = "actionButtonMovie",
|
|
76
|
+
actionButtonReturn = "actionButtonReturn",
|
|
77
|
+
actionButtonSound = "actionButtonSound",
|
|
78
|
+
arc = "arc",
|
|
79
|
+
bentArrow = "bentArrow",
|
|
80
|
+
bentUpArrow = "bentUpArrow",
|
|
81
|
+
bevel = "bevel",
|
|
82
|
+
blockArc = "blockArc",
|
|
83
|
+
borderCallout1 = "borderCallout1",
|
|
84
|
+
borderCallout2 = "borderCallout2",
|
|
85
|
+
borderCallout3 = "borderCallout3",
|
|
86
|
+
bracePair = "bracePair",
|
|
87
|
+
bracketPair = "bracketPair",
|
|
88
|
+
callout1 = "callout1",
|
|
89
|
+
callout2 = "callout2",
|
|
90
|
+
callout3 = "callout3",
|
|
91
|
+
can = "can",
|
|
92
|
+
chartPlus = "chartPlus",
|
|
93
|
+
chartStar = "chartStar",
|
|
94
|
+
chartX = "chartX",
|
|
95
|
+
chevron = "chevron",
|
|
96
|
+
chord = "chord",
|
|
97
|
+
circularArrow = "circularArrow",
|
|
98
|
+
cloud = "cloud",
|
|
99
|
+
cloudCallout = "cloudCallout",
|
|
100
|
+
corner = "corner",
|
|
101
|
+
cornerTabs = "cornerTabs",
|
|
102
|
+
cube = "cube",
|
|
103
|
+
curvedDownArrow = "curvedDownArrow",
|
|
104
|
+
curvedLeftArrow = "curvedLeftArrow",
|
|
105
|
+
curvedRightArrow = "curvedRightArrow",
|
|
106
|
+
curvedUpArrow = "curvedUpArrow",
|
|
107
|
+
custGeom = "custGeom",
|
|
108
|
+
decagon = "decagon",
|
|
109
|
+
diagStripe = "diagStripe",
|
|
110
|
+
diamond = "diamond",
|
|
111
|
+
dodecagon = "dodecagon",
|
|
112
|
+
donut = "donut",
|
|
113
|
+
doubleWave = "doubleWave",
|
|
114
|
+
downArrow = "downArrow",
|
|
115
|
+
downArrowCallout = "downArrowCallout",
|
|
116
|
+
ellipse = "ellipse",
|
|
117
|
+
ellipseRibbon = "ellipseRibbon",
|
|
118
|
+
ellipseRibbon2 = "ellipseRibbon2",
|
|
119
|
+
flowChartAlternateProcess = "flowChartAlternateProcess",
|
|
120
|
+
flowChartCollate = "flowChartCollate",
|
|
121
|
+
flowChartConnector = "flowChartConnector",
|
|
122
|
+
flowChartDecision = "flowChartDecision",
|
|
123
|
+
flowChartDelay = "flowChartDelay",
|
|
124
|
+
flowChartDisplay = "flowChartDisplay",
|
|
125
|
+
flowChartDocument = "flowChartDocument",
|
|
126
|
+
flowChartExtract = "flowChartExtract",
|
|
127
|
+
flowChartInputOutput = "flowChartInputOutput",
|
|
128
|
+
flowChartInternalStorage = "flowChartInternalStorage",
|
|
129
|
+
flowChartMagneticDisk = "flowChartMagneticDisk",
|
|
130
|
+
flowChartMagneticDrum = "flowChartMagneticDrum",
|
|
131
|
+
flowChartMagneticTape = "flowChartMagneticTape",
|
|
132
|
+
flowChartManualInput = "flowChartManualInput",
|
|
133
|
+
flowChartManualOperation = "flowChartManualOperation",
|
|
134
|
+
flowChartMerge = "flowChartMerge",
|
|
135
|
+
flowChartMultidocument = "flowChartMultidocument",
|
|
136
|
+
flowChartOfflineStorage = "flowChartOfflineStorage",
|
|
137
|
+
flowChartOffpageConnector = "flowChartOffpageConnector",
|
|
138
|
+
flowChartOnlineStorage = "flowChartOnlineStorage",
|
|
139
|
+
flowChartOr = "flowChartOr",
|
|
140
|
+
flowChartPredefinedProcess = "flowChartPredefinedProcess",
|
|
141
|
+
flowChartPreparation = "flowChartPreparation",
|
|
142
|
+
flowChartProcess = "flowChartProcess",
|
|
143
|
+
flowChartPunchedCard = "flowChartPunchedCard",
|
|
144
|
+
flowChartPunchedTape = "flowChartPunchedTape",
|
|
145
|
+
flowChartSort = "flowChartSort",
|
|
146
|
+
flowChartSummingJunction = "flowChartSummingJunction",
|
|
147
|
+
flowChartTerminator = "flowChartTerminator",
|
|
148
|
+
foldedCorner = "foldedCorner",
|
|
149
|
+
frame = "frame",
|
|
150
|
+
funnel = "funnel",
|
|
151
|
+
gear6 = "gear6",
|
|
152
|
+
gear9 = "gear9",
|
|
153
|
+
halfFrame = "halfFrame",
|
|
154
|
+
heart = "heart",
|
|
155
|
+
heptagon = "heptagon",
|
|
156
|
+
hexagon = "hexagon",
|
|
157
|
+
homePlate = "homePlate",
|
|
158
|
+
horizontalScroll = "horizontalScroll",
|
|
159
|
+
irregularSeal1 = "irregularSeal1",
|
|
160
|
+
irregularSeal2 = "irregularSeal2",
|
|
161
|
+
leftArrow = "leftArrow",
|
|
162
|
+
leftArrowCallout = "leftArrowCallout",
|
|
163
|
+
leftBrace = "leftBrace",
|
|
164
|
+
leftBracket = "leftBracket",
|
|
165
|
+
leftCircularArrow = "leftCircularArrow",
|
|
166
|
+
leftRightArrow = "leftRightArrow",
|
|
167
|
+
leftRightArrowCallout = "leftRightArrowCallout",
|
|
168
|
+
leftRightCircularArrow = "leftRightCircularArrow",
|
|
169
|
+
leftRightRibbon = "leftRightRibbon",
|
|
170
|
+
leftRightUpArrow = "leftRightUpArrow",
|
|
171
|
+
leftUpArrow = "leftUpArrow",
|
|
172
|
+
lightningBolt = "lightningBolt",
|
|
173
|
+
line = "line",
|
|
174
|
+
lineInv = "lineInv",
|
|
175
|
+
mathDivide = "mathDivide",
|
|
176
|
+
mathEqual = "mathEqual",
|
|
177
|
+
mathMinus = "mathMinus",
|
|
178
|
+
mathMultiply = "mathMultiply",
|
|
179
|
+
mathNotEqual = "mathNotEqual",
|
|
180
|
+
mathPlus = "mathPlus",
|
|
181
|
+
moon = "moon",
|
|
182
|
+
noSmoking = "noSmoking",
|
|
183
|
+
nonIsoscelesTrapezoid = "nonIsoscelesTrapezoid",
|
|
184
|
+
notchedRightArrow = "notchedRightArrow",
|
|
185
|
+
octagon = "octagon",
|
|
186
|
+
parallelogram = "parallelogram",
|
|
187
|
+
pentagon = "pentagon",
|
|
188
|
+
pie = "pie",
|
|
189
|
+
pieWedge = "pieWedge",
|
|
190
|
+
plaque = "plaque",
|
|
191
|
+
plaqueTabs = "plaqueTabs",
|
|
192
|
+
plus = "plus",
|
|
193
|
+
quadArrow = "quadArrow",
|
|
194
|
+
quadArrowCallout = "quadArrowCallout",
|
|
195
|
+
rect = "rect",
|
|
196
|
+
ribbon = "ribbon",
|
|
197
|
+
ribbon2 = "ribbon2",
|
|
198
|
+
rightArrow = "rightArrow",
|
|
199
|
+
rightArrowCallout = "rightArrowCallout",
|
|
200
|
+
rightBrace = "rightBrace",
|
|
201
|
+
rightBracket = "rightBracket",
|
|
202
|
+
round1Rect = "round1Rect",
|
|
203
|
+
round2DiagRect = "round2DiagRect",
|
|
204
|
+
round2SameRect = "round2SameRect",
|
|
205
|
+
roundRect = "roundRect",
|
|
206
|
+
rtTriangle = "rtTriangle",
|
|
207
|
+
smileyFace = "smileyFace",
|
|
208
|
+
snip1Rect = "snip1Rect",
|
|
209
|
+
snip2DiagRect = "snip2DiagRect",
|
|
210
|
+
snip2SameRect = "snip2SameRect",
|
|
211
|
+
snipRoundRect = "snipRoundRect",
|
|
212
|
+
squareTabs = "squareTabs",
|
|
213
|
+
star10 = "star10",
|
|
214
|
+
star12 = "star12",
|
|
215
|
+
star16 = "star16",
|
|
216
|
+
star24 = "star24",
|
|
217
|
+
star32 = "star32",
|
|
218
|
+
star4 = "star4",
|
|
219
|
+
star5 = "star5",
|
|
220
|
+
star6 = "star6",
|
|
221
|
+
star7 = "star7",
|
|
222
|
+
star8 = "star8",
|
|
223
|
+
stripedRightArrow = "stripedRightArrow",
|
|
224
|
+
sun = "sun",
|
|
225
|
+
swooshArrow = "swooshArrow",
|
|
226
|
+
teardrop = "teardrop",
|
|
227
|
+
trapezoid = "trapezoid",
|
|
228
|
+
triangle = "triangle",
|
|
229
|
+
upArrow = "upArrow",
|
|
230
|
+
upArrowCallout = "upArrowCallout",
|
|
231
|
+
upDownArrow = "upDownArrow",
|
|
232
|
+
upDownArrowCallout = "upDownArrowCallout",
|
|
233
|
+
uturnArrow = "uturnArrow",
|
|
234
|
+
verticalScroll = "verticalScroll",
|
|
235
|
+
wave = "wave",
|
|
236
|
+
wedgeEllipseCallout = "wedgeEllipseCallout",
|
|
237
|
+
wedgeRectCallout = "wedgeRectCallout",
|
|
238
|
+
wedgeRoundRectCallout = "wedgeRoundRectCallout"
|
|
239
|
+
}
|
|
240
|
+
declare enum SchemeColor {
|
|
241
|
+
text1 = "tx1",
|
|
242
|
+
text2 = "tx2",
|
|
243
|
+
background1 = "bg1",
|
|
244
|
+
background2 = "bg2",
|
|
245
|
+
accent1 = "accent1",
|
|
246
|
+
accent2 = "accent2",
|
|
247
|
+
accent3 = "accent3",
|
|
248
|
+
accent4 = "accent4",
|
|
249
|
+
accent5 = "accent5",
|
|
250
|
+
accent6 = "accent6"
|
|
251
|
+
}
|
|
252
|
+
declare enum AlignH {
|
|
253
|
+
left = "left",
|
|
254
|
+
center = "center",
|
|
255
|
+
right = "right",
|
|
256
|
+
justify = "justify"
|
|
257
|
+
}
|
|
258
|
+
declare enum AlignV {
|
|
259
|
+
top = "top",
|
|
260
|
+
middle = "middle",
|
|
261
|
+
bottom = "bottom"
|
|
262
|
+
}
|
|
263
|
+
type SHAPE_NAME = 'accentBorderCallout1' | 'accentBorderCallout2' | 'accentBorderCallout3' | 'accentCallout1' | 'accentCallout2' | 'accentCallout3' | 'actionButtonBackPrevious' | 'actionButtonBeginning' | 'actionButtonBlank' | 'actionButtonDocument' | 'actionButtonEnd' | 'actionButtonForwardNext' | 'actionButtonHelp' | 'actionButtonHome' | 'actionButtonInformation' | 'actionButtonMovie' | 'actionButtonReturn' | 'actionButtonSound' | 'arc' | 'bentArrow' | 'bentUpArrow' | 'bevel' | 'blockArc' | 'borderCallout1' | 'borderCallout2' | 'borderCallout3' | 'bracePair' | 'bracketPair' | 'callout1' | 'callout2' | 'callout3' | 'can' | 'chartPlus' | 'chartStar' | 'chartX' | 'chevron' | 'chord' | 'circularArrow' | 'cloud' | 'cloudCallout' | 'corner' | 'cornerTabs' | 'cube' | 'curvedDownArrow' | 'curvedLeftArrow' | 'curvedRightArrow' | 'curvedUpArrow' | 'custGeom' | 'decagon' | 'diagStripe' | 'diamond' | 'dodecagon' | 'donut' | 'doubleWave' | 'downArrow' | 'downArrowCallout' | 'ellipse' | 'ellipseRibbon' | 'ellipseRibbon2' | 'flowChartAlternateProcess' | 'flowChartCollate' | 'flowChartConnector' | 'flowChartDecision' | 'flowChartDelay' | 'flowChartDisplay' | 'flowChartDocument' | 'flowChartExtract' | 'flowChartInputOutput' | 'flowChartInternalStorage' | 'flowChartMagneticDisk' | 'flowChartMagneticDrum' | 'flowChartMagneticTape' | 'flowChartManualInput' | 'flowChartManualOperation' | 'flowChartMerge' | 'flowChartMultidocument' | 'flowChartOfflineStorage' | 'flowChartOffpageConnector' | 'flowChartOnlineStorage' | 'flowChartOr' | 'flowChartPredefinedProcess' | 'flowChartPreparation' | 'flowChartProcess' | 'flowChartPunchedCard' | 'flowChartPunchedTape' | 'flowChartSort' | 'flowChartSummingJunction' | 'flowChartTerminator' | 'foldedCorner' | 'frame' | 'funnel' | 'gear6' | 'gear9' | 'halfFrame' | 'heart' | 'heptagon' | 'hexagon' | 'homePlate' | 'horizontalScroll' | 'irregularSeal1' | 'irregularSeal2' | 'leftArrow' | 'leftArrowCallout' | 'leftBrace' | 'leftBracket' | 'leftCircularArrow' | 'leftRightArrow' | 'leftRightArrowCallout' | 'leftRightCircularArrow' | 'leftRightRibbon' | 'leftRightUpArrow' | 'leftUpArrow' | 'lightningBolt' | 'line' | 'lineInv' | 'mathDivide' | 'mathEqual' | 'mathMinus' | 'mathMultiply' | 'mathNotEqual' | 'mathPlus' | 'moon' | 'noSmoking' | 'nonIsoscelesTrapezoid' | 'notchedRightArrow' | 'octagon' | 'parallelogram' | 'pentagon' | 'pie' | 'pieWedge' | 'plaque' | 'plaqueTabs' | 'plus' | 'quadArrow' | 'quadArrowCallout' | 'rect' | 'ribbon' | 'ribbon2' | 'rightArrow' | 'rightArrowCallout' | 'rightBrace' | 'rightBracket' | 'round1Rect' | 'round2DiagRect' | 'round2SameRect' | 'roundRect' | 'rtTriangle' | 'smileyFace' | 'snip1Rect' | 'snip2DiagRect' | 'snip2SameRect' | 'snipRoundRect' | 'squareTabs' | 'star10' | 'star12' | 'star16' | 'star24' | 'star32' | 'star4' | 'star5' | 'star6' | 'star7' | 'star8' | 'stripedRightArrow' | 'sun' | 'swooshArrow' | 'teardrop' | 'trapezoid' | 'triangle' | 'upArrow' | 'upArrowCallout' | 'upDownArrow' | 'upDownArrowCallout' | 'uturnArrow' | 'verticalScroll' | 'wave' | 'wedgeEllipseCallout' | 'wedgeRectCallout' | 'wedgeRoundRectCallout' | CONNECTOR_PRESET_NAME;
|
|
264
|
+
/**
|
|
265
|
+
* Valid ECMA-376 `ST_ShapeType` presets that are not surfaced with a friendly
|
|
266
|
+
* `ShapeType` name. They are still legal geometries PowerPoint renders, so the
|
|
267
|
+
* preset-validation set must accept them.
|
|
268
|
+
*/
|
|
269
|
+
declare const EXTRA_SHAPE_PRESETS: readonly ["straightConnector1", "bentConnector2", "bentConnector3", "bentConnector4", "bentConnector5", "curvedConnector2", "curvedConnector3", "curvedConnector4", "curvedConnector5"];
|
|
270
|
+
/**
|
|
271
|
+
* Connector preset geometries (`straightConnector1` / `bentConnector{2-5}` /
|
|
272
|
+
* `curvedConnector{2-5}`) that `addShape` can serialize but that are not surfaced
|
|
273
|
+
* as friendly `ShapeType` names. Derived from `EXTRA_SHAPE_PRESETS` so the public
|
|
274
|
+
* `SHAPE_NAME` union and the runtime `VALID_SHAPE_PRESETS` set share one source of
|
|
275
|
+
* truth and cannot drift. Use `addConnector` for live, endpoint-bound connectors;
|
|
276
|
+
* pass these to `addShape` for a static box-positioned connector geometry.
|
|
277
|
+
*/
|
|
278
|
+
type CONNECTOR_PRESET_NAME = (typeof EXTRA_SHAPE_PRESETS)[number];
|
|
279
|
+
/**
|
|
280
|
+
* Every shape geometry name ts-pptx can serialize without corrupting the
|
|
281
|
+
* package: the OOXML preset geometries (`ST_ShapeType` — `ShapeType` values
|
|
282
|
+
* plus the unexposed connectors above) and `custGeom` (freeform paths, emitted
|
|
283
|
+
* as `<a:custGeom>` rather than `<a:prstGeom>`). Used to reject bogus presets
|
|
284
|
+
* before they become an invalid `<a:prstGeom prst="...">` that triggers
|
|
285
|
+
* PowerPoint's "needs repair" dialog and drops the shape.
|
|
286
|
+
*/
|
|
287
|
+
declare const VALID_SHAPE_PRESETS: ReadonlySet<string>;
|
|
288
|
+
/**
|
|
289
|
+
* Narrow a public `CHART_NAME` to the internal `ChartType` enum. Because
|
|
290
|
+
* `CHART_NAME` is derived from `ChartType`, every `CHART_NAME` value is by
|
|
291
|
+
* construction a valid enum value, so this conversion is total and safe — it is
|
|
292
|
+
* the single boundary cast that lets internal code compare against the enum
|
|
293
|
+
* (enum-to-enum) instead of enum-to-string.
|
|
294
|
+
*/
|
|
295
|
+
declare function asChartType(name: CHART_NAME): ChartType;
|
|
296
|
+
/**
|
|
297
|
+
* Is `type` a chartEx (cx:) chart? Accepts a `ChartType`/`CHART_NAME` string; anything else —
|
|
298
|
+
* including a combo-chart `ChartMulti[]` array or `undefined` — is not a chartEx type (combos are
|
|
299
|
+
* classic-only), so those return `false`.
|
|
300
|
+
*/
|
|
301
|
+
declare function isChartExType(type: unknown): boolean;
|
|
302
|
+
declare enum SlideObjectType {
|
|
303
|
+
chart = "chart",
|
|
304
|
+
connector = "connector",
|
|
305
|
+
group = "group",
|
|
306
|
+
hyperlink = "hyperlink",
|
|
307
|
+
image = "image",
|
|
308
|
+
media = "media",
|
|
309
|
+
oleObject = "oleObject",
|
|
310
|
+
online = "online",
|
|
311
|
+
placeholder = "placeholder",
|
|
312
|
+
table = "table",
|
|
313
|
+
tablecell = "tablecell",
|
|
314
|
+
text = "text",
|
|
315
|
+
notes = "notes",
|
|
316
|
+
zoom = "zoom"
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Maps a friendly `ConnectorType` to its OOXML connector preset *family*. `straight`
|
|
320
|
+
* has a single fixed preset; `elbow` and `curved` select a member by bend count
|
|
321
|
+
* (`bentConnector{3,4,5}` / `curvedConnector{3,4,5}`) — see `connectorPresetFor`.
|
|
322
|
+
*/
|
|
323
|
+
declare const CONNECTOR_PRESETS: {
|
|
324
|
+
readonly straight: "straightConnector1";
|
|
325
|
+
readonly elbow: "bentConnector";
|
|
326
|
+
readonly curved: "curvedConnector";
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Resolve the concrete connector preset geometry name for a `type` + bend count.
|
|
330
|
+
* `straight` ignores `bends` (it has no adjustable jog). For `elbow` / `curved`, the
|
|
331
|
+
* preset suffix is `bends + 2`, so `bends` of 1/2/3 maps to `…Connector3/4/5`, each
|
|
332
|
+
* of which exposes exactly `bends` adjustable guides (`adj1…adjN`).
|
|
333
|
+
* @param {'straight' | 'elbow' | 'curved'} type - friendly connector routing style
|
|
334
|
+
* @param {number} bends - number of adjustable bends (1–3); ignored for `straight`
|
|
335
|
+
* @return {CONNECTOR_PRESET_NAME} OOXML preset geometry name (e.g. `bentConnector4`)
|
|
336
|
+
*/
|
|
337
|
+
declare function connectorPresetFor(type: 'straight' | 'elbow' | 'curved', bends: number): CONNECTOR_PRESET_NAME;
|
|
338
|
+
declare enum PlaceholderType {
|
|
339
|
+
title = "title",
|
|
340
|
+
body = "body",
|
|
341
|
+
image = "pic",
|
|
342
|
+
chart = "chart",
|
|
343
|
+
table = "tbl",
|
|
344
|
+
media = "media"
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Placeholder-type name. Derived from the `PlaceholderType` enum (above) so the two
|
|
348
|
+
* never drift.
|
|
349
|
+
*/
|
|
350
|
+
type PLACEHOLDER_TYPE = `${PlaceholderType}`;
|
|
351
|
+
/**
|
|
352
|
+
* Bullet glyph presets. Only `DEFAULT` is currently wired through to output; the remaining entries are
|
|
353
|
+
* reserved and not yet selectable via options.
|
|
354
|
+
*/
|
|
355
|
+
declare enum BulletType {
|
|
356
|
+
DEFAULT = "•",
|
|
357
|
+
CHECK = "✓",
|
|
358
|
+
STAR = "★",
|
|
359
|
+
TRIANGLE = "▶"
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Built-in PowerPoint table style IDs.
|
|
363
|
+
*
|
|
364
|
+
* Each value is the GUID that goes into `<a:tableStyleId>` inside `<a:tblPr>`.
|
|
365
|
+
* These 74 GUIDs are the complete set defined in [MS-OE376] §5.1.6.10 and are
|
|
366
|
+
* resolved by PowerPoint without embedding any style definition in the file.
|
|
367
|
+
*
|
|
368
|
+
* Only these enum members are supported. Raw GUID strings are not accepted;
|
|
369
|
+
* use `TableStyle` members exclusively.
|
|
370
|
+
*/
|
|
371
|
+
declare enum TableStyle {
|
|
372
|
+
NO_STYLE_NO_GRID = "{2D5ABB26-0587-4C30-8999-92F81FD0307C}",
|
|
373
|
+
NO_STYLE_TABLE_GRID = "{5940675A-B579-460E-94D1-54222C63F5DA}",
|
|
374
|
+
THEMED_STYLE_1_ACCENT_1 = "{3C2FFA5D-87B4-456A-9821-1D502468CF0F}",
|
|
375
|
+
THEMED_STYLE_1_ACCENT_2 = "{284E427A-3D55-4303-BF80-6455036E1DE7}",
|
|
376
|
+
THEMED_STYLE_1_ACCENT_3 = "{69C7853C-536D-4A76-A0AE-DD22124D55A5}",
|
|
377
|
+
THEMED_STYLE_1_ACCENT_4 = "{775DCB02-9BB8-47FD-8907-85C794F793BA}",
|
|
378
|
+
THEMED_STYLE_1_ACCENT_5 = "{35758FB7-9AC5-4552-8A53-C91805E547FA}",
|
|
379
|
+
THEMED_STYLE_1_ACCENT_6 = "{08FB837D-C827-4EFA-A057-4D05807E0F7C}",
|
|
380
|
+
THEMED_STYLE_2_ACCENT_1 = "{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}",
|
|
381
|
+
THEMED_STYLE_2_ACCENT_2 = "{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}",
|
|
382
|
+
THEMED_STYLE_2_ACCENT_3 = "{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}",
|
|
383
|
+
THEMED_STYLE_2_ACCENT_4 = "{E269D01E-BC32-4049-B463-5C60D7B0CCD2}",
|
|
384
|
+
THEMED_STYLE_2_ACCENT_5 = "{327F97BB-C833-4FB7-BDE5-3F7075034690}",
|
|
385
|
+
THEMED_STYLE_2_ACCENT_6 = "{638B1855-1B75-4FBE-930C-398BA8C253C6}",
|
|
386
|
+
LIGHT_STYLE_1 = "{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}",
|
|
387
|
+
LIGHT_STYLE_1_ACCENT_1 = "{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}",
|
|
388
|
+
LIGHT_STYLE_1_ACCENT_2 = "{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}",
|
|
389
|
+
LIGHT_STYLE_1_ACCENT_3 = "{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}",
|
|
390
|
+
LIGHT_STYLE_1_ACCENT_4 = "{D27102A9-8310-4765-A935-A1911B00CA55}",
|
|
391
|
+
LIGHT_STYLE_1_ACCENT_5 = "{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}",
|
|
392
|
+
LIGHT_STYLE_1_ACCENT_6 = "{68D230F3-CF80-4859-8CE7-A43EE81993B5}",
|
|
393
|
+
LIGHT_STYLE_2 = "{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}",
|
|
394
|
+
LIGHT_STYLE_2_ACCENT_1 = "{69012ECD-51FC-41F1-AA8D-1B2483CD663E}",
|
|
395
|
+
LIGHT_STYLE_2_ACCENT_2 = "{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}",
|
|
396
|
+
LIGHT_STYLE_2_ACCENT_3 = "{F2DE63D5-997A-4646-A377-4702673A728D}",
|
|
397
|
+
LIGHT_STYLE_2_ACCENT_4 = "{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}",
|
|
398
|
+
LIGHT_STYLE_2_ACCENT_5 = "{5A111915-BE36-4E01-A7E5-04B1672EAD32}",
|
|
399
|
+
LIGHT_STYLE_2_ACCENT_6 = "{912C8C85-51F0-491E-9774-3900AFEF0FD7}",
|
|
400
|
+
LIGHT_STYLE_3 = "{616DA210-FB5B-4158-B5E0-FEB733F419BA}",
|
|
401
|
+
LIGHT_STYLE_3_ACCENT_1 = "{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}",
|
|
402
|
+
LIGHT_STYLE_3_ACCENT_2 = "{5DA37D80-6434-44D0-A028-1B22A696006F}",
|
|
403
|
+
LIGHT_STYLE_3_ACCENT_3 = "{8799B23B-EC83-4686-B30A-512413B5E67A}",
|
|
404
|
+
LIGHT_STYLE_3_ACCENT_4 = "{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}",
|
|
405
|
+
LIGHT_STYLE_3_ACCENT_5 = "{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}",
|
|
406
|
+
LIGHT_STYLE_3_ACCENT_6 = "{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}",
|
|
407
|
+
MEDIUM_STYLE_1 = "{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}",
|
|
408
|
+
MEDIUM_STYLE_1_ACCENT_1 = "{B301B821-A1FF-4177-AEE7-76D212191A09}",
|
|
409
|
+
MEDIUM_STYLE_1_ACCENT_2 = "{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}",
|
|
410
|
+
MEDIUM_STYLE_1_ACCENT_3 = "{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}",
|
|
411
|
+
MEDIUM_STYLE_1_ACCENT_4 = "{1E171933-4619-4E11-9A3F-F7608DF75F80}",
|
|
412
|
+
MEDIUM_STYLE_1_ACCENT_5 = "{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}",
|
|
413
|
+
MEDIUM_STYLE_1_ACCENT_6 = "{10A1B5D5-9B99-4C35-A422-299274C87663}",
|
|
414
|
+
MEDIUM_STYLE_2 = "{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}",
|
|
415
|
+
MEDIUM_STYLE_2_ACCENT_1 = "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
416
|
+
MEDIUM_STYLE_2_ACCENT_2 = "{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}",
|
|
417
|
+
MEDIUM_STYLE_2_ACCENT_3 = "{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}",
|
|
418
|
+
MEDIUM_STYLE_2_ACCENT_4 = "{00A15C55-8517-42AA-B614-E9B94910E393}",
|
|
419
|
+
MEDIUM_STYLE_2_ACCENT_5 = "{7DF18680-E054-41AD-8BC1-D1AEF772440D}",
|
|
420
|
+
MEDIUM_STYLE_2_ACCENT_6 = "{93296810-A885-4BE3-A3E7-6D5BEEA58F35}",
|
|
421
|
+
MEDIUM_STYLE_3 = "{8EC20E35-A176-4012-BC5E-935CFFF8708E}",
|
|
422
|
+
MEDIUM_STYLE_3_ACCENT_1 = "{6E25E649-3F16-4E02-A733-19D2CDBF48F0}",
|
|
423
|
+
MEDIUM_STYLE_3_ACCENT_2 = "{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}",
|
|
424
|
+
MEDIUM_STYLE_3_ACCENT_3 = "{EB344D84-9AFB-497E-A393-DC336BA19D2E}",
|
|
425
|
+
MEDIUM_STYLE_3_ACCENT_4 = "{EB9631B5-78F2-41C9-869B-9F39066F8104}",
|
|
426
|
+
MEDIUM_STYLE_3_ACCENT_5 = "{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}",
|
|
427
|
+
MEDIUM_STYLE_3_ACCENT_6 = "{2A488322-F2BA-4B5B-9748-0D474271808F}",
|
|
428
|
+
MEDIUM_STYLE_4 = "{D7AC3CCA-C797-4891-BE02-D94E43425B78}",
|
|
429
|
+
MEDIUM_STYLE_4_ACCENT_1 = "{69CF1AB2-1976-4502-BF36-3FF5EA218861}",
|
|
430
|
+
MEDIUM_STYLE_4_ACCENT_2 = "{8A107856-5554-42FB-B03E-39F5DBC370BA}",
|
|
431
|
+
MEDIUM_STYLE_4_ACCENT_3 = "{0505E3EF-67EA-436B-97B2-0124C06EBD24}",
|
|
432
|
+
MEDIUM_STYLE_4_ACCENT_4 = "{C4B1156A-380E-4F78-BDF5-A606A8083BF9}",
|
|
433
|
+
MEDIUM_STYLE_4_ACCENT_5 = "{22838BEF-8BB2-4498-84A7-C5851F593DF1}",
|
|
434
|
+
MEDIUM_STYLE_4_ACCENT_6 = "{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}",
|
|
435
|
+
DARK_STYLE_1 = "{E8034E78-7F5D-4C2E-B375-FC64B27BC917}",
|
|
436
|
+
DARK_STYLE_1_ACCENT_1 = "{125E5076-3810-47DD-B79F-674D7AD40C01}",
|
|
437
|
+
DARK_STYLE_1_ACCENT_2 = "{37CE84F3-28C3-443E-9E96-99CF82512B78}",
|
|
438
|
+
DARK_STYLE_1_ACCENT_3 = "{D03447BB-5D67-496B-8E87-E561075AD55C}",
|
|
439
|
+
DARK_STYLE_1_ACCENT_4 = "{E929F9F4-4A8F-4326-A1B4-22849713DDAB}",
|
|
440
|
+
DARK_STYLE_1_ACCENT_5 = "{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}",
|
|
441
|
+
DARK_STYLE_1_ACCENT_6 = "{AF606853-7671-496A-8E4F-DF71F8EC918B}",
|
|
442
|
+
DARK_STYLE_2 = "{5202B0CA-FC54-4496-8BCA-5EF66A818D29}",
|
|
443
|
+
/** Header uses Accent 2, body rows use Accent 1 */
|
|
444
|
+
DARK_STYLE_2_ACCENT_1_ACCENT_2 = "{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}",
|
|
445
|
+
/** Header uses Accent 4, body rows use Accent 3 */
|
|
446
|
+
DARK_STYLE_2_ACCENT_3_ACCENT_4 = "{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}",
|
|
447
|
+
/** Header uses Accent 6, body rows use Accent 5 */
|
|
448
|
+
DARK_STYLE_2_ACCENT_5_ACCENT_6 = "{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}"
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
export { isChartExType as C, connectorPresetFor as S, TextAnchor as _, CONNECTOR_PRESETS as a, ZIP_OUTPUT_TYPE as b, OutputType as c, SCHEME_COLORS as d, SHAPE_NAME as f, TableStyle as g, SlideObjectType as h, CHART_NAME as i, PLACEHOLDER_TYPE as l, ShapeType as m, AlignV as n, CONNECTOR_PRESET_NAME as o, SchemeColor as p, BulletType as r, ChartType as s, AlignH as t, PlaceholderType as u, VALID_SHAPE_PRESETS as v, asChartType as x, WRITE_OUTPUT_TYPE as y };
|
|
452
|
+
//# sourceMappingURL=enums-D3aF4QGb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums-D3aF4QGb.d.ts","names":[],"sources":["../src/enums.ts"],"mappings":";;;;;;;;;;KAUY,qBAAqB;KACrB,oBAAoB;;;;;;KAMpB,gBAAgB;;;;;KAKhB,mBAAmB;aAEnB;EACX;EACA;EACA;;aAIW;EACX;EACA;EACA;EACA;EACA;EACA;;aAEW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;aAEW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;aAEW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;aAEW;EACX;EACA;EACA;EACA;;aAEW;EACX;EACA;EACA;;KAGW,8iGAoLT;;;;;;cAOG;;;;;;;;;KAoBM,gCAAgC;;;;;;;;;cAU/B,qBAAqB;;;;;;;;iBAYlB,YAAY,MAAM,aAAa;;;;;;iBA4B/B,cAAc;aAIlB;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;cAQY;;;;;;;;;;;;;;iBAeG,mBAAmB,uCAAuC,gBAAgB;aAI9E;EACX;EACA;EACA;EACA;EACA;EACA;;;;;;KAMW,sBAAsB;;;;;aAMtB;EACX;EACA;EACA;EACA;;;;;;;;;;;;aAaW;EAEX;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;;EAEA;;EAEA;;EAEA"}
|