slotdeck 0.1.0 → 0.1.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.
@@ -0,0 +1,668 @@
1
+ # API reference
2
+
3
+ Every export of the package, grouped by what it is for. Types are written as TypeScript. Everything is imported
4
+ from `slotdeck` unless noted.
5
+
6
+ ```ts
7
+ import { renderDeck /* ... */ } from 'slotdeck';
8
+ import { directoryStore } from 'slotdeck/node';
9
+ ```
10
+
11
+ The package ships its own type declarations (`dist/*.d.ts`), which carry the same information with comments on
12
+ every field.
13
+
14
+ ## Rendering
15
+
16
+ ### `loadTemplate`
17
+
18
+ ```ts
19
+ function loadTemplate(pptx: Uint8Array, manifest: TemplateManifest): Template;
20
+ ```
21
+
22
+ Unzips a template once. Reuse the result.
23
+
24
+ ### `renderDeck`
25
+
26
+ ```ts
27
+ function renderDeck(template: Template, deck: DeckSpec, options?: RenderOptions): RenderResult;
28
+ ```
29
+
30
+ Deck JSON to pptx bytes. Synchronous, no model. Throws `DeckValidationError` when the deck has errors.
31
+
32
+ ### `validateDeck`
33
+
34
+ ```ts
35
+ function validateDeck(manifest: TemplateManifest, deck: DeckSpec, options?: ValidateOptions): Issue[];
36
+ ```
37
+
38
+ Checks a deck against a manifest with the renderer's own rules.
39
+
40
+ ### `extractAssets`
41
+
42
+ ```ts
43
+ function extractAssets(template: Template, deck: DeckSpec, pptx: Uint8Array): Record<string, Uint8Array>;
44
+ ```
45
+
46
+ Reads a deck's pictures back from a pptx rendered from it, by asset id.
47
+
48
+ ### `DeckValidationError`
49
+
50
+ ```ts
51
+ class DeckValidationError extends Error {
52
+ readonly issues: Issue[];
53
+ }
54
+ ```
55
+
56
+ ### `isImageRef`, `isTableValue`, `isChartValue`
57
+
58
+ ```ts
59
+ function isImageRef(value: unknown): value is ImageRef;
60
+ function isTableValue(value: unknown): value is TableValue;
61
+ function isChartValue(value: unknown): value is ChartValue;
62
+ ```
63
+
64
+ Tell the kinds of slot value apart when walking a deck.
65
+
66
+ ### Types
67
+
68
+ ```ts
69
+ interface Template { pkg: PptxPackage; manifest: TemplateManifest }
70
+
71
+ interface RenderOptions { assets?: Record<string, Uint8Array>; layout?: LayoutMode }
72
+ interface RenderResult { pptx: Uint8Array; warnings: Issue[] }
73
+
74
+ type LayoutMode = 'strict' | 'adaptive';
75
+ interface ValidateOptions { layout?: LayoutMode; assets?: Iterable<string> }
76
+ interface Issue { severity: 'error' | 'warning'; slide?: number; slot?: string; message: string }
77
+
78
+ interface DeckSpec {
79
+ version: 1;
80
+ title?: string;
81
+ brief?: string;
82
+ language?: string;
83
+ direction?: Direction;
84
+ fields?: Record<string, string>;
85
+ textScale?: number;
86
+ slides: SlideSpec[];
87
+ }
88
+ interface SlideSpec { pattern: string; items?: number; slots: Record<string, SlotValue> }
89
+ type SlotValue = string | string[] | ImageRef | TableValue | ChartValue | null;
90
+ interface ImageRef { asset: string; alt?: string; prompt?: string }
91
+ interface TableValue { header: string[]; rows: string[][] }
92
+ type ChartType = 'column' | 'bar' | 'line' | 'pie';
93
+ interface ChartValue {
94
+ type: ChartType;
95
+ categories: string[];
96
+ series: Array<{ name: string; values: number[] }>;
97
+ format?: 'number' | 'percent';
98
+ }
99
+ ```
100
+
101
+ ## Generating and editing
102
+
103
+ ### `generateDeck`
104
+
105
+ ```ts
106
+ function generateDeck(template: Template, brief: Brief, options: GenerateOptions): Promise<GenerateResult>;
107
+ ```
108
+
109
+ Brief to pptx: plans, gathers pictures, renders.
110
+
111
+ ### `editDeck`
112
+
113
+ ```ts
114
+ function editDeck(template: Template, deck: DeckSpec, instruction: string, options: EditDeckOptions): Promise<EditDeckResult>;
115
+ ```
116
+
117
+ Applies an instruction to a deck, gathers pictures, renders.
118
+
119
+ ### `planDeck`
120
+
121
+ ```ts
122
+ function planDeck(template: Template, brief: Brief, options: PlanOptions): Promise<PlanResult>;
123
+ ```
124
+
125
+ Brief to deck JSON: `planOutline` then `writeDeck`.
126
+
127
+ ### `planOutline`
128
+
129
+ ```ts
130
+ function planOutline(template: Template, brief: Brief, options: PlanOptions): Promise<DeckPlan>;
131
+ ```
132
+
133
+ Decides which pattern each slide uses and the point it makes. One model call.
134
+
135
+ ### `editPlan`
136
+
137
+ ```ts
138
+ function editPlan(template: Template, plan: DeckPlan, instruction: string, options: PlanOptions): Promise<{ plan: DeckPlan; summary: string }>;
139
+ ```
140
+
141
+ Changes a plan by instruction. One model call.
142
+
143
+ ### `writeDeck`
144
+
145
+ ```ts
146
+ function writeDeck(template: Template, plan: DeckPlan, options: PlanOptions): Promise<PlanResult>;
147
+ ```
148
+
149
+ Writes the content of a plan's slides. One model call plus repairs.
150
+
151
+ ### `planEdit`
152
+
153
+ ```ts
154
+ function planEdit(template: Template, deck: DeckSpec, instruction: string, options: EditOptions): Promise<EditResult>;
155
+ ```
156
+
157
+ Applies an instruction to a deck and returns the new deck JSON, without pictures or rendering.
158
+
159
+ ### `resolveAssets`
160
+
161
+ ```ts
162
+ function resolveAssets(template: Template, deck: DeckSpec, options?: ResolveOptions): Promise<Record<string, Uint8Array>>;
163
+ ```
164
+
165
+ Collects the bytes of every picture a deck refers to.
166
+
167
+ ### `directionOf`
168
+
169
+ ```ts
170
+ function directionOf(language: string): Direction;
171
+ ```
172
+
173
+ The reading direction of a BCP 47 language tag.
174
+
175
+ ### `PlanError`
176
+
177
+ ```ts
178
+ class PlanError extends Error {}
179
+ ```
180
+
181
+ Thrown when no usable plan can be made. The message says why.
182
+
183
+ ### `TEXT_SIZES`
184
+
185
+ ```ts
186
+ const TEXT_SIZES: { normal: 1; large: 1.25; 'x-large': 1.5 };
187
+ type TextSize = 'normal' | 'large' | 'x-large';
188
+ ```
189
+
190
+ ### Types
191
+
192
+ ```ts
193
+ interface Brief {
194
+ prompt: string;
195
+ slideCount?: number | { min: number; max: number };
196
+ language?: string;
197
+ direction?: Direction;
198
+ imageDensity?: ImageDensity;
199
+ instructions?: string;
200
+ fields?: Record<string, string>;
201
+ textSize?: TextSize;
202
+ }
203
+ type ImageDensity = 'none' | 'low' | 'medium' | 'high';
204
+
205
+ interface PlanOptions {
206
+ llm: LlmProvider;
207
+ layout?: LayoutMode;
208
+ icons?: IconDef[];
209
+ assets?: AssetDef[];
210
+ patterns?: string[];
211
+ numberPatterns?: 'from-brief' | 'always' | 'never';
212
+ maxRepairs?: number;
213
+ onProgress?: (event: PlanProgress) => void;
214
+ signal?: AbortSignal;
215
+ }
216
+ type PlanProgress = { stage: 'outline' } | { stage: 'write'; slides: number } | { stage: 'repair'; attempt: number; issues: number };
217
+
218
+ interface IconDef { id: string; description: string; data: Uint8Array }
219
+ interface AssetDef { id: string; kind: 'photo' | 'graphic'; description: string; data: Uint8Array }
220
+
221
+ interface OutlineEntry { pattern: string; purpose: string; items?: number }
222
+ interface DeckPlan { version: 1; title: string; brief: Brief; slides: OutlineEntry[] }
223
+ interface PlanResult { deck: DeckSpec; warnings: Issue[]; outline: OutlineEntry[] }
224
+
225
+ interface EditOptions extends PlanOptions {
226
+ fields?: Record<string, string>;
227
+ direction?: Direction;
228
+ imageDensity?: ImageDensity;
229
+ }
230
+ interface EditResult { deck: DeckSpec; summary: string; rewritten: number[]; warnings: Issue[] }
231
+
232
+ // generateDeck and editDeck add picture handling to the options above:
233
+ interface GenerateOptions extends Omit<PlanOptions, 'onProgress'> {
234
+ images?: ImageProvider;
235
+ cache?: Map<string, Uint8Array>;
236
+ imageConcurrency?: number;
237
+ onProgress?: (event: GenerateProgress) => void;
238
+ }
239
+ interface EditDeckOptions extends Omit<EditOptions, 'onProgress'> {
240
+ images?: ImageProvider;
241
+ cache?: Map<string, Uint8Array>;
242
+ imageConcurrency?: number;
243
+ onProgress?: (event: GenerateProgress) => void;
244
+ }
245
+ type GenerateProgress = PlanProgress | { stage: 'images'; done: number; total: number } | { stage: 'render' };
246
+
247
+ interface GenerateResult { pptx: Uint8Array; deck: DeckSpec; assets: Record<string, Uint8Array>; warnings: Issue[]; outline: OutlineEntry[] }
248
+ interface EditDeckResult { pptx: Uint8Array; deck: DeckSpec; assets: Record<string, Uint8Array>; warnings: Issue[]; summary: string; rewritten: number[] }
249
+
250
+ interface ResolveOptions {
251
+ images?: ImageProvider;
252
+ icons?: IconDef[];
253
+ assets?: AssetDef[];
254
+ cache?: Map<string, Uint8Array>;
255
+ concurrency?: number;
256
+ onProgress?: (event: { stage: 'images'; done: number; total: number }) => void;
257
+ signal?: AbortSignal;
258
+ }
259
+ ```
260
+
261
+ ## Chat tools and storage
262
+
263
+ ### `presentationTools`
264
+
265
+ ```ts
266
+ function presentationTools(options: PresentationToolsOptions): PresentationTools;
267
+ ```
268
+
269
+ Builds the four tools for a chat model.
270
+
271
+ ### `TOOL_NAMES`
272
+
273
+ ```ts
274
+ const TOOL_NAMES: {
275
+ plan: 'plan_presentation';
276
+ editPlan: 'edit_presentation_plan';
277
+ create: 'create_presentation';
278
+ edit: 'edit_presentation';
279
+ };
280
+ ```
281
+
282
+ ### `storeKeys`
283
+
284
+ ```ts
285
+ const storeKeys: {
286
+ plan(id: string): string; // 'plan/<id>.json'
287
+ deck(id: string): string; // 'deck/<id>.json'
288
+ pptx(id: string): string; // 'pptx/<id>.pptx'
289
+ asset(id: string): string; // 'asset/<id>'
290
+ };
291
+ ```
292
+
293
+ ### `memoryStore`
294
+
295
+ ```ts
296
+ function memoryStore(): BlobStore & { keys(): string[] };
297
+ ```
298
+
299
+ ### `directoryStore` (from `slotdeck/node`)
300
+
301
+ ```ts
302
+ function directoryStore(directory: string): BlobStore;
303
+ ```
304
+
305
+ A store backed by a folder. Keys become file paths under it.
306
+
307
+ ### Types
308
+
309
+ ```ts
310
+ interface BlobStore {
311
+ get(key: string): Promise<Uint8Array | undefined>;
312
+ set(key: string, data: Uint8Array): Promise<void>;
313
+ }
314
+
315
+ interface PresentationToolsOptions {
316
+ template: Template;
317
+ llm: LlmProvider;
318
+ store: BlobStore;
319
+ images?: ImageProvider;
320
+ icons?: IconDef[];
321
+ assets?: AssetDef[];
322
+ layout?: LayoutMode;
323
+ fields?: Record<string, string>;
324
+ numberPatterns?: 'from-brief' | 'always' | 'never';
325
+ thumbnail?: (patternId: string) => string | undefined;
326
+ newId?: (kind: 'plan' | 'deck') => string;
327
+ onProgress?: (event: GenerateProgress, tool: string) => void;
328
+ }
329
+ interface PresentationTools {
330
+ definitions: ToolDefinition[];
331
+ call(name: string, args: unknown, context?: { signal?: AbortSignal }): Promise<ToolResult>;
332
+ }
333
+ interface ToolDefinition { name: string; description: string; parameters: JsonSchema }
334
+ interface ToolResult { output: Record<string, unknown>; plan?: DeckPlan; deck?: DeckSpec; pptx?: Uint8Array }
335
+ ```
336
+
337
+ ## Providers
338
+
339
+ ### `gemini`, `geminiImages`
340
+
341
+ ```ts
342
+ function gemini(options: GeminiOptions): LlmProvider;
343
+ function geminiImages(options: GeminiImageOptions): ImageProvider;
344
+ ```
345
+
346
+ ### `vertexEndpoint`, `GEMINI_DEVELOPER_ENDPOINT`
347
+
348
+ ```ts
349
+ function vertexEndpoint(project: string, location?: string): string; // location defaults to 'global'
350
+ const GEMINI_DEVELOPER_ENDPOINT: string;
351
+ ```
352
+
353
+ ### `GeminiError`
354
+
355
+ ```ts
356
+ class GeminiError extends Error {
357
+ readonly status: number | undefined;
358
+ }
359
+ ```
360
+
361
+ ### Types
362
+
363
+ ```ts
364
+ type JsonSchema = { [key: string]: unknown };
365
+ interface JsonRequest {
366
+ system: string;
367
+ prompt: string;
368
+ schema: JsonSchema;
369
+ images?: Array<{ mimeType: string; data: Uint8Array }>;
370
+ signal?: AbortSignal;
371
+ }
372
+ interface LlmProvider { generateJson(request: JsonRequest): Promise<unknown> }
373
+
374
+ interface ImageRequest { prompt: string; kind: ImageKind; aspectRatio: number; signal?: AbortSignal }
375
+ interface ImageProvider { generateImage(request: ImageRequest): Promise<Uint8Array> }
376
+
377
+ interface GeminiOptions {
378
+ model: string;
379
+ apiKey?: string;
380
+ endpoint?: string;
381
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
382
+ fetch?: typeof fetch;
383
+ timeoutMs?: number;
384
+ thinkingLevel?: 'minimal' | 'low' | 'medium' | 'high';
385
+ maxOutputTokens?: number;
386
+ }
387
+ interface GeminiImageOptions {
388
+ model: string;
389
+ apiKey?: string;
390
+ endpoint?: string;
391
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
392
+ fetch?: typeof fetch;
393
+ timeoutMs?: number;
394
+ imageSize?: '512' | '1K' | '2K' | '4K';
395
+ style?: string;
396
+ }
397
+ ```
398
+
399
+ ## Template studio
400
+
401
+ ### `draftManifest`
402
+
403
+ ```ts
404
+ function draftManifest(pptx: Uint8Array | PptxPackage, options: DraftOptions): Promise<DraftResult>;
405
+ ```
406
+
407
+ ### `checkManifest`
408
+
409
+ ```ts
410
+ function checkManifest(template: Template): ManifestIssue[];
411
+ ```
412
+
413
+ ### `sampleDeck`
414
+
415
+ ```ts
416
+ function sampleDeck(template: Template, options?: SampleOptions): { deck: DeckSpec; assets: Record<string, Uint8Array> };
417
+ ```
418
+
419
+ ### `changeManifest`
420
+
421
+ ```ts
422
+ function changeManifest(template: Template, changes: ManifestChange[]): ChangeResult;
423
+ ```
424
+
425
+ ### `editManifest`
426
+
427
+ ```ts
428
+ function editManifest(template: Template, instruction: string, options: ManifestEditOptions): Promise<ManifestEditResult>;
429
+ ```
430
+
431
+ ### `describeManifest`, `describeSlot`
432
+
433
+ ```ts
434
+ function describeManifest(template: Template): string;
435
+ function describeSlot(slot: SlotDef): string;
436
+ ```
437
+
438
+ ### `studioView`
439
+
440
+ ```ts
441
+ function studioView(template: Template): StudioView;
442
+ ```
443
+
444
+ ### `inspectTemplate`
445
+
446
+ ```ts
447
+ function inspectTemplate(pkg: PptxPackage): TemplateInfo;
448
+ ```
449
+
450
+ ### `ROLES`
451
+
452
+ ```ts
453
+ const ROLES: readonly ['title', 'subtitle', 'text', 'list', 'number', 'caption', 'photo', 'icon', 'graphic', 'chart', 'table', 'decoration', 'fixed'];
454
+ type Role = (typeof ROLES)[number];
455
+ ```
456
+
457
+ ### `PptxPackage`
458
+
459
+ ```ts
460
+ class PptxPackage {
461
+ static load(bytes: Uint8Array): PptxPackage;
462
+ clone(): PptxPackage;
463
+ has(partPath: string): boolean;
464
+ paths(): string[];
465
+ read(partPath: string): Uint8Array;
466
+ readText(partPath: string): string;
467
+ write(partPath: string, data: Uint8Array | string): void;
468
+ delete(partPath: string): void;
469
+ save(): Uint8Array;
470
+ }
471
+ ```
472
+
473
+ The unzipped parts of a pptx. Needed directly only for `inspectTemplate` and for reading a part such as a
474
+ picture out of a template (`template.pkg.read('ppt/media/image1.png')`).
475
+
476
+ ### Types
477
+
478
+ ```ts
479
+ interface SlidePicture { mimeType: string; data: Uint8Array }
480
+ interface DraftOptions {
481
+ llm: LlmProvider;
482
+ name?: string;
483
+ slideImage?: (slide: number) => SlidePicture | undefined | Promise<SlidePicture | undefined>;
484
+ slides?: number[];
485
+ concurrency?: number;
486
+ onProgress?: (event: { done: number; total: number; slide: number }) => void;
487
+ signal?: AbortSignal;
488
+ }
489
+ interface DraftResult { manifest: TemplateManifest; skipped: Array<{ slide: number; reason: string }>; issues: ManifestIssue[] }
490
+
491
+ interface ManifestIssue { severity: 'error' | 'warning'; pattern?: string; slot?: string; message: string }
492
+ interface SampleOptions { fill?: number; items?: 'drawn' | 'max' | 'min' }
493
+
494
+ type ManifestChange =
495
+ | { op: 'setManifest'; name?: string; language?: string; direction?: Direction; alignOnDirectionChange?: AlignPolicy }
496
+ | { op: 'addPattern'; slide: number; id: string; description?: string }
497
+ | { op: 'copyPattern'; pattern: string; id: string; description?: string }
498
+ | { op: 'removePattern'; pattern: string }
499
+ | { op: 'setPattern'; pattern: string; id?: string; description?: string; figures?: boolean }
500
+ | { op: 'addSlot'; pattern: string; shape: string; role: Role; name?: string; optional?: boolean }
501
+ | { op: 'removeSlot'; pattern: string; slot: string }
502
+ | ({ op: 'setSlot'; pattern: string; slot: string } & SlotPatch)
503
+ | { op: 'setRepeat'; pattern: string; min?: number; max?: number; item?: string; span?: { left: number; right: number } | null }
504
+ | { op: 'removeRepeat'; pattern: string };
505
+
506
+ interface SlotPatch {
507
+ name?: string;
508
+ description?: string | null;
509
+ empty?: EmptyPolicy;
510
+ maxChars?: number;
511
+ maxParagraphs?: number | null;
512
+ deckField?: string | null;
513
+ alignOnDirectionChange?: AlignPolicy | null;
514
+ styleRun?: 'first' | 'last' | null;
515
+ fontSize?: number | null;
516
+ paragraphGap?: number | null;
517
+ scales?: boolean | null;
518
+ box?: SlideBox | null;
519
+ imageKind?: ImageKind;
520
+ fit?: 'cover' | 'contain' | null;
521
+ maxColumns?: number;
522
+ maxRows?: number;
523
+ maxCellChars?: number;
524
+ headerText?: TableTextStyle | null;
525
+ bodyText?: TableTextStyle | null;
526
+ maxCategories?: number;
527
+ maxSeries?: number;
528
+ colors?: string[] | null;
529
+ text?: TableTextStyle | null;
530
+ lineColor?: string | null;
531
+ }
532
+
533
+ interface ChangeResult {
534
+ manifest: TemplateManifest;
535
+ applied: Array<{ index: number; change: ManifestChange; message: string }>;
536
+ rejected: Array<{ index: number; change: ManifestChange; reason: string }>;
537
+ issues: ManifestIssue[];
538
+ }
539
+ interface ManifestEditOptions { llm: LlmProvider; signal?: AbortSignal }
540
+ interface ManifestEditResult extends ChangeResult { note: string }
541
+
542
+ interface StudioView { aspectRatio: number; slides: StudioSlide[] }
543
+ interface StudioSlide { slide: number; patterns: string[]; shapes: StudioShape[] }
544
+ interface StudioShape {
545
+ id: string;
546
+ kind: ShapeKind;
547
+ box: Box;
548
+ groupId?: string;
549
+ text?: string;
550
+ fontSize?: number;
551
+ frame: boolean;
552
+ roles: Role[];
553
+ slots: Array<{ pattern: string; name: string; kind: 'text' | 'image' | 'table' | 'chart'; empty: EmptyPolicy; summary: string }>;
554
+ }
555
+
556
+ type ShapeKind = 'text' | 'picture' | 'shape' | 'line' | 'group' | 'table' | 'other';
557
+ interface Box { x: number; y: number; w: number; h: number } // fractions of the slide
558
+ interface ShapeInfo {
559
+ id: string;
560
+ name: string;
561
+ kind: ShapeKind;
562
+ box: Box;
563
+ groupId?: string;
564
+ placeholder?: string;
565
+ paragraphs?: string[];
566
+ fontSizes?: number[];
567
+ image?: { part: string; width?: number; height?: number; cropped: boolean; geometry: string };
568
+ table?: { columns: number; rows: number };
569
+ }
570
+ interface SlideInfo { number: number; part: string; layout: string; shapes: ShapeInfo[] }
571
+ interface TemplateInfo { slideWidth: number; slideHeight: number; defaultFontSize: number; slides: SlideInfo[] }
572
+ ```
573
+
574
+ ## Manifest types
575
+
576
+ Described field by field in [manifest-format.md](manifest-format.md).
577
+
578
+ ```ts
579
+ type Direction = 'rtl' | 'ltr';
580
+ type AlignPolicy = 'flip' | 'keep';
581
+ type EmptyPolicy = 'error' | 'remove' | 'keep' | 'drop';
582
+ type ImageKind = 'photo' | 'icon' | 'graphic';
583
+ interface SlideBox { x: number; y: number; w: number; h: number }
584
+ interface TableTextStyle { size?: number; bold?: boolean; color?: string; font?: string }
585
+
586
+ interface TemplateManifest {
587
+ version: 1;
588
+ name: string;
589
+ language?: string;
590
+ direction: Direction;
591
+ alignOnDirectionChange?: AlignPolicy;
592
+ patterns: PatternDef[];
593
+ }
594
+ interface PatternDef {
595
+ id: string;
596
+ sourceSlide: number;
597
+ description: string;
598
+ slots: SlotDef[];
599
+ figures?: boolean;
600
+ sequences?: string[][][];
601
+ repeat?: RepeatDef;
602
+ }
603
+ interface RepeatDef {
604
+ item: string;
605
+ slots: string[];
606
+ shapes: string[][];
607
+ min?: number;
608
+ max?: number;
609
+ span?: { left: number; right: number };
610
+ columns?: number;
611
+ }
612
+ type SlotDef = TextSlotDef | ImageSlotDef | TableSlotDef | ChartSlotDef;
613
+
614
+ // Every slot kind has: name, shapeId, description?, empty?
615
+ interface TextSlotDef {
616
+ kind: 'text';
617
+ name: string;
618
+ shapeId: string;
619
+ description?: string;
620
+ empty?: EmptyPolicy;
621
+ maxChars?: number;
622
+ maxParagraphs?: number;
623
+ deckField?: string;
624
+ alignOnDirectionChange?: AlignPolicy;
625
+ styleRun?: 'first' | 'last';
626
+ size?: number;
627
+ fontSize?: number;
628
+ box?: SlideBox;
629
+ paragraphGap?: number;
630
+ scales?: boolean;
631
+ }
632
+ interface ImageSlotDef {
633
+ kind: 'image';
634
+ name: string;
635
+ shapeId: string;
636
+ description?: string;
637
+ empty?: EmptyPolicy;
638
+ imageKind: ImageKind;
639
+ fit?: 'cover' | 'contain';
640
+ box?: SlideBox;
641
+ copyOf?: string; // set by the engine on slots of copied items
642
+ }
643
+ interface TableSlotDef {
644
+ kind: 'table';
645
+ name: string;
646
+ shapeId: string;
647
+ description?: string;
648
+ empty?: EmptyPolicy;
649
+ maxColumns?: number;
650
+ maxRows?: number;
651
+ maxCellChars?: number;
652
+ headerText?: TableTextStyle;
653
+ bodyText?: TableTextStyle;
654
+ }
655
+ interface ChartSlotDef {
656
+ kind: 'chart';
657
+ name: string;
658
+ shapeId: string;
659
+ description?: string;
660
+ empty?: EmptyPolicy;
661
+ box?: SlideBox;
662
+ maxCategories?: number;
663
+ maxSeries?: number;
664
+ colors?: string[];
665
+ text?: TableTextStyle;
666
+ lineColor?: string;
667
+ }
668
+ ```