deckjsx 0.1.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 ADDED
@@ -0,0 +1,98 @@
1
+ # deckjsx
2
+
3
+ `deckjsx` is a TypeScript library for generating presentation files from JSX through a compiler pipeline.
4
+
5
+ The intended architecture is:
6
+
7
+ ```text
8
+ JSX
9
+ -> Presentation IR
10
+ -> Backend
11
+ |- PptxGenJS backend
12
+ `- OOXML direct backend (future)
13
+ ```
14
+
15
+ This project is being designed as a compiler, not as a thin `PptxGenJS` wrapper.
16
+ The current API direction is a class-based compiler with callback-based `.add()`, `.render()`, and `.output()`, and JSX authoring centered on a `style` object prop.
17
+
18
+ The implementation preserves the compiler model with explicit module boundaries for authoring,
19
+ style normalization, layout, IR, backend emission, and Node runtime output.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm install deckjsx
25
+ ```
26
+
27
+ The package currently targets Node.js output and ships a `pptxgenjs` backend.
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ import { Deck, Slide, Text, View } from "deckjsx";
33
+
34
+ const deck = new Deck({
35
+ layout: { width: 13.333, height: 7.5, unit: "in" },
36
+ meta: { title: "Quarterly Review", author: "deckjsx" },
37
+ });
38
+
39
+ deck.add(({ slideIndex, totalSlides }) => (
40
+ <Slide name={`Slide ${slideIndex + 1}`} style={{ backgroundColor: "#F8FAFC" }}>
41
+ <Text
42
+ style={{
43
+ x: 0.7,
44
+ y: 0.5,
45
+ width: 8.5,
46
+ height: 0.6,
47
+ fontSize: 28,
48
+ fontWeight: 700,
49
+ color: "#0F172A",
50
+ }}
51
+ >
52
+ Quarterly Review
53
+ </Text>
54
+ <View
55
+ style={{
56
+ x: 0.7,
57
+ y: 1.4,
58
+ width: 11.9,
59
+ height: 4.8,
60
+ display: "grid",
61
+ gridTemplateColumns: "1fr 1fr",
62
+ columnGap: 0.35,
63
+ }}
64
+ >
65
+ <Text style={{ fontSize: 18, color: "#334155", fit: "shrink" }}>
66
+ Author slides with TSX primitives, inspect the generated IR, and emit PPTX files through the
67
+ backend boundary.
68
+ </Text>
69
+ <Text style={{ fontSize: 18, color: "#334155", fit: "shrink" }}>
70
+ {slideIndex + 1} / {totalSlides}
71
+ </Text>
72
+ </View>
73
+ </Slide>
74
+ ));
75
+
76
+ const ir = deck.render();
77
+ await deck.output({ backend: "pptxgenjs", output: "quarterly-review.pptx" });
78
+ ```
79
+
80
+ Use `deck.render()` for tests, snapshots, and backend-independent inspection. Use
81
+ `deck.output({ backend: "pptxgenjs", output })` when writing a PowerPoint file.
82
+
83
+ ## Spec
84
+
85
+ The current draft specification is here:
86
+
87
+ - [docs/compiler-spec.md](docs/compiler-spec.md)
88
+ - [docs/css-support-matrix.md](docs/css-support-matrix.md)
89
+ - [docs/css-completion-plan.md](docs/css-completion-plan.md)
90
+
91
+ ## Development
92
+
93
+ ```bash
94
+ vp install
95
+ vp check
96
+ vp test
97
+ vp pack
98
+ ```
@@ -0,0 +1,609 @@
1
+ //#region src/authoring/index.d.ts
2
+ type DeckLength = number | `${number}${"in" | "pt" | "px" | "%" | "em" | "rem" | "vh" | "vw" | "ch"}`;
3
+ type DeckPointLength = number | `${number}${"pt" | "in" | "px" | "em" | "rem" | "vh" | "vw" | "ch"}`;
4
+ type CssAspectRatio = number | `${number}/${number}` | `${number} / ${number}`;
5
+ type CssBoxSizing = "border-box" | "content-box";
6
+ type Spacing = DeckLength | readonly [DeckLength, DeckLength, DeckLength, DeckLength];
7
+ type StackAxis = "horizontal" | "vertical";
8
+ type StackAlignment = "start" | "center" | "end";
9
+ type LayoutMode = "absolute" | "stack" | "grid";
10
+ type BackendName = "pptxgenjs" | "ooxml";
11
+ type ImplementedBackendName = "pptxgenjs";
12
+ type BorderStyle = "none" | "solid" | "dash";
13
+ type StrokeDashType = "solid" | "dash" | "dashDot" | "lgDash" | "lgDashDot" | "lgDashDotDot" | "sysDash" | "sysDot";
14
+ type StrokeLineCap = "butt" | "round" | "square";
15
+ type StrokeLineJoin = "miter" | "round" | "bevel";
16
+ type VerticalAlign = "top" | "middle" | "bottom";
17
+ type TextFit = "none" | "shrink" | "resize";
18
+ type CssDisplay = "flex" | "block" | "grid" | "none";
19
+ type CssPosition = "absolute" | "relative";
20
+ type CssVisibility = "visible" | "hidden";
21
+ type CssOverflow = "visible" | "hidden";
22
+ type CssFlexDirection = "row" | "column";
23
+ type CssGridTrack = DeckLength | `${number}fr` | `minmax(${string})`;
24
+ type CssGridTemplate = readonly CssGridTrack[] | string;
25
+ type CssGridLine = number | "auto" | `span ${number}`;
26
+ type CssGridPlacement = number | `span ${number}` | `${number} / ${number}` | `${number}/${number}` | `${number} / span ${number}` | `${number}/span${number}`;
27
+ type CssAlignItems = "start" | "flex-start" | "center" | "end" | "flex-end" | "stretch";
28
+ type CssAlignSelf = CssAlignItems | "auto";
29
+ type CssJustifySelf = CssAlignItems | "auto";
30
+ type CssJustifyContent = "start" | "flex-start" | "center" | "end" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly";
31
+ type CssAlignContent = "start" | "flex-start" | "center" | "end" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "stretch";
32
+ type CssFlexWrap = "nowrap" | "wrap";
33
+ type CssFlexBasis = DeckLength | "auto";
34
+ type CssGridAutoFlow = "row" | "column" | "row dense" | "column dense";
35
+ type CssGridTemplateAreas = string | readonly string[];
36
+ type CssGridTemplateShorthand = string;
37
+ type CssGridShorthand = string;
38
+ type CssObjectPosition = string;
39
+ type ImageCropValue = number | `${number}%`;
40
+ type TextTabStopLength = DeckPointLength;
41
+ type TextTabStopAlignment = "left" | "right" | "center" | "decimal";
42
+ type TextTabStopAuthoring = {
43
+ position: TextTabStopLength;
44
+ alignment?: TextTabStopAlignment;
45
+ };
46
+ type ImageCropAuthoring = {
47
+ top?: ImageCropValue;
48
+ right?: ImageCropValue;
49
+ bottom?: ImageCropValue;
50
+ left?: ImageCropValue;
51
+ };
52
+ type TextJsxChild = string | number | boolean | null | undefined | readonly TextJsxChild[];
53
+ type ContentAuthorNode = AuthorNode<"view" | "text" | "image" | "shape">;
54
+ type ContentJsxChild = AuthorNode | boolean | null | undefined | readonly ContentJsxChild[];
55
+ type JsxNode = AuthorNode | string | number | boolean | null | undefined | readonly JsxNode[];
56
+ type BaseAuthorProps = {
57
+ opacity?: number;
58
+ rotation?: number;
59
+ transform?: string;
60
+ transformOrigin?: string;
61
+ zIndex?: number;
62
+ flipH?: boolean;
63
+ flipV?: boolean;
64
+ overflow?: CssOverflow;
65
+ alignSelf?: CssAlignSelf;
66
+ justifySelf?: CssJustifySelf;
67
+ placeSelf?: string;
68
+ position?: CssPosition;
69
+ order?: number;
70
+ flexGrow?: number;
71
+ flexShrink?: number;
72
+ flexBasis?: CssFlexBasis;
73
+ gridArea?: string;
74
+ gridColumnStart?: CssGridLine;
75
+ gridColumnEnd?: CssGridLine;
76
+ gridRowStart?: CssGridLine;
77
+ gridRowEnd?: CssGridLine;
78
+ gridColumn?: CssGridPlacement;
79
+ gridRow?: CssGridPlacement;
80
+ };
81
+ type FrameAuthorProps = BaseAuthorProps & {
82
+ display?: CssDisplay;
83
+ visibility?: CssVisibility;
84
+ x?: DeckLength;
85
+ y?: DeckLength;
86
+ inset?: Spacing;
87
+ left?: DeckLength;
88
+ top?: DeckLength;
89
+ right?: DeckLength;
90
+ bottom?: DeckLength;
91
+ width?: DeckLength;
92
+ height?: DeckLength;
93
+ aspectRatio?: CssAspectRatio;
94
+ minWidth?: DeckLength;
95
+ minHeight?: DeckLength;
96
+ maxWidth?: DeckLength;
97
+ maxHeight?: DeckLength;
98
+ };
99
+ type BoxStyleAuthorProps = {
100
+ boxSizing?: CssBoxSizing;
101
+ background?: string;
102
+ backgroundImage?: string;
103
+ backgroundColor?: string;
104
+ backgroundTransparency?: number;
105
+ backgroundPosition?: string;
106
+ backgroundSize?: string;
107
+ backgroundRepeat?: string;
108
+ backgroundClip?: string;
109
+ backgroundOrigin?: string;
110
+ boxShadow?: string;
111
+ strokeLinecap?: StrokeLineCap;
112
+ strokeLinejoin?: StrokeLineJoin;
113
+ border?: string;
114
+ borderColor?: string;
115
+ borderWidth?: DeckLength;
116
+ borderStyle?: BorderStyle;
117
+ borderTransparency?: number;
118
+ borderTop?: string;
119
+ borderRight?: string;
120
+ borderBottom?: string;
121
+ borderLeft?: string;
122
+ borderTopColor?: string;
123
+ borderRightColor?: string;
124
+ borderBottomColor?: string;
125
+ borderLeftColor?: string;
126
+ borderTopWidth?: DeckLength;
127
+ borderRightWidth?: DeckLength;
128
+ borderBottomWidth?: DeckLength;
129
+ borderLeftWidth?: DeckLength;
130
+ borderTopStyle?: BorderStyle;
131
+ borderRightStyle?: BorderStyle;
132
+ borderBottomStyle?: BorderStyle;
133
+ borderLeftStyle?: BorderStyle;
134
+ borderRadius?: DeckLength;
135
+ outline?: string;
136
+ outlineColor?: string;
137
+ outlineWidth?: DeckLength;
138
+ outlineStyle?: BorderStyle;
139
+ margin?: Spacing;
140
+ marginTop?: DeckLength;
141
+ marginRight?: DeckLength;
142
+ marginBottom?: DeckLength;
143
+ marginLeft?: DeckLength;
144
+ paddingTop?: DeckLength;
145
+ paddingRight?: DeckLength;
146
+ paddingBottom?: DeckLength;
147
+ paddingLeft?: DeckLength;
148
+ };
149
+ type SlideStyle = {
150
+ background?: string;
151
+ backgroundImage?: string;
152
+ backgroundColor?: string;
153
+ backgroundTransparency?: number;
154
+ backgroundPosition?: string;
155
+ backgroundSize?: string;
156
+ backgroundRepeat?: string;
157
+ backgroundClip?: string;
158
+ backgroundOrigin?: string;
159
+ };
160
+ type ViewStyle = FrameAuthorProps & BoxStyleAuthorProps & {
161
+ layout?: LayoutMode;
162
+ display?: CssDisplay;
163
+ direction?: StackAxis;
164
+ flexDirection?: CssFlexDirection;
165
+ gap?: DeckLength;
166
+ rowGap?: DeckLength;
167
+ columnGap?: DeckLength;
168
+ padding?: Spacing;
169
+ alignItems?: StackAlignment | CssAlignItems;
170
+ justifyContent?: StackAlignment | CssJustifyContent;
171
+ justifyItems?: CssJustifySelf;
172
+ placeItems?: string;
173
+ alignContent?: StackAlignment | CssAlignContent;
174
+ placeContent?: string;
175
+ flexWrap?: CssFlexWrap;
176
+ grid?: CssGridShorthand;
177
+ gridTemplate?: CssGridTemplateShorthand;
178
+ gridTemplateAreas?: CssGridTemplateAreas;
179
+ gridTemplateColumns?: CssGridTemplate;
180
+ gridTemplateRows?: CssGridTemplate;
181
+ gridAutoColumns?: CssGridTrack;
182
+ gridAutoRows?: CssGridTrack;
183
+ gridAutoFlow?: CssGridAutoFlow;
184
+ };
185
+ type TextStyle = FrameAuthorProps & BoxStyleAuthorProps & {
186
+ fontFamily?: string;
187
+ fontSize?: DeckPointLength;
188
+ fontWeight?: number | "normal" | "bold";
189
+ italic?: boolean;
190
+ fontStyle?: "normal" | "italic";
191
+ underline?: boolean;
192
+ strike?: boolean;
193
+ textDecoration?: string;
194
+ textDecorationLine?: string;
195
+ textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" | "wavy";
196
+ textDecorationColor?: string;
197
+ textTransform?: "none" | "uppercase" | "lowercase" | "capitalize";
198
+ direction?: "ltr" | "rtl";
199
+ writingMode?: "horizontal-tb" | "vertical-rl" | "vertical-lr";
200
+ color?: string;
201
+ textAlign?: "left" | "center" | "right" | "justify";
202
+ verticalAlign?: VerticalAlign;
203
+ padding?: Spacing;
204
+ lineSpacing?: number;
205
+ lineSpacingMultiple?: number;
206
+ lineHeight?: DeckPointLength | "normal";
207
+ paragraphSpacingBefore?: number;
208
+ paragraphSpacingAfter?: number;
209
+ textIndent?: DeckPointLength;
210
+ tabStops?: readonly TextTabStopAuthoring[];
211
+ charSpacing?: number;
212
+ letterSpacing?: number;
213
+ whiteSpace?: "normal" | "nowrap" | "pre" | "pre-wrap" | "pre-line";
214
+ wordBreak?: "normal" | "break-all" | "keep-all" | "break-word";
215
+ overflowWrap?: "normal" | "break-word" | "anywhere";
216
+ href?: string;
217
+ tooltip?: string;
218
+ listStyleType?: "none" | "disc" | "circle" | "square" | "decimal" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
219
+ listStart?: number;
220
+ listIndent?: DeckPointLength;
221
+ superscript?: boolean;
222
+ subscript?: boolean;
223
+ textShadow?: string;
224
+ fit?: TextFit;
225
+ wrap?: boolean;
226
+ };
227
+ type ImageStyle = FrameAuthorProps & {
228
+ fit?: "contain" | "cover" | "stretch";
229
+ objectFit?: "contain" | "cover" | "stretch";
230
+ objectPosition?: CssObjectPosition;
231
+ crop?: ImageCropAuthoring;
232
+ href?: string;
233
+ tooltip?: string;
234
+ transparency?: number;
235
+ rounding?: boolean;
236
+ borderRadius?: DeckLength;
237
+ boxShadow?: string;
238
+ margin?: Spacing;
239
+ marginTop?: DeckLength;
240
+ marginRight?: DeckLength;
241
+ marginBottom?: DeckLength;
242
+ marginLeft?: DeckLength;
243
+ };
244
+ type ShapeStyle = FrameAuthorProps & Omit<BoxStyleAuthorProps, "backgroundColor" | "backgroundTransparency" | "borderRadius"> & {
245
+ background?: string;
246
+ backgroundColor?: string;
247
+ backgroundTransparency?: number;
248
+ href?: string;
249
+ tooltip?: string;
250
+ fill?: string;
251
+ fillTransparency?: number;
252
+ stroke?: string;
253
+ strokeWidth?: DeckLength;
254
+ strokeOpacity?: number;
255
+ strokeDasharray?: string;
256
+ borderRadius?: DeckLength;
257
+ radius?: DeckLength;
258
+ };
259
+ type DeckOptions = {
260
+ layout: {
261
+ width: number;
262
+ height: number;
263
+ unit: "in" | "pt";
264
+ };
265
+ meta?: {
266
+ title?: string;
267
+ author?: string;
268
+ subject?: string;
269
+ };
270
+ };
271
+ type SlideContext = {
272
+ slideIndex: number;
273
+ totalSlides: number;
274
+ };
275
+ type SlideFactory = (context: SlideContext) => JsxNode;
276
+ type OutputConfig = {
277
+ backend: ImplementedBackendName;
278
+ output: string;
279
+ };
280
+ type SlideProps = {
281
+ name?: string;
282
+ style?: SlideStyle;
283
+ background?: string;
284
+ backgroundImage?: string;
285
+ backgroundColor?: string;
286
+ backgroundTransparency?: number;
287
+ backgroundPosition?: string;
288
+ backgroundSize?: string;
289
+ backgroundRepeat?: string;
290
+ backgroundClip?: string;
291
+ backgroundOrigin?: string;
292
+ children?: ContentJsxChild;
293
+ };
294
+ type ViewProps = {
295
+ style?: ViewStyle;
296
+ children?: ContentJsxChild;
297
+ } & ViewStyle;
298
+ type TextProps = {
299
+ style?: TextStyle;
300
+ children?: TextJsxChild;
301
+ } & TextStyle;
302
+ type ImageProps = {
303
+ style?: ImageStyle;
304
+ src?: string;
305
+ data?: string;
306
+ children?: never;
307
+ } & ImageStyle;
308
+ type ShapeProps = {
309
+ style?: ShapeStyle;
310
+ shape: "rect" | "ellipse" | "line";
311
+ children?: never;
312
+ } & ShapeStyle;
313
+ type AuthorNodeMap = {
314
+ slide: SlideProps;
315
+ view: ViewProps;
316
+ text: TextProps;
317
+ image: ImageProps;
318
+ shape: ShapeProps;
319
+ };
320
+ type AuthorNodeKind = keyof AuthorNodeMap;
321
+ type AuthorNodeProps<K extends AuthorNodeKind> = Omit<AuthorNodeMap[K], "children">;
322
+ type AuthorNodePropsMap = { [NodeKind in AuthorNodeKind]: AuthorNodeProps<NodeKind> };
323
+ type AuthorNode<K extends AuthorNodeKind = AuthorNodeKind> = { [NodeKind in K]: {
324
+ readonly $$typeof: "deckjsx.author-node";
325
+ readonly kind: NodeKind;
326
+ readonly props: AuthorNodeProps<NodeKind>;
327
+ readonly children: ReadonlyArray<JsxNode>;
328
+ } }[K];
329
+ //#endregion
330
+ //#region src/ir/index.d.ts
331
+ type PresentationIR = {
332
+ version: "0.1";
333
+ meta?: {
334
+ title?: string;
335
+ author?: string;
336
+ subject?: string;
337
+ };
338
+ size: SizeIR;
339
+ slides: ReadonlyArray<SlideIR>;
340
+ };
341
+ type SizeIR = {
342
+ widthEmu: number;
343
+ heightEmu: number;
344
+ };
345
+ type FrameIR = SizeIR & {
346
+ xEmu: number;
347
+ yEmu: number;
348
+ };
349
+ type SlideIR = {
350
+ id: string;
351
+ name?: string;
352
+ background?: FillIR;
353
+ backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
354
+ nodes: ReadonlyArray<NodeIR>;
355
+ };
356
+ type NodeIR = GroupIR | TextIR | ImageIR | ShapeIR;
357
+ type BaseNodeIR = {
358
+ id: string;
359
+ frame: FrameIR;
360
+ opacity?: number;
361
+ rotation?: number;
362
+ zIndex?: number;
363
+ visibility?: CssVisibility;
364
+ flipH?: boolean;
365
+ flipV?: boolean;
366
+ };
367
+ type ShadowIR = {
368
+ type: "outer" | "inner";
369
+ color: string;
370
+ opacity?: number;
371
+ blurPt?: number;
372
+ offsetPt?: number;
373
+ angle?: number;
374
+ };
375
+ type HyperlinkIR = {
376
+ url: string;
377
+ tooltip?: string;
378
+ };
379
+ type ObjectPositionIR = {
380
+ x: number;
381
+ y: number;
382
+ };
383
+ type ImageCropIR = {
384
+ top: number;
385
+ right: number;
386
+ bottom: number;
387
+ left: number;
388
+ };
389
+ type GroupIR = BaseNodeIR & {
390
+ kind: "group";
391
+ children: ReadonlyArray<NodeIR>;
392
+ fill?: FillIR;
393
+ backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
394
+ stroke?: StrokeIR;
395
+ edgeStrokes?: EdgeStrokeIR;
396
+ outline?: StrokeIR;
397
+ shadow?: ShadowIR;
398
+ radiusEmu?: number;
399
+ };
400
+ type TextIR = BaseNodeIR & {
401
+ kind: "text";
402
+ content: TextContentIR;
403
+ style: TextStyleIR;
404
+ fill?: FillIR;
405
+ backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
406
+ stroke?: StrokeIR;
407
+ edgeStrokes?: EdgeStrokeIR;
408
+ outline?: StrokeIR;
409
+ shadow?: ShadowIR;
410
+ hyperlink?: HyperlinkIR;
411
+ radiusEmu?: number;
412
+ };
413
+ type ImageIR = BaseNodeIR & {
414
+ kind: "image";
415
+ sourceFrame: FrameIR;
416
+ source: ImageSourceIR;
417
+ fit: "contain" | "cover" | "stretch";
418
+ objectPosition?: ObjectPositionIR;
419
+ crop?: ImageCropIR;
420
+ transparency?: number;
421
+ rounding?: boolean;
422
+ shadow?: ShadowIR;
423
+ hyperlink?: HyperlinkIR;
424
+ };
425
+ type ShapeIR = BaseNodeIR & {
426
+ kind: "shape";
427
+ shape: "rect" | "ellipse" | "line";
428
+ fill?: FillIR;
429
+ backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
430
+ stroke?: StrokeIR;
431
+ edgeStrokes?: EdgeStrokeIR;
432
+ outline?: StrokeIR;
433
+ shadow?: ShadowIR;
434
+ hyperlink?: HyperlinkIR;
435
+ radiusEmu?: number;
436
+ };
437
+ type SolidFillIR = {
438
+ kind: "solid";
439
+ color: string;
440
+ transparency?: number;
441
+ frame?: FrameIR;
442
+ };
443
+ type LinearGradientStopIR = {
444
+ color: string;
445
+ transparency?: number;
446
+ position: number;
447
+ };
448
+ type LinearGradientFillIR = {
449
+ kind: "linear-gradient";
450
+ angle: number;
451
+ stops: ReadonlyArray<LinearGradientStopIR>;
452
+ frame?: FrameIR;
453
+ };
454
+ type RadialGradientFillIR = {
455
+ kind: "radial-gradient";
456
+ shape: "circle" | "ellipse";
457
+ center: {
458
+ x: number;
459
+ y: number;
460
+ };
461
+ radius: {
462
+ x: number;
463
+ y: number;
464
+ };
465
+ stops: ReadonlyArray<LinearGradientStopIR>;
466
+ frame?: FrameIR;
467
+ };
468
+ type BackgroundImageLayerIR = {
469
+ kind: "background-image";
470
+ frame: FrameIR;
471
+ sourceFrame: FrameIR;
472
+ source: ImageSourceIR;
473
+ fit: "contain" | "cover" | "stretch" | "size";
474
+ size?: {
475
+ widthEmu?: number;
476
+ heightEmu?: number;
477
+ };
478
+ repeat: "no-repeat" | "repeat-x" | "repeat-y" | "repeat";
479
+ objectPosition?: ObjectPositionIR;
480
+ transparency?: number;
481
+ };
482
+ type FillIR = SolidFillIR | LinearGradientFillIR | RadialGradientFillIR;
483
+ type BackgroundLayerIR = FillIR | BackgroundImageLayerIR;
484
+ type StrokeIR = {
485
+ color: string;
486
+ widthPt: number;
487
+ style?: BorderStyle;
488
+ dashType?: StrokeDashType;
489
+ lineCap?: StrokeLineCap;
490
+ lineJoin?: StrokeLineJoin;
491
+ transparency?: number;
492
+ };
493
+ type EdgeStrokeIR = {
494
+ top?: StrokeIR;
495
+ right?: StrokeIR;
496
+ bottom?: StrokeIR;
497
+ left?: StrokeIR;
498
+ };
499
+ type TextContentIR = {
500
+ text: string;
501
+ };
502
+ type TextTabStopIR = {
503
+ positionIn: number;
504
+ alignment?: "l" | "r" | "ctr" | "dec";
505
+ };
506
+ type TextBulletListIR = {
507
+ type: "bullet";
508
+ characterCode?: string;
509
+ indentPt?: number;
510
+ };
511
+ type TextNumberListIR = {
512
+ type: "number";
513
+ style: "arabicPeriod" | "alphaLcPeriod" | "alphaUcPeriod" | "romanLcPeriod" | "romanUcPeriod";
514
+ startAt?: number;
515
+ indentPt?: number;
516
+ };
517
+ type TextNoListIR = {
518
+ type: "none";
519
+ };
520
+ type TextListIR = TextBulletListIR | TextNumberListIR | TextNoListIR;
521
+ type TextStyleIR = {
522
+ fontFamily?: string;
523
+ fontSizePt?: number;
524
+ fontWeight?: number | "normal" | "bold";
525
+ italic?: boolean;
526
+ underline?: boolean;
527
+ underlineStyle?: "dash" | "dbl" | "dotted" | "none" | "sng" | "wavy";
528
+ underlineColor?: string;
529
+ strike?: boolean;
530
+ rtlMode?: boolean;
531
+ textDirection?: "horz" | "vert" | "vert270";
532
+ superscript?: boolean;
533
+ subscript?: boolean;
534
+ color?: string;
535
+ textAlign?: "left" | "center" | "right" | "justify";
536
+ verticalAlign?: VerticalAlign;
537
+ paddingPt?: [number, number, number, number];
538
+ lineSpacing?: number;
539
+ lineSpacingMultiple?: number;
540
+ paragraphSpacingBefore?: number;
541
+ paragraphSpacingAfter?: number;
542
+ textIndentPt?: number;
543
+ tabStops?: ReadonlyArray<TextTabStopIR>;
544
+ charSpacing?: number;
545
+ list?: TextListIR;
546
+ fit?: TextFit;
547
+ wrap?: boolean;
548
+ };
549
+ type ImageSourceIR = {
550
+ kind: "path";
551
+ path: string;
552
+ } | {
553
+ kind: "data";
554
+ data: string;
555
+ };
556
+ type BackendArtifact = {
557
+ kind: "buffer";
558
+ mimeType: string;
559
+ data: Uint8Array;
560
+ extension: string;
561
+ };
562
+ type CompileBackend = {
563
+ name: BackendName;
564
+ emit(ir: PresentationIR): Promise<BackendArtifact>;
565
+ };
566
+ //#endregion
567
+ //#region src/deck.d.ts
568
+ declare class Deck {
569
+ #private;
570
+ constructor(options: DeckOptions);
571
+ add(slide: SlideFactory): this;
572
+ render(): PresentationIR;
573
+ output(config: OutputConfig): Promise<void>;
574
+ }
575
+ //#endregion
576
+ //#region src/jsx.d.ts
577
+ type ComponentProps = {
578
+ children?: JsxNode;
579
+ };
580
+ type ElementChildren<P> = P extends {
581
+ children?: infer Child;
582
+ } ? Child : never;
583
+ type ElementChildArgs<P> = P extends {
584
+ children?: never;
585
+ } ? [] : ElementChildren<P>[];
586
+ declare function createElement<P extends {
587
+ children?: unknown;
588
+ }, R extends JsxNode>(type: (props: P) => R, props: (Omit<P, "children"> & Partial<Pick<P, "children">>) | null, ...children: ElementChildArgs<P>): R;
589
+ declare function createElement(type: string, props: ComponentProps | null): never;
590
+ declare function Fragment(props: {
591
+ children?: ContentJsxChild;
592
+ }): ContentJsxChild;
593
+ declare function Slide(props: SlideProps): AuthorNode<"slide">;
594
+ declare function View(props: ViewProps): AuthorNode<"view">;
595
+ declare function Text(props: TextProps): AuthorNode<"text">;
596
+ declare function Image(props: ImageProps): AuthorNode<"image">;
597
+ declare function Shape(props: ShapeProps): AuthorNode<"shape">;
598
+ declare function isAuthorNode(value: unknown): value is AuthorNode;
599
+ declare function isSlideNode(value: unknown): value is AuthorNode<"slide">;
600
+ declare function isContentNode(value: unknown): value is ContentAuthorNode;
601
+ //#endregion
602
+ //#region src/backends/pptxgenjs.d.ts
603
+ declare function pptxgenjsBackend(): CompileBackend;
604
+ //#endregion
605
+ //#region src/types.d.ts
606
+ declare const EMU_PER_INCH = 914400;
607
+ declare const POINTS_PER_INCH = 72;
608
+ //#endregion
609
+ export { type AuthorNode, type AuthorNodeKind, type AuthorNodeMap, type AuthorNodeProps, type AuthorNodePropsMap, type BackendArtifact, type BackendName, type BackgroundImageLayerIR, type BackgroundLayerIR, type BaseNodeIR, type BorderStyle, type CompileBackend, type ContentAuthorNode, type ContentJsxChild, type CssAlignContent, type CssAlignItems, type CssAlignSelf, type CssAspectRatio, type CssBoxSizing, type CssDisplay, type CssFlexBasis, type CssFlexDirection, type CssFlexWrap, type CssGridAutoFlow, type CssGridLine, type CssGridPlacement, type CssGridShorthand, type CssGridTemplate, type CssGridTemplateAreas, type CssGridTemplateShorthand, type CssGridTrack, type CssJustifyContent, type CssJustifySelf, type CssObjectPosition, type CssOverflow, type CssPosition, type CssVisibility, Deck, type DeckLength, type DeckOptions, type DeckPointLength, EMU_PER_INCH, type EdgeStrokeIR, type FillIR, Fragment, type FrameIR, type GroupIR, type HyperlinkIR, Image, type ImageCropAuthoring, type ImageCropIR, type ImageCropValue, type ImageIR, type ImageProps, type ImageSourceIR, type ImageStyle, type ImplementedBackendName, type JsxNode, type LayoutMode, type LinearGradientFillIR, type LinearGradientStopIR, type NodeIR, type ObjectPositionIR, type OutputConfig, POINTS_PER_INCH, type PresentationIR, type RadialGradientFillIR, type ShadowIR, Shape, type ShapeIR, type ShapeProps, type ShapeStyle, type SizeIR, Slide, type SlideContext, type SlideFactory, type SlideIR, type SlideProps, type SlideStyle, type SolidFillIR, type Spacing, type StackAlignment, type StackAxis, type StrokeDashType, type StrokeIR, type StrokeLineCap, type StrokeLineJoin, Text, type TextBulletListIR, type TextContentIR, type TextFit, type TextIR, type TextJsxChild, type TextListIR, type TextNoListIR, type TextNumberListIR, type TextProps, type TextStyle, type TextStyleIR, type TextTabStopAlignment, type TextTabStopAuthoring, type TextTabStopIR, type TextTabStopLength, type VerticalAlign, View, type ViewProps, type ViewStyle, createElement, isAuthorNode, isContentNode, isSlideNode, pptxgenjsBackend };