@leafer-ui/interface 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interface",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "@leafer-ui/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,6 +22,6 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/interface": "2.0.1"
25
+ "@leafer/interface": "2.0.2"
26
26
  }
27
27
  }
package/src/IUI.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData, ITransition, IAround } from '@leafer/interface'
1
+ import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData, ISizeData, ITransition, IAround, IMultimediaType } from '@leafer/interface'
2
2
 
3
3
  import {
4
4
  IFillAttrData, IFillInputData, IFillComputedData,
@@ -73,88 +73,6 @@ export interface IFlowData extends IFlowAttrData, IBoxData { }
73
73
  export interface IFlowInputData extends IFlowAttrData, IBoxInputData { }
74
74
 
75
75
 
76
-
77
- // Video
78
- export interface IVideo extends IPlayerMethods, IRect {
79
- __: IVideoData
80
- }
81
-
82
- interface IPlayerMethods {
83
- play(): void
84
- pause(): void
85
- stop(): void
86
- }
87
-
88
- interface IVideoAttrData {
89
- url?: string
90
- }
91
- export interface IVideoData extends IVideoAttrData, IRectData { }
92
- export interface IVideoInputData extends IVideoAttrData, IRectInputData { }
93
-
94
-
95
-
96
- // GIF
97
- export interface IGIF extends IPlayerMethods, IRect {
98
- __: IGIFData
99
- }
100
-
101
- interface IGIFAttrData {
102
- url?: string
103
- }
104
- export interface IGIFData extends IGIFAttrData, IRectData { }
105
- export interface IGIFInputData extends IGIFAttrData, IRectInputData { }
106
-
107
-
108
-
109
- // Robot
110
- export interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
111
- __: IRobotData
112
- readonly running: boolean
113
- readonly nowFrame?: IRobotComputedKeyframe
114
- readonly robotFrames?: IRobotComputedKeyframe[]
115
-
116
- __updateRobot(): void
117
- __updateAction(): void
118
- }
119
-
120
- interface IRobotAttrData {
121
- robot?: IRobotKeyframe | IRobotKeyframe[]
122
- actions?: IRobotActions
123
- action?: IRobotActionName
124
- now?: number
125
- FPS?: number
126
- loop?: boolean | number
127
- }
128
-
129
- export interface IRobotActions {
130
- [name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation
131
- }
132
-
133
- export interface IRobotAnimation {
134
- keyframes: IKeyframeId[]
135
- loop?: boolean | number
136
- FPS?: number
137
- }
138
-
139
- export type IRobotActionName = string
140
-
141
- export interface IRobotKeyframe {
142
- mode?: 'normal' | 'clip'
143
- url: string
144
-
145
- offset?: IPointData
146
- size?: number | ISizeData
147
- total?: number
148
- }
149
-
150
- export interface IRobotComputedKeyframe extends IBoundsData {
151
- view: any
152
- }
153
-
154
- export interface IRobotData extends IRobotAttrData, IRectData { }
155
- export interface IRobotInputData extends IRobotAttrData, IRectInputData { }
156
-
157
-
158
76
  // Rect
159
77
  export interface IRect extends IUI {
160
78
  __: IRectData
@@ -313,10 +231,13 @@ interface IImageAttrData {
313
231
  background?: IFill
314
232
  }
315
233
  export interface IImageData extends IImageAttrData, IRectData {
234
+ readonly __urlType: IMultimediaType
316
235
  __setImageFill(value: string): void
317
236
  }
318
237
  export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
319
238
 
239
+
240
+ // Canvas
320
241
  export interface ICanvas extends ICanvasAttrData, IRect {
321
242
  __: ICanvasData
322
243
  canvas?: ILeaferCanvas
@@ -333,6 +254,90 @@ export interface ICanvasData extends ICanvasAttrData, IRectData { }
333
254
  export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
334
255
 
335
256
 
257
+ // Film
258
+ export interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
259
+ __: IFilmData
260
+ }
261
+ interface IFilmAttrData {
262
+ url?: string
263
+ }
264
+ export interface IFilmData extends IFilmAttrData, IImageData {
265
+
266
+ }
267
+ export interface IFilmInputData extends IFilmAttrData, IUIBaseInputData { }
268
+
269
+
270
+
271
+ // Video
272
+ export interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
273
+ __: IVideoData
274
+ }
275
+
276
+ interface IPlayerMethods {
277
+ togglePlay(): void
278
+ play(): void
279
+ pause(): void
280
+ stop(): void
281
+ }
282
+
283
+ interface IVideoAttrData {
284
+ url?: string
285
+ }
286
+ export interface IVideoData extends IVideoAttrData, IImageData { }
287
+ export interface IVideoInputData extends IVideoAttrData, IImageInputData { }
288
+
289
+
290
+
291
+ // Robot
292
+ export interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
293
+ __: IRobotData
294
+ readonly running: boolean
295
+ readonly nowFrame?: IRobotComputedKeyframe
296
+ readonly robotFrames?: IRobotComputedKeyframe[]
297
+
298
+ __updateRobot(): void
299
+ __updateAction(): void
300
+ }
301
+
302
+ interface IRobotAttrData {
303
+ robot?: IRobotKeyframe | IRobotKeyframe[]
304
+ actions?: IRobotActions
305
+ action?: IRobotActionName
306
+ now?: number
307
+ FPS?: number
308
+ loop?: boolean | number
309
+ }
310
+
311
+ export interface IRobotActions {
312
+ [name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation
313
+ }
314
+
315
+ export interface IRobotAnimation {
316
+ keyframes: IKeyframeId[]
317
+ loop?: boolean | number
318
+ FPS?: number
319
+ }
320
+
321
+ export type IRobotActionName = string
322
+
323
+ export interface IRobotKeyframe {
324
+ mode?: 'normal' | 'clip'
325
+ url: string
326
+
327
+ offset?: IPointData
328
+ size?: number | ISizeData
329
+ total?: number
330
+ }
331
+
332
+ export interface IRobotComputedKeyframe extends IBoundsData {
333
+ view: any
334
+ }
335
+
336
+ export interface IRobotData extends IRobotAttrData, IRectData { }
337
+ export interface IRobotInputData extends IRobotAttrData, IRectInputData { }
338
+
339
+
340
+
336
341
  // Leafer
337
342
  export interface ILeaferData extends IGroupData {
338
343
 
@@ -571,12 +576,12 @@ export type IUITag =
571
576
  | 'Box'
572
577
  | 'Arrow'
573
578
  | 'Robot'
574
- | 'GIF'
579
+ | 'Film'
575
580
  | 'Video'
576
581
  | (string & {})
577
582
 
578
583
 
579
- export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IGIFInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
584
+ export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
580
585
  children?: IUIInputData[]
581
586
  }
582
587
 
package/src/index.ts CHANGED
@@ -16,10 +16,10 @@ export {
16
16
  IText, ITextInputData, ITextData, ITextRowData, ITextWordData, ITextCharData, ITextDrawData, IBackgroundBoxStyle,
17
17
  IImage, IImageInputData, IImageData,
18
18
  ICanvas, ICanvasInputData, ICanvasData,
19
+ IFilm, IFilmInputData, IFilmData,
19
20
  IFrame, IFrameInputData, IFrameData,
20
21
  IFlow, IFlowInputData, IFlowData,
21
22
  IVideo, IVideoInputData, IVideoData,
22
- IGIF, IGIFInputData, IGIFData,
23
23
  IRobot, IRobotInputData, IRobotData, IRobotActions, IRobotActionName, IRobotKeyframe, IRobotComputedKeyframe, IRobotAnimation,
24
24
  IBox, IBoxInputData, IBoxData,
25
25
  IGroup, IGroupInputData, IGroupData,
@@ -30,6 +30,9 @@ export interface IPaintModule {
30
30
  export interface IPaintImageModule {
31
31
  image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint
32
32
 
33
+ film?(paint: ILeafPaint): void
34
+ video?(paint: ILeafPaint): void
35
+
33
36
  checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean // 返回true表示已进行了原生绘制
34
37
  drawImage(paint: ILeafPaint, imageScaleX: number, imageScaleY: number, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void
35
38
  getImageRenderScaleData(paint: ILeafPaint, ui: IUI, canvas?: ILeaferCanvas, renderOptions?: IRenderOptions): IScaleData // 当前图片渲染的比例数据,必须马上分解使用
@@ -1,13 +1,13 @@
1
- import { IBlendMode, IDirection, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem } from '@leafer/interface'
1
+ import { IBlendMode, IDirection, IFilmPlayOptions, IInterlace, ILeaferImage, IMatrixData, IPointData, IScaleFixed, ITaskItem } from '@leafer/interface'
2
2
 
3
3
  import { IColorString } from './IStringType'
4
- import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IImageFilters, IPaint } from './IType'
4
+ import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode, IPaint } from './IType'
5
5
  import { IPaintType } from './IType'
6
6
  import { IStrokeComputedStyle } from '../ICommonAttr'
7
7
 
8
8
  export type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern
9
9
 
10
- export interface ILeafPaint {
10
+ export interface ILeafPaint extends IFilmPlayOptions {
11
11
  type?: IPaintType
12
12
  style?: ILeafPaintColor
13
13
  strokeStyle?: IStrokeComputedStyle // 子描边样式选项
@@ -18,22 +18,24 @@ export interface ILeafPaint {
18
18
  drawLevel?: number // drawImage level
19
19
 
20
20
  loadId?: number
21
- patternId?: string
21
+ patternId?: string | number
22
22
  patternTask?: ITaskItem
23
23
  progressTimer?: any
24
24
 
25
+ complex?: boolean | 2 // 绘制原图时canvas需要save、restore, 为2表示需要clipUI
26
+
25
27
  isTransparent?: boolean // 是否为透明色
26
28
  data?: ILeafPaintPatternData
27
29
  originPaint?: IPaint // 原始paint对象
30
+
31
+ film?: boolean // flim或video类型
28
32
  }
29
33
 
30
34
  export interface ILeafPaintPatternData {
31
35
  scaleX?: number
32
36
  scaleY?: number
33
37
  gap?: IPointData
34
- opacity?: number
35
38
  transform?: IMatrixData
36
- filters?: IImageFilters
37
39
  mode?: IImagePaintMode
38
40
  repeat?: 'repeat' | 'repeat-x' | 'repeat-y'
39
41
  interlace?: IInterlace
package/src/type/IType.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IInterlace, IFilter, IOptionSizeData, ISizeData, IGap, IPointGap, IScaleFixed, IDirection, IImageLOD, IPercentData } from '@leafer/interface'
1
+ import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, IMultimediaType, IFourNumber, IAlign, IUnitPointData, IAxis, IAxisReverse, IInterlace, IFilter, IOptionSizeData, ISizeData, IGap, IPointGap, IScaleFixed, IDirection, IImageLOD, IPercentData, IFilmOptions } from '@leafer/interface'
2
2
  import { IColorString, IPaintString } from './IStringType'
3
3
  import { IStrokeStyle } from '../ICommonAttr'
4
4
 
@@ -24,9 +24,9 @@ export interface IPaintBase {
24
24
  }
25
25
 
26
26
  export type IPaintType =
27
- | 'image'
28
27
  | 'solid'
29
28
  | IGradientType
29
+ | IMultimediaType
30
30
 
31
31
  export type IGradientType =
32
32
  | 'linear'
@@ -70,8 +70,8 @@ export interface IColorStop {
70
70
  }
71
71
 
72
72
  // ---
73
- export interface IImagePaint extends IPaintBase {
74
- type: "image"
73
+ export interface IImagePaint extends IPaintBase, IFilmOptions {
74
+ type: IMultimediaType
75
75
 
76
76
  url: string
77
77
  lod?: IImageLOD
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IBlendMode, IScaleFixed, IAlign, IUnitPointData, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, IAround, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
1
+ import { IMultimediaType, IBlendMode, IScaleFixed, IAlign, IUnitPointData, IFilmOptions, IImageLOD, IExportFileType, IFourNumber, IPointData, IOptionSizeData, ISizeData, IGap, IPointGap, IPercentData, IInterlace, IPathCommandData, IAxis, IAxisReverse, IDirection, IWindingRule, IFilter, IFilmPlayOptions, IMatrixData, ILeaferImage, ITaskItem, INumber, IString, IBoolean, IUnitData, IAnimateOptions, IAnimateEasing, IEventer, IObject, IEventParamsMap, IAnimateEasingFunction, IAnimateEnding, ITransition, IBounds, ILeafInputData, ILeaf as ILeaf$1, ILeafComputedData, ILeafData, IBoundsData, IValue, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, IAround, ICanvasContext2DSettings, ICanvasContext2D, ILeaferAttrData, IControl, ILeaferType, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IScaleData as IScaleData$1, IBooleanMap, IFunction, IMatrixWithBoundsScaleData } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
3
  import { IObject as IObject$1, IEditSize, IStroke as IStroke$1, IFourNumber as IFourNumber$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, IDirection4, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IShortcutKeysCheck, IShortcutKeys, IUI as IUI$1, IPointData as IPointData$1, IScaleData, ISkewData, IGroup as IGroup$1, ISelectorProxy, IBox as IBox$1, ILayoutBoundsData, IKeyEvent, IUIEvent, IDragEvent, IMoveEvent, IZoomEvent, IRotateEvent, ITransition as ITransition$1, ILeafList, ILeafer as ILeafer$1, ILeaf, IGroupInputData as IGroupInputData$1, IStateName as IStateName$1, IString as IString$1, IBoolean as IBoolean$1, IStateStyle as IStateStyle$1 } from '@leafer-ui/interface';
4
4
 
@@ -27,7 +27,7 @@ interface IPaintBase {
27
27
  editing?: boolean;
28
28
  scaleFixed?: IScaleFixed;
29
29
  }
30
- type IPaintType = 'image' | 'solid' | IGradientType;
30
+ type IPaintType = 'solid' | IGradientType | IMultimediaType;
31
31
  type IGradientType = 'linear' | 'radial' | 'angular';
32
32
  interface ISolidPaint extends IPaintBase {
33
33
  type: 'solid';
@@ -59,8 +59,8 @@ interface IColorStop {
59
59
  color: IColor;
60
60
  selected?: boolean;
61
61
  }
62
- interface IImagePaint extends IPaintBase {
63
- type: "image";
62
+ interface IImagePaint extends IPaintBase, IFilmOptions {
63
+ type: IMultimediaType;
64
64
  url: string;
65
65
  lod?: IImageLOD;
66
66
  mode?: IImagePaintMode;
@@ -166,7 +166,7 @@ type IOverflow = 'show' | 'hide' | 'scroll' | 'x-scroll' | 'y-scroll';
166
166
  type ITextOverflow = 'show' | 'hide' | 'ellipsis' | (string & {});
167
167
 
168
168
  type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
169
- interface ILeafPaint {
169
+ interface ILeafPaint extends IFilmPlayOptions {
170
170
  type?: IPaintType;
171
171
  style?: ILeafPaintColor;
172
172
  strokeStyle?: IStrokeComputedStyle;
@@ -175,20 +175,20 @@ interface ILeafPaint {
175
175
  level?: number;
176
176
  drawLevel?: number;
177
177
  loadId?: number;
178
- patternId?: string;
178
+ patternId?: string | number;
179
179
  patternTask?: ITaskItem;
180
180
  progressTimer?: any;
181
+ complex?: boolean | 2;
181
182
  isTransparent?: boolean;
182
183
  data?: ILeafPaintPatternData;
183
184
  originPaint?: IPaint;
185
+ film?: boolean;
184
186
  }
185
187
  interface ILeafPaintPatternData {
186
188
  scaleX?: number;
187
189
  scaleY?: number;
188
190
  gap?: IPointData;
189
- opacity?: number;
190
191
  transform?: IMatrixData;
191
- filters?: IImageFilters;
192
192
  mode?: IImagePaintMode;
193
193
  repeat?: 'repeat' | 'repeat-x' | 'repeat-y';
194
194
  interlace?: IInterlace;
@@ -741,70 +741,6 @@ interface IFlowData extends IFlowAttrData, IBoxData {
741
741
  }
742
742
  interface IFlowInputData extends IFlowAttrData, IBoxInputData {
743
743
  }
744
- interface IVideo extends IPlayerMethods, IRect {
745
- __: IVideoData;
746
- }
747
- interface IPlayerMethods {
748
- play(): void;
749
- pause(): void;
750
- stop(): void;
751
- }
752
- interface IVideoAttrData {
753
- url?: string;
754
- }
755
- interface IVideoData extends IVideoAttrData, IRectData {
756
- }
757
- interface IVideoInputData extends IVideoAttrData, IRectInputData {
758
- }
759
- interface IGIF extends IPlayerMethods, IRect {
760
- __: IGIFData;
761
- }
762
- interface IGIFAttrData {
763
- url?: string;
764
- }
765
- interface IGIFData extends IGIFAttrData, IRectData {
766
- }
767
- interface IGIFInputData extends IGIFAttrData, IRectInputData {
768
- }
769
- interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
770
- __: IRobotData;
771
- readonly running: boolean;
772
- readonly nowFrame?: IRobotComputedKeyframe;
773
- readonly robotFrames?: IRobotComputedKeyframe[];
774
- __updateRobot(): void;
775
- __updateAction(): void;
776
- }
777
- interface IRobotAttrData {
778
- robot?: IRobotKeyframe | IRobotKeyframe[];
779
- actions?: IRobotActions;
780
- action?: IRobotActionName;
781
- now?: number;
782
- FPS?: number;
783
- loop?: boolean | number;
784
- }
785
- interface IRobotActions {
786
- [name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation;
787
- }
788
- interface IRobotAnimation {
789
- keyframes: IKeyframeId[];
790
- loop?: boolean | number;
791
- FPS?: number;
792
- }
793
- type IRobotActionName = string;
794
- interface IRobotKeyframe {
795
- mode?: 'normal' | 'clip';
796
- url: string;
797
- offset?: IPointData;
798
- size?: number | ISizeData;
799
- total?: number;
800
- }
801
- interface IRobotComputedKeyframe extends IBoundsData {
802
- view: any;
803
- }
804
- interface IRobotData extends IRobotAttrData, IRectData {
805
- }
806
- interface IRobotInputData extends IRobotAttrData, IRectInputData {
807
- }
808
744
  interface IRect extends IUI {
809
745
  __: IRectData;
810
746
  }
@@ -941,6 +877,7 @@ interface IImageAttrData {
941
877
  background?: IFill;
942
878
  }
943
879
  interface IImageData extends IImageAttrData, IRectData {
880
+ readonly __urlType: IMultimediaType;
944
881
  __setImageFill(value: string): void;
945
882
  }
946
883
  interface IImageInputData extends IImageAttrData, IUIBaseInputData {
@@ -961,6 +898,71 @@ interface ICanvasData extends ICanvasAttrData, IRectData {
961
898
  }
962
899
  interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData {
963
900
  }
901
+ interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
902
+ __: IFilmData;
903
+ }
904
+ interface IFilmAttrData {
905
+ url?: string;
906
+ }
907
+ interface IFilmData extends IFilmAttrData, IImageData {
908
+ }
909
+ interface IFilmInputData extends IFilmAttrData, IUIBaseInputData {
910
+ }
911
+ interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
912
+ __: IVideoData;
913
+ }
914
+ interface IPlayerMethods {
915
+ togglePlay(): void;
916
+ play(): void;
917
+ pause(): void;
918
+ stop(): void;
919
+ }
920
+ interface IVideoAttrData {
921
+ url?: string;
922
+ }
923
+ interface IVideoData extends IVideoAttrData, IImageData {
924
+ }
925
+ interface IVideoInputData extends IVideoAttrData, IImageInputData {
926
+ }
927
+ interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
928
+ __: IRobotData;
929
+ readonly running: boolean;
930
+ readonly nowFrame?: IRobotComputedKeyframe;
931
+ readonly robotFrames?: IRobotComputedKeyframe[];
932
+ __updateRobot(): void;
933
+ __updateAction(): void;
934
+ }
935
+ interface IRobotAttrData {
936
+ robot?: IRobotKeyframe | IRobotKeyframe[];
937
+ actions?: IRobotActions;
938
+ action?: IRobotActionName;
939
+ now?: number;
940
+ FPS?: number;
941
+ loop?: boolean | number;
942
+ }
943
+ interface IRobotActions {
944
+ [name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation;
945
+ }
946
+ interface IRobotAnimation {
947
+ keyframes: IKeyframeId[];
948
+ loop?: boolean | number;
949
+ FPS?: number;
950
+ }
951
+ type IRobotActionName = string;
952
+ interface IRobotKeyframe {
953
+ mode?: 'normal' | 'clip';
954
+ url: string;
955
+ offset?: IPointData;
956
+ size?: number | ISizeData;
957
+ total?: number;
958
+ }
959
+ interface IRobotComputedKeyframe extends IBoundsData {
960
+ view: any;
961
+ }
962
+ interface IRobotData extends IRobotAttrData, IRectData {
963
+ }
964
+ interface IRobotInputData extends IRobotAttrData, IRectInputData {
965
+ }
964
966
  interface ILeaferData extends IGroupData {
965
967
  }
966
968
  interface ILeaferInputData extends IGroupInputData {
@@ -1115,8 +1117,8 @@ interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderCompute
1115
1117
  interface IUIBaseInputData extends IUIAttrData, IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
1116
1118
  children?: IUIInputData[];
1117
1119
  }
1118
- type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | 'GIF' | 'Video' | (string & {});
1119
- interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IGIFInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
1120
+ type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | 'Film' | 'Video' | (string & {});
1121
+ interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
1120
1122
  children?: IUIInputData[];
1121
1123
  }
1122
1124
  interface IUIJSONData extends IUIInputData {
@@ -1262,6 +1264,8 @@ interface IPaintModule {
1262
1264
  }
1263
1265
  interface IPaintImageModule {
1264
1266
  image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
1267
+ film?(paint: ILeafPaint): void;
1268
+ video?(paint: ILeafPaint): void;
1265
1269
  checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean;
1266
1270
  drawImage(paint: ILeafPaint, imageScaleX: number, imageScaleY: number, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
1267
1271
  getImageRenderScaleData(paint: ILeafPaint, ui: IUI, canvas?: ILeaferCanvas, renderOptions?: IRenderOptions): IScaleData$1;
@@ -1311,4 +1315,4 @@ interface IFilterFunction {
1311
1315
  (filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
1312
1316
  }
1313
1317
 
1314
- export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowStyle, IArrowType, IArrowTypeData, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeEditInner, IEditorBeforeEditOuter, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorEditInnerData, IEditorEditOuterData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGIF, IGIFData, IGIFInputData, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, ILinker, ILinkerData, ILinkerInputData, ILinkerPointData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IScrollConfig, IScrollTheme, IScroller, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeComputedStyle, IStrokeGradientPaint, IStrokeImagePaint, IStrokeInputData, IStrokeJoin, IStrokePaint, IStrokeSolidPaint, IStrokeStyle, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextOverflow, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransformTool, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };
1318
+ export type { IAnimate, IAnimateKeyframe, IAnimateList, IAnimateType, IAnimation, IApp, IAppConfig, IAppData, IAppForEachFunction, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowStyle, IArrowType, IArrowTypeData, IBackgroundBoxStyle, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, IComputedKeyframe, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointInputData, IEditPointType, IEditToolFunction, IEditorBase, IEditorBeforeEditInner, IEditorBeforeEditOuter, IEditorBeforeMove, IEditorBeforeRotate, IEditorBeforeScale, IEditorBeforeSelect, IEditorBeforeSkew, IEditorConfig, IEditorConfigFunction, IEditorDragStartData, IEditorEditInnerData, IEditorEditOuterData, IEditorMoveData, IEditorRotationData, IEditorScaleData, IEditorSelectData, IEditorSkewData, IEffect, IEffectAttrData, IEffectComputedData, IEffectInputData, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFilm, IFilmData, IFilmInputData, IFilterFunction, IFilterModule, IFilterProcessor, IFindUIMethod, IFlow, IFlowData, IFlowInputData, IFontWeight, IFontWeightNumer, IFontWeightString, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGradientType, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, ILinker, ILinkerData, ILinkerInputData, ILinkerPointData, IOverflow, IPaint, IPaintAttr, IPaintBase, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPaintType, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathDataArrowOffset, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IRobot, IRobotActionName, IRobotActions, IRobotAnimation, IRobotComputedKeyframe, IRobotData, IRobotInputData, IRobotKeyframe, IScrollConfig, IScrollTheme, IScroller, IShadowEffect, IShadowString, ISolidPaint, IStar, IStarData, IStarInputData, IStateModule, IStateName, IStateStyle, IStates, IStroke, IStrokeAlign, IStrokeAttrData, IStrokeCap, IStrokeComputedData, IStrokeComputedStyle, IStrokeGradientPaint, IStrokeImagePaint, IStrokeInputData, IStrokeJoin, IStrokePaint, IStrokeSolidPaint, IStrokeStyle, IStrokeWidthString, IStyleAnimation, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDecorationData, ITextDecorationType, ITextDrawData, ITextInputData, ITextOverflow, ITextRenderModule, ITextRowData, ITextStyleAttrData, ITextStyleComputedData, ITextStyleInputData, ITextWordData, ITextWrap, ITransformTool, ITransitionFunction, ITransitionMap, ITransitionModule, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIJSONData, IUIRenderModule, IUITag, IVectorPath, IVerticalAlign, IVideo, IVideoData, IVideoInputData, IWritingMode };