pptx-ts 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 +319 -0
- package/dist/autopage-DkjYZUFD.js +423 -0
- package/dist/autopage-DkjYZUFD.js.map +1 -0
- package/dist/browser.d.ts +31 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +110 -0
- package/dist/browser.js.map +1 -0
- package/dist/diagnostics-Du_s75MT.d.ts +829 -0
- package/dist/diagnostics-Du_s75MT.d.ts.map +1 -0
- package/dist/enums-CvRYniUA.d.ts +463 -0
- package/dist/enums-CvRYniUA.d.ts.map +1 -0
- package/dist/errors-Bvln0H-7.js +112 -0
- package/dist/errors-Bvln0H-7.js.map +1 -0
- package/dist/errors-PflMPWBn.d.ts +182 -0
- package/dist/errors-PflMPWBn.d.ts.map +1 -0
- package/dist/fit-BKs0zxMI.js +1356 -0
- package/dist/fit-BKs0zxMI.js.map +1 -0
- package/dist/html-dom-B0I0QSbU.js +679 -0
- package/dist/html-dom-B0I0QSbU.js.map +1 -0
- package/dist/html.d.ts +26 -0
- package/dist/html.d.ts.map +1 -0
- package/dist/html.js +63 -0
- package/dist/html.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect.d.ts +197 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +317 -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 +203 -0
- package/dist/math.js.map +1 -0
- package/dist/measure.d.ts +313 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +3 -0
- package/dist/namespaces-BVnNu7sg.js +666 -0
- package/dist/namespaces-BVnNu7sg.js.map +1 -0
- package/dist/node.d.ts +20 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +55 -0
- package/dist/node.js.map +1 -0
- package/dist/notes-RLCwdlTE.js +1703 -0
- package/dist/notes-RLCwdlTE.js.map +1 -0
- package/dist/package-CaOLXSNi.d.ts +193 -0
- package/dist/package-CaOLXSNi.d.ts.map +1 -0
- package/dist/pres-C5__xkDh.d.ts +202 -0
- package/dist/pres-C5__xkDh.d.ts.map +1 -0
- package/dist/presentation-Cp7vzlAw.js +5427 -0
- package/dist/presentation-Cp7vzlAw.js.map +1 -0
- package/dist/presentation-types-DP_8jog7.d.ts +4872 -0
- package/dist/presentation-types-DP_8jog7.d.ts.map +1 -0
- package/dist/read.d.ts +55 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +4 -0
- package/dist/script.d.ts +581 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +3741 -0
- package/dist/script.js.map +1 -0
- package/dist/shapes-BemroU-z.js +6951 -0
- package/dist/shapes-BemroU-z.js.map +1 -0
- package/dist/slide-js0QpRV-.d.ts +3873 -0
- package/dist/slide-js0QpRV-.d.ts.map +1 -0
- package/dist/text-CyetbF6p.js +11278 -0
- package/dist/text-CyetbF6p.js.map +1 -0
- package/dist/units-1kRzYShk.js +231 -0
- package/dist/units-1kRzYShk.js.map +1 -0
- package/dist/units-internal-Dg95w_YD.js +753 -0
- package/dist/units-internal-Dg95w_YD.js.map +1 -0
- package/dist/zip.d.ts +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 +152 -0
- package/skills/ts-pptx-upstream/SKILL.md +340 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { y as WRITE_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
|
|
2
|
+
import { H as HexColor, a as Slide } from "./slide-js0QpRV-.js";
|
|
3
|
+
//#region src/types/theme.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Theme color scheme overrides. Each slot maps to one `<a:clrScheme>` entry in `theme1.xml`;
|
|
6
|
+
* any slot left unset keeps the default Office value. Provide 6-digit hex (no `#`).
|
|
7
|
+
*
|
|
8
|
+
* Slot names use the OOXML scheme names. The PowerPoint UI labels them as:
|
|
9
|
+
* `dk1`=Text/Dark 1, `lt1`=Background/Light 1, `dk2`=Text/Dark 2, `lt2`=Background/Light 2,
|
|
10
|
+
* `accent1`-`accent6`=Accent 1-6, `hlink`=Hyperlink, `folHlink`=Followed Hyperlink.
|
|
11
|
+
* @example { accent1: 'C00000', dk2: '1F3864', hlink: '0070C0' }
|
|
12
|
+
*/
|
|
13
|
+
interface ThemeColorScheme {
|
|
14
|
+
/** Text/Dark 1 (default Office: black via `windowText`) */
|
|
15
|
+
dk1?: HexColor;
|
|
16
|
+
/** Background/Light 1 (default Office: white via `window`) */
|
|
17
|
+
lt1?: HexColor;
|
|
18
|
+
/** Text/Dark 2 (default Office: `44546A`) */
|
|
19
|
+
dk2?: HexColor;
|
|
20
|
+
/** Background/Light 2 (default Office: `E7E6E6`) */
|
|
21
|
+
lt2?: HexColor;
|
|
22
|
+
/** Accent 1 (default Office: `4472C4`) */
|
|
23
|
+
accent1?: HexColor;
|
|
24
|
+
/** Accent 2 (default Office: `ED7D31`) */
|
|
25
|
+
accent2?: HexColor;
|
|
26
|
+
/** Accent 3 (default Office: `A5A5A5`) */
|
|
27
|
+
accent3?: HexColor;
|
|
28
|
+
/** Accent 4 (default Office: `FFC000`) */
|
|
29
|
+
accent4?: HexColor;
|
|
30
|
+
/** Accent 5 (default Office: `5B9BD5`) */
|
|
31
|
+
accent5?: HexColor;
|
|
32
|
+
/** Accent 6 (default Office: `70AD47`) */
|
|
33
|
+
accent6?: HexColor;
|
|
34
|
+
/** Hyperlink (default Office: `0563C1`) */
|
|
35
|
+
hlink?: HexColor;
|
|
36
|
+
/** Followed Hyperlink (default Office: `954F72`) */
|
|
37
|
+
folHlink?: HexColor;
|
|
38
|
+
}
|
|
39
|
+
interface ThemeProps {
|
|
40
|
+
/**
|
|
41
|
+
* Headings font face name
|
|
42
|
+
* @example 'Arial Narrow'
|
|
43
|
+
* @default 'Calibri Light'
|
|
44
|
+
*/
|
|
45
|
+
headFontFace?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Body font face name
|
|
48
|
+
* @example 'Arial'
|
|
49
|
+
* @default 'Calibri'
|
|
50
|
+
*/
|
|
51
|
+
bodyFontFace?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Headings East Asian font face — theme `<a:ea>` slot of the major font.
|
|
54
|
+
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
55
|
+
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
56
|
+
* @example 'Yu Gothic'
|
|
57
|
+
*/
|
|
58
|
+
headFontFaceEA?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Body East Asian font face — theme `<a:ea>` slot of the minor font.
|
|
61
|
+
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
62
|
+
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
63
|
+
* @example 'Yu Gothic'
|
|
64
|
+
*/
|
|
65
|
+
bodyFontFaceEA?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Headings complex-script font face — theme `<a:cs>` slot of the major font.
|
|
68
|
+
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
69
|
+
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
70
|
+
* @example 'Arial'
|
|
71
|
+
*/
|
|
72
|
+
headFontFaceCS?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Body complex-script font face — theme `<a:cs>` slot of the minor font.
|
|
75
|
+
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
76
|
+
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
77
|
+
* @example 'Arial'
|
|
78
|
+
*/
|
|
79
|
+
bodyFontFaceCS?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Theme color scheme overrides written to `ppt/theme/theme1.xml`.
|
|
82
|
+
* - any unset slot keeps its default Office value
|
|
83
|
+
* - references such as `SchemeColor.accent1` resolve against these values
|
|
84
|
+
* @example { accent1: 'C00000', accent2: '00B050', hlink: '0070C0' }
|
|
85
|
+
*/
|
|
86
|
+
colorScheme?: ThemeColorScheme;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/types/pres.d.ts
|
|
90
|
+
interface WriteBaseProps {
|
|
91
|
+
/**
|
|
92
|
+
* Whether to DEFLATE-compress the package (PowerPoint itself always compresses;
|
|
93
|
+
* set `false` only if export time matters more than file size)
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
compression?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* How to handle a media asset (image/audio/video) that fails to load during export.
|
|
99
|
+
* - `'throw'` (default): reject the export with an error naming the failing asset. A deck
|
|
100
|
+
* that silently embeds a broken-image placeholder is a degenerate result, so failing
|
|
101
|
+
* loudly is the safe default.
|
|
102
|
+
* - `'placeholder'`: substitute a broken-image placeholder, emit a `media/load-failed`
|
|
103
|
+
* diagnostic (see `setDiagnosticHandler`), and
|
|
104
|
+
* continue. Useful for best-effort/batch jobs where one missing asset should not abort
|
|
105
|
+
* the whole deck.
|
|
106
|
+
* @default 'throw'
|
|
107
|
+
*/
|
|
108
|
+
onMediaError?: 'throw' | 'placeholder';
|
|
109
|
+
}
|
|
110
|
+
interface WriteProps extends WriteBaseProps {
|
|
111
|
+
/**
|
|
112
|
+
* Output type
|
|
113
|
+
* - values: 'arraybuffer' | 'base64' | 'binarystring' | 'blob' | 'nodebuffer' | 'uint8array'
|
|
114
|
+
* @default 'blob'
|
|
115
|
+
*/
|
|
116
|
+
outputType?: WRITE_OUTPUT_TYPE;
|
|
117
|
+
}
|
|
118
|
+
interface WriteFileProps extends WriteBaseProps {
|
|
119
|
+
/**
|
|
120
|
+
* Export file name
|
|
121
|
+
* @default 'Presentation.pptx'
|
|
122
|
+
*/
|
|
123
|
+
fileName?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* One emitted OOXML package part: its full slash-path and already-encoded bytes. Returned by
|
|
127
|
+
* {@link TsPptx.toParts} for callers that want the raw parts of the `.pptx` OPC package without
|
|
128
|
+
* zipping (custom containers, streaming, part-level inspection). The bytes are byte-identical to
|
|
129
|
+
* what `write()` would compress for the same part;
|
|
130
|
+
* XML parts are UTF-8 (decode with `new TextDecoder().decode(part.data)`), media/font parts are
|
|
131
|
+
* their raw binary.
|
|
132
|
+
*/
|
|
133
|
+
interface PackagePart {
|
|
134
|
+
/** Full OOXML package part path, e.g. `ppt/slides/slide1.xml`. */
|
|
135
|
+
readonly path: string;
|
|
136
|
+
/** The part's already-encoded bytes: a fresh view per call, safe to keep or transfer. */
|
|
137
|
+
readonly data: Uint8Array;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Options for {@link TsPptx.toParts}. A deliberately narrow subset of {@link WriteProps}:
|
|
141
|
+
* `compression` and `outputType` are zip concerns and do not apply when parts are returned
|
|
142
|
+
* unzipped, so only media-error handling is exposed.
|
|
143
|
+
*/
|
|
144
|
+
interface PartsProps {
|
|
145
|
+
/**
|
|
146
|
+
* How to handle a media asset (image/audio/video) that fails to load. Same semantics as
|
|
147
|
+
* {@link WriteBaseProps.onMediaError}.
|
|
148
|
+
* @default 'throw'
|
|
149
|
+
*/
|
|
150
|
+
onMediaError?: 'throw' | 'placeholder';
|
|
151
|
+
}
|
|
152
|
+
interface SectionProps {
|
|
153
|
+
/**
|
|
154
|
+
* Section title
|
|
155
|
+
*/
|
|
156
|
+
title: string;
|
|
157
|
+
/**
|
|
158
|
+
* Section order - uses to add section at any index
|
|
159
|
+
* - values: 1-n
|
|
160
|
+
*/
|
|
161
|
+
order?: number;
|
|
162
|
+
}
|
|
163
|
+
interface PresLayout {
|
|
164
|
+
_sizeW?: number;
|
|
165
|
+
_sizeH?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Layout Name
|
|
168
|
+
* @example 'LAYOUT_WIDE'
|
|
169
|
+
*/
|
|
170
|
+
name: string;
|
|
171
|
+
width: number;
|
|
172
|
+
height: number;
|
|
173
|
+
}
|
|
174
|
+
type CustomPropertyValue = string | number | boolean | Date;
|
|
175
|
+
interface PresentationProps {
|
|
176
|
+
author: string;
|
|
177
|
+
company: string;
|
|
178
|
+
layout: string;
|
|
179
|
+
masterSlide: Slide;
|
|
180
|
+
/**
|
|
181
|
+
* Presentation's layout
|
|
182
|
+
* read-only
|
|
183
|
+
*/
|
|
184
|
+
presLayout: PresLayout;
|
|
185
|
+
revision: string;
|
|
186
|
+
/**
|
|
187
|
+
* Slide number to assign to the first slide (affects the slide-number field displayed in placeholders).
|
|
188
|
+
* @default 1
|
|
189
|
+
*/
|
|
190
|
+
firstSlideNum: number;
|
|
191
|
+
/**
|
|
192
|
+
* Whether to enable right-to-left mode
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
rtlMode: boolean;
|
|
196
|
+
subject: string;
|
|
197
|
+
theme: ThemeProps;
|
|
198
|
+
title: string;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
export { PresentationProps as a, WriteFileProps as c, ThemeProps as d, PresLayout as i, WriteProps as l, PackagePart as n, SectionProps as o, PartsProps as r, WriteBaseProps as s, CustomPropertyValue as t, ThemeColorScheme as u };
|
|
202
|
+
//# sourceMappingURL=pres-C5__xkDh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pres-C5__xkDh.d.ts","names":[],"sources":["../src/types/theme.ts","../src/types/pres.ts"],"mappings":";;;;;;;;;;;;UAgBiB;;EAEhB,MAAM;;EAEN,MAAM;;EAEN,MAAM;;EAEN,MAAM;;EAEN,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;EAER,WAAW;;UAEK;;;;;;EAMhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA,cAAc;;;;UC/EE;;;;;;EAMhB;;;;;;;;;;;;EAYA;;UAEgB,mBAAmB;;;;;;EAMnC,aAAa;;UAEG,uBAAuB;;;;;EAKvC;;;;;;;;;;UAUgB;;WAEP;;WAEA,MAAM;;;;;;;UAOC;;;;;;EAMhB;;UAEgB;;;;EAIhB;;;;;EAKA;;UAEgB;EAChB;EACA;;;;;EAMA;EACA;EACA;;KAEW,kDAAkD;UAE7C;EAChB;EACA;EACA;EACA,aAAa;;;;;EAKb,YAAY;EACZ;;;;;EAKA;;;;;EAKA;EACA;EACA,OAAO;EACP"}
|