@8btc/ppt-generator-mcp 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +129 -0
  2. package/dist/export-pptx.d.ts +6 -0
  3. package/dist/export-pptx.js +876 -0
  4. package/dist/generate-ppt-slides.d.ts +10 -0
  5. package/dist/generate-ppt-slides.js +581 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +161 -0
  8. package/dist/ppt-generator.d.ts +39 -0
  9. package/dist/ppt-generator.js +110 -0
  10. package/dist/tpls/imgs.json +482 -0
  11. package/dist/tpls/tpl-1.json +7649 -0
  12. package/dist/tpls/tpl-2.json +7455 -0
  13. package/dist/tpls/tpl-3.json +8184 -0
  14. package/dist/tpls/tpl-4.json +8352 -0
  15. package/dist/types/outline.d.ts +36 -0
  16. package/dist/types/outline.js +2 -0
  17. package/dist/types/slide.d.ts +696 -0
  18. package/dist/types/slide.js +2 -0
  19. package/dist/utils/element.d.ts +94 -0
  20. package/dist/utils/element.js +239 -0
  21. package/dist/utils/htmlParser/format.d.ts +3 -0
  22. package/dist/utils/htmlParser/format.js +47 -0
  23. package/dist/utils/htmlParser/index.d.ts +4 -0
  24. package/dist/utils/htmlParser/index.js +15 -0
  25. package/dist/utils/htmlParser/lexer.d.ts +2 -0
  26. package/dist/utils/htmlParser/lexer.js +245 -0
  27. package/dist/utils/htmlParser/parser.d.ts +15 -0
  28. package/dist/utils/htmlParser/parser.js +117 -0
  29. package/dist/utils/htmlParser/stringify.d.ts +3 -0
  30. package/dist/utils/htmlParser/stringify.js +32 -0
  31. package/dist/utils/htmlParser/tags.d.ts +8 -0
  32. package/dist/utils/htmlParser/tags.js +50 -0
  33. package/dist/utils/htmlParser/types.d.ts +55 -0
  34. package/dist/utils/htmlParser/types.js +2 -0
  35. package/dist/utils/svg2Base64.d.ts +1 -0
  36. package/dist/utils/svg2Base64.js +58 -0
  37. package/dist/utils/svgPathParser.d.ts +120 -0
  38. package/dist/utils/svgPathParser.js +145 -0
  39. package/package.json +59 -0
