@leafer-ui/interface 2.0.1 → 2.0.3
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 +2 -2
- package/src/ICommonAttr.ts +2 -2
- package/src/IUI.ts +123 -90
- package/src/index.ts +3 -3
- package/src/module/IPaint.ts +8 -1
- package/src/module/IPathArrow.ts +4 -2
- package/src/type/IComputedType.ts +8 -6
- package/src/type/IType.ts +25 -13
- package/types/index.d.ts +120 -92
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
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.
|
|
25
|
+
"@leafer/interface": "2.0.3"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface IStrokeInputData extends IStrokeStyle {
|
|
|
53
53
|
export interface IStrokeStyle {
|
|
54
54
|
strokeAlign?: IStrokeAlign
|
|
55
55
|
strokeWidth?: IFourNumber | IStrokeWidthString
|
|
56
|
-
|
|
56
|
+
strokeScaleFixed?: IScaleFixed
|
|
57
57
|
strokeCap?: IStrokeCap
|
|
58
58
|
strokeJoin?: IStrokeJoin
|
|
59
59
|
dashPattern?: INumber[] | IDashPatternString
|
|
@@ -72,7 +72,7 @@ export interface IStrokeComputedStyle {
|
|
|
72
72
|
strokeAlign?: IStrokeAlign
|
|
73
73
|
strokeWidth?: number
|
|
74
74
|
strokeWidths?: number[]
|
|
75
|
-
|
|
75
|
+
strokeScaleFixed?: IScaleFixed
|
|
76
76
|
strokeCap?: IStrokeCap
|
|
77
77
|
strokeJoin?: IStrokeJoin
|
|
78
78
|
dashPattern?: number[]
|
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, IDirection4, IOptionPointData, IDirection } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
IFillAttrData, IFillInputData, IFillComputedData,
|
|
@@ -44,21 +44,43 @@ export interface IArrowInputData extends IArrowAttrData, ILineInputData { }
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
// Linker
|
|
47
|
-
export interface ILinker extends
|
|
47
|
+
export interface ILinker extends ILine {
|
|
48
48
|
__: ILinkerData
|
|
49
|
+
|
|
50
|
+
startNode: IUI
|
|
51
|
+
endNode: IUI
|
|
52
|
+
|
|
53
|
+
startData: ILinkerComputedPointData
|
|
54
|
+
endData: ILinkerComputedPointData
|
|
55
|
+
|
|
56
|
+
createLinkerPoint(worldPoint: IPointData, node: IUI, options?: ILinkerPointOptions): ILinkerPointData
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
export interface ILinkerPointData {
|
|
52
|
-
id
|
|
60
|
+
id?: string | IUI,
|
|
61
|
+
direction?: IDirection4 | 'center'
|
|
53
62
|
point?: IAround,
|
|
63
|
+
offset?: IOptionPointData
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ILinkerPointOptions {
|
|
67
|
+
snapRadius?: number
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type ILinkerPointType = 'start' | 'end'
|
|
71
|
+
|
|
72
|
+
export interface ILinkerComputedPointData {
|
|
73
|
+
auto: boolean
|
|
74
|
+
direction: IDirection
|
|
75
|
+
point: IPointData
|
|
54
76
|
}
|
|
55
77
|
|
|
56
78
|
interface ILinkerAttrData {
|
|
57
79
|
startPoint?: ILinkerPointData | IUI | string
|
|
58
80
|
endPoint?: ILinkerPointData | IUI | string
|
|
59
81
|
}
|
|
60
|
-
export interface ILinkerData extends ILinkerAttrData,
|
|
61
|
-
export interface ILinkerInputData extends ILinkerAttrData,
|
|
82
|
+
export interface ILinkerData extends ILinkerAttrData, ILineData { }
|
|
83
|
+
export interface ILinkerInputData extends ILinkerAttrData, ILineInputData { }
|
|
62
84
|
|
|
63
85
|
|
|
64
86
|
// Flow
|
|
@@ -73,88 +95,6 @@ export interface IFlowData extends IFlowAttrData, IBoxData { }
|
|
|
73
95
|
export interface IFlowInputData extends IFlowAttrData, IBoxInputData { }
|
|
74
96
|
|
|
75
97
|
|
|
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
98
|
// Rect
|
|
159
99
|
export interface IRect extends IUI {
|
|
160
100
|
__: IRectData
|
|
@@ -313,10 +253,13 @@ interface IImageAttrData {
|
|
|
313
253
|
background?: IFill
|
|
314
254
|
}
|
|
315
255
|
export interface IImageData extends IImageAttrData, IRectData {
|
|
256
|
+
readonly __urlType: IMultimediaType
|
|
316
257
|
__setImageFill(value: string): void
|
|
317
258
|
}
|
|
318
259
|
export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
|
|
319
260
|
|
|
261
|
+
|
|
262
|
+
// Canvas
|
|
320
263
|
export interface ICanvas extends ICanvasAttrData, IRect {
|
|
321
264
|
__: ICanvasData
|
|
322
265
|
canvas?: ILeaferCanvas
|
|
@@ -333,6 +276,91 @@ export interface ICanvasData extends ICanvasAttrData, IRectData { }
|
|
|
333
276
|
export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
|
|
334
277
|
|
|
335
278
|
|
|
279
|
+
// Film
|
|
280
|
+
export interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
|
|
281
|
+
__: IFilmData
|
|
282
|
+
seekFrame(frameIndex: number): void
|
|
283
|
+
}
|
|
284
|
+
interface IFilmAttrData {
|
|
285
|
+
url?: string
|
|
286
|
+
}
|
|
287
|
+
export interface IFilmData extends IFilmAttrData, IImageData {
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
export interface IFilmInputData extends IFilmAttrData, IUIBaseInputData { }
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
// Video
|
|
295
|
+
export interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
|
|
296
|
+
__: IVideoData
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface IPlayerMethods {
|
|
300
|
+
togglePlay(): void
|
|
301
|
+
play(): void
|
|
302
|
+
pause(): void
|
|
303
|
+
stop(): void
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface IVideoAttrData {
|
|
307
|
+
url?: string
|
|
308
|
+
}
|
|
309
|
+
export interface IVideoData extends IVideoAttrData, IImageData { }
|
|
310
|
+
export interface IVideoInputData extends IVideoAttrData, IImageInputData { }
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
// Robot
|
|
315
|
+
export interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
316
|
+
__: IRobotData
|
|
317
|
+
readonly running: boolean
|
|
318
|
+
readonly nowFrame?: IRobotComputedKeyframe
|
|
319
|
+
readonly robotFrames?: IRobotComputedKeyframe[]
|
|
320
|
+
|
|
321
|
+
__updateRobot(): void
|
|
322
|
+
__updateAction(): void
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
interface IRobotAttrData {
|
|
326
|
+
robot?: IRobotKeyframe | IRobotKeyframe[]
|
|
327
|
+
actions?: IRobotActions
|
|
328
|
+
action?: IRobotActionName
|
|
329
|
+
now?: number
|
|
330
|
+
FPS?: number
|
|
331
|
+
loop?: boolean | number
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface IRobotActions {
|
|
335
|
+
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface IRobotAnimation {
|
|
339
|
+
keyframes: IKeyframeId[]
|
|
340
|
+
loop?: boolean | number
|
|
341
|
+
FPS?: number
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export type IRobotActionName = string
|
|
345
|
+
|
|
346
|
+
export interface IRobotKeyframe {
|
|
347
|
+
mode?: 'normal' | 'clip'
|
|
348
|
+
url: string
|
|
349
|
+
|
|
350
|
+
offset?: IPointData
|
|
351
|
+
size?: number | ISizeData
|
|
352
|
+
total?: number
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface IRobotComputedKeyframe extends IBoundsData {
|
|
356
|
+
view: any
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface IRobotData extends IRobotAttrData, IRectData { }
|
|
360
|
+
export interface IRobotInputData extends IRobotAttrData, IRectInputData { }
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
336
364
|
// Leafer
|
|
337
365
|
export interface ILeaferData extends IGroupData {
|
|
338
366
|
|
|
@@ -419,6 +447,9 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
|
|
|
419
447
|
|
|
420
448
|
children?: IUI[]
|
|
421
449
|
|
|
450
|
+
startLinker?: ILinker[]
|
|
451
|
+
endLinker?: ILinker[]
|
|
452
|
+
|
|
422
453
|
__box?: IUI // 背景box, 一般用于文本背景框
|
|
423
454
|
__animate?: IAnimate
|
|
424
455
|
|
|
@@ -441,6 +472,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
|
|
|
441
472
|
|
|
442
473
|
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData
|
|
443
474
|
getPathString(curve?: boolean, pathForRender?: boolean): IPathString
|
|
475
|
+
asPath(curve?: boolean, pathForRender?: boolean): void
|
|
444
476
|
|
|
445
477
|
load(): void
|
|
446
478
|
|
|
@@ -509,8 +541,9 @@ export interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
509
541
|
__isFills?: boolean
|
|
510
542
|
__isStrokes?: boolean
|
|
511
543
|
|
|
512
|
-
readonly __strokeWidth: number // 会受
|
|
544
|
+
readonly __strokeWidth: number // 会受 strokeScaleFixed 影响
|
|
513
545
|
readonly __maxStrokeWidth: number
|
|
546
|
+
__strokeWidthCache?: number // 一般用于固定线宽的箭头做缓存对比
|
|
514
547
|
__hasMultiStrokeStyle?: number // 是否存在多个不同的描述样式(同时存储多个描边样式中的最大宽度用于运算)
|
|
515
548
|
readonly __hasMultiPaint?: boolean
|
|
516
549
|
|
|
@@ -571,12 +604,12 @@ export type IUITag =
|
|
|
571
604
|
| 'Box'
|
|
572
605
|
| 'Arrow'
|
|
573
606
|
| 'Robot'
|
|
574
|
-
| '
|
|
607
|
+
| 'Film'
|
|
575
608
|
| 'Video'
|
|
576
609
|
| (string & {})
|
|
577
610
|
|
|
578
611
|
|
|
579
|
-
export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData,
|
|
612
|
+
export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
|
|
580
613
|
children?: IUIInputData[]
|
|
581
614
|
}
|
|
582
615
|
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { ILeafer } from './app/ILeafer'
|
|
|
6
6
|
export {
|
|
7
7
|
ILine, ILineInputData, ILineData,
|
|
8
8
|
IArrow, IArrowInputData, IArrowData,
|
|
9
|
-
ILinker, ILinkerInputData, ILinkerData, ILinkerPointData,
|
|
9
|
+
ILinker, ILinkerInputData, ILinkerData, ILinkerPointData, ILinkerPointOptions, ILinkerComputedPointData, ILinkerPointType,
|
|
10
10
|
IRect, IRectInputData, IRectData,
|
|
11
11
|
IEllipse, IEllipseInputData, IEllipseData,
|
|
12
12
|
IPolygon, IPolygonInputData, IPolygonData,
|
|
@@ -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,
|
|
@@ -29,7 +29,7 @@ export {
|
|
|
29
29
|
IUITag, IUIInputData, IUIJSONData, IStateStyle, IStates, IStateName
|
|
30
30
|
} from './IUI'
|
|
31
31
|
|
|
32
|
-
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowStyle, IArrowType, IArrowTypeData, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IStrokePaint, IStrokeSolidPaint, IGradientPaint, IStrokeGradientPaint, IImagePaint, IStrokeImagePaint, IImagePaintMode, IFontWeight, IFontWeightNumer, IFontWeightString, ITextCase, ITextDecoration, ITextDecorationType, ITextDecorationData, IWritingMode, ITextAlign, IVerticalAlign, IOverflow, ITextOverflow, ITextWrap, IRepeat, IGradientType, IPaintType, IImageFilters, IPathDataArrowOffset, ISolidPaint, IPaintBase } from './type/IType'
|
|
32
|
+
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowStyle, IArrowType, IArrowTypeData, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IStrokePaint, IStrokeSolidPaint, IGradientPaint, IStrokeGradientPaint, IImagePaint, IStrokeImagePaint, IImagePaintMode, IFontWeight, IFontWeightNumer, IFontWeightString, ITextCase, ITextDecoration, ITextDecorationType, ITextDecorationData, IWritingMode, ITextAlign, IVerticalAlign, IOverflow, ITextOverflow, ITextWrap, IRepeat, IGradientType, IPaintType, IImageFilters, IImageFilter, IImageFilterType, IPathDataArrowOffset, ISolidPaint, IPaintBase } from './type/IType'
|
|
33
33
|
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
|
|
34
34
|
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
|
|
35
35
|
export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, IStrokeComputedStyle, IStrokeStyle, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'
|
package/src/module/IPaint.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage,
|
|
|
3
3
|
import { ILeafPaint, ILeafStrokePaint, ILeafPaintPatternData } from '../type/IComputedType'
|
|
4
4
|
import { IUI, IUIData } from '../IUI'
|
|
5
5
|
import { ICachedShape } from '../ICachedShape'
|
|
6
|
-
import { IGradientPaint, IImagePaint, IPaintAttr } from '../type/IType'
|
|
6
|
+
import { IGradientPaint, IImageFilters, IImagePaint, IPaintAttr } from '../type/IType'
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export interface IPaintModule {
|
|
@@ -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 // 当前图片渲染的比例数据,必须马上分解使用
|
|
@@ -42,6 +45,10 @@ export interface IPaintImageModule {
|
|
|
42
45
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void
|
|
43
46
|
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData
|
|
44
47
|
|
|
48
|
+
//@leafer-in/image-filter will rewrite
|
|
49
|
+
applyFilter?(leafPaint: ILeafPaint, image: ILeaferImage, filter: IImageFilters, ui: IUI): void
|
|
50
|
+
recycleFilter?(image: ILeaferImage, ui: IUI): void
|
|
51
|
+
|
|
45
52
|
stretchMode(data: ILeafPaintPatternData, box: IBoundsData, scaleX: number, scaleY: number): void
|
|
46
53
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
|
|
47
54
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void
|
package/src/module/IPathArrow.ts
CHANGED
|
@@ -4,7 +4,9 @@ import { IUI } from '../IUI'
|
|
|
4
4
|
|
|
5
5
|
export interface IPathArrowModule {
|
|
6
6
|
list: IPathDataArrowMap
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
fillList: IPathDataArrowMap
|
|
8
|
+
addArrows(ui: IUI, updateCache?: boolean): void
|
|
9
|
+
updateArrow(ui: IUI): void
|
|
10
|
+
register(name: string, data: IPathDataArrow, fillData?: IPathDataArrow): void
|
|
9
11
|
get(name: string): IPathDataArrow
|
|
10
12
|
}
|
|
@@ -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,
|
|
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:
|
|
73
|
+
export interface IImagePaint extends IPaintBase, IFilmOptions {
|
|
74
|
+
type: IMultimediaType
|
|
75
75
|
|
|
76
76
|
url: string
|
|
77
77
|
lod?: IImageLOD
|
|
@@ -79,7 +79,7 @@ export interface IImagePaint extends IPaintBase {
|
|
|
79
79
|
mode?: IImagePaintMode
|
|
80
80
|
format?: IExportFileType
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
filter?: IImageFilters
|
|
83
83
|
|
|
84
84
|
padding?: IFourNumber
|
|
85
85
|
|
|
@@ -105,15 +105,25 @@ export interface IImagePaint extends IPaintBase {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export interface IStrokeImagePaint extends IImagePaint { }
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
|
|
109
|
+
export type IImageFilterType =
|
|
110
|
+
| 'exposure' // 曝光
|
|
111
|
+
| 'contrast' // 对比度
|
|
112
|
+
| 'saturation' // 饱和度
|
|
113
|
+
| 'temperature' // 色温
|
|
114
|
+
| 'tint' // 色调
|
|
115
|
+
| 'highlights' // 高光
|
|
116
|
+
| 'shadows' // 阴影
|
|
117
|
+
| (string & {})
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
export interface IImageFilter {
|
|
121
|
+
type: IImageFilterType
|
|
122
|
+
value: number // -1 ~ 1
|
|
116
123
|
}
|
|
124
|
+
|
|
125
|
+
export type IImageFilters = IImageFilter[]
|
|
126
|
+
|
|
117
127
|
export type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'stretch' | 'clip' | 'repeat'
|
|
118
128
|
export type IRepeat = boolean | 'x' | 'y' | IPointData
|
|
119
129
|
|
|
@@ -129,6 +139,7 @@ export type IArrowStyle = IPathDataArrow | IArrowType | IArrowTypeData
|
|
|
129
139
|
export interface IArrowTypeData {
|
|
130
140
|
type: IArrowType
|
|
131
141
|
scale?: number
|
|
142
|
+
rotation?: number
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
export interface IPathDataArrowMap {
|
|
@@ -140,6 +151,7 @@ export interface IPathDataArrow {
|
|
|
140
151
|
offset?: IPathDataArrowOffset // 箭头偏移距离,与末端对齐
|
|
141
152
|
path: IPathCommandData
|
|
142
153
|
dashPath?: IPathCommandData // 采用虚线时,需增加填充的内容
|
|
154
|
+
fill?: boolean // 是否进行fill,性能会差一点
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
export interface IPathDataArrowOffset {
|
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,
|
|
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, IDirection4 as IDirection4$1, IAround, IOptionPointData, IPathCreator, IJSONOptions, IFindCondition, IAnswer, IPathString, IPathDrawer, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPickOptions, IPickResult, 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 = '
|
|
30
|
+
type IPaintType = 'solid' | IGradientType | IMultimediaType;
|
|
31
31
|
type IGradientType = 'linear' | 'radial' | 'angular';
|
|
32
32
|
interface ISolidPaint extends IPaintBase {
|
|
33
33
|
type: 'solid';
|
|
@@ -59,13 +59,13 @@ interface IColorStop {
|
|
|
59
59
|
color: IColor;
|
|
60
60
|
selected?: boolean;
|
|
61
61
|
}
|
|
62
|
-
interface IImagePaint extends IPaintBase {
|
|
63
|
-
type:
|
|
62
|
+
interface IImagePaint extends IPaintBase, IFilmOptions {
|
|
63
|
+
type: IMultimediaType;
|
|
64
64
|
url: string;
|
|
65
65
|
lod?: IImageLOD;
|
|
66
66
|
mode?: IImagePaintMode;
|
|
67
67
|
format?: IExportFileType;
|
|
68
|
-
|
|
68
|
+
filter?: IImageFilters;
|
|
69
69
|
padding?: IFourNumber;
|
|
70
70
|
align?: IAlign;
|
|
71
71
|
offset?: IPointData;
|
|
@@ -84,15 +84,12 @@ interface IImagePaint extends IPaintBase {
|
|
|
84
84
|
}
|
|
85
85
|
interface IStrokeImagePaint extends IImagePaint {
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
temperature?: number;
|
|
92
|
-
tint?: number;
|
|
93
|
-
highlights?: number;
|
|
94
|
-
shadows?: number;
|
|
87
|
+
type IImageFilterType = 'exposure' | 'contrast' | 'saturation' | 'temperature' | 'tint' | 'highlights' | 'shadows' | (string & {});
|
|
88
|
+
interface IImageFilter {
|
|
89
|
+
type: IImageFilterType;
|
|
90
|
+
value: number;
|
|
95
91
|
}
|
|
92
|
+
type IImageFilters = IImageFilter[];
|
|
96
93
|
type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'stretch' | 'clip' | 'repeat';
|
|
97
94
|
type IRepeat = boolean | 'x' | 'y' | IPointData;
|
|
98
95
|
type IStrokeAlign = 'inside' | 'outside' | 'center';
|
|
@@ -103,6 +100,7 @@ type IArrowStyle = IPathDataArrow | IArrowType | IArrowTypeData;
|
|
|
103
100
|
interface IArrowTypeData {
|
|
104
101
|
type: IArrowType;
|
|
105
102
|
scale?: number;
|
|
103
|
+
rotation?: number;
|
|
106
104
|
}
|
|
107
105
|
interface IPathDataArrowMap {
|
|
108
106
|
[name: string]: IPathDataArrow;
|
|
@@ -112,6 +110,7 @@ interface IPathDataArrow {
|
|
|
112
110
|
offset?: IPathDataArrowOffset;
|
|
113
111
|
path: IPathCommandData;
|
|
114
112
|
dashPath?: IPathCommandData;
|
|
113
|
+
fill?: boolean;
|
|
115
114
|
}
|
|
116
115
|
interface IPathDataArrowOffset {
|
|
117
116
|
x?: number;
|
|
@@ -166,7 +165,7 @@ type IOverflow = 'show' | 'hide' | 'scroll' | 'x-scroll' | 'y-scroll';
|
|
|
166
165
|
type ITextOverflow = 'show' | 'hide' | 'ellipsis' | (string & {});
|
|
167
166
|
|
|
168
167
|
type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern;
|
|
169
|
-
interface ILeafPaint {
|
|
168
|
+
interface ILeafPaint extends IFilmPlayOptions {
|
|
170
169
|
type?: IPaintType;
|
|
171
170
|
style?: ILeafPaintColor;
|
|
172
171
|
strokeStyle?: IStrokeComputedStyle;
|
|
@@ -175,20 +174,20 @@ interface ILeafPaint {
|
|
|
175
174
|
level?: number;
|
|
176
175
|
drawLevel?: number;
|
|
177
176
|
loadId?: number;
|
|
178
|
-
patternId?: string;
|
|
177
|
+
patternId?: string | number;
|
|
179
178
|
patternTask?: ITaskItem;
|
|
180
179
|
progressTimer?: any;
|
|
180
|
+
complex?: boolean | 2;
|
|
181
181
|
isTransparent?: boolean;
|
|
182
182
|
data?: ILeafPaintPatternData;
|
|
183
183
|
originPaint?: IPaint;
|
|
184
|
+
film?: boolean;
|
|
184
185
|
}
|
|
185
186
|
interface ILeafPaintPatternData {
|
|
186
187
|
scaleX?: number;
|
|
187
188
|
scaleY?: number;
|
|
188
189
|
gap?: IPointData;
|
|
189
|
-
opacity?: number;
|
|
190
190
|
transform?: IMatrixData;
|
|
191
|
-
filters?: IImageFilters;
|
|
192
191
|
mode?: IImagePaintMode;
|
|
193
192
|
repeat?: 'repeat' | 'repeat-x' | 'repeat-y';
|
|
194
193
|
interlace?: IInterlace;
|
|
@@ -255,7 +254,7 @@ interface IStrokeInputData extends IStrokeStyle {
|
|
|
255
254
|
interface IStrokeStyle {
|
|
256
255
|
strokeAlign?: IStrokeAlign;
|
|
257
256
|
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
258
|
-
|
|
257
|
+
strokeScaleFixed?: IScaleFixed;
|
|
259
258
|
strokeCap?: IStrokeCap;
|
|
260
259
|
strokeJoin?: IStrokeJoin;
|
|
261
260
|
dashPattern?: INumber[] | IDashPatternString;
|
|
@@ -271,7 +270,7 @@ interface IStrokeComputedStyle {
|
|
|
271
270
|
strokeAlign?: IStrokeAlign;
|
|
272
271
|
strokeWidth?: number;
|
|
273
272
|
strokeWidths?: number[];
|
|
274
|
-
|
|
273
|
+
strokeScaleFixed?: IScaleFixed;
|
|
275
274
|
strokeCap?: IStrokeCap;
|
|
276
275
|
strokeJoin?: IStrokeJoin;
|
|
277
276
|
dashPattern?: number[];
|
|
@@ -717,20 +716,36 @@ interface IArrowData extends IArrowAttrData, ILineData {
|
|
|
717
716
|
}
|
|
718
717
|
interface IArrowInputData extends IArrowAttrData, ILineInputData {
|
|
719
718
|
}
|
|
720
|
-
interface ILinker extends
|
|
719
|
+
interface ILinker extends ILine {
|
|
721
720
|
__: ILinkerData;
|
|
721
|
+
startNode: IUI;
|
|
722
|
+
endNode: IUI;
|
|
723
|
+
startData: ILinkerComputedPointData;
|
|
724
|
+
endData: ILinkerComputedPointData;
|
|
725
|
+
createLinkerPoint(worldPoint: IPointData, node: IUI, options?: ILinkerPointOptions): ILinkerPointData;
|
|
722
726
|
}
|
|
723
727
|
interface ILinkerPointData {
|
|
724
|
-
id
|
|
728
|
+
id?: string | IUI;
|
|
729
|
+
direction?: IDirection4$1 | 'center';
|
|
725
730
|
point?: IAround;
|
|
731
|
+
offset?: IOptionPointData;
|
|
732
|
+
}
|
|
733
|
+
interface ILinkerPointOptions {
|
|
734
|
+
snapRadius?: number;
|
|
735
|
+
}
|
|
736
|
+
type ILinkerPointType = 'start' | 'end';
|
|
737
|
+
interface ILinkerComputedPointData {
|
|
738
|
+
auto: boolean;
|
|
739
|
+
direction: IDirection;
|
|
740
|
+
point: IPointData;
|
|
726
741
|
}
|
|
727
742
|
interface ILinkerAttrData {
|
|
728
743
|
startPoint?: ILinkerPointData | IUI | string;
|
|
729
744
|
endPoint?: ILinkerPointData | IUI | string;
|
|
730
745
|
}
|
|
731
|
-
interface ILinkerData extends ILinkerAttrData,
|
|
746
|
+
interface ILinkerData extends ILinkerAttrData, ILineData {
|
|
732
747
|
}
|
|
733
|
-
interface ILinkerInputData extends ILinkerAttrData,
|
|
748
|
+
interface ILinkerInputData extends ILinkerAttrData, ILineInputData {
|
|
734
749
|
}
|
|
735
750
|
interface IFlow extends IBox {
|
|
736
751
|
__: IFlowData;
|
|
@@ -741,70 +756,6 @@ interface IFlowData extends IFlowAttrData, IBoxData {
|
|
|
741
756
|
}
|
|
742
757
|
interface IFlowInputData extends IFlowAttrData, IBoxInputData {
|
|
743
758
|
}
|
|
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
759
|
interface IRect extends IUI {
|
|
809
760
|
__: IRectData;
|
|
810
761
|
}
|
|
@@ -941,6 +892,7 @@ interface IImageAttrData {
|
|
|
941
892
|
background?: IFill;
|
|
942
893
|
}
|
|
943
894
|
interface IImageData extends IImageAttrData, IRectData {
|
|
895
|
+
readonly __urlType: IMultimediaType;
|
|
944
896
|
__setImageFill(value: string): void;
|
|
945
897
|
}
|
|
946
898
|
interface IImageInputData extends IImageAttrData, IUIBaseInputData {
|
|
@@ -961,6 +913,72 @@ interface ICanvasData extends ICanvasAttrData, IRectData {
|
|
|
961
913
|
}
|
|
962
914
|
interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData {
|
|
963
915
|
}
|
|
916
|
+
interface IFilm extends IFilmAttrData, IPlayerMethods, IImage {
|
|
917
|
+
__: IFilmData;
|
|
918
|
+
seekFrame(frameIndex: number): void;
|
|
919
|
+
}
|
|
920
|
+
interface IFilmAttrData {
|
|
921
|
+
url?: string;
|
|
922
|
+
}
|
|
923
|
+
interface IFilmData extends IFilmAttrData, IImageData {
|
|
924
|
+
}
|
|
925
|
+
interface IFilmInputData extends IFilmAttrData, IUIBaseInputData {
|
|
926
|
+
}
|
|
927
|
+
interface IVideo extends IVideoAttrData, IPlayerMethods, IImage {
|
|
928
|
+
__: IVideoData;
|
|
929
|
+
}
|
|
930
|
+
interface IPlayerMethods {
|
|
931
|
+
togglePlay(): void;
|
|
932
|
+
play(): void;
|
|
933
|
+
pause(): void;
|
|
934
|
+
stop(): void;
|
|
935
|
+
}
|
|
936
|
+
interface IVideoAttrData {
|
|
937
|
+
url?: string;
|
|
938
|
+
}
|
|
939
|
+
interface IVideoData extends IVideoAttrData, IImageData {
|
|
940
|
+
}
|
|
941
|
+
interface IVideoInputData extends IVideoAttrData, IImageInputData {
|
|
942
|
+
}
|
|
943
|
+
interface IRobot extends IRobotAttrData, IPlayerMethods, IRect {
|
|
944
|
+
__: IRobotData;
|
|
945
|
+
readonly running: boolean;
|
|
946
|
+
readonly nowFrame?: IRobotComputedKeyframe;
|
|
947
|
+
readonly robotFrames?: IRobotComputedKeyframe[];
|
|
948
|
+
__updateRobot(): void;
|
|
949
|
+
__updateAction(): void;
|
|
950
|
+
}
|
|
951
|
+
interface IRobotAttrData {
|
|
952
|
+
robot?: IRobotKeyframe | IRobotKeyframe[];
|
|
953
|
+
actions?: IRobotActions;
|
|
954
|
+
action?: IRobotActionName;
|
|
955
|
+
now?: number;
|
|
956
|
+
FPS?: number;
|
|
957
|
+
loop?: boolean | number;
|
|
958
|
+
}
|
|
959
|
+
interface IRobotActions {
|
|
960
|
+
[name: string]: IKeyframeId | IKeyframeId[] | IRobotAnimation;
|
|
961
|
+
}
|
|
962
|
+
interface IRobotAnimation {
|
|
963
|
+
keyframes: IKeyframeId[];
|
|
964
|
+
loop?: boolean | number;
|
|
965
|
+
FPS?: number;
|
|
966
|
+
}
|
|
967
|
+
type IRobotActionName = string;
|
|
968
|
+
interface IRobotKeyframe {
|
|
969
|
+
mode?: 'normal' | 'clip';
|
|
970
|
+
url: string;
|
|
971
|
+
offset?: IPointData;
|
|
972
|
+
size?: number | ISizeData;
|
|
973
|
+
total?: number;
|
|
974
|
+
}
|
|
975
|
+
interface IRobotComputedKeyframe extends IBoundsData {
|
|
976
|
+
view: any;
|
|
977
|
+
}
|
|
978
|
+
interface IRobotData extends IRobotAttrData, IRectData {
|
|
979
|
+
}
|
|
980
|
+
interface IRobotInputData extends IRobotAttrData, IRectInputData {
|
|
981
|
+
}
|
|
964
982
|
interface ILeaferData extends IGroupData {
|
|
965
983
|
}
|
|
966
984
|
interface ILeaferInputData extends IGroupInputData {
|
|
@@ -1026,6 +1044,8 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
|
|
|
1026
1044
|
animation?: IAnimation | IAnimation[];
|
|
1027
1045
|
animationOut?: IAnimation | IAnimation[];
|
|
1028
1046
|
children?: IUI[];
|
|
1047
|
+
startLinker?: ILinker[];
|
|
1048
|
+
endLinker?: ILinker[];
|
|
1029
1049
|
__box?: IUI;
|
|
1030
1050
|
__animate?: IAnimate;
|
|
1031
1051
|
readonly pen: IPathCreator;
|
|
@@ -1041,6 +1061,7 @@ interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICornerRadius
|
|
|
1041
1061
|
findId(id: number | string): IUI | undefined;
|
|
1042
1062
|
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
|
|
1043
1063
|
getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
|
|
1064
|
+
asPath(curve?: boolean, pathForRender?: boolean): void;
|
|
1044
1065
|
load(): void;
|
|
1045
1066
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData, ignoreCornerRadius?: boolean): void;
|
|
1046
1067
|
__drawPathByBox(drawer: IPathDrawer, ignoreCornerRadius?: boolean): void;
|
|
@@ -1087,6 +1108,7 @@ interface IUIData extends IUIAttrData, IUIComputedData, ILeafData {
|
|
|
1087
1108
|
__isStrokes?: boolean;
|
|
1088
1109
|
readonly __strokeWidth: number;
|
|
1089
1110
|
readonly __maxStrokeWidth: number;
|
|
1111
|
+
__strokeWidthCache?: number;
|
|
1090
1112
|
__hasMultiStrokeStyle?: number;
|
|
1091
1113
|
readonly __hasMultiPaint?: boolean;
|
|
1092
1114
|
__isAlphaPixelFill?: boolean;
|
|
@@ -1115,8 +1137,8 @@ interface IUIComputedData extends IUIAttrData, IFillComputedData, IBorderCompute
|
|
|
1115
1137
|
interface IUIBaseInputData extends IUIAttrData, IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
1116
1138
|
children?: IUIInputData[];
|
|
1117
1139
|
}
|
|
1118
|
-
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | '
|
|
1119
|
-
interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData,
|
|
1140
|
+
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box' | 'Arrow' | 'Robot' | 'Film' | 'Video' | (string & {});
|
|
1141
|
+
interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IBoxInputData, IFrameInputData, IFlowInputData, IArrowInputData, IVideoInputData, IRobotInputData, IUIBaseInputData, IObject {
|
|
1120
1142
|
children?: IUIInputData[];
|
|
1121
1143
|
}
|
|
1122
1144
|
interface IUIJSONData extends IUIInputData {
|
|
@@ -1182,8 +1204,10 @@ type IUIHitModule = ILeafHit & ThisType<IUI>;
|
|
|
1182
1204
|
|
|
1183
1205
|
interface IPathArrowModule {
|
|
1184
1206
|
list: IPathDataArrowMap;
|
|
1185
|
-
|
|
1186
|
-
|
|
1207
|
+
fillList: IPathDataArrowMap;
|
|
1208
|
+
addArrows(ui: IUI, updateCache?: boolean): void;
|
|
1209
|
+
updateArrow(ui: IUI): void;
|
|
1210
|
+
register(name: string, data: IPathDataArrow, fillData?: IPathDataArrow): void;
|
|
1187
1211
|
get(name: string): IPathDataArrow;
|
|
1188
1212
|
}
|
|
1189
1213
|
|
|
@@ -1262,6 +1286,8 @@ interface IPaintModule {
|
|
|
1262
1286
|
}
|
|
1263
1287
|
interface IPaintImageModule {
|
|
1264
1288
|
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
|
|
1289
|
+
film?(paint: ILeafPaint): void;
|
|
1290
|
+
video?(paint: ILeafPaint): void;
|
|
1265
1291
|
checkImage(paint: ILeafPaint, allowDraw: boolean, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): boolean;
|
|
1266
1292
|
drawImage(paint: ILeafPaint, imageScaleX: number, imageScaleY: number, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void;
|
|
1267
1293
|
getImageRenderScaleData(paint: ILeafPaint, ui: IUI, canvas?: ILeaferCanvas, renderOptions?: IRenderOptions): IScaleData$1;
|
|
@@ -1271,6 +1297,8 @@ interface IPaintImageModule {
|
|
|
1271
1297
|
getPatternFixScale(paint: ILeafPaint, imageScaleX: number, imageScaleY: number): number;
|
|
1272
1298
|
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
|
|
1273
1299
|
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData;
|
|
1300
|
+
applyFilter?(leafPaint: ILeafPaint, image: ILeaferImage, filter: IImageFilters, ui: IUI): void;
|
|
1301
|
+
recycleFilter?(image: ILeaferImage, ui: IUI): void;
|
|
1274
1302
|
stretchMode(data: ILeafPaintPatternData, box: IBoundsData, scaleX: number, scaleY: number): void;
|
|
1275
1303
|
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
|
|
1276
1304
|
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skew: IPointData, clipScaleX?: number, clipScaleY?: number): void;
|
|
@@ -1311,4 +1339,4 @@ interface IFilterFunction {
|
|
|
1311
1339
|
(filter: IFilter, ui: IUI, bounds: IMatrixWithBoundsScaleData, currentCanvas: ILeaferCanvas, originCanvas: ILeaferCanvas, shape: ICachedShape): void;
|
|
1312
1340
|
}
|
|
1313
1341
|
|
|
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,
|
|
1342
|
+
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, IImageFilter, IImageFilterType, IImageFilters, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, IKeyframe, IKeyframeId, IKeyframesAnimation, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, ILinker, ILinkerComputedPointData, ILinkerData, ILinkerInputData, ILinkerPointData, ILinkerPointOptions, ILinkerPointType, 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 };
|