@coco-vexel/coco-office 0.0.0-stage → 1.0.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.
Files changed (76) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +120 -2
  3. package/THIRD_PARTY_NOTICES.md +1188 -0
  4. package/dist/excel-worker-browser.cjs +6544 -0
  5. package/dist/excel-worker-browser.cjs.map +1 -0
  6. package/dist/excel-worker-browser.d.cts +2 -0
  7. package/dist/excel-worker-browser.d.ts +2 -0
  8. package/dist/excel-worker-browser.js +6523 -0
  9. package/dist/excel-worker-browser.js.map +1 -0
  10. package/dist/excel-worker.cjs +6547 -0
  11. package/dist/excel-worker.cjs.map +1 -0
  12. package/dist/excel-worker.d.cts +2 -0
  13. package/dist/excel-worker.d.ts +2 -0
  14. package/dist/excel-worker.js +6526 -0
  15. package/dist/excel-worker.js.map +1 -0
  16. package/dist/excel.cjs +12523 -0
  17. package/dist/excel.cjs.map +1 -0
  18. package/dist/excel.d.cts +2252 -0
  19. package/dist/excel.d.ts +2252 -0
  20. package/dist/excel.js +12368 -0
  21. package/dist/excel.js.map +1 -0
  22. package/dist/index.cjs +19 -0
  23. package/dist/index.cjs.map +1 -0
  24. package/dist/index.d.cts +2 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +1 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/kernel-worker-browser.cjs +12304 -0
  29. package/dist/kernel-worker-browser.cjs.map +1 -0
  30. package/dist/kernel-worker-browser.d.cts +2 -0
  31. package/dist/kernel-worker-browser.d.ts +2 -0
  32. package/dist/kernel-worker-browser.js +12283 -0
  33. package/dist/kernel-worker-browser.js.map +1 -0
  34. package/dist/kernel-worker.cjs +12309 -0
  35. package/dist/kernel-worker.cjs.map +1 -0
  36. package/dist/kernel-worker.d.cts +2 -0
  37. package/dist/kernel-worker.d.ts +2 -0
  38. package/dist/kernel-worker.js +12288 -0
  39. package/dist/kernel-worker.js.map +1 -0
  40. package/dist/pack.cjs +459 -0
  41. package/dist/pack.cjs.map +1 -0
  42. package/dist/pack.d.cts +119 -0
  43. package/dist/pack.d.ts +119 -0
  44. package/dist/pack.js +408 -0
  45. package/dist/pack.js.map +1 -0
  46. package/dist/ppt.cjs +7427 -0
  47. package/dist/ppt.cjs.map +1 -0
  48. package/dist/ppt.d.cts +1432 -0
  49. package/dist/ppt.d.ts +1432 -0
  50. package/dist/ppt.js +7355 -0
  51. package/dist/ppt.js.map +1 -0
  52. package/dist/shared.cjs +105 -0
  53. package/dist/shared.cjs.map +1 -0
  54. package/dist/shared.d.cts +31 -0
  55. package/dist/shared.d.ts +31 -0
  56. package/dist/shared.js +81 -0
  57. package/dist/shared.js.map +1 -0
  58. package/dist/types-BVkkdcfh.d.cts +54 -0
  59. package/dist/types-BVkkdcfh.d.ts +54 -0
  60. package/dist/types-C2vQfM-b.d.cts +102 -0
  61. package/dist/types-C2vQfM-b.d.ts +102 -0
  62. package/dist/view-DAkeR0RW.d.ts +1199 -0
  63. package/dist/view-DX2YAG5A.d.cts +1199 -0
  64. package/dist/word-view.cjs +1824 -0
  65. package/dist/word-view.cjs.map +1 -0
  66. package/dist/word-view.d.cts +2 -0
  67. package/dist/word-view.d.ts +2 -0
  68. package/dist/word-view.js +1791 -0
  69. package/dist/word-view.js.map +1 -0
  70. package/dist/word.cjs +14106 -0
  71. package/dist/word.cjs.map +1 -0
  72. package/dist/word.d.cts +3042 -0
  73. package/dist/word.d.ts +3042 -0
  74. package/dist/word.js +14011 -0
  75. package/dist/word.js.map +1 -0
  76. package/package.json +103 -3