@@ -0,0 +1,36 @@
1
+ export interface OutlineCover {
2
+ type: "cover";
3
+ data: {
4
+ title: string;
5
+ text: string;
6
+ };
7
+ }
8
+ export interface OutlineContents {
9
+ type: "contents";
10
+ data: {
11
+ items: string[];
12
+ };
13
+ offset?: number;
14
+ }
15
+ export interface OutlineTransition {
16
+ type: "transition";
17
+ data: {
18
+ title: string;
19
+ text: string;
20
+ };
21
+ }
22
+ export interface OutlineContent {
23
+ type: "content";
24
+ data: {
25
+ title: string;
26
+ items: {
27
+ title: string;
28
+ text: string;
29
+ }[];
30
+ };
31
+ offset?: number;
32
+ }
33
+ export interface OutlineEnd {
34
+ type: "end";
35
+ }
36
+ export type Outline = OutlineCover | OutlineContents | OutlineTransition | OutlineContent | OutlineEnd;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,696 @@
1
+ export declare const enum ShapePathFormulasKeys {
2
+ ROUND_RECT = "roundRect",
3
+ ROUND_RECT_DIAGONAL = "roundRectDiagonal",
4
+ ROUND_RECT_SINGLE = "roundRectSingle",
5
+ ROUND_RECT_SAMESIDE = "roundRectSameSide",
6
+ CUT_RECT_DIAGONAL = "cutRectDiagonal",
7
+ CUT_RECT_SINGLE = "cutRectSingle",
8
+ CUT_RECT_SAMESIDE = "cutRectSameSide",
9
+ CUT_ROUND_RECT = "cutRoundRect",
10
+ MESSAGE = "message",
11
+ ROUND_MESSAGE = "roundMessage",
12
+ L = "L",
13
+ RING_RECT = "ringRect",
14
+ PLUS = "plus",
15
+ TRIANGLE = "triangle",
16
+ PARALLELOGRAM_LEFT = "parallelogramLeft",
17
+ PARALLELOGRAM_RIGHT = "parallelogramRight",
18
+ TRAPEZOID = "trapezoid",
19
+ BULLET = "bullet",
20
+ INDICATOR = "indicator"
21
+ }
22
+ export declare const enum ElementTypes {
23
+ TEXT = "text",
24
+ IMAGE = "image",
25
+ SHAPE = "shape",
26
+ LINE = "line",
27
+ CHART = "chart",
28
+ TABLE = "table",
29
+ LATEX = "latex",
30
+ VIDEO = "video",
31
+ AUDIO = "audio"
32
+ }
33
+ /**
34
+ * 渐变
35
+ *
36
+ * type: 渐变类型(径向、线性)
37
+ *
38
+ * colors: 渐变颜色列表(pos: 百分比位置;color: 颜色)
39
+ *
40
+ * rotate: 渐变角度(线性渐变)
41
+ */
42
+ export type GradientType = "linear" | "radial";
43
+ export type GradientColor = {
44
+ pos: number;
45
+ color: string;
46
+ };
47
+ export interface Gradient {
48
+ type: GradientType;
49
+ colors: GradientColor[];
50
+ rotate: number;
51
+ }
52
+ export type LineStyleType = "solid" | "dashed" | "dotted";
53
+ /**
54
+ * 元素阴影
55
+ *
56
+ * h: 水平偏移量
57
+ *
58
+ * v: 垂直偏移量
59
+ *
60
+ * blur: 模糊程度
61
+ *
62
+ * color: 阴影颜色
63
+ */
64
+ export interface PPTElementShadow {
65
+ h: number;
66
+ v: number;
67
+ blur: number;
68
+ color: string;
69
+ }
70
+ /**
71
+ * 元素边框
72
+ *
73
+ * style?: 边框样式(实线或虚线)
74
+ *
75
+ * width?: 边框宽度
76
+ *
77
+ * color?: 边框颜色
78
+ */
79
+ export interface PPTElementOutline {
80
+ style?: LineStyleType;
81
+ width?: number;
82
+ color?: string;
83
+ }
84
+ export type ElementLinkType = "web" | "slide";
85
+ /**
86
+ * 元素超链接
87
+ *
88
+ * type: 链接类型(网页、幻灯片页面)
89
+ *
90
+ * target: 目标地址(网页链接、幻灯片页面ID)
91
+ */
92
+ export interface PPTElementLink {
93
+ type: ElementLinkType;
94
+ target: string;
95
+ }
96
+ /**
97
+ * 元素通用属性
98
+ *
99
+ * id: 元素ID
100
+ *
101
+ * left: 元素水平方向位置(距离画布左侧)
102
+ *
103
+ * top: 元素垂直方向位置(距离画布顶部)
104
+ *
105
+ * lock?: 锁定元素
106
+ *
107
+ * groupId?: 组合ID(拥有相同组合ID的元素即为同一组合元素成员)
108
+ *
109
+ * width: 元素宽度
110
+ *
111
+ * height: 元素高度
112
+ *
113
+ * rotate: 旋转角度
114
+ *
115
+ * link?: 超链接
116
+ *
117
+ * name?: 元素名
118
+ */
119
+ interface PPTBaseElement {
120
+ id: string;
121
+ left: number;
122
+ top: number;
123
+ lock?: boolean;
124
+ groupId?: string;
125
+ width: number;
126
+ height: number;
127
+ rotate: number;
128
+ link?: PPTElementLink;
129
+ name?: string;
130
+ }
131
+ export type TextType = "title" | "subtitle" | "content" | "item" | "itemTitle" | "notes" | "header" | "footer" | "partNumber" | "itemNumber";
132
+ /**
133
+ * 文本元素
134
+ *
135
+ * type: 元素类型(text)
136
+ *
137
+ * content: 文本内容(HTML字符串)
138
+ *
139
+ * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)
140
+ *
141
+ * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)
142
+ *
143
+ * outline?: 边框
144
+ *
145
+ * fill?: 填充色
146
+ *
147
+ * lineHeight?: 行高(倍),默认1.5
148
+ *
149
+ * wordSpace?: 字间距,默认0
150
+ *
151
+ * opacity?: 不透明度,默认1
152
+ *
153
+ * shadow?: 阴影
154
+ *
155
+ * paragraphSpace?: 段间距,默认 5px
156
+ *
157
+ * vertical?: 竖向文本
158
+ *
159
+ * textType?: 文本类型
160
+ */
161
+ export interface PPTTextElement extends PPTBaseElement {
162
+ type: "text";
163
+ content: string;
164
+ defaultFontName: string;
165
+ defaultColor: string;
166
+ outline?: PPTElementOutline;
167
+ fill?: string;
168
+ lineHeight?: number;
169
+ wordSpace?: number;
170
+ opacity?: number;
171
+ shadow?: PPTElementShadow;
172
+ paragraphSpace?: number;
173
+ vertical?: boolean;
174
+ textType?: TextType;
175
+ }
176
+ /**
177
+ * 图片翻转、形状翻转
178
+ *
179
+ * flipH?: 水平翻转
180
+ *
181
+ * flipV?: 垂直翻转
182
+ */
183
+ export interface ImageOrShapeFlip {
184
+ flipH?: boolean;
185
+ flipV?: boolean;
186
+ }
187
+ /**
188
+ * 图片滤镜
189
+ *
190
+ * https://developer.mozilla.org/zh-CN/docs/Web/CSS/filter
191
+ *
192
+ * 'blur'?: 模糊,默认0(px)
193
+ *
194
+ * 'brightness'?: 亮度,默认100(%)
195
+ *
196
+ * 'contrast'?: 对比度,默认100(%)
197
+ *
198
+ * 'grayscale'?: 灰度,默认0(%)
199
+ *
200
+ * 'saturate'?: 饱和度,默认100(%)
201
+ *
202
+ * 'hue-rotate'?: 色相旋转,默认0(deg)
203
+ *
204
+ * 'opacity'?: 不透明度,默认100(%)
205
+ */
206
+ export type ImageElementFilterKeys = "blur" | "brightness" | "contrast" | "grayscale" | "saturate" | "hue-rotate" | "opacity" | "sepia" | "invert";
207
+ export interface ImageElementFilters {
208
+ blur?: string;
209
+ brightness?: string;
210
+ contrast?: string;
211
+ grayscale?: string;
212
+ saturate?: string;
213
+ "hue-rotate"?: string;
214
+ sepia?: string;
215
+ invert?: string;
216
+ opacity?: string;
217
+ }
218
+ export type ImageClipDataRange = [[number, number], [number, number]];
219
+ /**
220
+ * 图片裁剪
221
+ *
222
+ * range: 裁剪范围,例如:[[10, 10], [90, 90]] 表示裁取原图从左上角 10%, 10% 到 90%, 90% 的范围
223
+ *
224
+ * shape: 裁剪形状,见 configs/imageClip.ts CLIPPATHS
225
+ */
226
+ export interface ImageElementClip {
227
+ range: ImageClipDataRange;
228
+ shape: string;
229
+ }
230
+ export type ImageType = "pageFigure" | "itemFigure" | "background";
231
+ /**
232
+ * 图片元素
233
+ *
234
+ * type: 元素类型(image)
235
+ *
236
+ * fixedRatio: 固定图片宽高比例
237
+ *
238
+ * src: 图片地址
239
+ *
240
+ * outline?: 边框
241
+ *
242
+ * filters?: 图片滤镜
243
+ *
244
+ * clip?: 裁剪信息
245
+ *
246
+ * flipH?: 水平翻转
247
+ *
248
+ * flipV?: 垂直翻转
249
+ *
250
+ * shadow?: 阴影
251
+ *
252
+ * radius?: 圆角半径
253
+ *
254
+ * colorMask?: 颜色蒙版
255
+ *
256
+ * imageType?: 图片类型
257
+ */
258
+ export interface PPTImageElement extends PPTBaseElement {
259
+ type: "image";
260
+ fixedRatio: boolean;
261
+ src: string;
262
+ outline?: PPTElementOutline;
263
+ filters?: ImageElementFilters;
264
+ clip?: ImageElementClip;
265
+ flipH?: boolean;
266
+ flipV?: boolean;
267
+ shadow?: PPTElementShadow;
268
+ radius?: number;
269
+ colorMask?: string;
270
+ imageType?: ImageType;
271
+ }
272
+ export type ShapeTextAlign = "top" | "middle" | "bottom";
273
+ /**
274
+ * 形状内文本
275
+ *
276
+ * content: 文本内容(HTML字符串)
277
+ *
278
+ * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)
279
+ *
280
+ * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)
281
+ *
282
+ * align: 文本对齐方向(垂直方向)
283
+ *
284
+ * type: 文本类型
285
+ */
286
+ export interface ShapeText {
287
+ content: string;
288
+ defaultFontName: string;
289
+ defaultColor: string;
290
+ align: ShapeTextAlign;
291
+ type?: TextType;
292
+ }
293
+ /**
294
+ * 形状元素
295
+ *
296
+ * type: 元素类型(shape)
297
+ *
298
+ * viewBox: SVG的viewBox属性,例如 [1000, 1000] 表示 '0 0 1000 1000'
299
+ *
300
+ * path: 形状路径,SVG path 的 d 属性
301
+ *
302
+ * fixedRatio: 固定形状宽高比例
303
+ *
304
+ * fill: 填充,不存在渐变时生效
305
+ *
306
+ * gradient?: 渐变,该属性存在时将优先作为填充
307
+ *
308
+ * pattern?: 图案,该属性存在时将优先作为填充
309
+ *
310
+ * outline?: 边框
311
+ *
312
+ * opacity?: 不透明度
313
+ *
314
+ * flipH?: 水平翻转
315
+ *
316
+ * flipV?: 垂直翻转
317
+ *
318
+ * shadow?: 阴影
319
+ *
320
+ * special?: 特殊形状(标记一些难以解析的形状,例如路径使用了 L Q C A 以外的类型,该类形状在导出后将变为图片的形式)
321
+ *
322
+ * text?: 形状内文本
323
+ *
324
+ * pathFormula?: 形状路径计算公式
325
+ * 一般情况下,形状的大小变化时仅由宽高基于 viewBox 的缩放比例来调整形状,而 viewBox 本身和 path 不会变化,
326
+ * 但也有一些形状希望能更精确的控制一些关键点的位置,此时就需要提供路径计算公式,通过在缩放时更新 viewBox 并重新计算 path 来重新绘制形状
327
+ *
328
+ * keypoints?: 关键点位置百分比
329
+ */
330
+ export interface PPTShapeElement extends PPTBaseElement {
331
+ type: "shape";
332
+ viewBox: [number, number];
333
+ path: string;
334
+ fixedRatio: boolean;
335
+ fill: string;
336
+ gradient?: Gradient;
337
+ pattern?: string;
338
+ outline?: PPTElementOutline;
339
+ opacity?: number;
340
+ flipH?: boolean;
341
+ flipV?: boolean;
342
+ shadow?: PPTElementShadow;
343
+ special?: boolean;
344
+ text?: ShapeText;
345
+ pathFormula?: ShapePathFormulasKeys;
346
+ keypoints?: number[];
347
+ }
348
+ export type LinePoint = "" | "arrow" | "dot";
349
+ /**
350
+ * 线条元素
351
+ *
352
+ * type: 元素类型(line)
353
+ *
354
+ * start: 起点位置([x, y])
355
+ *
356
+ * end: 终点位置([x, y])
357
+ *
358
+ * style: 线条样式(实线、虚线、点线)
359
+ *
360
+ * color: 线条颜色
361
+ *
362
+ * points: 端点样式([起点样式, 终点样式],可选:无、箭头、圆点)
363
+ *
364
+ * shadow?: 阴影
365
+ *
366
+ * broken?: 折线控制点位置([x, y])
367
+ *
368
+ * broken2?: 双折线控制点位置([x, y])
369
+ *
370
+ * curve?: 二次曲线控制点位置([x, y])
371
+ *
372
+ * cubic?: 三次曲线控制点位置([[x1, y1], [x2, y2]])
373
+ */
374
+ export interface PPTLineElement extends Omit<PPTBaseElement, "height" | "rotate"> {
375
+ type: "line";
376
+ start: [number, number];
377
+ end: [number, number];
378
+ style: LineStyleType;
379
+ color: string;
380
+ points: [LinePoint, LinePoint];
381
+ shadow?: PPTElementShadow;
382
+ broken?: [number, number];
383
+ broken2?: [number, number];
384
+ curve?: [number, number];
385
+ cubic?: [[number, number], [number, number]];
386
+ }
387
+ export type ChartType = "bar" | "column" | "line" | "pie" | "ring" | "area" | "radar" | "scatter";
388
+ export interface ChartOptions {
389
+ lineSmooth?: boolean;
390
+ stack?: boolean;
391
+ }
392
+ export interface ChartData {
393
+ labels: string[];
394
+ legends: string[];
395
+ series: number[][];
396
+ }
397
+ /**
398
+ * 图表元素
399
+ *
400
+ * type: 元素类型(chart)
401
+ *
402
+ * fill?: 填充色
403
+ *
404
+ * chartType: 图表基础类型(bar/line/pie),所有图表类型都是由这三种基本类型衍生而来
405
+ *
406
+ * data: 图表数据
407
+ *
408
+ * options: 扩展选项
409
+ *
410
+ * outline?: 边框
411
+ *
412
+ * themeColors: 主题色
413
+ *
414
+ * textColor?: 坐标和文字颜色
415
+ *
416
+ * lineColor?: 网格颜色
417
+ */
418
+ export interface PPTChartElement extends PPTBaseElement {
419
+ type: "chart";
420
+ fill?: string;
421
+ chartType: ChartType;
422
+ data: ChartData;
423
+ options?: ChartOptions;
424
+ outline?: PPTElementOutline;
425
+ themeColors: string[];
426
+ textColor?: string;
427
+ lineColor?: string;
428
+ }
429
+ export type TextAlign = "left" | "center" | "right" | "justify";
430
+ /**
431
+ * 表格单元格样式
432
+ *
433
+ * bold?: 加粗
434
+ *
435
+ * em?: 斜体
436
+ *
437
+ * underline?: 下划线
438
+ *
439
+ * strikethrough?: 删除线
440
+ *
441
+ * color?: 字体颜色
442
+ *
443
+ * backcolor?: 填充色
444
+ *
445
+ * fontsize?: 字体大小
446
+ *
447
+ * fontname?: 字体
448
+ *
449
+ * align?: 对齐方式
450
+ */
451
+ export interface TableCellStyle {
452
+ bold?: boolean;
453
+ em?: boolean;
454
+ underline?: boolean;
455
+ strikethrough?: boolean;
456
+ color?: string;
457
+ backcolor?: string;
458
+ fontsize?: string;
459
+ fontname?: string;
460
+ align?: TextAlign;
461
+ }
462
+ /**
463
+ * 表格单元格
464
+ *
465
+ * id: 单元格ID
466
+ *
467
+ * colspan: 合并列数
468
+ *
469
+ * rowspan: 合并行数
470
+ *
471
+ * text: 文字内容
472
+ *
473
+ * style?: 单元格样式
474
+ */
475
+ export interface TableCell {
476
+ id: string;
477
+ colspan: number;
478
+ rowspan: number;
479
+ text: string;
480
+ style?: TableCellStyle;
481
+ }
482
+ /**
483
+ * 表格主题
484
+ *
485
+ * color: 主题色
486
+ *
487
+ * rowHeader: 标题行
488
+ *
489
+ * rowFooter: 汇总行
490
+ *
491
+ * colHeader: 第一列
492
+ *
493
+ * colFooter: 最后一列
494
+ */
495
+ export interface TableTheme {
496
+ color: string;
497
+ rowHeader: boolean;
498
+ rowFooter: boolean;
499
+ colHeader: boolean;
500
+ colFooter: boolean;
501
+ }
502
+ /**
503
+ * 表格元素
504
+ *
505
+ * type: 元素类型(table)
506
+ *
507
+ * outline: 边框
508
+ *
509
+ * theme?: 主题
510
+ *
511
+ * colWidths: 列宽数组,如[30, 50, 20]表示三列宽度分别为30%, 50%, 20%
512
+ *
513
+ * cellMinHeight: 单元格最小高度
514
+ *
515
+ * data: 表格数据
516
+ */
517
+ export interface PPTTableElement extends PPTBaseElement {
518
+ type: "table";
519
+ outline: PPTElementOutline;
520
+ theme?: TableTheme;
521
+ colWidths: number[];
522
+ cellMinHeight: number;
523
+ data: TableCell[][];
524
+ }
525
+ /**
526
+ * LaTeX元素(公式)
527
+ *
528
+ * type: 元素类型(latex)
529
+ *
530
+ * latex: latex代码
531
+ *
532
+ * path: svg path
533
+ *
534
+ * color: 颜色
535
+ *
536
+ * strokeWidth: 路径宽度
537
+ *
538
+ * viewBox: SVG的viewBox属性
539
+ *
540
+ * fixedRatio: 固定形状宽高比例
541
+ */
542
+ export interface PPTLatexElement extends PPTBaseElement {
543
+ type: "latex";
544
+ latex: string;
545
+ path: string;
546
+ color: string;
547
+ strokeWidth: number;
548
+ viewBox: [number, number];
549
+ fixedRatio: boolean;
550
+ }
551
+ /**
552
+ * 视频元素
553
+ *
554
+ * type: 元素类型(video)
555
+ *
556
+ * src: 视频地址
557
+ *
558
+ * autoplay: 自动播放
559
+ *
560
+ * poster: 预览封面
561
+ *
562
+ * ext: 视频后缀,当资源链接缺少后缀时用该字段确认资源类型
563
+ */
564
+ export interface PPTVideoElement extends PPTBaseElement {
565
+ type: "video";
566
+ src: string;
567
+ autoplay: boolean;
568
+ poster?: string;
569
+ ext?: string;
570
+ }
571
+ /**
572
+ * 音频元素
573
+ *
574
+ * type: 元素类型(audio)
575
+ *
576
+ * fixedRatio: 固定图标宽高比例
577
+ *
578
+ * color: 图标颜色
579
+ *
580
+ * loop: 循环播放
581
+ *
582
+ * autoplay: 自动播放
583
+ *
584
+ * src: 音频地址
585
+ *
586
+ * ext: 音频后缀,当资源链接缺少后缀时用该字段确认资源类型
587
+ */
588
+ export interface PPTAudioElement extends PPTBaseElement {
589
+ type: "audio";
590
+ fixedRatio: boolean;
591
+ color: string;
592
+ loop: boolean;
593
+ autoplay: boolean;
594
+ src: string;
595
+ ext?: string;
596
+ }
597
+ export type PPTElement = PPTTextElement | PPTImageElement | PPTShapeElement | PPTLineElement | PPTChartElement | PPTTableElement | PPTLatexElement | PPTVideoElement | PPTAudioElement;
598
+ export type AnimationType = "in" | "out" | "attention";
599
+ export type AnimationTrigger = "click" | "meantime" | "auto";
600
+ /**
601
+ * 元素动画
602
+ *
603
+ * id: 动画id
604
+ *
605
+ * elId: 元素ID
606
+ *
607
+ * effect: 动画效果
608
+ *
609
+ * type: 动画类型(入场、退场、强调)
610
+ *
611
+ * duration: 动画持续时间
612
+ *
613
+ * trigger: 动画触发方式(click - 单击时、meantime - 与上一动画同时、auto - 上一动画之后)
614
+ */
615
+ export interface PPTAnimation {
616
+ id: string;
617
+ elId: string;
618
+ effect: string;
619
+ type: AnimationType;
620
+ duration: number;
621
+ trigger: AnimationTrigger;
622
+ }
623
+ export type SlideBackgroundType = "solid" | "image" | "gradient";
624
+ export type SlideBackgroundImageSize = "cover" | "contain" | "repeat";
625
+ export interface SlideBackgroundImage {
626
+ src: string;
627
+ size: SlideBackgroundImageSize;
628
+ }
629
+ /**
630
+ * 幻灯片背景
631
+ *
632
+ * type: 背景类型(纯色、图片、渐变)
633
+ *
634
+ * color?: 背景颜色(纯色)
635
+ *
636
+ * image?: 图片背景
637
+ *
638
+ * gradientType?: 渐变背景
639
+ */
640
+ export interface SlideBackground {
641
+ type: SlideBackgroundType;
642
+ color?: string;
643
+ image?: SlideBackgroundImage;
644
+ gradient?: Gradient;
645
+ }
646
+ export type TurningMode = "no" | "fade" | "slideX" | "slideY" | "random" | "slideX3D" | "slideY3D" | "rotate" | "scaleY" | "scaleX" | "scale" | "scaleReverse";
647
+ export interface NoteReply {
648
+ id: string;
649
+ content: string;
650
+ time: number;
651
+ user: string;
652
+ }
653
+ export interface Note {
654
+ id: string;
655
+ content: string;
656
+ time: number;
657
+ user: string;
658
+ elId?: string;
659
+ replies?: NoteReply[];
660
+ }
661
+ export interface SectionTag {
662
+ id: string;
663
+ title?: string;
664
+ }
665
+ export type SlideType = "cover" | "contents" | "transition" | "content" | "end";
666
+ /**
667
+ * 幻灯片页面
668
+ *
669
+ * id: 页面ID
670
+ *
671
+ * elements: 元素集合
672
+ *
673
+ * notes?: 批注
674
+ *
675
+ * remark?: 备注
676
+ *
677
+ * background?: 页面背景
678
+ *
679
+ * animations?: 元素动画集合
680
+ *
681
+ * turningMode?: 翻页方式
682
+ *
683
+ * slideType?: 页面类型
684
+ */
685
+ export interface Slide {
686
+ id: string;
687
+ elements: PPTElement[];
688
+ notes?: Note[];
689
+ remark?: string;
690
+ background?: SlideBackground;
691
+ animations?: PPTAnimation[];
692
+ turningMode?: TurningMode;
693
+ sectionTag?: SectionTag;
694
+ type?: SlideType;
695
+ }
696
+ export {};