| export const enum ShapePathFormulasKeys { |
| ROUND_RECT = 'roundRect', |
| ROUND_RECT_DIAGONAL = 'roundRectDiagonal', |
| ROUND_RECT_SINGLE = 'roundRectSingle', |
| ROUND_RECT_SAMESIDE = 'roundRectSameSide', |
| CUT_RECT_DIAGONAL = 'cutRectDiagonal', |
| CUT_RECT_SINGLE = 'cutRectSingle', |
| CUT_RECT_SAMESIDE = 'cutRectSameSide', |
| CUT_ROUND_RECT = 'cutRoundRect', |
| MESSAGE = 'message', |
| ROUND_MESSAGE = 'roundMessage', |
| L = 'L', |
| RING_RECT = 'ringRect', |
| PLUS = 'plus', |
| TRIANGLE = 'triangle', |
| PARALLELOGRAM_LEFT = 'parallelogramLeft', |
| PARALLELOGRAM_RIGHT = 'parallelogramRight', |
| TRAPEZOID = 'trapezoid', |
| BULLET = 'bullet', |
| INDICATOR = 'indicator', |
| DONUT = 'donut', |
| DIAGSTRIPE = 'diagStripe', |
| } |
|
|
| export const enum ElementTypes { |
| TEXT = 'text', |
| IMAGE = 'image', |
| SHAPE = 'shape', |
| LINE = 'line', |
| CHART = 'chart', |
| TABLE = 'table', |
| LATEX = 'latex', |
| VIDEO = 'video', |
| AUDIO = 'audio', |
| CODE = 'code', |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export type GradientType = 'linear' | 'radial'; |
| export type GradientColor = { |
| pos: number; |
| color: string; |
| }; |
| export interface Gradient { |
| type: GradientType; |
| colors: GradientColor[]; |
| rotate: number; |
| } |
|
|
| export type LineStyleType = 'solid' | 'dashed' | 'dotted'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTElementShadow { |
| h: number; |
| v: number; |
| blur: number; |
| color: string; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTElementOutline { |
| style?: LineStyleType; |
| width?: number; |
| color?: string; |
| } |
|
|
| export type ElementLinkType = 'web' | 'slide'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| export interface PPTElementLink { |
| type: ElementLinkType; |
| target: string; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| interface PPTBaseElement { |
| id: string; |
| left: number; |
| top: number; |
| lock?: boolean; |
| groupId?: string; |
| width: number; |
| height: number; |
| rotate: number; |
| link?: PPTElementLink; |
| name?: string; |
| } |
|
|
| export type TextType = |
| | 'title' |
| | 'subtitle' |
| | 'content' |
| | 'item' |
| | 'itemTitle' |
| | 'notes' |
| | 'header' |
| | 'footer' |
| | 'partNumber' |
| | 'itemNumber'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTTextElement extends PPTBaseElement { |
| type: 'text'; |
| content: string; |
| defaultFontName: string; |
| defaultColor: string; |
| outline?: PPTElementOutline; |
| fill?: string; |
| lineHeight?: number; |
| wordSpace?: number; |
| opacity?: number; |
| shadow?: PPTElementShadow; |
| paragraphSpace?: number; |
| vertical?: boolean; |
| textType?: TextType; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| export interface ImageOrShapeFlip { |
| flipH?: boolean; |
| flipV?: boolean; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export type ImageElementFilterKeys = |
| | 'blur' |
| | 'brightness' |
| | 'contrast' |
| | 'grayscale' |
| | 'saturate' |
| | 'hue-rotate' |
| | 'opacity' |
| | 'sepia' |
| | 'invert'; |
| export interface ImageElementFilters { |
| blur?: string; |
| brightness?: string; |
| contrast?: string; |
| grayscale?: string; |
| saturate?: string; |
| 'hue-rotate'?: string; |
| sepia?: string; |
| invert?: string; |
| opacity?: string; |
| } |
|
|
| export type ImageClipDataRange = [[number, number], [number, number]]; |
|
|
| |
| |
| |
| |
| |
| |
| |
| export interface ImageElementClip { |
| range: ImageClipDataRange; |
| shape: string; |
| } |
|
|
| export type ImageType = 'pageFigure' | 'itemFigure' | 'background'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTImageElement extends PPTBaseElement { |
| type: 'image'; |
| fixedRatio: boolean; |
| src: string; |
| outline?: PPTElementOutline; |
| filters?: ImageElementFilters; |
| clip?: ImageElementClip; |
| flipH?: boolean; |
| flipV?: boolean; |
| shadow?: PPTElementShadow; |
| radius?: number; |
| colorMask?: string; |
| imageType?: ImageType; |
| } |
|
|
| export type ShapeTextAlign = 'top' | 'middle' | 'bottom'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface ShapeText { |
| content: string; |
| defaultFontName: string; |
| defaultColor: string; |
| align: ShapeTextAlign; |
| lineHeight?: number; |
| wordSpace?: number; |
| paragraphSpace?: number; |
| type?: TextType; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTShapeElement extends PPTBaseElement { |
| type: 'shape'; |
| viewBox: [number, number]; |
| path: string; |
| fixedRatio: boolean; |
| fill: string; |
| gradient?: Gradient; |
| pattern?: string; |
| outline?: PPTElementOutline; |
| opacity?: number; |
| flipH?: boolean; |
| flipV?: boolean; |
| shadow?: PPTElementShadow; |
| special?: boolean; |
| text?: ShapeText; |
| pathFormula?: ShapePathFormulasKeys; |
| keypoints?: number[]; |
| } |
|
|
| export type LinePoint = '' | 'arrow' | 'dot'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTLineElement extends Omit<PPTBaseElement, 'height' | 'rotate'> { |
| type: 'line'; |
| start: [number, number]; |
| end: [number, number]; |
| style: LineStyleType; |
| color: string; |
| points: [LinePoint, LinePoint]; |
| shadow?: PPTElementShadow; |
| broken?: [number, number]; |
| broken2?: [number, number]; |
| curve?: [number, number]; |
| cubic?: [[number, number], [number, number]]; |
| } |
|
|
| export type ChartType = 'bar' | 'column' | 'line' | 'pie' | 'ring' | 'area' | 'radar' | 'scatter'; |
|
|
| export interface ChartOptions { |
| lineSmooth?: boolean; |
| stack?: boolean; |
| } |
|
|
| export interface ChartData { |
| labels: string[]; |
| legends: string[]; |
| series: number[][]; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTChartElement extends PPTBaseElement { |
| type: 'chart'; |
| fill?: string; |
| chartType: ChartType; |
| data: ChartData; |
| options?: ChartOptions; |
| outline?: PPTElementOutline; |
| themeColors: string[]; |
| textColor?: string; |
| lineColor?: string; |
| } |
|
|
| export type TextAlign = 'left' | 'center' | 'right' | 'justify'; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface TableCellStyle { |
| bold?: boolean; |
| em?: boolean; |
| underline?: boolean; |
| strikethrough?: boolean; |
| color?: string; |
| backcolor?: string; |
| fontsize?: string; |
| fontname?: string; |
| align?: TextAlign; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface TableCell { |
| id: string; |
| colspan: number; |
| rowspan: number; |
| text: string; |
| style?: TableCellStyle; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface TableTheme { |
| color: string; |
| rowHeader: boolean; |
| rowFooter: boolean; |
| colHeader: boolean; |
| colFooter: boolean; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTTableElement extends PPTBaseElement { |
| type: 'table'; |
| outline: PPTElementOutline; |
| theme?: TableTheme; |
| colWidths: number[]; |
| cellMinHeight: number; |
| data: TableCell[][]; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTLatexElement extends PPTBaseElement { |
| type: 'latex'; |
| latex: string; |
| html?: string; |
| path?: string; |
| color?: string; |
| strokeWidth?: number; |
| viewBox?: [number, number]; |
| fixedRatio?: boolean; |
| align?: 'left' | 'center' | 'right'; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTVideoElement extends PPTBaseElement { |
| type: 'video'; |
| src: string; |
| autoplay: boolean; |
| poster?: string; |
| ext?: string; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTAudioElement extends PPTBaseElement { |
| type: 'audio'; |
| fixedRatio: boolean; |
| color: string; |
| loop: boolean; |
| autoplay: boolean; |
| src: string; |
| ext?: string; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| export interface CodeLine { |
| id: string; |
| content: string; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTCodeElement extends PPTBaseElement { |
| type: 'code'; |
| language: string; |
| lines: CodeLine[]; |
| fileName?: string; |
| showLineNumbers?: boolean; |
| fontSize?: number; |
| } |
|
|
| export type PPTElement = |
| | PPTTextElement |
| | PPTImageElement |
| | PPTShapeElement |
| | PPTLineElement |
| | PPTChartElement |
| | PPTTableElement |
| | PPTLatexElement |
| | PPTVideoElement |
| | PPTAudioElement |
| | PPTCodeElement; |
|
|
| export type AnimationType = 'in' | 'out' | 'attention'; |
| export type AnimationTrigger = 'click' | 'meantime' | 'auto'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface PPTAnimation { |
| id: string; |
| elId: string; |
| effect: string; |
| type: AnimationType; |
| duration: number; |
| trigger: AnimationTrigger; |
| } |
|
|
| export type SlideBackgroundType = 'solid' | 'image' | 'gradient'; |
| export type SlideBackgroundImageSize = 'cover' | 'contain' | 'repeat'; |
| export interface SlideBackgroundImage { |
| src: string; |
| size: SlideBackgroundImageSize; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface SlideBackground { |
| type: SlideBackgroundType; |
| color?: string; |
| image?: SlideBackgroundImage; |
| gradient?: Gradient; |
| } |
|
|
| export type TurningMode = |
| | 'no' |
| | 'fade' |
| | 'slideX' |
| | 'slideY' |
| | 'random' |
| | 'slideX3D' |
| | 'slideY3D' |
| | 'rotate' |
| | 'scaleY' |
| | 'scaleX' |
| | 'scale' |
| | 'scaleReverse'; |
|
|
| export interface SectionTag { |
| id: string; |
| title?: string; |
| } |
|
|
| export type SlideType = 'cover' | 'contents' | 'transition' | 'content' | 'end'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface Slide { |
| id: string; |
| viewportSize: number; |
| viewportRatio: number; |
| theme: SlideTheme; |
| elements: PPTElement[]; |
| background?: SlideBackground; |
| animations?: PPTAnimation[]; |
| turningMode?: TurningMode; |
| sectionTag?: SectionTag; |
| type?: SlideType; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface SlideTheme { |
| backgroundColor: string; |
| themeColors: string[]; |
| fontColor: string; |
| fontName: string; |
| outline?: PPTElementOutline; |
| shadow?: PPTElementShadow; |
| } |
|
|
| export interface SlideTemplate { |
| name: string; |
| id: string; |
| cover: string; |
| origin?: string; |
| } |
|
|
| |
| |
| |
| export interface SlideData { |
| id: string; |
| viewportSize: number; |
| viewportRatio: number; |
| theme: { |
| themeColors: string[]; |
| fontColor: string; |
| fontName: string; |
| backgroundColor: string; |
| }; |
| elements: PPTElement[]; |
| background?: SlideBackground; |
| animations?: unknown[]; |
| } |
|
|