package/dist/ppt.d.cts ADDED
@@ -0,0 +1,1432 @@
1
+ import { P as Part, a as Package } from './types-BVkkdcfh.cjs';
2
+
3
+ type PptShapeKind = 'placeholder' | 'textBox' | 'picture' | 'table' | 'chart' | 'smartArt' | 'geometricShape' | 'line' | 'group' | 'media' | 'oleObject' | 'unknown';
4
+ interface PptSlideSize {
5
+ width: number;
6
+ height: number;
7
+ }
8
+ interface PptShapeGeometry {
9
+ left?: number;
10
+ top?: number;
11
+ width?: number;
12
+ height?: number;
13
+ rotation?: number;
14
+ flipHorizontal?: boolean;
15
+ flipVertical?: boolean;
16
+ }
17
+ interface PptTextBodyModel {
18
+ text: string;
19
+ style?: PptTextStyle;
20
+ body?: PptTextBodyProperties;
21
+ paragraphs?: PptTextParagraph[];
22
+ }
23
+ interface PptTextBodyProperties {
24
+ anchor?: 'top' | 'middle' | 'bottom';
25
+ autoFit?: 'none' | 'shape' | 'normal';
26
+ wrap?: 'none' | 'square';
27
+ vertical?: 'eastAsian' | 'vertical';
28
+ insetLeft?: number;
29
+ insetTop?: number;
30
+ insetRight?: number;
31
+ insetBottom?: number;
32
+ }
33
+ interface PptTextStyle {
34
+ fontSize?: number;
35
+ fontFamily?: string;
36
+ color?: string;
37
+ textFill?: 'none';
38
+ textGradient?: PptGradientFillModel;
39
+ textOutlineColor?: string;
40
+ textShadow?: PptShadowModel;
41
+ bold?: boolean;
42
+ italic?: boolean;
43
+ underline?: boolean;
44
+ strike?: boolean;
45
+ baseline?: number;
46
+ highlight?: string;
47
+ alignment?: PptParagraphAlignment;
48
+ lineHeight?: number;
49
+ characterSpacing?: number;
50
+ }
51
+ type PptParagraphAlignment = 'left' | 'center' | 'right' | 'justify' | 'distributed';
52
+ interface PptHyperlinkModel {
53
+ relationshipId?: string;
54
+ target?: string;
55
+ targetMode?: string;
56
+ action?: string;
57
+ tooltip?: string;
58
+ }
59
+ interface PptHyperlinkWriteOptions {
60
+ target: string;
61
+ targetMode?: string;
62
+ action?: string;
63
+ tooltip?: string;
64
+ }
65
+ interface PptTextRun {
66
+ text: string;
67
+ style?: PptTextStyle;
68
+ hyperlink?: PptHyperlinkModel;
69
+ }
70
+ interface PptTextRunWrite {
71
+ text: string;
72
+ style?: Partial<PptTextStyle>;
73
+ }
74
+ interface PptTextParagraph {
75
+ text: string;
76
+ style?: Pick<PptTextStyle, 'alignment'> & {
77
+ bullet?: string;
78
+ bulletColor?: string;
79
+ bulletFontFamily?: string;
80
+ bulletSize?: number;
81
+ lineHeight?: number;
82
+ marginLeft?: number;
83
+ textIndent?: number;
84
+ spaceBefore?: number;
85
+ spaceAfter?: number;
86
+ };
87
+ runs: PptTextRun[];
88
+ }
89
+ interface PptTextParagraphWrite {
90
+ text?: string;
91
+ style?: Pick<PptTextStyle, 'alignment'> & {
92
+ bullet?: string;
93
+ bulletColor?: string;
94
+ bulletFontFamily?: string;
95
+ bulletSize?: number;
96
+ lineHeight?: number;
97
+ marginLeft?: number;
98
+ textIndent?: number;
99
+ spaceBefore?: number;
100
+ spaceAfter?: number;
101
+ };
102
+ runs?: PptTextRunWrite[];
103
+ }
104
+ interface PptShapeStyle {
105
+ fillColor?: string;
106
+ fillGradient?: PptGradientFillModel;
107
+ opacity?: number;
108
+ lineColor?: string;
109
+ lineGradient?: PptGradientFillModel;
110
+ lineOpacity?: number;
111
+ lineWidth?: number;
112
+ lineCap?: string;
113
+ lineDash?: string;
114
+ lineHeadEnd?: string;
115
+ lineTailEnd?: string;
116
+ shadow?: PptShadowModel;
117
+ }
118
+ interface PptSlideBackgroundModel {
119
+ fillColor?: string;
120
+ fillGradient?: PptGradientFillModel;
121
+ imagePath?: string;
122
+ }
123
+ interface PptGradientFillModel {
124
+ colors: string[];
125
+ angle?: number;
126
+ positions?: number[];
127
+ opacities?: number[];
128
+ flip?: 'none' | 'x' | 'y' | 'xy';
129
+ rotWithShape?: boolean;
130
+ scaled?: boolean;
131
+ tileRect?: {
132
+ left?: number;
133
+ top?: number;
134
+ right?: number;
135
+ bottom?: number;
136
+ };
137
+ }
138
+ interface PptShadowModel {
139
+ color?: string;
140
+ opacity?: number;
141
+ blur?: number;
142
+ distance?: number;
143
+ direction?: number;
144
+ }
145
+ interface PptCustomGeometryModel {
146
+ paths: PptCustomGeometryPathModel[];
147
+ }
148
+ interface PptShape3dModel {
149
+ material?: string;
150
+ extrusionHeight?: number;
151
+ }
152
+ interface PptCustomGeometryPathModel {
153
+ width?: number;
154
+ height?: number;
155
+ commands: PptCustomGeometryCommand[];
156
+ }
157
+ type PptCustomGeometryCommand = {
158
+ kind: 'moveTo';
159
+ x: number;
160
+ y: number;
161
+ } | {
162
+ kind: 'lineTo';
163
+ x: number;
164
+ y: number;
165
+ } | {
166
+ kind: 'cubicBezierTo';
167
+ x1: number;
168
+ y1: number;
169
+ x2: number;
170
+ y2: number;
171
+ x: number;
172
+ y: number;
173
+ } | {
174
+ kind: 'arcTo';
175
+ wR: number;
176
+ hR: number;
177
+ stAng: number;
178
+ swAng: number;
179
+ } | {
180
+ kind: 'close';
181
+ };
182
+ interface PptPlaceholderModel {
183
+ type?: string;
184
+ index?: string;
185
+ size?: string;
186
+ orientation?: string;
187
+ }
188
+ interface PptImageModel {
189
+ relationshipId?: string;
190
+ targetPath?: string;
191
+ contentType?: string;
192
+ filename?: string;
193
+ crop?: PptImageCropModel;
194
+ fillRect?: PptImageCropModel;
195
+ opacity?: number;
196
+ }
197
+ interface PptImageStyle {
198
+ crop?: PptImageCropModel;
199
+ fillRect?: PptImageCropModel;
200
+ opacity?: number;
201
+ }
202
+ interface PptImageCropModel {
203
+ left?: number;
204
+ top?: number;
205
+ right?: number;
206
+ bottom?: number;
207
+ }
208
+ interface PptChartModel {
209
+ relationshipId?: string;
210
+ targetPath?: string;
211
+ type?: string;
212
+ grouping?: string;
213
+ title?: string;
214
+ seriesNames?: string[];
215
+ data?: PptChartData;
216
+ plotLayout?: PptChartLayoutModel;
217
+ axes?: PptChartAxesModel;
218
+ }
219
+ interface PptChartData {
220
+ title?: string;
221
+ series: PptChartSeriesData[];
222
+ }
223
+ interface PptChartSeriesData {
224
+ name?: string;
225
+ type?: string;
226
+ chartGroup?: number;
227
+ categories?: string[];
228
+ values: number[];
229
+ fillColor?: string;
230
+ fillGradient?: PptGradientFillModel;
231
+ pointColors?: string[];
232
+ borderColor?: string;
233
+ borderWidth?: number;
234
+ lineColor?: string;
235
+ lineWidth?: number;
236
+ marker?: PptChartMarkerModel;
237
+ showValueLabels?: boolean;
238
+ showCategoryNameLabels?: boolean;
239
+ showPercentLabels?: boolean;
240
+ dataLabelLayouts?: PptChartDataLabelLayoutModel[];
241
+ smooth?: boolean;
242
+ }
243
+ interface PptChartDataLabelLayoutModel {
244
+ index: number;
245
+ x?: number;
246
+ y?: number;
247
+ }
248
+ interface PptChartLayoutModel {
249
+ x?: number;
250
+ y?: number;
251
+ width?: number;
252
+ height?: number;
253
+ }
254
+ interface PptChartAxesModel {
255
+ category?: PptChartAxisModel;
256
+ value?: PptChartAxisModel;
257
+ }
258
+ interface PptChartAxisModel {
259
+ deleted?: boolean;
260
+ min?: number;
261
+ max?: number;
262
+ majorUnit?: number;
263
+ majorGridlines?: boolean;
264
+ lineColor?: string;
265
+ lineWidth?: number;
266
+ gridlineColor?: string;
267
+ gridlineWidth?: number;
268
+ tickLabelPosition?: string;
269
+ }
270
+ interface PptChartMarkerModel {
271
+ symbol?: string;
272
+ size?: number;
273
+ fillColor?: string;
274
+ lineColor?: string;
275
+ lineWidth?: number;
276
+ }
277
+ interface PptShapeMediaModel {
278
+ relationshipId?: string;
279
+ targetPath?: string;
280
+ mediaType?: 'audio' | 'video' | 'media';
281
+ contentType?: string;
282
+ filename?: string;
283
+ }
284
+ interface PptOleObjectModel {
285
+ relationshipId?: string;
286
+ targetPath?: string;
287
+ progId?: string;
288
+ name?: string;
289
+ }
290
+ interface PptSmartArtModel {
291
+ relationshipIds?: Record<string, string>;
292
+ targetPaths?: Record<string, string>;
293
+ }
294
+ interface PptThemeModel {
295
+ relationshipId?: string;
296
+ path?: string;
297
+ name?: string;
298
+ colorScheme?: Record<string, string>;
299
+ fontScheme?: {
300
+ name?: string;
301
+ majorLatin?: string;
302
+ majorEa?: string;
303
+ majorCs?: string;
304
+ minorLatin?: string;
305
+ minorEa?: string;
306
+ minorCs?: string;
307
+ };
308
+ }
309
+ interface PptTableModel {
310
+ values: string[][];
311
+ rowCount: number;
312
+ columnCount: number;
313
+ columnWidths?: number[];
314
+ rowHeights?: number[];
315
+ cellStyles?: PptTableCellStyle[][];
316
+ mergedCells?: PptTableCellMerge[];
317
+ }
318
+ interface PptTableCellStyle {
319
+ fillColor?: string;
320
+ fillGradient?: PptGradientFillModel;
321
+ borders?: PptTableCellBorders;
322
+ body?: PptTextBodyProperties;
323
+ textStyle?: PptTextStyle;
324
+ }
325
+ interface PptTableCellBorders {
326
+ left?: PptTableCellBorder;
327
+ right?: PptTableCellBorder;
328
+ top?: PptTableCellBorder;
329
+ bottom?: PptTableCellBorder;
330
+ }
331
+ interface PptTableCellBorder {
332
+ color?: string;
333
+ opacity?: number;
334
+ width?: number;
335
+ dash?: string;
336
+ hidden?: boolean;
337
+ }
338
+ interface PptTableCellMerge {
339
+ row: number;
340
+ column: number;
341
+ rowSpan?: number;
342
+ columnSpan?: number;
343
+ hMerge?: boolean;
344
+ vMerge?: boolean;
345
+ }
346
+ interface PptShapeModel {
347
+ id: string;
348
+ name?: string;
349
+ kind: PptShapeKind;
350
+ geometry: PptShapeGeometry;
351
+ style?: PptShapeStyle;
352
+ text?: PptTextBodyModel;
353
+ image?: PptImageModel;
354
+ chart?: PptChartModel;
355
+ media?: PptShapeMediaModel;
356
+ oleObject?: PptOleObjectModel;
357
+ smartArt?: PptSmartArtModel;
358
+ table?: PptTableModel;
359
+ placeholder?: PptPlaceholderModel;
360
+ hyperlink?: PptHyperlinkModel;
361
+ children?: PptShapeModel[];
362
+ raw?: {
363
+ slidePath?: string;
364
+ relationshipId?: string;
365
+ hostType?: string;
366
+ presetGeometry?: string;
367
+ presetAdjustments?: Record<string, number>;
368
+ customGeometry?: PptCustomGeometryModel;
369
+ threeD?: PptShape3dModel;
370
+ groupTransform?: PptGroupTransformModel;
371
+ useBackgroundFill?: boolean;
372
+ };
373
+ }
374
+ interface PptGroupTransformModel {
375
+ childLeft?: number;
376
+ childTop?: number;
377
+ childWidth?: number;
378
+ childHeight?: number;
379
+ }
380
+ interface PptSlideModel {
381
+ id: string;
382
+ index: number;
383
+ name?: string;
384
+ title?: string;
385
+ relationshipId?: string;
386
+ path?: string;
387
+ layoutId?: string;
388
+ layout?: PptSlideLayoutModel;
389
+ notes?: PptSlideNotesModel;
390
+ comments?: PptCommentModel[];
391
+ transition?: PptSlideTransitionModel;
392
+ timing?: PptSlideTimingModel;
393
+ background?: PptSlideBackgroundModel;
394
+ shapes: PptShapeModel[];
395
+ }
396
+ interface PptSlideLayoutModel {
397
+ relationshipId?: string;
398
+ path?: string;
399
+ name?: string;
400
+ background?: PptSlideBackgroundModel;
401
+ shapes?: PptShapeModel[];
402
+ master?: PptSlideMasterModel;
403
+ }
404
+ interface PptSlideMasterModel {
405
+ relationshipId?: string;
406
+ path?: string;
407
+ name?: string;
408
+ background?: PptSlideBackgroundModel;
409
+ shapes?: PptShapeModel[];
410
+ theme?: PptThemeModel;
411
+ }
412
+ interface PptSlideNotesModel {
413
+ text: string;
414
+ }
415
+ interface PptCommentModel {
416
+ id?: string;
417
+ authorId?: string;
418
+ author?: string;
419
+ initials?: string;
420
+ date?: string;
421
+ text: string;
422
+ x?: number;
423
+ y?: number;
424
+ }
425
+ interface PptCommentAddOptions {
426
+ text: string;
427
+ author?: string;
428
+ initials?: string;
429
+ date?: string;
430
+ x?: number;
431
+ y?: number;
432
+ }
433
+ interface PptSlideTransitionModel {
434
+ type?: string;
435
+ speed?: string;
436
+ duration?: number;
437
+ advanceOnClick?: boolean;
438
+ advanceAfterTime?: number;
439
+ attributes?: Record<string, string>;
440
+ }
441
+ interface PptSlideTimingModel {
442
+ hasTiming: boolean;
443
+ timeNodeCount: number;
444
+ mainSequenceCount: number;
445
+ interactiveSequenceCount: number;
446
+ rootDuration?: string;
447
+ rootNodeType?: string;
448
+ }
449
+ interface PptMediaModel {
450
+ path: string;
451
+ contentType: string;
452
+ byteLength: number;
453
+ }
454
+ interface PptExportedImage extends PptMediaModel {
455
+ bytes: Uint8Array;
456
+ }
457
+ interface PptFontModel {
458
+ family: string;
459
+ path: string;
460
+ contentType: string;
461
+ byteLength: number;
462
+ weight?: number;
463
+ style?: 'normal' | 'italic';
464
+ }
465
+ interface PptExportedFont extends PptFontModel {
466
+ bytes: Uint8Array;
467
+ }
468
+ interface PptPresentationModel {
469
+ id?: string;
470
+ title?: string;
471
+ slideSize?: PptSlideSize;
472
+ slides: PptSlideModel[];
473
+ media?: PptMediaModel[];
474
+ fonts?: PptFontModel[];
475
+ themes?: PptThemeModel[];
476
+ }
477
+ interface PptPresentationProperties {
478
+ presentationId?: string;
479
+ slideCount: number;
480
+ shapeCount: number;
481
+ textShapeCount: number;
482
+ tableCount: number;
483
+ pictureCount: number;
484
+ mediaCount: number;
485
+ slideSize?: PptSlideSize;
486
+ }
487
+ interface PptSlideProperties {
488
+ id: string;
489
+ index: number;
490
+ name?: string;
491
+ title?: string;
492
+ shapeCount: number;
493
+ textShapeCount: number;
494
+ tableCount: number;
495
+ pictureCount: number;
496
+ }
497
+ interface PptTextWriteOptions {
498
+ preserveFirstRunStyle?: boolean;
499
+ }
500
+ interface PptTextReplaceOptions extends PptTextWriteOptions {
501
+ caseSensitive?: boolean;
502
+ }
503
+ interface PptTextReplaceResult {
504
+ count: number;
505
+ }
506
+ interface PptFindTextOptions {
507
+ caseSensitive?: boolean;
508
+ }
509
+ interface PptTextMatch {
510
+ slideId: string;
511
+ slideIndex: number;
512
+ shapeId: string;
513
+ shapeName?: string;
514
+ source: 'shapeText' | 'tableCell';
515
+ text: string;
516
+ start: number;
517
+ length: number;
518
+ row?: number;
519
+ column?: number;
520
+ }
521
+ type PptImageSource = Uint8Array | ArrayBuffer | {
522
+ bytes: Uint8Array | ArrayBuffer;
523
+ mimeType?: string;
524
+ filename?: string;
525
+ } | {
526
+ base64: string;
527
+ mimeType?: string;
528
+ filename?: string;
529
+ };
530
+ interface PptImageInfo {
531
+ relationshipId?: string;
532
+ targetPath?: string;
533
+ contentType?: string;
534
+ filename?: string;
535
+ byteLength?: number;
536
+ }
537
+ interface PptImageReplaceOptions {
538
+ mimeType?: string;
539
+ filename?: string;
540
+ }
541
+ type PresentationRuntimeMode = 'auto' | 'inline' | 'worker';
542
+ interface PresentationLoadOptions {
543
+ presentationId?: string;
544
+ mode?: PresentationRuntimeMode;
545
+ onModeResolved?: (decision: {
546
+ mode: 'inline' | 'worker';
547
+ source: string;
548
+ }, presentationId: string) => void;
549
+ }
550
+
551
+ type PptMutation = {
552
+ type: 'shape.add';
553
+ slideId: string;
554
+ shapeId: string;
555
+ kind: PptShapeKind;
556
+ imageRef?: string;
557
+ } | {
558
+ type: 'shape.delete';
559
+ slideId: string;
560
+ shapeId: string;
561
+ } | {
562
+ type: 'shape.name.set';
563
+ slideId: string;
564
+ shapeId: string;
565
+ name: string;
566
+ } | {
567
+ type: 'shape.zOrder.set';
568
+ slideId: string;
569
+ shapeId: string;
570
+ position: 'front' | 'back';
571
+ } | {
572
+ type: 'shape.geometry.set';
573
+ slideId: string;
574
+ shapeId: string;
575
+ geometry: Partial<PptShapeGeometry>;
576
+ } | {
577
+ type: 'shape.style.set';
578
+ slideId: string;
579
+ shapeId: string;
580
+ style: Partial<PptShapeStyle>;
581
+ } | {
582
+ type: 'shape.hyperlink.set';
583
+ slideId: string;
584
+ shapeId: string;
585
+ hyperlink: PptHyperlinkWriteOptions;
586
+ } | {
587
+ type: 'shape.hyperlink.clear';
588
+ slideId: string;
589
+ shapeId: string;
590
+ } | {
591
+ type: 'shape.text.set';
592
+ slideId: string;
593
+ shapeId: string;
594
+ text: string;
595
+ } | {
596
+ type: 'shape.text.style.set';
597
+ slideId: string;
598
+ shapeId: string;
599
+ style: Partial<PptTextStyle>;
600
+ } | {
601
+ type: 'shape.text.body.set';
602
+ slideId: string;
603
+ shapeId: string;
604
+ body: Partial<PptTextBodyProperties>;
605
+ } | {
606
+ type: 'shape.text.paragraphs.set';
607
+ slideId: string;
608
+ shapeId: string;
609
+ paragraphs: PptTextParagraphWrite[];
610
+ } | {
611
+ type: 'shape.text.run.style.set';
612
+ slideId: string;
613
+ shapeId: string;
614
+ runIndex: number;
615
+ style: Partial<PptTextStyle>;
616
+ } | {
617
+ type: 'shape.text.run.hyperlink.set';
618
+ slideId: string;
619
+ shapeId: string;
620
+ runIndex: number;
621
+ hyperlink: PptHyperlinkWriteOptions;
622
+ } | {
623
+ type: 'shape.text.run.hyperlink.clear';
624
+ slideId: string;
625
+ shapeId: string;
626
+ runIndex: number;
627
+ } | {
628
+ type: 'shape.text.replace';
629
+ slideId: string;
630
+ shapeId: string;
631
+ search: string;
632
+ replacement: string;
633
+ count: number;
634
+ } | {
635
+ type: 'slide.notes.set';
636
+ slideId: string;
637
+ text: string;
638
+ } | {
639
+ type: 'slide.notes.clear';
640
+ slideId: string;
641
+ } | {
642
+ type: 'slide.comment.add';
643
+ slideId: string;
644
+ comment: PptCommentAddOptions;
645
+ } | {
646
+ type: 'slide.comment.delete';
647
+ slideId: string;
648
+ commentId: string;
649
+ } | {
650
+ type: 'slide.comments.clear';
651
+ slideId: string;
652
+ } | {
653
+ type: 'shape.chart.data.set';
654
+ slideId: string;
655
+ shapeId: string;
656
+ data: PptChartData;
657
+ } | {
658
+ type: 'shape.image.replace';
659
+ slideId: string;
660
+ shapeId: string;
661
+ imageRef: string;
662
+ } | {
663
+ type: 'shape.image.style.set';
664
+ slideId: string;
665
+ shapeId: string;
666
+ style: Partial<PptImageStyle>;
667
+ } | {
668
+ type: 'table.cell.text.set';
669
+ slideId: string;
670
+ shapeId: string;
671
+ row: number;
672
+ column: number;
673
+ text: string;
674
+ } | {
675
+ type: 'table.cell.style.set';
676
+ slideId: string;
677
+ shapeId: string;
678
+ row: number;
679
+ column: number;
680
+ style: Partial<PptTableCellStyle>;
681
+ } | {
682
+ type: 'table.cell.text.paragraphs.set';
683
+ slideId: string;
684
+ shapeId: string;
685
+ row: number;
686
+ column: number;
687
+ paragraphs: PptTextParagraphWrite[];
688
+ } | {
689
+ type: 'table.cell.text.run.style.set';
690
+ slideId: string;
691
+ shapeId: string;
692
+ row: number;
693
+ column: number;
694
+ runIndex: number;
695
+ style: Partial<PptTextStyle>;
696
+ } | {
697
+ type: 'table.values.set';
698
+ slideId: string;
699
+ shapeId: string;
700
+ values: string[][];
701
+ } | {
702
+ type: 'table.row.add';
703
+ slideId: string;
704
+ shapeId: string;
705
+ index: number;
706
+ values: string[];
707
+ } | {
708
+ type: 'table.row.delete';
709
+ slideId: string;
710
+ shapeId: string;
711
+ index: number;
712
+ } | {
713
+ type: 'table.column.add';
714
+ slideId: string;
715
+ shapeId: string;
716
+ index: number;
717
+ values: string[];
718
+ } | {
719
+ type: 'table.column.delete';
720
+ slideId: string;
721
+ shapeId: string;
722
+ index: number;
723
+ };
724
+ declare class PptMutationLog {
725
+ private readonly items;
726
+ record(mutation: PptMutation): void;
727
+ list(): PptMutation[];
728
+ clear(): void;
729
+ }
730
+
731
+ interface PptRelationship {
732
+ id: string;
733
+ type: string;
734
+ target: string;
735
+ targetMode?: string;
736
+ }
737
+
738
+ interface PptShapeInternal {
739
+ slide: PptSlideInternal;
740
+ model: PptShapeModel;
741
+ element: Element;
742
+ textElements: Element[];
743
+ tableCells: Element[][];
744
+ children: PptShapeInternal[];
745
+ }
746
+ interface PptSlideInternal {
747
+ model: PptSlideModel;
748
+ part: Part;
749
+ relationships: Map<string, PptRelationship>;
750
+ shapes: PptShapeInternal[];
751
+ }
752
+ interface PptReadResult {
753
+ model: PptPresentationModel;
754
+ presentationPart: Part;
755
+ slides: PptSlideInternal[];
756
+ }
757
+
758
+ interface PresentationCoreLoadOptions {
759
+ presentationId?: string;
760
+ }
761
+ declare class PresentationCore {
762
+ readonly presentationId: string;
763
+ readonly slides: SlideCollectionCore;
764
+ readonly themes: PresentationThemeCollectionCore;
765
+ private readonly pkg;
766
+ private read;
767
+ private readonly mutations;
768
+ private constructor();
769
+ static fromZip(bytes: Uint8Array | ArrayBuffer, opts?: PresentationCoreLoadOptions): Promise<PresentationCore>;
770
+ static fromPackage(pkg: Package, opts?: PresentationCoreLoadOptions): PresentationCore;
771
+ static fromModel(model: PptPresentationModel, opts?: PresentationCoreLoadOptions): PresentationCore;
772
+ toModel(): PptPresentationModel;
773
+ properties(): PptPresentationProperties;
774
+ getMutations(): PptMutation[];
775
+ clearMutations(): void;
776
+ findText(query: string | RegExp, options?: PptFindTextOptions): PptTextMatch[];
777
+ replaceText(search: string | RegExp, replacement: string, options?: PptTextReplaceOptions): PptTextReplaceResult;
778
+ exportImages(): PptExportedImage[];
779
+ exportFonts(): PptExportedFont[];
780
+ toZip(): Promise<Uint8Array>;
781
+ _slides(): PptSlideModel[];
782
+ _getSlide(indexOrId: number | string): PptSlideModel | null;
783
+ _getSlideInternal(slideId: string): PptReadResult['slides'][number] | null;
784
+ _record(mutation: PptMutation): void;
785
+ _package(): Package;
786
+ _reloadFromPackage(): void;
787
+ }
788
+ declare class PresentationThemeCollectionCore {
789
+ private readonly presentation;
790
+ constructor(presentation: PresentationCore);
791
+ items(): PptThemeModel[];
792
+ getCount(): number;
793
+ }
794
+ declare class SlideCollectionCore {
795
+ private readonly presentation;
796
+ constructor(presentation: PresentationCore);
797
+ items(): SlideCore[];
798
+ getCount(): number;
799
+ getItem(indexOrId: number | string): SlideCore;
800
+ getItemOrNullObject(indexOrId: number | string): SlideCore | null;
801
+ add(options?: PptSlideAddOptions): SlideCore;
802
+ copy(indexOrId: number | string, options?: PptSlideCopyOptions): SlideCore;
803
+ move(indexOrId: number | string, toIndex: number): void;
804
+ deleteItem(indexOrId: number | string): void;
805
+ }
806
+ interface PptSlideAddOptions {
807
+ index?: number | 'end';
808
+ title?: string;
809
+ }
810
+ interface PptSlideCopyOptions {
811
+ index?: number | 'end';
812
+ }
813
+ interface PptShapeAddOptions {
814
+ name?: string;
815
+ geometry?: Partial<PptShapeGeometry>;
816
+ }
817
+ interface PptTableAddOptions extends PptShapeAddOptions {
818
+ values?: string[][];
819
+ }
820
+ interface PptImageAddOptions extends PptShapeAddOptions {
821
+ mimeType?: string;
822
+ filename?: string;
823
+ }
824
+ interface PptShapeDuplicateOptions extends PptShapeAddOptions {
825
+ }
826
+ type PptPresetShape = 'rect' | 'roundRect' | 'ellipse' | 'line';
827
+ declare class SlideCore {
828
+ private readonly presentation;
829
+ private readonly slideId;
830
+ readonly shapes: ShapeCollectionCore;
831
+ readonly notes: SlideNotesApiCore;
832
+ readonly comments: SlideCommentsApiCore;
833
+ constructor(presentation: PresentationCore, slideId: string);
834
+ id(): string;
835
+ index(): number;
836
+ name(): string | undefined;
837
+ title(): string | undefined;
838
+ layout(): PptSlideLayoutModel | null;
839
+ transition(): PptSlideTransitionModel | null;
840
+ timing(): PptSlideTimingModel | null;
841
+ properties(): PptSlideProperties;
842
+ setTitle(text: string, opts?: PptTextWriteOptions): void;
843
+ findText(query: string | RegExp, options?: PptFindTextOptions): PptTextMatch[];
844
+ replaceText(search: string | RegExp, replacement: string, options?: PptTextReplaceOptions): PptTextReplaceResult;
845
+ duplicate(options?: PptSlideCopyOptions): SlideCore;
846
+ moveTo(index: number): void;
847
+ delete(): void;
848
+ toModel(): PptSlideModel;
849
+ private model;
850
+ }
851
+ declare class SlideNotesApiCore {
852
+ private readonly presentation;
853
+ private readonly slideId;
854
+ constructor(presentation: PresentationCore, slideId: string);
855
+ hasText(): boolean;
856
+ getText(): string;
857
+ setText(text: string): void;
858
+ clear(): void;
859
+ private model;
860
+ private internal;
861
+ }
862
+ declare class SlideCommentsApiCore {
863
+ private readonly presentation;
864
+ private readonly slideId;
865
+ constructor(presentation: PresentationCore, slideId: string);
866
+ items(): PptCommentModel[];
867
+ getCount(): number;
868
+ add(options: PptCommentAddOptions): PptCommentModel;
869
+ delete(commentId: string): void;
870
+ clear(): void;
871
+ private model;
872
+ private internal;
873
+ }
874
+ declare class ShapeCollectionCore {
875
+ private readonly presentation;
876
+ private readonly slideId;
877
+ private readonly parentShapeId?;
878
+ constructor(presentation: PresentationCore, slideId: string, parentShapeId?: string | undefined);
879
+ items(): ShapeCore[];
880
+ getCount(): number;
881
+ getItem(idOrName: string): ShapeCore;
882
+ getItemAt(index: number): ShapeCore;
883
+ getItemOrNullObject(idOrName: string): ShapeCore | null;
884
+ addTextBox(text: string, options?: PptShapeAddOptions): ShapeCore;
885
+ addTable(rowCount: number, columnCount: number, options?: PptTableAddOptions): ShapeCore;
886
+ addImage(source: PptImageSource, options?: PptImageAddOptions): ShapeCore;
887
+ addShape(preset: PptPresetShape, options?: PptShapeAddOptions): ShapeCore;
888
+ deleteItem(idOrName: string): void;
889
+ private slideModel;
890
+ private shapeModels;
891
+ }
892
+ declare class ShapeCore {
893
+ private readonly presentation;
894
+ private readonly slideId;
895
+ private readonly shapeId;
896
+ readonly chart: ShapeChartApiCore;
897
+ readonly text: ShapeTextApiCore;
898
+ readonly image: ShapeImageApiCore;
899
+ readonly table: TableApiCore;
900
+ readonly group: ShapeGroupApiCore;
901
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
902
+ id(): string;
903
+ name(): string | undefined;
904
+ setName(name: string): void;
905
+ kind(): PptShapeKind;
906
+ geometry(): PptShapeGeometry;
907
+ style(): PptShapeStyle;
908
+ hyperlink(): PptHyperlinkModel | null;
909
+ setHyperlink(hyperlink: PptHyperlinkWriteOptions): void;
910
+ clearHyperlink(): void;
911
+ setGeometry(geometry: Partial<PptShapeGeometry>): void;
912
+ setFillColor(color: string): void;
913
+ setLineStyle(style: Pick<PptShapeStyle, 'lineColor' | 'lineWidth'>): void;
914
+ setStyle(style: Partial<PptShapeStyle>): void;
915
+ delete(): void;
916
+ duplicate(options?: PptShapeDuplicateOptions): ShapeCore;
917
+ bringToFront(): void;
918
+ sendToBack(): void;
919
+ toModel(): PptShapeModel;
920
+ private model;
921
+ private internal;
922
+ private moveInZOrder;
923
+ }
924
+ declare class ShapeTextApiCore {
925
+ private readonly presentation;
926
+ private readonly slideId;
927
+ private readonly shapeId;
928
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
929
+ hasText(): boolean;
930
+ getText(): string;
931
+ style(): PptTextStyle;
932
+ body(): PptTextBodyProperties;
933
+ paragraphs(): PptTextParagraph[];
934
+ runs(): PptTextRun[];
935
+ setParagraphs(paragraphs: PptTextParagraphWrite[]): void;
936
+ setRunStyle(runIndex: number, style: Partial<PptTextStyle>): void;
937
+ setRunTextStyle(runIndex: number, style: Partial<PptTextStyle>): void;
938
+ setRunHyperlink(runIndex: number, hyperlink: PptHyperlinkWriteOptions): void;
939
+ clearRunHyperlink(runIndex: number): void;
940
+ setText(text: string, opts?: PptTextWriteOptions): void;
941
+ setStyle(style: Partial<PptTextStyle>): void;
942
+ setTextStyle(style: Partial<PptTextStyle>): void;
943
+ setBodyProperties(body: Partial<PptTextBodyProperties>): void;
944
+ setBold(enabled: boolean): void;
945
+ setItalic(enabled: boolean): void;
946
+ setAlignment(alignment: PptTextStyle['alignment']): void;
947
+ replace(search: string | RegExp, replacement: string, opts?: PptTextReplaceOptions): PptTextReplaceResult;
948
+ private internal;
949
+ }
950
+ declare class ShapeChartApiCore {
951
+ private readonly presentation;
952
+ private readonly slideId;
953
+ private readonly shapeId;
954
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
955
+ isChart(): boolean;
956
+ getInfo(): PptChartModel | null;
957
+ getData(): PptChartData | null;
958
+ setData(data: PptChartData): void;
959
+ private internal;
960
+ private chartPart;
961
+ }
962
+ declare class ShapeGroupApiCore {
963
+ private readonly presentation;
964
+ private readonly slideId;
965
+ private readonly shapeId;
966
+ private readonly children;
967
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
968
+ isGroup(): boolean;
969
+ items(): ShapeCore[];
970
+ getCount(): number;
971
+ getItem(idOrName: string): ShapeCore;
972
+ getItemAt(index: number): ShapeCore;
973
+ getItemOrNullObject(idOrName: string): ShapeCore | null;
974
+ private requireGroup;
975
+ private internal;
976
+ }
977
+ declare class ShapeImageApiCore {
978
+ private readonly presentation;
979
+ private readonly slideId;
980
+ private readonly shapeId;
981
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
982
+ isImage(): boolean;
983
+ getInfo(): PptImageInfo | null;
984
+ style(): PptImageStyle;
985
+ setStyle(style: Partial<PptImageStyle>): void;
986
+ setCrop(crop: PptImageStyle['crop']): void;
987
+ setFillRect(fillRect: PptImageStyle['fillRect']): void;
988
+ setOpacity(opacity: number): void;
989
+ bytes(): Uint8Array;
990
+ replace(source: PptImageSource): void;
991
+ private internal;
992
+ }
993
+ declare class TableApiCore {
994
+ private readonly presentation;
995
+ private readonly slideId;
996
+ private readonly shapeId;
997
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string);
998
+ isTable(): boolean;
999
+ rowCount(): number;
1000
+ columnCount(): number;
1001
+ values(): string[][];
1002
+ hasMergedCells(): boolean;
1003
+ mergedCells(): PptTableCellMerge[];
1004
+ setValues(values: string[][]): void;
1005
+ getCell(row: number, column: number): TableCellCore;
1006
+ setCellText(row: number, column: number, text: string): void;
1007
+ addRow(index?: number | 'end', values?: string[]): void;
1008
+ deleteRow(index: number): void;
1009
+ addColumn(index?: number | 'end', values?: string[]): void;
1010
+ deleteColumn(index: number): void;
1011
+ _cellText(row: number, column: number): string;
1012
+ _cellStyle(row: number, column: number): PptTableCellStyle;
1013
+ _cellParagraphs(row: number, column: number): PptTextParagraph[];
1014
+ _setCellParagraphs(row: number, column: number, paragraphs: PptTextParagraphWrite[]): void;
1015
+ _setCellRunStyle(row: number, column: number, runIndex: number, style: Partial<PptTextStyle>): void;
1016
+ _setCellText(row: number, column: number, text: string): void;
1017
+ _setCellStyle(row: number, column: number, style: Partial<PptTableCellStyle>): void;
1018
+ private writeCellText;
1019
+ private table;
1020
+ private requireCell;
1021
+ private assertNoMergedCells;
1022
+ private assertEditableCell;
1023
+ private internal;
1024
+ }
1025
+ declare class TableCellCore {
1026
+ private readonly presentation;
1027
+ private readonly slideId;
1028
+ private readonly shapeId;
1029
+ private readonly row;
1030
+ private readonly column;
1031
+ constructor(presentation: PresentationCore, slideId: string, shapeId: string, row: number, column: number);
1032
+ text(): string;
1033
+ paragraphs(): PptTextParagraph[];
1034
+ runs(): PptTextRun[];
1035
+ setParagraphs(paragraphs: PptTextParagraphWrite[]): void;
1036
+ setRunStyle(runIndex: number, style: Partial<PptTextStyle>): void;
1037
+ setText(text: string): void;
1038
+ style(): PptTableCellStyle;
1039
+ setStyle(style: Partial<PptTableCellStyle>): void;
1040
+ }
1041
+
1042
+ interface PresentationModeDecision {
1043
+ mode: 'inline' | 'worker';
1044
+ source: 'explicit-inline' | 'explicit-worker' | 'auto/inline';
1045
+ }
1046
+ declare class Presentation {
1047
+ private readonly core;
1048
+ readonly presentationId: string;
1049
+ readonly mode: 'inline' | 'worker';
1050
+ readonly modeSource: PresentationModeDecision['source'];
1051
+ readonly slides: SlideCollection;
1052
+ readonly themes: PresentationThemeCollection;
1053
+ private disposed;
1054
+ private constructor();
1055
+ static fromZip(bytes: Uint8Array | ArrayBuffer, opts?: PresentationLoadOptions): Promise<Presentation>;
1056
+ static fromModel(model: PptPresentationModel, opts?: PresentationLoadOptions): Promise<Presentation>;
1057
+ static createBlank(opts?: PresentationLoadOptions): Promise<Presentation>;
1058
+ toModel(): Promise<PptPresentationModel>;
1059
+ properties(): Promise<PptPresentationProperties>;
1060
+ toZip(): Promise<Uint8Array>;
1061
+ getMutations(): Promise<PptMutation[]>;
1062
+ clearMutations(): Promise<void>;
1063
+ findText(query: string | RegExp, options?: PptFindTextOptions): Promise<PptTextMatch[]>;
1064
+ replaceText(search: string | RegExp, replacement: string, options?: PptTextReplaceOptions): Promise<PptTextReplaceResult>;
1065
+ exportImages(): Promise<PptExportedImage[]>;
1066
+ exportFonts(): Promise<PptExportedFont[]>;
1067
+ executeCode<T = unknown>(): Promise<T>;
1068
+ dispose(): Promise<void>;
1069
+ private assertNotDisposed;
1070
+ }
1071
+ declare class PresentationThemeCollection {
1072
+ private readonly core;
1073
+ constructor(core: PresentationThemeCollectionCore);
1074
+ items(): Promise<PptThemeModel[]>;
1075
+ getCount(): Promise<number>;
1076
+ }
1077
+ declare class SlideCollection {
1078
+ private readonly core;
1079
+ constructor(core: SlideCollectionCore);
1080
+ items(): Promise<Slide[]>;
1081
+ getCount(): Promise<number>;
1082
+ getItem(indexOrId: number | string): Slide;
1083
+ getItemOrNullObject(indexOrId: number | string): Promise<Slide | null>;
1084
+ add(options?: PptSlideAddOptions): Promise<Slide>;
1085
+ copy(indexOrId: number | string, options?: PptSlideCopyOptions): Promise<Slide>;
1086
+ move(indexOrId: number | string, toIndex: number): Promise<void>;
1087
+ deleteItem(indexOrId: number | string): Promise<void>;
1088
+ }
1089
+ declare class Slide {
1090
+ private readonly core;
1091
+ readonly shapes: ShapeCollection;
1092
+ readonly notes: SlideNotesApi;
1093
+ readonly comments: SlideCommentsApi;
1094
+ constructor(core: SlideCore);
1095
+ id(): Promise<string>;
1096
+ index(): Promise<number>;
1097
+ name(): Promise<string | undefined>;
1098
+ title(): Promise<string | undefined>;
1099
+ layout(): Promise<PptSlideLayoutModel | null>;
1100
+ transition(): Promise<PptSlideTransitionModel | null>;
1101
+ timing(): Promise<PptSlideTimingModel | null>;
1102
+ properties(): Promise<PptSlideProperties>;
1103
+ setTitle(text: string, opts?: PptTextWriteOptions): Promise<void>;
1104
+ findText(query: string | RegExp, options?: PptFindTextOptions): Promise<PptTextMatch[]>;
1105
+ replaceText(search: string | RegExp, replacement: string, options?: PptTextReplaceOptions): Promise<PptTextReplaceResult>;
1106
+ duplicate(options?: PptSlideCopyOptions): Promise<Slide>;
1107
+ moveTo(index: number): Promise<void>;
1108
+ delete(): Promise<void>;
1109
+ toModel(): Promise<PptSlideModel>;
1110
+ }
1111
+ declare class SlideNotesApi {
1112
+ private readonly core;
1113
+ constructor(core: SlideNotesApiCore);
1114
+ hasText(): Promise<boolean>;
1115
+ getText(): Promise<string>;
1116
+ setText(text: string): Promise<void>;
1117
+ clear(): Promise<void>;
1118
+ }
1119
+ declare class SlideCommentsApi {
1120
+ private readonly core;
1121
+ constructor(core: SlideCommentsApiCore);
1122
+ items(): Promise<PptCommentModel[]>;
1123
+ getCount(): Promise<number>;
1124
+ add(options: PptCommentAddOptions): Promise<PptCommentModel>;
1125
+ delete(commentId: string): Promise<void>;
1126
+ clear(): Promise<void>;
1127
+ }
1128
+ declare class ShapeCollection {
1129
+ private readonly core;
1130
+ constructor(core: ShapeCollectionCore);
1131
+ items(): Promise<Shape[]>;
1132
+ getCount(): Promise<number>;
1133
+ getItem(idOrName: string): Shape;
1134
+ getItemAt(index: number): Shape;
1135
+ getItemOrNullObject(idOrName: string): Promise<Shape | null>;
1136
+ addTextBox(text: string, options?: PptShapeAddOptions): Promise<Shape>;
1137
+ addTable(rowCount: number, columnCount: number, options?: PptTableAddOptions): Promise<Shape>;
1138
+ addImage(source: PptImageSource, options?: PptImageAddOptions): Promise<Shape>;
1139
+ addShape(preset: PptPresetShape, options?: PptShapeAddOptions): Promise<Shape>;
1140
+ deleteItem(idOrName: string): Promise<void>;
1141
+ }
1142
+ declare class Shape {
1143
+ private readonly core;
1144
+ readonly chart: ShapeChartApi;
1145
+ readonly text: ShapeTextApi;
1146
+ readonly image: ShapeImageApi;
1147
+ readonly table: TableApi;
1148
+ readonly group: ShapeGroupApi;
1149
+ constructor(core: ShapeCore);
1150
+ id(): Promise<string>;
1151
+ name(): Promise<string | undefined>;
1152
+ setName(name: string): Promise<void>;
1153
+ kind(): Promise<PptShapeKind>;
1154
+ geometry(): Promise<PptShapeGeometry>;
1155
+ style(): Promise<PptShapeStyle>;
1156
+ hyperlink(): Promise<PptHyperlinkModel | null>;
1157
+ setHyperlink(hyperlink: PptHyperlinkWriteOptions): Promise<void>;
1158
+ clearHyperlink(): Promise<void>;
1159
+ setGeometry(geometry: Partial<PptShapeGeometry>): Promise<void>;
1160
+ setFillColor(color: string): Promise<void>;
1161
+ setLineStyle(style: Pick<PptShapeStyle, 'lineColor' | 'lineWidth'>): Promise<void>;
1162
+ setStyle(style: Partial<PptShapeStyle>): Promise<void>;
1163
+ delete(): Promise<void>;
1164
+ duplicate(options?: PptShapeDuplicateOptions): Promise<Shape>;
1165
+ bringToFront(): Promise<void>;
1166
+ sendToBack(): Promise<void>;
1167
+ toModel(): Promise<PptShapeModel>;
1168
+ }
1169
+ declare class ShapeChartApi {
1170
+ private readonly core;
1171
+ constructor(core: ShapeChartApiCore);
1172
+ isChart(): Promise<boolean>;
1173
+ getInfo(): Promise<PptChartModel | null>;
1174
+ getData(): Promise<PptChartData | null>;
1175
+ setData(data: PptChartData): Promise<void>;
1176
+ }
1177
+ declare class ShapeGroupApi {
1178
+ private readonly core;
1179
+ constructor(core: ShapeGroupApiCore);
1180
+ isGroup(): Promise<boolean>;
1181
+ items(): Promise<Shape[]>;
1182
+ getCount(): Promise<number>;
1183
+ getItem(idOrName: string): Shape;
1184
+ getItemAt(index: number): Shape;
1185
+ getItemOrNullObject(idOrName: string): Promise<Shape | null>;
1186
+ }
1187
+ declare class ShapeTextApi {
1188
+ private readonly core;
1189
+ constructor(core: ShapeTextApiCore);
1190
+ hasText(): Promise<boolean>;
1191
+ getText(): Promise<string>;
1192
+ style(): Promise<PptTextStyle>;
1193
+ body(): Promise<PptTextBodyProperties>;
1194
+ paragraphs(): Promise<PptTextParagraph[]>;
1195
+ runs(): Promise<PptTextRun[]>;
1196
+ setParagraphs(paragraphs: PptTextParagraphWrite[]): Promise<void>;
1197
+ setRunStyle(runIndex: number, style: Partial<PptTextStyle>): Promise<void>;
1198
+ setRunTextStyle(runIndex: number, style: Partial<PptTextStyle>): Promise<void>;
1199
+ setRunHyperlink(runIndex: number, hyperlink: PptHyperlinkWriteOptions): Promise<void>;
1200
+ clearRunHyperlink(runIndex: number): Promise<void>;
1201
+ setText(text: string, opts?: PptTextWriteOptions): Promise<void>;
1202
+ setStyle(style: Partial<PptTextStyle>): Promise<void>;
1203
+ setTextStyle(style: Partial<PptTextStyle>): Promise<void>;
1204
+ setBodyProperties(body: Partial<PptTextBodyProperties>): Promise<void>;
1205
+ setBold(enabled: boolean): Promise<void>;
1206
+ setItalic(enabled: boolean): Promise<void>;
1207
+ setAlignment(alignment: PptParagraphAlignment): Promise<void>;
1208
+ replace(search: string | RegExp, replacement: string, opts?: PptTextReplaceOptions): Promise<PptTextReplaceResult>;
1209
+ }
1210
+ declare class ShapeImageApi {
1211
+ private readonly core;
1212
+ constructor(core: ShapeImageApiCore);
1213
+ isImage(): Promise<boolean>;
1214
+ getInfo(): Promise<PptImageInfo | null>;
1215
+ style(): Promise<PptImageStyle>;
1216
+ setStyle(style: Partial<PptImageStyle>): Promise<void>;
1217
+ setCrop(crop: PptImageCropModel): Promise<void>;
1218
+ setFillRect(fillRect: PptImageCropModel): Promise<void>;
1219
+ setOpacity(opacity: number): Promise<void>;
1220
+ bytes(): Promise<Uint8Array>;
1221
+ replace(source: PptImageSource): Promise<void>;
1222
+ }
1223
+ declare class TableApi {
1224
+ private readonly core;
1225
+ constructor(core: TableApiCore);
1226
+ isTable(): Promise<boolean>;
1227
+ rowCount(): Promise<number>;
1228
+ columnCount(): Promise<number>;
1229
+ values(): Promise<string[][]>;
1230
+ hasMergedCells(): Promise<boolean>;
1231
+ mergedCells(): Promise<PptTableCellMerge[]>;
1232
+ setValues(values: string[][]): Promise<void>;
1233
+ setCellText(row: number, column: number, text: string): Promise<void>;
1234
+ addRow(index?: number | 'end', values?: string[]): Promise<void>;
1235
+ deleteRow(index: number): Promise<void>;
1236
+ addColumn(index?: number | 'end', values?: string[]): Promise<void>;
1237
+ deleteColumn(index: number): Promise<void>;
1238
+ getCell(row: number, column: number): TableCell;
1239
+ }
1240
+ declare class TableCell {
1241
+ private readonly core;
1242
+ constructor(core: TableCellCore);
1243
+ text(): Promise<string>;
1244
+ paragraphs(): Promise<PptTextParagraph[]>;
1245
+ runs(): Promise<PptTextRun[]>;
1246
+ setParagraphs(paragraphs: PptTextParagraphWrite[]): Promise<void>;
1247
+ setRunStyle(runIndex: number, style: Partial<PptTextStyle>): Promise<void>;
1248
+ setText(text: string): Promise<void>;
1249
+ style(): Promise<PptTableCellStyle>;
1250
+ setStyle(style: Partial<PptTableCellStyle>): Promise<void>;
1251
+ }
1252
+
1253
+ /** Receivers exposed inside Presentation CodePlan scripts. */
1254
+ interface PptScriptApiReceiverMap {
1255
+ presentation: Presentation;
1256
+ 'presentation.slides': SlideCollection;
1257
+ 'presentation.themes': PresentationThemeCollection;
1258
+ slide: Slide;
1259
+ 'slide.shapes': ShapeCollection;
1260
+ 'slide.notes': SlideNotesApi;
1261
+ 'slide.comments': SlideCommentsApi;
1262
+ shape: Shape;
1263
+ 'shape.text': ShapeTextApi;
1264
+ 'shape.image': ShapeImageApi;
1265
+ 'shape.table': TableApi;
1266
+ 'shape.chart': ShapeChartApi;
1267
+ 'shape.group': ShapeGroupApi;
1268
+ cell: TableCell;
1269
+ }
1270
+ type PptScriptApiReceiver = keyof PptScriptApiReceiverMap;
1271
+ type MethodName<T> = {
1272
+ [K in keyof T]-?: T[K] extends (...args: never[]) => unknown ? K : never;
1273
+ }[keyof T] & string;
1274
+ /** Type-safe receiver-qualified method path for the asynchronous PPT script runtime. */
1275
+ type PptScriptApiPath = {
1276
+ [R in PptScriptApiReceiver]: `${R}.${MethodName<PptScriptApiReceiverMap[R]>}`;
1277
+ }[PptScriptApiReceiver];
1278
+
1279
+ declare function createPresentationPackageFromModel(model: PptPresentationModel): Package;
1280
+
1281
+ type PptWritebackStrategy = 'no-op' | 'presentation-package-replace' | 'slide-package-replace' | 'mutation-replay' | 'unsupported';
1282
+ type PptWritebackPreference = 'auto' | 'package' | 'slide-package' | 'mutation';
1283
+ interface PptWritebackCapabilities {
1284
+ /** Host can replace the active presentation with a full pptx package. */
1285
+ canReplacePresentationPackage?: boolean;
1286
+ /** Host can replace an existing slide from a generated slide/package payload. */
1287
+ canReplaceSlides?: boolean;
1288
+ /** Host can insert new slides from a generated slide/package payload. */
1289
+ canInsertSlides?: boolean;
1290
+ /** Host can delete slides. */
1291
+ canDeleteSlides?: boolean;
1292
+ /** Host can reorder slides. */
1293
+ canReorderSlides?: boolean;
1294
+ /** Host can replay SDK mutation records through live host APIs. */
1295
+ canReplayMutations?: boolean;
1296
+ /** Optional allow-list for mutation replay. Missing means every mutation type is accepted by the planner. */
1297
+ supportedMutationTypes?: PptMutation['type'][];
1298
+ /** Upper bound for replay operation count before planner should prefer package replacement. */
1299
+ maxMutationCount?: number;
1300
+ }
1301
+ interface PptWritebackPlanOptions {
1302
+ preference?: PptWritebackPreference;
1303
+ mutations?: PptMutation[];
1304
+ }
1305
+ type PptDeckDiffKind = 'added' | 'deleted' | 'modified';
1306
+ type PptShapeDiffKind = 'added' | 'deleted' | 'modified';
1307
+ interface PptShapeDiff {
1308
+ kind: PptShapeDiffKind;
1309
+ shapeId: string;
1310
+ beforeName?: string;
1311
+ afterName?: string;
1312
+ beforeKind?: PptShapeModel['kind'];
1313
+ afterKind?: PptShapeModel['kind'];
1314
+ before?: PptShapeModel;
1315
+ after?: PptShapeModel;
1316
+ }
1317
+ interface PptSlideDiff {
1318
+ kind: PptDeckDiffKind;
1319
+ slideId: string;
1320
+ beforeIndex?: number;
1321
+ afterIndex?: number;
1322
+ beforeTitle?: string;
1323
+ afterTitle?: string;
1324
+ moved: boolean;
1325
+ propertiesChanged: boolean;
1326
+ shapeOrderChanged: boolean;
1327
+ shapeChanges: PptShapeDiff[];
1328
+ before?: PptSlideModel;
1329
+ after?: PptSlideModel;
1330
+ }
1331
+ interface PptPresentationDiff {
1332
+ changed: boolean;
1333
+ presentationPropertiesChanged: boolean;
1334
+ slideSizeChanged: boolean;
1335
+ mediaChanged: boolean;
1336
+ slides: PptSlideDiff[];
1337
+ }
1338
+ type PptWritebackOperation = {
1339
+ type: 'replacePresentationPackage';
1340
+ } | {
1341
+ type: 'replaceSlidePackage';
1342
+ slideId: string;
1343
+ slideIndex: number;
1344
+ targetSlide: PptSlideModel;
1345
+ } | {
1346
+ type: 'insertSlidePackage';
1347
+ slideId: string;
1348
+ slideIndex: number;
1349
+ targetSlide: PptSlideModel;
1350
+ } | {
1351
+ type: 'deleteSlide';
1352
+ slideId: string;
1353
+ slideIndex: number;
1354
+ } | {
1355
+ type: 'moveSlide';
1356
+ slideId: string;
1357
+ fromIndex: number;
1358
+ toIndex: number;
1359
+ } | {
1360
+ type: 'replayMutations';
1361
+ mutations: PptMutation[];
1362
+ };
1363
+ interface PptWritebackPlan {
1364
+ strategy: PptWritebackStrategy;
1365
+ diff: PptPresentationDiff;
1366
+ operations: PptWritebackOperation[];
1367
+ warnings: string[];
1368
+ unsupportedReasons: string[];
1369
+ }
1370
+ declare function diffPptPresentationModels(before: PptPresentationModel, after: PptPresentationModel): PptPresentationDiff;
1371
+ declare function planPptWriteback(before: PptPresentationModel, after: PptPresentationModel, capabilities: PptWritebackCapabilities, options?: PptWritebackPlanOptions): PptWritebackPlan;
1372
+
1373
+ type PptHostKind = 'microsoft-powerpoint' | 'wps-presentation' | 'onlyoffice-presentation' | 'desktop-package' | 'custom';
1374
+ type PptHostCapabilityStatus = 'unproven' | 'probed' | 'supported';
1375
+ interface PptHostWritebackProfile {
1376
+ host: PptHostKind;
1377
+ status: PptHostCapabilityStatus;
1378
+ capabilities: PptWritebackCapabilities;
1379
+ notes: string[];
1380
+ }
1381
+ interface PptHostWritebackProfileOptions {
1382
+ capabilities?: PptWritebackCapabilities;
1383
+ notes?: string[];
1384
+ status?: PptHostCapabilityStatus;
1385
+ }
1386
+ interface PptWritebackPlanValidation {
1387
+ ok: boolean;
1388
+ unsupportedReasons: string[];
1389
+ warnings: string[];
1390
+ }
1391
+ type PptHostProbeCheckName = 'package.replace' | 'slide.replace' | 'slide.insert' | 'slide.delete' | 'slide.reorder' | 'shape.add' | 'shape.delete' | 'shape.name.write' | 'shape.zOrder.write' | 'shape.geometry.write' | 'shape.style.write' | 'text.write' | 'text.style.write' | 'image.write' | 'table.cell.write' | 'table.cell.style.write' | 'table.values.write' | 'table.structure.write' | 'save.freshness';
1392
+ interface PptHostProbeCheck {
1393
+ name: PptHostProbeCheckName;
1394
+ passed: boolean;
1395
+ message?: string;
1396
+ details?: Record<string, unknown>;
1397
+ }
1398
+ interface PptHostProbeReport {
1399
+ host: PptHostKind;
1400
+ generatedAt?: string;
1401
+ adapterVersion?: string;
1402
+ checks: PptHostProbeCheck[];
1403
+ maxMutationCount?: number;
1404
+ notes?: string[];
1405
+ }
1406
+ interface PptHostProbeSummary {
1407
+ host: PptHostKind;
1408
+ passed: PptHostProbeCheckName[];
1409
+ failed: PptHostProbeCheckName[];
1410
+ capabilities: PptWritebackCapabilities;
1411
+ notes: string[];
1412
+ }
1413
+ interface PptHostProbeAdapter {
1414
+ host: PptHostKind;
1415
+ adapterVersion?: string;
1416
+ runCheck(check: PptHostProbeCheckName): Promise<Omit<PptHostProbeCheck, 'name'> | boolean>;
1417
+ }
1418
+ interface PptHostProbeRunOptions {
1419
+ checks?: PptHostProbeCheckName[];
1420
+ generatedAt?: string;
1421
+ maxMutationCount?: number;
1422
+ notes?: string[];
1423
+ }
1424
+ declare function createPptHostWritebackProfile(host: PptHostKind, options?: PptHostWritebackProfileOptions): PptHostWritebackProfile;
1425
+ declare function runPptHostProbe(adapter: PptHostProbeAdapter, options?: PptHostProbeRunOptions): Promise<PptHostProbeReport>;
1426
+ declare function getDefaultPptHostProbeChecks(host: PptHostKind): PptHostProbeCheckName[];
1427
+ declare function summarizePptHostProbeReport(report: PptHostProbeReport): PptHostProbeSummary;
1428
+ declare function createPptHostWritebackProfileFromProbeReport(report: PptHostProbeReport): PptHostWritebackProfile;
1429
+ declare function getPptWritebackOperationRequirements(operation: PptWritebackOperation): Array<keyof PptWritebackCapabilities>;
1430
+ declare function validatePptWritebackPlan(plan: PptWritebackPlan, profileOrCapabilities: PptHostWritebackProfile | PptWritebackCapabilities): PptWritebackPlanValidation;
1431
+
1432
+ export { type PptChartAxesModel, type PptChartAxisModel, type PptChartData, type PptChartDataLabelLayoutModel, type PptChartLayoutModel, type PptChartMarkerModel, type PptChartModel, type PptChartSeriesData, type PptCommentAddOptions, type PptCommentModel, type PptCustomGeometryCommand, type PptCustomGeometryModel, type PptCustomGeometryPathModel, type PptDeckDiffKind, type PptExportedFont, type PptExportedImage, type PptFindTextOptions, type PptFontModel, type PptGradientFillModel, type PptGroupTransformModel, type PptHostCapabilityStatus, type PptHostKind, type PptHostProbeAdapter, type PptHostProbeCheck, type PptHostProbeCheckName, type PptHostProbeReport, type PptHostProbeRunOptions, type PptHostProbeSummary, type PptHostWritebackProfile, type PptHostWritebackProfileOptions, type PptHyperlinkModel, type PptHyperlinkWriteOptions, type PptImageAddOptions, type PptImageCropModel, type PptImageInfo, type PptImageModel, type PptImageReplaceOptions, type PptImageSource, type PptImageStyle, type PptMediaModel, type PptMutation, PptMutationLog, type PptOleObjectModel, type PptParagraphAlignment, type PptPlaceholderModel, type PptPresentationDiff, type PptPresentationModel, type PptPresentationProperties, type PptPresetShape, type PptScriptApiPath, type PptScriptApiReceiver, type PptScriptApiReceiverMap, type PptShadowModel, type PptShape3dModel, type PptShapeAddOptions, type PptShapeDiff, type PptShapeDiffKind, type PptShapeDuplicateOptions, type PptShapeGeometry, type PptShapeKind, type PptShapeMediaModel, type PptShapeModel, type PptShapeStyle, type PptSlideAddOptions, type PptSlideBackgroundModel, type PptSlideCopyOptions, type PptSlideDiff, type PptSlideLayoutModel, type PptSlideMasterModel, type PptSlideModel, type PptSlideNotesModel, type PptSlideProperties, type PptSlideSize, type PptSlideTimingModel, type PptSlideTransitionModel, type PptSmartArtModel, type PptTableAddOptions, type PptTableCellBorder, type PptTableCellBorders, type PptTableCellMerge, type PptTableCellStyle, type PptTableModel, type PptTextBodyModel, type PptTextBodyProperties, type PptTextMatch, type PptTextParagraph, type PptTextParagraphWrite, type PptTextReplaceOptions, type PptTextReplaceResult, type PptTextRun, type PptTextRunWrite, type PptTextStyle, type PptTextWriteOptions, type PptThemeModel, type PptWritebackCapabilities, type PptWritebackOperation, type PptWritebackPlan, type PptWritebackPlanOptions, type PptWritebackPlanValidation, type PptWritebackPreference, type PptWritebackStrategy, Presentation, PresentationCore, type PresentationLoadOptions, type PresentationModeDecision, type PresentationRuntimeMode, PresentationThemeCollection, PresentationThemeCollectionCore, Shape, ShapeChartApi, ShapeChartApiCore, ShapeCollection, ShapeCollectionCore, ShapeCore, ShapeGroupApi, ShapeGroupApiCore, ShapeImageApi, ShapeImageApiCore, ShapeTextApi, ShapeTextApiCore, Slide, SlideCollection, SlideCollectionCore, SlideCommentsApi, SlideCommentsApiCore, SlideCore, SlideNotesApi, SlideNotesApiCore, TableApi, TableApiCore, TableCell, TableCellCore, createPptHostWritebackProfile, createPptHostWritebackProfileFromProbeReport, createPresentationPackageFromModel, diffPptPresentationModels, getDefaultPptHostProbeChecks, getPptWritebackOperationRequirements, planPptWriteback, runPptHostProbe, summarizePptHostProbeReport, validatePptWritebackPlan };