@leafer/interface 1.0.0-rc.3 → 1.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/app/IApp.ts +3 -3
  3. package/src/app/ILeafer.ts +46 -21
  4. package/src/canvas/ICanvas.ts +7 -2
  5. package/src/canvas/IHitCanvasManager.ts +3 -3
  6. package/src/canvas/ILeaferCanvas.ts +23 -11
  7. package/src/canvas/ISkiaCanvas.ts +20 -1
  8. package/src/data/IData.ts +12 -5
  9. package/src/data/ILeafData.ts +12 -6
  10. package/src/data/IList.ts +9 -6
  11. package/src/display/IBranch.ts +2 -1
  12. package/src/display/ILeaf.ts +452 -108
  13. package/src/display/IView.ts +2 -6
  14. package/src/display/module/IBranchRender.ts +2 -2
  15. package/src/display/module/ILeafBounds.ts +3 -0
  16. package/src/display/module/ILeafDataProxy.ts +5 -3
  17. package/src/display/module/ILeafEventer.ts +1 -1
  18. package/src/display/module/ILeafHit.ts +4 -1
  19. package/src/display/module/ILeafRender.ts +2 -1
  20. package/src/event/IEvent.ts +3 -23
  21. package/src/event/IEventer.ts +7 -2
  22. package/src/event/IUIEvent.ts +14 -9
  23. package/src/file/IExport.ts +41 -0
  24. package/src/file/IFileType.ts +1 -1
  25. package/src/function/IFunction.ts +18 -0
  26. package/src/image/IImageManager.ts +4 -0
  27. package/src/image/ILeaferImage.ts +13 -0
  28. package/src/index.ts +16 -15
  29. package/src/interaction/ICursor.ts +16 -0
  30. package/src/interaction/IInteraction.ts +40 -5
  31. package/src/layout/ILeafLayout.ts +41 -18
  32. package/src/layouter/ILayouter.ts +3 -0
  33. package/src/math/IMath.ts +98 -37
  34. package/src/path/IPathDrawer.ts +6 -3
  35. package/src/platform/IPlatform.ts +22 -4
  36. package/src/plugin/IPlugin.ts +2 -2
  37. package/src/renderer/IRenderer.ts +4 -2
  38. package/src/selector/ISelector.ts +38 -9
  39. package/types/index.d.ts +884 -418
  40. package/src/display/module/ILeafMask.ts +0 -12
package/types/index.d.ts CHANGED
@@ -1,110 +1,44 @@
1
- import { IFunction as IFunction$1, IObject as IObject$1, IEvent as IEvent$1, ILeaferCanvas as ILeaferCanvas$1, IScreenSizeData as IScreenSizeData$1 } from '@leafer/interface';
1
+ import { ILeaferCanvas as ILeaferCanvas$1, IScreenSizeData as IScreenSizeData$1 } from '@leafer/interface';
2
2
 
3
- type __Number = number;
4
- type __Boolean = boolean;
5
- type __String = string;
6
- type __Object = IObject;
7
- type __Value = __Number | __Boolean | __String | __Object;
8
- type ITimer = any;
9
- type IPathString = string;
10
- interface IObject {
11
- [name: string]: any;
12
- }
13
- interface IBooleanMap {
14
- [name: string]: boolean;
15
- }
16
- interface INumberMap {
17
- [name: string]: number;
18
- }
19
- interface IStringMap {
20
- [name: string]: string;
21
- }
22
- interface IDataTypeHandle {
23
- (target: any): void;
24
- }
25
-
26
- interface ILeafMap {
27
- [name: string]: ILeaf;
28
- }
29
- interface ILeafArrayMap {
30
- [name: string]: ILeaf[];
31
- }
32
- type ILeafListItemCallback = (item: ILeaf, index?: number) => void;
33
- interface ILeafList {
34
- list: ILeaf[];
35
- keys: INumberMap;
36
- readonly length: number;
37
- has(leaf: ILeaf): boolean;
38
- indexAt(index: number): ILeaf;
39
- indexOf(leaf: ILeaf): number;
40
- unshift(leaf: ILeaf): void;
41
- pushList(list: ILeaf[]): void;
42
- push(leaf: ILeaf): void;
43
- sort(reverse?: boolean): void;
44
- remove(leaf: ILeaf): void;
45
- forEach(itemCallback: ILeafListItemCallback): void;
46
- clone(): ILeafList;
47
- reset(): void;
48
- destroy(): void;
49
- }
50
- interface ILeafLevelList {
51
- levelMap: ILeafArrayMap;
52
- keys: INumberMap;
53
- levels: number[];
54
- readonly length: number;
55
- has(leaf: ILeaf): boolean;
56
- without(leaf: ILeaf): boolean;
57
- sort(reverse?: boolean): void;
58
- pushList(list: ILeaf[]): void;
59
- push(leaf: ILeaf): void;
60
- forEach(itemCallback: ILeafListItemCallback): void;
61
- reset(): void;
62
- destroy(): void;
63
- }
64
-
65
- interface IControl {
66
- start(): void;
67
- stop(): void;
68
- destroy(): void;
3
+ interface IPointData {
4
+ x: number;
5
+ y: number;
69
6
  }
70
-
71
- interface IWatchEventData {
72
- updatedList: ILeafList;
7
+ interface IUnitPointData {
8
+ type?: 'percent' | 'px';
9
+ x: number;
10
+ y: number;
73
11
  }
74
- interface IWatcherConfig {
12
+ interface IFromToData {
13
+ from: IPointData;
14
+ to: IPointData;
75
15
  }
76
- interface IWatcher extends IControl {
77
- target: ILeaf;
78
- totalTimes: number;
79
- disabled: boolean;
80
- running: boolean;
81
- changed: boolean;
82
- hasVisible: boolean;
83
- hasAdd: boolean;
84
- hasRemove: boolean;
85
- readonly childrenChanged: boolean;
86
- config: IWatcherConfig;
87
- updatedList: ILeafList;
88
- disable(): void;
89
- update(): void;
16
+ interface IScrollPointData {
17
+ scrollX: number;
18
+ scrollY: number;
90
19
  }
91
-
92
- interface IPointData {
93
- x: number;
94
- y: number;
20
+ interface IClientPointData {
21
+ clientX: number;
22
+ clientY: number;
95
23
  }
96
24
  interface IPoint extends IPointData {
97
- set(x?: number, y?: number): void;
98
- copy(point: IPointData): IPoint;
25
+ set(x?: number | IPointData, y?: number): IPoint;
26
+ get(): IPointData;
99
27
  clone(): IPoint;
100
- rotate(angle: number, center?: IPointData): IPoint;
28
+ move(x: number, y: number): IPoint;
29
+ scale(scaleX: number, scaleY?: number): IPoint;
30
+ scaleOf(origin: IPointData, scaleX: number, scaleY?: number): IPoint;
31
+ rotate(rotation: number, origin?: IPointData): IPoint;
32
+ rotateOf(origin: IPointData, rotation: number): IPoint;
33
+ getRotation(origin: IPointData, to: IPointData, toOrigin?: IPointData): number;
101
34
  toInnerOf(matrix: IMatrixData, to?: IPointData): IPoint;
102
35
  toOuterOf(matrix: IMatrixData, to?: IPointData): IPoint;
103
- getCenter(to: IPointData): IPointData;
36
+ getCenter(to: IPointData): IPoint;
104
37
  getDistance(to: IPointData): number;
38
+ getDistancePoint(to: IPointData, distance: number, changeTo?: boolean): IPoint;
105
39
  getAngle(to: IPointData): number;
106
40
  getAtan2(to: IPointData): number;
107
- reset(): void;
41
+ reset(): IPoint;
108
42
  }
109
43
  interface IRadiusPointData extends IPointData {
110
44
  radiusX: number;
@@ -125,25 +59,33 @@ interface IOffsetBoundsData extends IBoundsData {
125
59
  offsetX: number;
126
60
  offsetY: number;
127
61
  }
128
- interface IBoundsDataHandle {
62
+ interface IBoundsDataFn {
129
63
  (target: any): IBoundsData;
130
64
  }
131
- interface IBounds extends IBoundsData {
132
- set(x?: number, y?: number, width?: number, height?: number): void;
133
- copy(bounds: IBoundsData): IBounds;
65
+ interface IBounds extends IBoundsData, ITwoPointBoundsData {
66
+ set(x?: number | IBoundsData, y?: number, width?: number, height?: number): IBounds;
67
+ get(): IBoundsData;
134
68
  clone(): IBounds;
69
+ move(x: number, y: number): IBounds;
135
70
  scale(scaleX: number, scaleY?: number): IBounds;
71
+ scaleOf(origin: IPointData, scaleX: number, scaleY?: number): IBounds;
136
72
  toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds;
137
- getFitMatrix(put: IBoundsData): IMatrix;
138
- spread(size: number): IBounds;
73
+ toInnerOf(matrix: IMatrixData, to?: IBoundsData): IBounds;
74
+ getFitMatrix(put: IBoundsData, baseScale?: number): IMatrix;
75
+ spread(fourNumber: IFourNumber): IBounds;
76
+ shrink(fourNumber: IFourNumber): IBounds;
139
77
  ceil(): IBounds;
140
78
  unsign(): IBounds;
79
+ float(maxLength?: number): IBounds;
141
80
  add(bounds: IBoundsData): IBounds;
142
- addList(boundsList: IBounds[]): IBounds;
143
- setByList(boundsList: IBounds[], addMode?: boolean): IBounds;
144
- addListWithHandle(list: IObject[], boundsDataHandle: IBoundsDataHandle): IBounds;
145
- setByListWithHandle(list: IObject[], boundsDataHandle: IBoundsDataHandle, addMode: boolean): IBounds;
146
- setByPoints(points: IPointData[]): IBounds;
81
+ addList(boundsList: IBoundsData[]): IBounds;
82
+ setList(boundsList: IBoundsData[]): IBounds;
83
+ addListWithFn(list: IObject[], boundsDataHandle: IBoundsDataFn): IBounds;
84
+ setListWithFn(list: IObject[], boundsDataHandle: IBoundsDataFn): IBounds;
85
+ setPoint(point: IPointData): IBounds;
86
+ setPoints(points: IPointData[]): IBounds;
87
+ addPoint(point: IPointData): IBounds;
88
+ getPoints(): IPointData[];
147
89
  hitPoint(point: IPointData, pointMatrix?: IMatrixData): boolean;
148
90
  hitRadiusPoint(point: IRadiusPointData, pointMatrix?: IMatrixWithLayoutData): boolean;
149
91
  hit(bounds: IBoundsData, boundsMatrix?: IMatrixData): boolean;
@@ -160,16 +102,13 @@ interface ITwoPointBoundsData {
160
102
  maxX: number;
161
103
  maxY: number;
162
104
  }
163
- interface ITwoPointBounds extends ITwoPointBoundsData {
164
- addPoint(x: number, y: number): void;
165
- addBounds(x: number, y: number, width: number, height: number): void;
166
- add(pointBounds: ITwoPointBoundsData): void;
167
- }
168
- interface IAutoBoundsData {
105
+ interface IAutoBoxData {
169
106
  top?: number;
170
107
  right?: number;
171
108
  bottom?: number;
172
109
  left?: number;
110
+ }
111
+ interface IAutoBoundsData extends IAutoBoxData {
173
112
  width?: number;
174
113
  height?: number;
175
114
  }
@@ -186,23 +125,31 @@ interface IMatrixData {
186
125
  e: number;
187
126
  f: number;
188
127
  }
189
- interface IMatrixDecompositionData {
190
- x: number;
191
- y: number;
128
+ interface IScaleData {
192
129
  scaleX: number;
193
130
  scaleY: number;
131
+ }
132
+ interface IScaleRotationData extends IScaleData {
194
133
  rotation: number;
134
+ }
135
+ interface ISkewData {
195
136
  skewX: number;
196
137
  skewY: number;
197
138
  }
198
- type IMatrixDecompositionAttr = 'x' | 'y' | 'scaleX' | 'scaleY' | 'rotation' | 'skewX' | 'skewY';
199
- interface IMatrix extends IMatrixData {
200
- set(a: number, b: number, c: number, d: number, e: number, f: number): void;
201
- copy(matrix: IMatrixData): IMatrix;
139
+ interface ILayoutData extends IScaleRotationData, ISkewData, IPointData {
140
+ }
141
+ type ILayoutAttr = 'x' | 'y' | 'scaleX' | 'scaleY' | 'rotation' | 'skewX' | 'skewY';
142
+ interface ILayoutBoundsData extends ILayoutData, IBoundsData {
143
+ }
144
+ interface IMatrix extends IMatrixWithScaleData {
145
+ set(a: number | IMatrixData, b: number, c: number, d: number, e: number, f: number): IMatrix;
146
+ setWith(dataWithScale: IMatrixWithScaleData): IMatrix;
147
+ get(): IMatrixData;
202
148
  clone(): IMatrix;
203
149
  translate(x: number, y: number): IMatrix;
204
150
  translateInner(x: number, y: number): IMatrix;
205
151
  scale(x: number, y?: number): IMatrix;
152
+ scaleWith(x: number, y?: number): IMatrix;
206
153
  scaleOfOuter(origin: IPointData, x: number, y?: number): IMatrix;
207
154
  scaleOfInner(origin: IPointData, x: number, y?: number): IMatrix;
208
155
  rotate(angle: number): IMatrix;
@@ -211,18 +158,123 @@ interface IMatrix extends IMatrixData {
211
158
  skew(x: number, y?: number): IMatrix;
212
159
  skewOfOuter(origin: IPointData, x: number, y?: number): IMatrix;
213
160
  skewOfInner(origin: IPointData, x: number, y?: number): IMatrix;
214
- multiply(matrix: IMatrixData): IMatrix;
215
- divide(matrix: IMatrixData): IMatrix;
216
- preMultiply(matrix: IMatrixData): IMatrix;
161
+ multiply(child: IMatrixData): IMatrix;
162
+ multiplyParent(parent: IMatrixData): IMatrix;
163
+ divide(child: IMatrixData): IMatrix;
164
+ divideParent(parent: IMatrixData): IMatrix;
217
165
  invert(): IMatrix;
166
+ invertWith(): IMatrix;
218
167
  toOuterPoint(inner: IPointData, to?: IPointData, distance?: boolean): void;
219
168
  toInnerPoint(outer: IPointData, to?: IPointData, distance?: boolean): void;
220
- decompose(): IMatrixDecompositionData;
169
+ setLayout(data: ILayoutData, origin?: IPointData): IMatrix;
170
+ getLayout(origin?: IPointData, firstSkewY?: boolean): ILayoutData;
171
+ withScale(scaleX?: number, scaleY?: number): IMatrixWithScaleData;
221
172
  reset(): void;
222
173
  }
223
174
  interface IMatrixWithBoundsData extends IMatrixData, IBoundsData {
224
175
  }
225
- interface IMatrixWithLayoutData extends IMatrixData, IMatrixDecompositionData, IBoundsData {
176
+ interface IMatrixWithScaleData extends IMatrixData, IScaleData {
177
+ }
178
+ interface IMatrixWithOptionScaleData extends IMatrixData {
179
+ scaleX?: number;
180
+ scaleY?: number;
181
+ }
182
+ interface IMatrixWithBoundsScaleData extends IMatrixData, IBoundsData, IScaleData {
183
+ }
184
+ interface IMatrixWithLayoutData extends IMatrixData, ILayoutBoundsData {
185
+ }
186
+
187
+ type INumber = number;
188
+ type IBoolean = boolean;
189
+ type IString = string;
190
+ type IValue = INumber | IBoolean | IString | IObject;
191
+ type ITimer = any;
192
+ type IPathString = string;
193
+ type IFourNumber = number | number[];
194
+ interface IObject {
195
+ [name: string]: any;
196
+ }
197
+ interface IBooleanMap {
198
+ [name: string]: boolean;
199
+ }
200
+ interface INumberMap {
201
+ [name: string]: number;
202
+ }
203
+ interface IStringMap {
204
+ [name: string]: string;
205
+ }
206
+ interface IPointDataMap {
207
+ [name: string]: IPointData;
208
+ }
209
+ interface IDataTypeHandle {
210
+ (target: any): void;
211
+ }
212
+
213
+ interface ILeafMap {
214
+ [name: string]: ILeaf;
215
+ }
216
+ interface ILeafArrayMap {
217
+ [name: string]: ILeaf[];
218
+ }
219
+ type ILeafListItemCallback = (item: ILeaf, index?: number) => void;
220
+ interface ILeafList {
221
+ list: ILeaf[];
222
+ keys: INumberMap;
223
+ readonly length: number;
224
+ has(leaf: ILeaf): boolean;
225
+ indexAt(index: number): ILeaf;
226
+ indexOf(leaf: ILeaf): number;
227
+ add(leaf: ILeaf): void;
228
+ addAt(leaf: ILeaf, index: number): void;
229
+ addList(list: ILeaf[]): void;
230
+ remove(leaf: ILeaf): void;
231
+ forEach(itemCallback: ILeafListItemCallback): void;
232
+ sort(reverse?: boolean): void;
233
+ clone(): ILeafList;
234
+ update(): void;
235
+ reset(): void;
236
+ destroy(): void;
237
+ }
238
+ interface ILeafLevelList {
239
+ levelMap: ILeafArrayMap;
240
+ keys: INumberMap;
241
+ levels: number[];
242
+ readonly length: number;
243
+ has(leaf: ILeaf): boolean;
244
+ without(leaf: ILeaf): boolean;
245
+ sort(reverse?: boolean): void;
246
+ addList(list: ILeaf[]): void;
247
+ add(leaf: ILeaf): void;
248
+ forEach(itemCallback: ILeafListItemCallback): void;
249
+ reset(): void;
250
+ destroy(): void;
251
+ }
252
+
253
+ interface IControl {
254
+ start(): void;
255
+ stop(): void;
256
+ destroy(): void;
257
+ }
258
+
259
+ interface IWatchEventData {
260
+ updatedList: ILeafList;
261
+ }
262
+ interface IWatcherConfig {
263
+ }
264
+ interface IWatcher extends IControl {
265
+ target: ILeaf;
266
+ totalTimes: number;
267
+ disabled: boolean;
268
+ running: boolean;
269
+ changed: boolean;
270
+ hasVisible: boolean;
271
+ hasAdd: boolean;
272
+ hasRemove: boolean;
273
+ readonly childrenChanged: boolean;
274
+ config: IWatcherConfig;
275
+ updatedList: ILeafList;
276
+ disable(): void;
277
+ update(): void;
226
278
  }
227
279
 
228
280
  interface ILayoutChangedData {
@@ -250,6 +302,7 @@ interface ILayouterConfig {
250
302
  interface ILayouter extends IControl {
251
303
  target: ILeaf;
252
304
  layoutedBlocks: ILayoutBlockData[];
305
+ extraBlock: ILayoutBlockData;
253
306
  totalTimes: number;
254
307
  times: number;
255
308
  disabled: boolean;
@@ -263,12 +316,14 @@ interface ILayouter extends IControl {
263
316
  layoutOnce(): void;
264
317
  partLayout(): void;
265
318
  fullLayout(): void;
319
+ addExtra(leaf: ILeaf): void;
266
320
  createBlock(data: ILeafList | ILeaf[]): ILayoutBlockData;
267
321
  getBlocks(list: ILeafList): ILayoutBlockData[];
268
322
  addBlocks(current: ILayoutBlockData[]): void;
269
323
  }
270
324
 
271
325
  interface IEvent {
326
+ origin?: IObject;
272
327
  type?: string;
273
328
  target?: IEventTarget;
274
329
  current?: IEventTarget;
@@ -319,25 +374,6 @@ interface ILayoutEvent extends IEvent {
319
374
  interface IWatchEvent extends IEvent {
320
375
  readonly data: IWatchEventData;
321
376
  }
322
- interface ITransformEventData {
323
- x: number;
324
- y: number;
325
- scaleX: number;
326
- scaleY: number;
327
- rotation: number;
328
- readonly zooming: boolean;
329
- readonly moving: boolean;
330
- readonly rotating: boolean;
331
- readonly changing: boolean;
332
- }
333
- interface ITransformEvent extends IEvent, ITransformEventData {
334
- readonly x: number;
335
- readonly y: number;
336
- readonly scaleX: number;
337
- readonly scaleY: number;
338
- readonly rotation: number;
339
- }
340
- type TransformMode = 'move' | 'zoom' | 'rotate';
341
377
  interface IMultiTouchData {
342
378
  move: IPointData;
343
379
  scale: number;
@@ -352,7 +388,7 @@ interface IKeepTouchData {
352
388
  type ILeafEventerModule = ILeafEventer & ThisType<ILeaf>;
353
389
  interface ILeafEventer {
354
390
  on?(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void;
355
- off?(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void;
391
+ off?(type?: string | string[], listener?: IEventListener, options?: IEventListenerOptions | boolean): void;
356
392
  on_?(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventListenerOptions | boolean): IEventListenerId;
357
393
  off_?(id: IEventListenerId | IEventListenerId[]): void;
358
394
  once?(type: string | string[], listener: IEventListener, capture?: boolean): void;
@@ -361,7 +397,29 @@ interface ILeafEventer {
361
397
  hasEvent?(type: string, capture?: boolean): boolean;
362
398
  }
363
399
 
364
- type IEventListener = IFunction$1;
400
+ interface IFunction {
401
+ (...arg: any): any;
402
+ }
403
+ interface INumberFunction {
404
+ (...arg: any): number;
405
+ }
406
+ interface IStringFunction {
407
+ (...arg: any): string;
408
+ }
409
+ interface IObjectFunction {
410
+ (...arg: any): IObject;
411
+ }
412
+ interface IPointDataFunction {
413
+ (...arg: any): IPointData;
414
+ }
415
+ interface IAttrDecorator {
416
+ (...arg: any): IAttrDecoratorInner;
417
+ }
418
+ interface IAttrDecoratorInner {
419
+ (target: any, key: string): any;
420
+ }
421
+
422
+ type IEventListener = IFunction;
365
423
  interface IEventListenerOptions {
366
424
  capture?: boolean;
367
425
  once?: boolean;
@@ -374,6 +432,7 @@ interface IEventListenerMap {
374
432
  }
375
433
  interface IEventListenerId {
376
434
  type: string | string[];
435
+ current: ILeaf;
377
436
  listener: IEventListener;
378
437
  options?: IEventListenerOptions | boolean;
379
438
  }
@@ -383,12 +442,12 @@ interface IEventer extends ILeafEventer {
383
442
  __captureMap?: IEventListenerMap;
384
443
  __bubbleMap?: IEventListenerMap;
385
444
  on(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void;
386
- off(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void;
387
- on_(type: string | string[], listener: IEventListener, bind?: IObject$1, options?: IEventListenerOptions | boolean): IEventListenerId;
445
+ off(type?: string | string[], listener?: IEventListener, options?: IEventListenerOptions | boolean): void;
446
+ on_(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventListenerOptions | boolean): IEventListenerId;
388
447
  off_(id: IEventListenerId | IEventListenerId[]): void;
389
448
  once(type: string | string[], listener: IEventListener): void;
390
- emit(type: string, event?: IEvent$1 | IObject$1, capture?: boolean): void;
391
- emitEvent(event?: IEvent$1, capture?: boolean): void;
449
+ emit(type: string, event?: IEvent | IObject, capture?: boolean): void;
450
+ emitEvent(event?: IEvent, capture?: boolean): void;
392
451
  hasEvent(type: string, capture?: boolean): boolean;
393
452
  destroy(): void;
394
453
  }
@@ -478,21 +537,23 @@ interface CanvasPathDrawingStyles {
478
537
  interface CanvasPattern {
479
538
  setTransform(transform?: DOMMatrix2DInit): void;
480
539
  }
540
+ type ICanvasPattern = CanvasPattern;
481
541
  interface CanvasRect {
482
542
  clearRect(x: number, y: number, w: number, h: number): void;
483
543
  fillRect(x: number, y: number, w: number, h: number): void;
484
544
  strokeRect(x: number, y: number, w: number, h: number): void;
485
545
  }
486
546
  type PredefinedColorSpace = 'display-p3' | 'srgb';
487
- interface CanvasRenderingContext2DSettings {
547
+ interface ICanvasRenderingContext2DSettings {
488
548
  alpha?: boolean;
489
549
  colorSpace?: PredefinedColorSpace;
490
550
  desynchronized?: boolean;
491
551
  willReadFrequently?: boolean;
492
552
  }
553
+ type ICanvasContext2DSettings = ICanvasRenderingContext2DSettings;
493
554
  interface ICanvasContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
494
555
  readonly canvas: HTMLCanvasElement;
495
- getContextAttributes(): CanvasRenderingContext2DSettings;
556
+ getContextAttributes(): ICanvasRenderingContext2DSettings;
496
557
  }
497
558
  interface CanvasShadowStyles {
498
559
  shadowBlur: number;
@@ -712,22 +773,24 @@ interface IPathDrawer {
712
773
  rect(x: number, y: number, width: number, height: number): void;
713
774
  roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): void;
714
775
  }
715
- interface IPathCreator {
776
+ interface IPathCreator extends IPathDrawer {
716
777
  path: IPathCommandData;
778
+ __path: IPathCommandData;
717
779
  beginPath(): IPathCreator;
718
780
  moveTo(x: number, y: number): IPathCreator;
719
781
  lineTo(x: number, y: number): IPathCreator;
720
782
  bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): IPathCreator;
721
783
  quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): IPathCreator;
722
784
  closePath(): IPathCreator;
723
- arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): IPathCreator;
785
+ arc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
724
786
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): IPathCreator;
725
- ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): IPathCreator;
787
+ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
726
788
  rect(x: number, y: number, width: number, height: number): IPathCreator;
727
789
  roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): IPathCreator;
728
790
  drawEllipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
729
791
  drawArc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
730
792
  drawPoints(points: number[], curve?: boolean | number, close?: boolean): IPathCreator;
793
+ clearPath(): IPathCreator;
731
794
  }
732
795
 
733
796
  interface ICanvasManager {
@@ -739,6 +802,112 @@ interface ICanvasManager {
739
802
  destroy(): void;
740
803
  }
741
804
 
805
+ type IExportImageType = 'jpg' | 'png' | 'webp';
806
+ type IExportFileType = IExportImageType | 'svg' | 'pdf' | 'json';
807
+
808
+ type ILocationType = 'world' | 'page' | 'local' | 'inner';
809
+ type IBoundsType = 'content' | 'box' | 'stroke' | 'render';
810
+ interface ILeafLayout {
811
+ leaf: ILeaf;
812
+ proxyZoom: boolean;
813
+ contentBounds: IBoundsData;
814
+ boxBounds: IBoundsData;
815
+ strokeBounds: IBoundsData;
816
+ renderBounds: IBoundsData;
817
+ localContentBounds: IBoundsData;
818
+ localStrokeBounds: IBoundsData;
819
+ localRenderBounds: IBoundsData;
820
+ worldContentBounds: IBoundsData;
821
+ worldBoxBounds: IBoundsData;
822
+ worldStrokeBounds: IBoundsData;
823
+ resized: boolean;
824
+ waitAutoLayout: boolean;
825
+ matrixChanged: boolean;
826
+ scaleChanged: boolean;
827
+ rotationChanged: boolean;
828
+ boundsChanged: boolean;
829
+ boxChanged: boolean;
830
+ strokeChanged: boolean;
831
+ renderChanged: boolean;
832
+ localBoxChanged: boolean;
833
+ surfaceChanged: boolean;
834
+ opacityChanged: boolean;
835
+ hitCanvasChanged: boolean;
836
+ childrenSortChanged?: boolean;
837
+ affectScaleOrRotation: boolean;
838
+ affectRotation: boolean;
839
+ affectChildrenSort?: boolean;
840
+ strokeSpread: number;
841
+ strokeBoxSpread: number;
842
+ renderSpread: number;
843
+ renderShapeSpread: number;
844
+ a: number;
845
+ b: number;
846
+ c: number;
847
+ d: number;
848
+ e: number;
849
+ f: number;
850
+ x: number;
851
+ y: number;
852
+ width: number;
853
+ height: number;
854
+ createLocal(): void;
855
+ update(): void;
856
+ getTransform(relative?: ILocationType | ILeaf): IMatrixData;
857
+ getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData;
858
+ getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData;
859
+ getLayoutPoints(type?: IBoundsType, relative?: ILocationType | ILeaf): IPointData[];
860
+ shrinkContent(): void;
861
+ spreadStroke(): void;
862
+ spreadRender(): void;
863
+ shrinkContentCancel(): void;
864
+ spreadStrokeCancel(): void;
865
+ spreadRenderCancel(): void;
866
+ boxChange(): void;
867
+ localBoxChange(): void;
868
+ strokeChange(): void;
869
+ renderChange(): void;
870
+ scaleChange(): void;
871
+ rotationChange(): void;
872
+ matrixChange(): void;
873
+ surfaceChange(): void;
874
+ opacityChange(): void;
875
+ childrenSortChange(): void;
876
+ destroy(): void;
877
+ }
878
+
879
+ interface IExportOptions {
880
+ quality?: number;
881
+ blob?: boolean;
882
+ scale?: number;
883
+ smooth?: boolean;
884
+ pixelRatio?: number;
885
+ slice?: boolean;
886
+ trim?: boolean;
887
+ fill?: string;
888
+ screenshot?: IBoundsData | boolean;
889
+ relative?: ILocationType | ILeaf;
890
+ json?: IJSONOptions;
891
+ contextSettings?: ICanvasContext2DSettings;
892
+ onCanvas?: IExportOnCanvasFunction;
893
+ }
894
+ interface IJSONOptions {
895
+ matrix?: boolean;
896
+ }
897
+ interface IExportResult {
898
+ data: ILeaferCanvas | IBlob | string | boolean;
899
+ width?: number;
900
+ height?: number;
901
+ renderBounds?: IBoundsData;
902
+ trimBounds?: IBoundsData;
903
+ }
904
+ interface IExportResultFunction {
905
+ (data: IExportResult): void;
906
+ }
907
+ interface IExportOnCanvasFunction {
908
+ (data: ILeaferCanvas): void;
909
+ }
910
+
742
911
  interface ILeaferCanvasConfig extends IAutoBoundsData {
743
912
  view?: string | IObject;
744
913
  fill?: string;
@@ -746,6 +915,7 @@ interface ILeaferCanvasConfig extends IAutoBoundsData {
746
915
  smooth?: boolean;
747
916
  hittable?: boolean;
748
917
  webgl?: boolean;
918
+ contextSettings?: ICanvasContext2DSettings;
749
919
  }
750
920
  type IHitCanvasConfig = ILeaferCanvasConfig;
751
921
  interface ICanvasStrokeOptions {
@@ -757,6 +927,10 @@ interface ICanvasStrokeOptions {
757
927
  dashOffset?: number;
758
928
  miterLimit?: number;
759
929
  }
930
+ interface ICanvasCacheOptions extends ICanvasStrokeOptions {
931
+ fillStyle?: string | object;
932
+ strokeStyle?: string | object;
933
+ }
760
934
  interface ICanvasAttr extends ICanvasStrokeOptions, IObject {
761
935
  smooth: boolean;
762
936
  smoothLevel: string;
@@ -811,6 +985,7 @@ interface ICanvasMethod {
811
985
  restoreBlendMode(): void;
812
986
  hitFill(point: IPointData, fillRule?: string): boolean;
813
987
  hitStroke(point: IPointData, strokeWidth?: number): boolean;
988
+ hitPixel(radiusPoint: IRadiusPointData, offset?: IPointData, scale?: number): boolean;
814
989
  setStroke(strokeStyle: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void;
815
990
  setStrokeOptions(options: ICanvasStrokeOptions): void;
816
991
  setWorld(matrix: IMatrixData, parentMatrix?: IMatrixData): void;
@@ -818,7 +993,7 @@ interface ICanvasMethod {
818
993
  setWorldShadow(x: number, y: number, blur: number, color?: string): void;
819
994
  setWorldBlur(blur: number): void;
820
995
  copyWorld(canvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData, blendMode?: string): void;
821
- copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string): void;
996
+ copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string, onlyResetTransform?: boolean): void;
822
997
  copyWorldToInner(canvas: ILeaferCanvas, fromWorld: IMatrixWithBoundsData, toInnerBounds: IBoundsData, blendMode?: string): void;
823
998
  useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
824
999
  useEraser(eraserCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
@@ -828,6 +1003,7 @@ interface ICanvasMethod {
828
1003
  clearWorld(bounds: IBoundsData, ceilPixel?: boolean): void;
829
1004
  clear(): void;
830
1005
  }
1006
+ type ILeaferCanvasView = any;
831
1007
  interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
832
1008
  readonly innerId: InnerId;
833
1009
  name: string;
@@ -840,17 +1016,20 @@ interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
840
1016
  readonly allowBackgroundColor?: boolean;
841
1017
  backgroundColor?: string;
842
1018
  hittable?: boolean;
1019
+ zIndex?: number;
1020
+ childIndex?: number;
843
1021
  bounds: IBounds;
844
1022
  clientBounds: IBoundsData;
845
1023
  config: ILeaferCanvasConfig;
846
1024
  autoLayout: boolean;
847
- view: any;
1025
+ view: ILeaferCanvasView;
848
1026
  parentView: any;
849
1027
  unreal?: boolean;
850
1028
  context: ICanvasContext2D;
851
1029
  recycled?: boolean;
852
1030
  worldTransform: IMatrixData;
853
1031
  init(): void;
1032
+ export(filename: IExportFileType | string, options?: IExportOptions | number | boolean): string | Promise<any>;
854
1033
  toBlob(type?: string, quality?: number): Promise<IBlob>;
855
1034
  toDataURL(type?: string, quality?: number): string | Promise<string>;
856
1035
  saveAs(filename: string, quality?: number): Promise<boolean>;
@@ -859,36 +1038,27 @@ interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
859
1038
  resize(size: IScreenSizeData): void;
860
1039
  updateViewSize(): void;
861
1040
  updateClientBounds(): void;
862
- setCursor(cursor: ICursorType | ICursorType[]): void;
1041
+ getClientBounds(update?: boolean): IBoundsData;
863
1042
  isSameSize(options: ILeaferCanvasConfig): boolean;
864
- getSameCanvas(useSameWorldTransform?: boolean): ILeaferCanvas;
865
- getBiggerCanvas(addWidth: number, addHeight: number): ILeaferCanvas;
866
- recycle(): void;
1043
+ getSameCanvas(useSameWorldTransform?: boolean, useSameSmooth?: boolean): ILeaferCanvas;
1044
+ recycle(clearBounds?: IBoundsData): void;
867
1045
  updateRender(): void;
868
1046
  unrealCanvas(): void;
869
1047
  destroy(): void;
870
1048
  }
871
1049
  interface IHitCanvas extends ILeaferCanvas {
1050
+ hitScale?: number;
872
1051
  }
873
1052
  interface IBlobFunction {
874
1053
  (blob: IBlob | null): void;
875
1054
  }
876
1055
  type IBlob = any;
877
1056
 
878
- interface IFunction {
879
- (...arg: any): any;
880
- }
881
- interface INumberFunction {
882
- (...arg: any): number;
883
- }
884
- interface IPointDataFunction {
885
- (...arg: any): IPointData;
886
- }
887
-
888
1057
  interface IRenderOptions {
1058
+ includes?: boolean;
889
1059
  bounds?: IBounds;
890
1060
  hideBounds?: IBounds;
891
- matrix?: IMatrix;
1061
+ matrix?: IMatrixWithScaleData;
892
1062
  inCamera?: boolean;
893
1063
  }
894
1064
  interface IRendererConfig {
@@ -907,6 +1077,7 @@ interface IRenderer extends IControl {
907
1077
  rendering: boolean;
908
1078
  waitAgain: boolean;
909
1079
  changed: boolean;
1080
+ ignore: boolean;
910
1081
  config: IRendererConfig;
911
1082
  update(): void;
912
1083
  requestLayout(): void;
@@ -924,8 +1095,10 @@ interface IRenderer extends IControl {
924
1095
 
925
1096
  type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>;
926
1097
  interface ILeafDataProxy {
927
- __setAttr?(name: string, newValue: __Value): void;
928
- __getAttr?(name: string): __Value;
1098
+ __setAttr?(name: string, newValue: IValue): boolean;
1099
+ __getAttr?(name: string): IValue;
1100
+ setProxyAttr?(name: string, newValue: IValue): void;
1101
+ getProxyAttr?(name: string): IValue;
929
1102
  }
930
1103
 
931
1104
  type ILeafMatrixModule = ILeafMatrix & ThisType<ILeaf>;
@@ -937,75 +1110,28 @@ interface ILeafMatrix {
937
1110
  type ILeafBoundsModule = ILeafBounds & ThisType<ILeaf>;
938
1111
  interface ILeafBounds {
939
1112
  __updateWorldBounds?(): void;
1113
+ __updateLocalBounds?(): void;
940
1114
  __updateLocalBoxBounds?(): void;
941
1115
  __updateLocalStrokeBounds?(): void;
942
1116
  __updateLocalRenderBounds?(): void;
943
1117
  __updateBoxBounds?(): void;
944
1118
  __updateStrokeBounds?(): void;
945
1119
  __updateRenderBounds?(): void;
1120
+ __updateAutoLayout?(): void;
1121
+ __updateFlowLayout?(): void;
946
1122
  __updateNaturalSize?(): void;
947
1123
  __updateStrokeSpread?(): number;
948
1124
  __updateRenderSpread?(): number;
949
1125
  __onUpdateSize?(): void;
950
1126
  }
951
1127
 
952
- type ILayoutLocationType = 'world' | 'local' | 'inner';
953
- type ILayoutBoundsType = 'content' | 'box' | 'stroke' | 'margin' | 'render';
954
- interface ILeafLayout {
955
- leaf: ILeaf;
956
- useZoomProxy: boolean;
957
- boxBounds: IBoundsData;
958
- strokeBounds: IBoundsData;
959
- renderBounds: IBoundsData;
960
- marginBounds: IBoundsData;
961
- contentBounds: IBoundsData;
962
- localStrokeBounds: IBoundsData;
963
- localRenderBounds: IBoundsData;
964
- matrixChanged: boolean;
965
- positionChanged: boolean;
966
- originChanged?: boolean;
967
- scaleChanged: boolean;
968
- rotationChanged: boolean;
969
- boundsChanged: boolean;
970
- boxChanged: boolean;
971
- strokeChanged: boolean;
972
- renderChanged: boolean;
973
- localBoxChanged: boolean;
974
- surfaceChanged: boolean;
975
- opacityChanged: boolean;
976
- hitCanvasChanged: boolean;
977
- childrenSortChanged?: boolean;
978
- affectScaleOrRotation: boolean;
979
- affectRotation: boolean;
980
- affectChildrenSort?: boolean;
981
- strokeSpread: number;
982
- renderSpread: number;
983
- strokeBoxSpread: number;
984
- renderShapeSpread: number;
985
- checkUpdate(force?: boolean): void;
986
- getTransform(locationType: ILayoutLocationType): IMatrixData;
987
- getBounds(type: ILayoutBoundsType, locationType: ILayoutLocationType): IBoundsData;
988
- spreadStroke(): void;
989
- spreadRender(): void;
990
- spreadStrokeCancel(): void;
991
- spreadRenderCancel(): void;
992
- boxChange(): void;
993
- localBoxChange(): void;
994
- strokeChange(): void;
995
- renderChange(): void;
996
- positionChange(): void;
997
- scaleChange(): void;
998
- rotationChange(): void;
999
- surfaceChange(): void;
1000
- opacityChange(): void;
1001
- childrenSortChange(): void;
1002
- destroy(): void;
1003
- }
1004
-
1005
1128
  type ILeafHitModule = ILeafHit & ThisType<ILeaf>;
1006
1129
  interface ILeafHit {
1007
1130
  __hitWorld?(point: IRadiusPointData): boolean;
1008
- __hit?(local: IRadiusPointData): boolean;
1131
+ __hit?(inner: IRadiusPointData): boolean;
1132
+ __hitFill?(inner: IRadiusPointData): boolean;
1133
+ __hitStroke?(inner: IRadiusPointData, strokeWidth: number): boolean;
1134
+ __hitPixel(inner: IRadiusPointData): boolean;
1009
1135
  __drawHitPath?(canvas: ILeaferCanvas): void;
1010
1136
  __updateHitCanvas?(): void;
1011
1137
  }
@@ -1015,35 +1141,89 @@ interface ILeafRender {
1015
1141
  __render?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1016
1142
  __draw?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1017
1143
  __drawFast?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1018
- __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1144
+ __clip?(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
1145
+ __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void;
1019
1146
  __updateWorldOpacity?(): void;
1020
1147
  __updateChange?(): void;
1021
1148
  }
1022
1149
 
1023
- type ILeafMaskModule = ILeafMask & ThisType<ILeaf>;
1024
- interface ILeafMask {
1025
- __updateEraser?(value?: boolean): void;
1026
- __updateMask?(value?: boolean): void;
1027
- __renderMask?(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void;
1028
- __removeMask?(child?: ILeaf): void;
1029
- }
1030
-
1031
- interface IDataProcessor extends IObject {
1150
+ interface IDataProcessor {
1032
1151
  __leaf: ILeaf;
1033
1152
  __input: IObject;
1034
1153
  __middle: IObject;
1035
- __single: boolean;
1036
- __checkSingle(): void;
1037
1154
  __get(name: string): any;
1155
+ __getData(): IObject;
1038
1156
  __setInput(name: string, value: any): void;
1039
1157
  __getInput(name: string): any;
1040
1158
  __removeInput(name: string): void;
1041
- __getInputData(): IObject;
1159
+ __getInputData(names?: string[] | IObject, options?: IJSONOptions): IObject;
1042
1160
  __setMiddle(name: string, value: any): void;
1043
1161
  __getMiddle(name: string): any;
1044
1162
  destroy(): void;
1045
1163
  }
1164
+ interface ILeafDataOptions {
1165
+ attrs?: 'all' | string[];
1166
+ children?: boolean;
1167
+ }
1046
1168
  interface ILeafData extends IDataProcessor, ILeafComputedData {
1169
+ __single?: boolean;
1170
+ __checkSingle(): void;
1171
+ __removeNaturalSize(): void;
1172
+ }
1173
+
1174
+ interface IBranch extends ILeaf {
1175
+ children: ILeaf[];
1176
+ __renderBranch?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1177
+ addMany(...children: ILeaf[]): void;
1178
+ removeAll(destroy?: boolean): void;
1179
+ clear(): void;
1180
+ }
1181
+
1182
+ interface IPickResult {
1183
+ target: ILeaf;
1184
+ path: ILeafList;
1185
+ throughPath?: ILeafList;
1186
+ }
1187
+ interface IPickOptions {
1188
+ name?: string;
1189
+ hitRadius?: number;
1190
+ through?: boolean;
1191
+ target?: IBranch;
1192
+ findList?: ILeaf[];
1193
+ bottomList?: IPickBottom[];
1194
+ exclude?: ILeafList;
1195
+ ignoreHittable?: boolean;
1196
+ }
1197
+ interface IPickBottom {
1198
+ target: ILeaf;
1199
+ proxy?: ILeaf;
1200
+ }
1201
+ interface ISelectorConfig {
1202
+ }
1203
+ type IAnswer = 0 | 1 | 2 | 3;
1204
+ interface IFindCondition {
1205
+ id?: number | string;
1206
+ className?: string;
1207
+ tag?: string | string[];
1208
+ }
1209
+ interface IFindMethod {
1210
+ (leaf: ILeaf, options?: any): IAnswer;
1211
+ }
1212
+ interface ISelectorProxy {
1213
+ list: ILeaf[];
1214
+ }
1215
+ interface ISelector {
1216
+ target: ILeaf;
1217
+ proxy?: ISelectorProxy;
1218
+ config: ISelectorConfig;
1219
+ getByPoint(hitPoint: IPointData, hitRadius: number, options?: IPickOptions): IPickResult;
1220
+ getBy(condition: number | string | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[];
1221
+ getByInnerId(innerId: number, branch?: ILeaf): ILeaf;
1222
+ getById(id: string, branch?: ILeaf): ILeaf;
1223
+ getByClassName(className: string, branch?: ILeaf): ILeaf[];
1224
+ getByTag(tag: string, branch?: ILeaf): ILeaf[];
1225
+ getByMethod(method: IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[];
1226
+ destroy(): void;
1047
1227
  }
1048
1228
 
1049
1229
  interface ICachedLeaf {
@@ -1052,79 +1232,190 @@ interface ICachedLeaf {
1052
1232
  bounds: IBoundsData;
1053
1233
  }
1054
1234
  interface ILeafAttrData {
1055
- id: __String;
1056
- name: __String;
1057
- className: __String;
1058
- blendMode: IBlendMode;
1059
- opacity: __Number;
1060
- visible: __Boolean;
1061
- isMask: __Boolean;
1062
- isEraser: __Boolean;
1063
- zIndex: __Number;
1064
- x: __Number;
1065
- y: __Number;
1066
- width: __Number;
1067
- height: __Number;
1068
- scaleX: __Number;
1069
- scaleY: __Number;
1070
- rotation: __Number;
1071
- skewX: __Number;
1072
- skewY: __Number;
1073
- scale: __Number | IPointData;
1074
- around: 'center' | IPointData;
1075
- draggable: __Boolean;
1076
- hittable: __Boolean;
1077
- hitFill: IHitType;
1078
- hitStroke: IHitType;
1079
- hitChildren: __Boolean;
1080
- hitSelf: __Boolean;
1081
- hitRadius: __Number;
1082
- cursor: ICursorType | ICursorType[];
1235
+ id?: IString;
1236
+ name?: IString;
1237
+ className?: IString;
1238
+ blendMode?: IBlendMode;
1239
+ opacity?: INumber;
1240
+ visible?: IBoolean | 0;
1241
+ selected?: IBoolean;
1242
+ disabled?: IBoolean;
1243
+ locked?: IBoolean;
1244
+ zIndex?: INumber;
1245
+ mask?: IBoolean | IMaskType;
1246
+ eraser?: IBoolean | IEraserType;
1247
+ x?: INumber;
1248
+ y?: INumber;
1249
+ width?: INumber;
1250
+ height?: INumber;
1251
+ scaleX?: INumber;
1252
+ scaleY?: INumber;
1253
+ rotation?: INumber;
1254
+ skewX?: INumber;
1255
+ skewY?: INumber;
1256
+ scale?: INumber | IPointData;
1257
+ offsetX?: INumber;
1258
+ offsetY?: INumber;
1259
+ scrollX?: INumber;
1260
+ scrollY?: INumber;
1261
+ origin?: IAlign | IUnitPointData;
1262
+ around?: IAlign | IUnitPointData;
1263
+ lazy?: IBoolean;
1264
+ pixelRatio?: INumber;
1265
+ path?: IPathCommandData | IPathString;
1266
+ windingRule?: IWindingRule;
1267
+ closed?: IBoolean;
1268
+ flow?: IFlowType;
1269
+ padding?: IFourNumber;
1270
+ gap?: IGap | IPointGap;
1271
+ flowAlign?: IFlowAlign | IFlowAxisAlign;
1272
+ flowWrap?: IFlowWrap;
1273
+ itemBox?: IFlowBoxType;
1274
+ inFlow?: IBoolean;
1275
+ autoWidth?: IAutoSize;
1276
+ autoHeight?: IAutoSize;
1277
+ lockRatio?: IBoolean;
1278
+ autoBox?: IAutoBoxData | IConstraint;
1279
+ widthRange?: IRangeSize;
1280
+ heightRange?: IRangeSize;
1281
+ draggable?: IBoolean | IAxis;
1282
+ dragBounds?: IBoundsData | 'parent';
1283
+ editable?: IBoolean;
1284
+ hittable?: IBoolean;
1285
+ hitFill?: IHitType;
1286
+ hitStroke?: IHitType;
1287
+ hitBox?: IBoolean;
1288
+ hitChildren?: IBoolean;
1289
+ hitSelf?: IBoolean;
1290
+ hitRadius?: INumber;
1291
+ cursor?: ICursorType | ICursorType[];
1292
+ normalStyle?: ILeafInputData;
1293
+ hoverStyle?: ILeafInputData;
1294
+ pressStyle?: ILeafInputData;
1295
+ focusStyle?: ILeafInputData;
1296
+ selectedStyle?: ILeafInputData;
1297
+ disabledStyle?: ILeafInputData;
1298
+ data: IObject;
1299
+ }
1300
+ type IAxis = 'x' | 'y';
1301
+ type IAxisReverse = 'x-reverse' | 'y-reverse';
1302
+ type IFlowType = boolean | IAxis | IAxisReverse;
1303
+ type IFlowBoxType = 'box' | 'stroke';
1304
+ type IGap = INumber | 'auto' | 'fit';
1305
+ interface IPointGap {
1306
+ x?: IGap;
1307
+ y?: IGap;
1308
+ }
1309
+ type IAxisAlign = 'from' | 'center' | 'to';
1310
+ interface IFlowAxisAlign {
1311
+ content?: IFlowAlign;
1312
+ x?: IAxisAlign;
1313
+ y?: IAxisAlign;
1314
+ }
1315
+ type IFlowWrap = boolean | 'reverse';
1316
+ type IAutoSize = IBoolean | INumber | IPercentData;
1317
+ interface IRangeSize {
1318
+ min?: number;
1319
+ max?: number;
1083
1320
  }
1321
+ interface IUnitData {
1322
+ type: 'percent' | 'px';
1323
+ value: number;
1324
+ }
1325
+ interface IPercentData extends IUnitData {
1326
+ type: 'percent';
1327
+ }
1328
+ interface IConstraint {
1329
+ x: IConstraintType;
1330
+ y: IConstraintType;
1331
+ }
1332
+ type IConstraintType = 'from' | 'center' | 'to' | 'from-to' | 'scale';
1084
1333
  type IHitType = 'path' | 'pixel' | 'all' | 'none';
1085
- type IBlendMode = 'pass-through' | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop';
1086
- type IResizeType = 'size' | 'scale';
1334
+ type IMaskType = 'path' | 'pixel' | 'clipping';
1335
+ type IEraserType = 'path' | 'pixel';
1336
+ type IBlendMode = 'pass-through' | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'xor';
1337
+ type IEditSize = 'size' | 'font-size' | 'scale';
1087
1338
  interface IImageCursor {
1088
1339
  url: string;
1089
1340
  x?: number;
1090
1341
  y?: number;
1342
+ rotation?: number;
1091
1343
  }
1092
- type IAround = 'center' | IPointData;
1093
- type ICursorType = IImageCursor | 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom -in' | 'zoom-out';
1094
- interface ICursorTypeMap {
1095
- [name: string]: ICursorType | ICursorType[];
1096
- }
1097
- interface ILeafInputData extends IObject {
1344
+ type IDirection = 'top-left' | 'top' | 'top-right' | 'right' | 'bottom-right' | 'bottom' | 'bottom-left' | 'left' | 'center';
1345
+ type IAlign = IDirection;
1346
+ type IBaseLineAlign = 'baseline-left' | 'baseline-center' | 'baseline-right';
1347
+ type IFlowAlign = IAlign | IBaseLineAlign;
1348
+ type IAround = IAlign | IUnitPointData;
1349
+ type ICursorType = IImageCursor | '' | 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out';
1350
+ type IStateStyleType = 'hoverStyle' | 'pressStyle' | 'focusStyle' | 'selectedStyle' | 'disabledStyle';
1351
+ interface ILeafInputData {
1098
1352
  tag?: string;
1099
- id?: __String;
1100
- name?: __String;
1101
- className?: __String;
1353
+ id?: IString;
1354
+ name?: IString;
1355
+ className?: IString;
1102
1356
  blendMode?: IBlendMode;
1103
- opacity?: __Number;
1104
- visible?: __Boolean;
1105
- isMask?: __Boolean;
1106
- isEraser?: __Boolean;
1107
- zIndex?: __Number;
1108
- x?: __Number;
1109
- y?: __Number;
1110
- width?: __Number;
1111
- height?: __Number;
1112
- scaleX?: __Number;
1113
- scaleY?: __Number;
1114
- rotation?: __Number;
1115
- skewX?: __Number;
1116
- skewY?: __Number;
1117
- scale?: __Number | IPointData;
1118
- around?: IAround;
1119
- draggable?: __Boolean;
1120
- hittable?: __Boolean;
1357
+ opacity?: INumber;
1358
+ visible?: IBoolean | 0;
1359
+ selected?: IBoolean;
1360
+ disabled?: IBoolean;
1361
+ locked?: IBoolean;
1362
+ zIndex?: INumber;
1363
+ mask?: IBoolean | IMaskType;
1364
+ eraser?: IBoolean | IEraserType;
1365
+ x?: INumber;
1366
+ y?: INumber;
1367
+ width?: INumber;
1368
+ height?: INumber;
1369
+ scaleX?: INumber;
1370
+ scaleY?: INumber;
1371
+ rotation?: INumber;
1372
+ skewX?: INumber;
1373
+ skewY?: INumber;
1374
+ scale?: INumber | IPointData;
1375
+ offsetX?: INumber;
1376
+ offsetY?: INumber;
1377
+ scrollX?: INumber;
1378
+ scrollY?: INumber;
1379
+ origin?: IAlign | IUnitPointData;
1380
+ around?: IAlign | IUnitPointData;
1381
+ lazy?: IBoolean;
1382
+ pixelRatio?: INumber;
1383
+ path?: IPathCommandData | IPathString;
1384
+ windingRule?: IWindingRule;
1385
+ closed?: IBoolean;
1386
+ flow?: IFlowType;
1387
+ padding?: IFourNumber;
1388
+ gap?: IGap | IPointGap;
1389
+ flowAlign?: IFlowAlign | IFlowAxisAlign;
1390
+ flowWrap?: IFlowWrap;
1391
+ itemBox?: IFlowBoxType;
1392
+ inFlow?: IBoolean;
1393
+ autoWidth?: IAutoSize;
1394
+ autoHeight?: IAutoSize;
1395
+ lockRatio?: IBoolean;
1396
+ autoBox?: IAutoBoxData | IConstraint;
1397
+ widthRange?: IRangeSize;
1398
+ heightRange?: IRangeSize;
1399
+ draggable?: IBoolean | IAxis;
1400
+ dragBounds?: IBoundsData | 'parent';
1401
+ editable?: IBoolean;
1402
+ hittable?: IBoolean;
1121
1403
  hitFill?: IHitType;
1122
1404
  hitStroke?: IHitType;
1123
- hitChildren?: __Boolean;
1124
- hitSelf?: __Boolean;
1125
- hitRadius?: __Number;
1405
+ hitBox?: IBoolean;
1406
+ hitChildren?: IBoolean;
1407
+ hitSelf?: IBoolean;
1408
+ hitRadius?: INumber;
1126
1409
  cursor?: ICursorType | ICursorType[];
1410
+ normalStyle?: ILeafInputData;
1411
+ hoverStyle?: ILeafInputData;
1412
+ pressStyle?: ILeafInputData;
1413
+ focusStyle?: ILeafInputData;
1414
+ selectedStyle?: ILeafInputData;
1415
+ disabledStyle?: ILeafInputData;
1416
+ data?: IObject;
1127
1417
  children?: ILeafInputData[];
1418
+ noBounds?: boolean;
1128
1419
  }
1129
1420
  interface ILeafComputedData {
1130
1421
  id?: string;
@@ -1132,10 +1423,13 @@ interface ILeafComputedData {
1132
1423
  className?: string;
1133
1424
  blendMode?: IBlendMode;
1134
1425
  opacity?: number;
1135
- visible?: boolean;
1136
- isMask?: boolean;
1137
- isEraser?: boolean;
1426
+ visible?: boolean | 0;
1427
+ selected?: boolean;
1428
+ disabled?: boolean;
1429
+ locked?: boolean;
1138
1430
  zIndex?: number;
1431
+ mask?: boolean | IMaskType;
1432
+ eraser?: boolean | IEraserType;
1139
1433
  x?: number;
1140
1434
  y?: number;
1141
1435
  width?: number;
@@ -1145,86 +1439,174 @@ interface ILeafComputedData {
1145
1439
  rotation?: number;
1146
1440
  skewX?: number;
1147
1441
  skewY?: number;
1148
- around?: IAround;
1149
- draggable?: boolean;
1442
+ offsetX?: number;
1443
+ offsetY?: number;
1444
+ scrollX?: number;
1445
+ scrollY?: number;
1446
+ origin?: IAlign | IUnitPointData;
1447
+ around?: IAlign | IUnitPointData;
1448
+ lazy?: boolean;
1449
+ pixelRatio?: number;
1450
+ path?: IPathCommandData;
1451
+ windingRule?: IWindingRule;
1452
+ closed?: boolean;
1453
+ flow?: IFlowType;
1454
+ padding?: IFourNumber;
1455
+ gap?: IGap | IPointGap;
1456
+ flowAlign?: IFlowAlign | IFlowAxisAlign;
1457
+ flowWrap?: IFlowWrap;
1458
+ itemBox?: IFlowBoxType;
1459
+ inFlow?: boolean;
1460
+ autoWidth?: IAutoSize;
1461
+ autoHeight?: IAutoSize;
1462
+ lockRatio?: boolean;
1463
+ autoBox?: IAutoBoxData | IConstraint;
1464
+ widthRange?: IRangeSize;
1465
+ heightRange?: IRangeSize;
1466
+ draggable?: boolean | IAxis;
1467
+ dragBounds?: IBoundsData | 'parent';
1468
+ editable?: boolean;
1150
1469
  hittable?: boolean;
1151
1470
  hitFill?: IHitType;
1152
1471
  hitStroke?: IHitType;
1472
+ hitBox?: boolean;
1153
1473
  hitChildren?: boolean;
1154
1474
  hitSelf?: boolean;
1155
1475
  hitRadius?: number;
1156
1476
  cursor?: ICursorType | ICursorType[];
1477
+ normalStyle?: ILeafInputData;
1478
+ hoverStyle?: ILeafInputData;
1479
+ pressStyle?: ILeafInputData;
1480
+ focusStyle?: ILeafInputData;
1481
+ selectedStyle?: ILeafInputData;
1482
+ disabledStyle?: ILeafInputData;
1483
+ data?: IObject;
1157
1484
  __childBranchNumber?: number;
1158
1485
  __complex?: boolean;
1159
1486
  __naturalWidth?: number;
1160
1487
  __naturalHeight?: number;
1161
- }
1162
- interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
1488
+ readonly __autoWidth?: boolean;
1489
+ readonly __autoHeight?: boolean;
1490
+ readonly __autoSide?: boolean;
1491
+ readonly __autoSize?: boolean;
1492
+ readonly __useNaturalRatio: boolean;
1493
+ readonly __isLinePath: boolean;
1494
+ readonly __blendMode: string;
1495
+ __useArrow?: boolean;
1496
+ __useEffect?: boolean;
1497
+ __pathInputed?: number;
1498
+ __pathForRender?: IPathCommandData;
1499
+ __path2DForRender?: IPath2D;
1500
+ }
1501
+ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
1163
1502
  tag: string;
1164
1503
  readonly __tag: string;
1165
1504
  readonly innerName: string;
1166
1505
  readonly __DataProcessor: IObject;
1167
1506
  readonly __LayoutProcessor: IObject;
1168
- leafer?: ILeafer;
1507
+ readonly app?: ILeaferBase;
1508
+ leafer?: ILeaferBase;
1169
1509
  parent?: ILeaf;
1510
+ zoomLayer?: ILeaf;
1170
1511
  readonly isApp?: boolean;
1171
- isLeafer?: boolean;
1172
- isBranch?: boolean;
1173
- isBranchLeaf?: boolean;
1512
+ readonly isLeafer?: boolean;
1513
+ readonly isBranch?: boolean;
1514
+ readonly isBranchLeaf?: boolean;
1515
+ readonly isOutside?: boolean;
1174
1516
  __: ILeafData;
1517
+ proxyData?: ILeafInputData;
1518
+ __proxyData?: ILeafInputData;
1519
+ syncEventer?: ILeaf;
1175
1520
  __layout: ILeafLayout;
1176
- __world: IMatrixWithLayoutData;
1177
- __local: IMatrixWithBoundsData;
1521
+ __world: IMatrixWithBoundsScaleData;
1522
+ __local?: IMatrixWithBoundsData;
1523
+ __nowWorld?: IMatrixWithBoundsScaleData;
1524
+ __cameraWorld?: IMatrixWithBoundsScaleData;
1525
+ readonly __localMatrix: IMatrixData;
1526
+ readonly __localBoxBounds: IBoundsData;
1178
1527
  __worldOpacity: number;
1179
- readonly worldTransform: IMatrixWithLayoutData;
1180
- readonly localTransform: IMatrixWithBoundsData;
1528
+ readonly worldTransform: IMatrixWithScaleData;
1529
+ readonly localTransform: IMatrixData;
1181
1530
  readonly boxBounds: IBoundsData;
1531
+ readonly renderBounds: IBoundsData;
1182
1532
  readonly worldBoxBounds: IBoundsData;
1183
1533
  readonly worldStrokeBounds: IBoundsData;
1184
1534
  readonly worldRenderBounds: IBoundsData;
1185
1535
  readonly worldOpacity: number;
1186
- __renderTime?: number;
1187
1536
  __level: number;
1188
1537
  __tempNumber?: number;
1189
- readonly resizeable: boolean;
1190
- readonly __hasMirror: boolean;
1538
+ readonly __worldFlipped: boolean;
1539
+ __hasAutoLayout?: boolean;
1191
1540
  __hasMask?: boolean;
1192
1541
  __hasEraser?: boolean;
1193
1542
  __hitCanvas?: IHitCanvas;
1543
+ __flowBounds?: IBoundsData;
1544
+ __widthGrow?: number;
1545
+ __heightGrow?: number;
1546
+ __hasGrow?: boolean;
1194
1547
  readonly __onlyHitMask: boolean;
1195
1548
  readonly __ignoreHitWorld: boolean;
1549
+ readonly __inLazyBounds: boolean;
1550
+ readonly pathInputed: boolean;
1196
1551
  __parentWait?: IFunction[];
1197
1552
  __leaferWait?: IFunction[];
1198
1553
  destroyed: boolean;
1199
- waitParent(item: IFunction): void;
1200
- waitLeafer(item: IFunction): void;
1201
- nextRender(item: IFunction): void;
1202
- __bindLeafer(leafer: ILeafer | null): void;
1554
+ reset(data?: ILeafInputData): void;
1555
+ resetCustom(): void;
1556
+ waitParent(item: IFunction, bind?: IObject): void;
1557
+ waitLeafer(item: IFunction, bind?: IObject): void;
1558
+ nextRender(item: IFunction, bind?: IObject, off?: 'off'): void;
1559
+ removeNextRender(item: IFunction): void;
1560
+ __bindLeafer(leafer: ILeaferBase | null): void;
1203
1561
  set(data: IObject): void;
1204
- toJSON(): IObject;
1205
- toString(): string;
1206
- __setAttr(attrName: string, newValue: __Value): void;
1207
- __getAttr(attrName: string): __Value;
1562
+ get(name?: string | string[] | IObject): ILeafInputData | IValue;
1563
+ setAttr(name: string, value: any): void;
1564
+ getAttr(name: string): any;
1565
+ getComputedAttr(name: string): any;
1566
+ toJSON(options?: IJSONOptions): IObject;
1567
+ toString(options?: IJSONOptions): string;
1568
+ toSVG(): string;
1569
+ __SVG(data: IObject): void;
1570
+ toHTML(): string;
1571
+ __setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean;
1572
+ __getAttr(attrName: string): IValue;
1573
+ setProxyAttr(name: string, newValue: IValue): void;
1574
+ getProxyAttr(name: string): IValue;
1575
+ find(condition: number | string | IFindMethod, options?: any): ILeaf[];
1576
+ findTag(tag: string | string[]): ILeaf[];
1577
+ findOne(condition: number | string | IFindMethod, options?: any): ILeaf | undefined;
1578
+ findId(id: number | string): ILeaf | undefined;
1579
+ focus(value?: boolean): void;
1580
+ updateLayout(): void;
1208
1581
  forceUpdate(attrName?: string): void;
1582
+ forceRender(_bounds?: IBoundsData): void;
1209
1583
  __updateWorldMatrix(): void;
1210
1584
  __updateLocalMatrix(): void;
1211
1585
  __updateWorldBounds(): void;
1586
+ __updateLocalBounds(): void;
1212
1587
  __updateLocalBoxBounds(): void;
1213
1588
  __updateLocalStrokeBounds(): void;
1214
1589
  __updateLocalRenderBounds(): void;
1590
+ __updateContentBounds(): void;
1215
1591
  __updateBoxBounds(): void;
1216
1592
  __updateStrokeBounds(): void;
1217
1593
  __updateRenderBounds(): void;
1594
+ __updateAutoLayout(): void;
1595
+ __updateFlowLayout(): void;
1218
1596
  __updateNaturalSize(): void;
1219
1597
  __updateStrokeSpread(): number;
1220
1598
  __updateRenderSpread(): number;
1221
1599
  __onUpdateSize(): void;
1222
1600
  __updateEraser(value?: boolean): void;
1223
1601
  __updateMask(value?: boolean): void;
1224
- __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void;
1225
- __removeMask(child?: ILeaf): void;
1226
- getWorld(attrName: IMatrixDecompositionAttr): number;
1227
- getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData;
1602
+ __renderMask(canvas: ILeaferCanvas, options: IRenderOptions): void;
1603
+ __renderEraser(canvas: ILeaferCanvas, options: IRenderOptions): void;
1604
+ __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData;
1605
+ getTransform(relative?: ILocationType | ILeaf): IMatrixData;
1606
+ getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData;
1607
+ getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData;
1608
+ getLayoutPoints(type?: IBoundsType, relative?: ILocationType | ILeaf): IPointData[];
1609
+ getWorldBounds(inner: IBoundsData, relative?: ILeaf, change?: boolean): IBoundsData;
1228
1610
  worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
1229
1611
  localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
1230
1612
  worldToInner(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
@@ -1235,18 +1617,35 @@ interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatr
1235
1617
  getLocalPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1236
1618
  getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1237
1619
  getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1238
- move(x: number, y?: number): void;
1239
- scaleOf(origin: IPointData, x: number, y?: number): void;
1240
- rotateOf(origin: IPointData, rotation: number): void;
1241
- skewOf(origin: IPointData, x: number, y: number): void;
1620
+ getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1621
+ getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1622
+ setTransform(transform?: IMatrixData, resize?: boolean): void;
1623
+ transform(transform?: IMatrixData, resize?: boolean): void;
1624
+ move(x: number | IPointData, y?: number): void;
1625
+ scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number, resize?: boolean): void;
1626
+ rotateOf(origin: IPointData | IAlign, rotation: number): void;
1627
+ skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean): void;
1628
+ transformWorld(worldTransform?: IMatrixData, resize?: boolean): void;
1629
+ moveWorld(x: number | IPointData, y?: number): void;
1630
+ scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void;
1631
+ rotateOfWorld(worldOrigin: IPointData, rotation: number): void;
1632
+ skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void;
1633
+ scaleResize(scaleX: number, scaleY: number, noResize?: boolean): void;
1634
+ __scaleResize(scaleX: number, scaleY: number): void;
1635
+ resizeWidth(width: number): void;
1636
+ resizeHeight(height: number): void;
1242
1637
  __hitWorld(point: IRadiusPointData): boolean;
1243
1638
  __hit(local: IRadiusPointData): boolean;
1639
+ __hitFill(inner: IRadiusPointData): boolean;
1640
+ __hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean;
1641
+ __hitPixel(inner: IRadiusPointData): boolean;
1244
1642
  __drawHitPath(canvas: ILeaferCanvas): void;
1245
1643
  __updateHitCanvas(): void;
1246
1644
  __render(canvas: ILeaferCanvas, options: IRenderOptions): void;
1247
1645
  __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void;
1248
1646
  __draw(canvas: ILeaferCanvas, options: IRenderOptions): void;
1249
- __renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void;
1647
+ __clip(canvas: ILeaferCanvas, options: IRenderOptions): void;
1648
+ __renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void;
1250
1649
  __updateWorldOpacity(): void;
1251
1650
  __updateChange(): void;
1252
1651
  __drawPath(canvas: ILeaferCanvas): void;
@@ -1257,36 +1656,13 @@ interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatr
1257
1656
  __updateSortChildren(): void;
1258
1657
  add(child: ILeaf, index?: number): void;
1259
1658
  remove(child?: ILeaf, destroy?: boolean): void;
1659
+ dropTo(parent: ILeaf, index?: number, resize?: boolean): void;
1260
1660
  }
1261
-
1262
- interface ISelectPathResult {
1263
- leaf: ILeaf;
1264
- path: ILeafList;
1265
- throughPath?: ILeafList;
1266
- }
1267
- interface ISelectPathOptions {
1268
- name?: string;
1269
- through?: boolean;
1270
- exclude?: ILeafList;
1271
- ignoreHittable?: boolean;
1272
- }
1273
- interface ISelectorConfig {
1274
- }
1275
- interface ISelector {
1276
- target: ILeaf;
1277
- config: ISelectorConfig;
1278
- getByPoint(hitPoint: IPointData, hitRadius: number, options?: ISelectPathOptions): ISelectPathResult;
1279
- find(name: number | string, branch?: ILeaf): ILeaf | ILeaf[];
1280
- getByInnerId(name: number, branch?: ILeaf): ILeaf;
1281
- getById(name: string, branch?: ILeaf): ILeaf;
1282
- getByClassName(name: string, branch?: ILeaf): ILeaf[];
1283
- getByTagName(name: string, branch?: ILeaf): ILeaf[];
1284
- destroy(): void;
1661
+ type ILeafAttrDescriptor = IObject & ThisType<ILeaf>;
1662
+ interface ILeafAttrDescriptorFn {
1663
+ (key: string): ILeafAttrDescriptor;
1285
1664
  }
1286
1665
 
1287
- type IExportImageType = 'jpg' | 'png' | 'webp';
1288
- type IExportFileType = IExportImageType | 'svg' | 'pdf' | 'json';
1289
-
1290
1666
  interface ILeaferImageConfig {
1291
1667
  url: string;
1292
1668
  thumb?: string;
@@ -1298,6 +1674,13 @@ interface ILeaferImageOnLoaded {
1298
1674
  interface ILeaferImageOnError {
1299
1675
  (error?: string | IObject, image?: ILeaferImage): any;
1300
1676
  }
1677
+ interface ILeaferImageCacheCanvas {
1678
+ data: IObject;
1679
+ params: IArguments;
1680
+ }
1681
+ interface ILeaferImagePatternPaint {
1682
+ transform: IMatrixData;
1683
+ }
1301
1684
  interface ILeaferImage {
1302
1685
  readonly innerId: InnerId;
1303
1686
  readonly url: string;
@@ -1305,6 +1688,7 @@ interface ILeaferImage {
1305
1688
  width: number;
1306
1689
  height: number;
1307
1690
  isSVG: boolean;
1691
+ hasOpacityPixel: boolean;
1308
1692
  readonly completed: boolean;
1309
1693
  ready: boolean;
1310
1694
  error: IObject;
@@ -1314,6 +1698,7 @@ interface ILeaferImage {
1314
1698
  load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError): number;
1315
1699
  unload(index: number, stopEvent?: boolean): void;
1316
1700
  getCanvas(width: number, height: number, opacity?: number, _filters?: IObject): unknown;
1701
+ getPattern(canvas: any, repeat: string | null, transform?: IMatrixData, paint?: IObject): ICanvasPattern;
1317
1702
  destroy(): void;
1318
1703
  }
1319
1704
 
@@ -1331,9 +1716,9 @@ interface IUIEvent extends IEvent {
1331
1716
  buttons?: number;
1332
1717
  path?: ILeafList;
1333
1718
  throughPath?: ILeafList;
1334
- origin?: IObject;
1335
- getInner?(target?: ILeaf): IPointData;
1336
- getLocal?(target?: ILeaf): IPointData;
1719
+ getPage?(): IPointData;
1720
+ getInner?(relative?: ILeaf): IPointData;
1721
+ getLocal?(relative?: ILeaf): IPointData;
1337
1722
  }
1338
1723
  interface IPointerEvent extends IUIEvent {
1339
1724
  width?: number;
@@ -1344,6 +1729,7 @@ interface IPointerEvent extends IUIEvent {
1344
1729
  tiltX?: number;
1345
1730
  tiltY?: number;
1346
1731
  twist?: number;
1732
+ isCancel?: boolean;
1347
1733
  }
1348
1734
  type PointerType = 'mouse' | 'pen' | 'touch';
1349
1735
  interface IDragEvent extends IPointerEvent {
@@ -1351,10 +1737,13 @@ interface IDragEvent extends IPointerEvent {
1351
1737
  moveY: number;
1352
1738
  totalX?: number;
1353
1739
  totalY?: number;
1354
- getInnerMove?(target?: ILeaf): IPointData;
1355
- getLocalMove?(target?: ILeaf): IPointData;
1356
- getInnerTotal?(target?: ILeaf): IPointData;
1357
- getLocalTotal?(target?: ILeaf): IPointData;
1740
+ getPageMove?(total?: boolean): IPointData;
1741
+ getInnerMove?(relative?: ILeaf): IPointData;
1742
+ getLocalMove?(relative?: ILeaf): IPointData;
1743
+ getPageTotal?(): IPointData;
1744
+ getInnerTotal?(relative?: ILeaf): IPointData;
1745
+ getLocalTotal?(relative?: ILeaf): IPointData;
1746
+ getPageBounds?(): IBoundsData;
1358
1747
  }
1359
1748
  interface IDropEvent extends IPointerEvent {
1360
1749
  list: ILeafList;
@@ -1387,14 +1776,18 @@ interface IInteraction extends IControl {
1387
1776
  selector: ISelector;
1388
1777
  running: boolean;
1389
1778
  readonly dragging: boolean;
1779
+ readonly isDragEmpty: boolean;
1780
+ readonly isHoldRightKey: boolean;
1390
1781
  readonly moveMode: boolean;
1391
1782
  config: IInteractionConfig;
1392
1783
  cursor: ICursorType | ICursorType[];
1393
1784
  readonly hitRadius: number;
1785
+ bottomList?: IPickBottom[];
1394
1786
  shrinkCanvasBounds: IBounds;
1395
1787
  downData: IPointerEvent;
1396
1788
  hoverData: IPointerEvent;
1397
1789
  downTime: number;
1790
+ focusData: ILeaf;
1398
1791
  receive(event: any): void;
1399
1792
  pointerDown(data?: IPointerEvent, defaultPath?: boolean): void;
1400
1793
  pointerMove(data?: IPointerEvent): void;
@@ -1407,10 +1800,20 @@ interface IInteraction extends IControl {
1407
1800
  rotate(data: IRotateEvent): void;
1408
1801
  keyDown(data: IKeyEvent): void;
1409
1802
  keyUp(data: IKeyEvent): void;
1410
- findPath(data: IPointerEvent, options?: ISelectPathOptions): ILeafList;
1411
- updateDownData(data?: IPointerEvent): void;
1803
+ findPath(data: IPointerEvent, options?: IPickOptions): ILeafList;
1804
+ isRootPath(data: IPointerEvent): boolean;
1805
+ isTreePath(data: IPointerEvent): boolean;
1806
+ canMove(data: IPointerEvent): boolean;
1807
+ isDrag(leaf: ILeaf): boolean;
1808
+ isPress(leaf: ILeaf): boolean;
1809
+ isHover(leaf: ILeaf): boolean;
1810
+ isFocus(leaf: ILeaf): boolean;
1811
+ cancelHover(): void;
1812
+ updateDownData(data?: IPointerEvent, options?: IPickOptions, merge?: boolean): void;
1412
1813
  updateHoverData(data: IPointerEvent): void;
1413
1814
  updateCursor(hoverData?: IPointerEvent): void;
1815
+ setCursor(cursor: ICursorType | ICursorType[]): void;
1816
+ getLocal(clientPoint: IClientPointData, updateClient?: boolean): IPointData;
1414
1817
  emit(type: string, data: IUIEvent, path?: ILeafList, excludePath?: ILeafList): void;
1415
1818
  }
1416
1819
  interface IInteractionCanvas extends ILeaferCanvas {
@@ -1421,19 +1824,29 @@ interface IInteractionConfig {
1421
1824
  zoom?: IZoomConfig;
1422
1825
  move?: IMoveConfig;
1423
1826
  eventer?: IObject;
1827
+ cursor?: boolean;
1828
+ keyEvent?: boolean;
1424
1829
  }
1425
1830
  interface IZoomConfig {
1831
+ disabled?: boolean;
1426
1832
  min?: number;
1427
1833
  max?: number;
1428
1834
  }
1429
1835
  interface IMoveConfig {
1836
+ disabled?: boolean;
1430
1837
  holdSpaceKey?: boolean;
1838
+ holdMiddleKey?: boolean;
1839
+ holdRightKey?: boolean;
1840
+ scroll?: boolean | 'limit';
1841
+ drag?: boolean;
1842
+ dragAnimate?: boolean;
1431
1843
  dragEmpty?: boolean;
1432
1844
  dragOut?: boolean;
1433
1845
  autoDistance?: number;
1434
1846
  }
1435
1847
  interface IWheelConfig {
1436
- zoomMode?: boolean;
1848
+ disabled?: boolean;
1849
+ zoomMode?: boolean | 'mouse';
1437
1850
  zoomSpeed?: number;
1438
1851
  moveSpeed?: number;
1439
1852
  rotateSpeed?: number;
@@ -1449,48 +1862,40 @@ interface IPointerConfig {
1449
1862
  tapTime?: number;
1450
1863
  longPressTime?: number;
1451
1864
  transformTime?: number;
1865
+ hover?: boolean;
1452
1866
  dragHover?: boolean;
1453
1867
  dragDistance?: number;
1454
1868
  swipeDistance?: number;
1455
1869
  ignoreMove?: boolean;
1456
1870
  preventDefault?: boolean;
1871
+ preventDefaultMenu?: boolean;
1457
1872
  }
1458
1873
 
1459
1874
  interface IHitCanvasManager extends ICanvasManager {
1875
+ maxTotal: number;
1460
1876
  getPathType(leaf: ILeaf): IHitCanvas;
1461
- getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas;
1462
- }
1463
-
1464
- interface IBranch extends ILeaf {
1465
- children: ILeaf[];
1466
- __renderBranch?(canvas: ILeaferCanvas, options: IRenderOptions): void;
1467
- addMany(...children: ILeaf[]): void;
1468
- removeAll(destroy?: boolean): void;
1877
+ getPixelType(leaf: ILeaf, config?: ILeaferCanvasConfig): IHitCanvas;
1469
1878
  }
1470
1879
 
1471
1880
  interface IZoomView extends IBranch {
1472
- zoomLayer?: ILeaf;
1473
- moveLayer?: ILeaf;
1474
- transformData?: ITransformEventData;
1475
- setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void;
1476
1881
  }
1477
1882
 
1478
- type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'user';
1883
+ type ILeaferType = 'draw' | 'editor' | 'design' | 'board' | 'document' | 'app' | 'website' | 'game' | 'player' | 'chart' | 'custom';
1479
1884
  interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteractionConfig, ILayouterConfig {
1480
1885
  start?: boolean;
1481
1886
  type?: ILeaferType;
1482
1887
  realCanvas?: boolean;
1888
+ lazySpeard?: IFourNumber;
1483
1889
  }
1484
- interface ILeafer extends IZoomView, IControl {
1485
- readonly isApp: boolean;
1486
- readonly app: ILeafer;
1487
- parent?: IApp;
1890
+ interface ILeaferAttrData {
1488
1891
  running: boolean;
1489
1892
  created: boolean;
1490
1893
  ready: boolean;
1491
1894
  viewReady: boolean;
1895
+ imageReady: boolean;
1492
1896
  viewCompleted: boolean;
1493
- pixelRatio: number;
1897
+ layoutLocked: boolean;
1898
+ transforming: boolean;
1494
1899
  view: unknown;
1495
1900
  canvas: ILeaferCanvas;
1496
1901
  renderer: IRenderer;
@@ -1501,25 +1906,41 @@ interface ILeafer extends IZoomView, IControl {
1501
1906
  canvasManager: ICanvasManager;
1502
1907
  hitCanvasManager?: IHitCanvasManager;
1503
1908
  autoLayout?: IAutoBounds;
1909
+ lazyBounds: IBounds;
1504
1910
  config: ILeaferConfig;
1911
+ readonly cursorPoint: IPointData;
1912
+ readonly clientBounds: IBoundsData;
1913
+ leafs: number;
1505
1914
  __eventIds: IEventListenerId[];
1506
1915
  __nextRenderWait: IFunction[];
1507
- init(userConfig?: ILeaferConfig, parentApp?: IApp): void;
1508
- setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void;
1509
- forceFullRender(): void;
1510
- updateCursor(): void;
1916
+ init(userConfig?: ILeaferConfig, parentApp?: IAppBase): void;
1917
+ start(): void;
1918
+ stop(): void;
1919
+ unlockLayout(): void;
1920
+ lockLayout(): void;
1921
+ updateCursor(cursor?: ICursorType): void;
1511
1922
  resize(size: IScreenSizeData): void;
1512
- waitReady(item: IFunction): void;
1513
- waitViewReady(item: IFunction): void;
1514
- waitViewCompleted(item: IFunction): void;
1923
+ waitReady(item: IFunction, bind?: IObject): void;
1924
+ waitViewReady(item: IFunction, bind?: IObject): void;
1925
+ waitViewCompleted(item: IFunction, bind?: IObject): void;
1926
+ zoom(zoomType: IZoomType, padding?: IFourNumber, fixedScale?: boolean): IBoundsData;
1927
+ getValidMove(moveX: number, moveY: number): IPointData;
1928
+ getValidScale(changeScale: number): number;
1929
+ getWorldPointByClient(clientPoint: IClientPointData, updateClient?: boolean): IPointData;
1930
+ }
1931
+ type IZoomType = 'in' | 'out' | 'fit' | 'fit-width' | 'fit-height' | number | ILeaf | ILeaf[] | IBoundsData;
1932
+ interface ILeaferBase extends IZoomView, IControl, ILeaferAttrData {
1933
+ readonly isApp: boolean;
1934
+ readonly app: ILeaferBase;
1935
+ parent?: IAppBase;
1515
1936
  }
1516
1937
  interface ILeaferTypeCreator {
1517
1938
  list: ILeaferTypeList;
1518
1939
  register(name: string, fn: ILeaferTypeFunction): void;
1519
- run(name: string, leafer: ILeafer): void;
1940
+ run(name: string, leafer: ILeaferBase): void;
1520
1941
  }
1521
1942
  interface ILeaferTypeFunction {
1522
- (leafer: ILeafer): void;
1943
+ (leafer: ILeaferBase): void;
1523
1944
  }
1524
1945
  interface ILeaferTypeList {
1525
1946
  [key: string]: ILeaferTypeFunction;
@@ -1528,19 +1949,21 @@ interface ICreator {
1528
1949
  image?(options?: ILeaferImageConfig): ILeaferImage;
1529
1950
  canvas?(options?: ILeaferCanvasConfig, manager?: ICanvasManager): ILeaferCanvas;
1530
1951
  hitCanvas?(options?: IHitCanvasConfig, manager?: ICanvasManager): IHitCanvas;
1952
+ hitCanvasManager?(): IHitCanvasManager;
1531
1953
  watcher?(target: ILeaf, options?: IWatcherConfig): IWatcher;
1532
1954
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter;
1533
1955
  renderer?(target: ILeaf, canvas: ILeaferCanvas, options?: IRendererConfig): IRenderer;
1534
1956
  selector?(target: ILeaf, options?: ISelectorConfig): ISelector;
1535
1957
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction;
1958
+ editor?(options?: IObject): ILeaf;
1536
1959
  }
1537
1960
  interface IUICreator {
1538
1961
  register(UI: IObject): void;
1539
1962
  get(tag: string, data: IObject): IObject;
1540
1963
  }
1541
1964
 
1542
- interface IApp extends ILeafer {
1543
- children: ILeafer[];
1965
+ interface IAppBase extends ILeaferBase {
1966
+ children: ILeaferBase[];
1544
1967
  realCanvas: boolean;
1545
1968
  }
1546
1969
 
@@ -1597,18 +2020,52 @@ interface IImageManager {
1597
2020
  recycledList: ILeaferImage[];
1598
2021
  tasker: ITaskProcessor;
1599
2022
  patternTasker: ITaskProcessor;
2023
+ patternLocked?: boolean;
1600
2024
  readonly isComplete: boolean;
1601
2025
  get(config: ILeaferImageConfig): ILeaferImage;
1602
2026
  recycle(image: ILeaferImage): void;
1603
2027
  clearRecycled(): void;
2028
+ hasOpacityPixel(config: ILeaferImageConfig): boolean;
2029
+ isFormat(format: IExportFileType, config: ILeaferImageConfig): boolean;
1604
2030
  destroy(): void;
1605
2031
  }
1606
2032
 
2033
+ type ICanvasType = 'skia' | 'napi' | 'canvas' | 'wx';
2034
+ interface ISkiaCanvas {
2035
+ toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>;
2036
+ toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any;
2037
+ toDataURL(format: IExportImageType, config: ISkiaCanvasExportConfig): Promise<string>;
2038
+ toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
2039
+ saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>;
2040
+ saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void;
2041
+ }
2042
+ interface ISkiaCanvasExportConfig {
2043
+ page?: number;
2044
+ matte?: string;
2045
+ density?: number;
2046
+ quality?: number;
2047
+ outline?: boolean;
2048
+ }
2049
+ interface ISkiaNAPICanvas {
2050
+ encodeSync(format: 'webp' | 'jpeg', quality?: number): any;
2051
+ encodeSync(format: 'png'): any;
2052
+ encode(format: 'webp' | 'jpeg' | string, quality?: number): Promise<any>;
2053
+ encode(format: 'png'): Promise<any>;
2054
+ toBuffer(mime: 'image/png'): any;
2055
+ toBuffer(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): any;
2056
+ toDataURL(mime?: 'image/png'): string;
2057
+ toDataURL(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): string;
2058
+ toDataURLAsync(mime?: 'image/png'): Promise<string>;
2059
+ toDataURLAsync(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): Promise<string>;
2060
+ }
2061
+
1607
2062
  interface IPlatform {
1608
2063
  name?: 'web' | 'node' | 'miniapp';
1609
2064
  os?: 'Mac' | 'Windows' | 'Linux';
2065
+ toURL(text: string, fileType?: 'text' | 'svg'): string;
1610
2066
  requestRender?(render: IFunction): void;
1611
2067
  canvas?: ILeaferCanvas;
2068
+ canvasType?: ICanvasType;
1612
2069
  isWorker?: boolean;
1613
2070
  isMobile?: boolean;
1614
2071
  devicePixelRatio?: number;
@@ -1618,17 +2075,32 @@ interface IPlatform {
1618
2075
  fullImageShadow?: boolean;
1619
2076
  syncDomFont?: boolean;
1620
2077
  layout?(target: ILeaf): void;
1621
- realtimeLayout?: boolean;
1622
2078
  origin?: {
1623
2079
  createCanvas(width: number, height: number, format?: 'svg' | 'pdf'): any;
1624
2080
  canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string | Promise<string>;
1625
2081
  canvasToBolb(canvas: any, type?: IExportFileType, quality?: number): Promise<any>;
1626
2082
  canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>;
2083
+ download(url: string, filename: string): Promise<void>;
1627
2084
  loadImage(url: string): Promise<any>;
1628
2085
  noRepeat?: string;
1629
2086
  };
2087
+ roundRectPatch?: boolean;
2088
+ ellipseToCurve?: boolean;
2089
+ event?: {
2090
+ stopDefault(origin: IObject): void;
2091
+ stopNow(origin: IObject): void;
2092
+ stop(origin: IObject): void;
2093
+ };
1630
2094
  miniapp?: IMiniapp;
1631
- imageSuffix?: string;
2095
+ image: {
2096
+ hitCanvasSize: number;
2097
+ maxCacheSize: number;
2098
+ maxPatternSize: number;
2099
+ prefix?: string;
2100
+ suffix?: string;
2101
+ crossOrigin: string | false;
2102
+ getRealURL: IStringFunction;
2103
+ };
1632
2104
  }
1633
2105
  interface IMiniappSelect extends IObject {
1634
2106
  }
@@ -1649,24 +2121,18 @@ interface IPlugin extends IObject {
1649
2121
  importVersion: string;
1650
2122
  import: string[];
1651
2123
  run(LeaferUI: IObject, config: IObject): void;
1652
- onLeafer?(leafer: ILeafer): void;
2124
+ onLeafer?(leafer: ILeaferBase): void;
1653
2125
  }
1654
2126
 
1655
- type ICanvasType = 'skia' | 'canvas' | 'wx';
1656
- interface ISkiaCanvas {
1657
- toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>;
1658
- toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any;
1659
- toDataURL(format: IExportImageType, config: ISkiaCanvasExportConfig): Promise<string>;
1660
- toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
1661
- saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>;
1662
- saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void;
2127
+ interface ICursorTypeMap {
2128
+ [name: string]: ICursorType | ICursorType[];
1663
2129
  }
1664
- interface ISkiaCanvasExportConfig {
1665
- page?: number;
1666
- matte?: string;
1667
- density?: number;
1668
- quality?: number;
1669
- outline?: boolean;
2130
+ interface ICursorRotate {
2131
+ rotation?: number;
2132
+ data?: string;
2133
+ }
2134
+ interface ICursorRotateMap {
2135
+ [name: string]: ICursorRotate;
1670
2136
  }
1671
2137
 
1672
- export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAnimateEvent, IApp, IAround, IAutoBounds, IAutoBoundsData, IBlendMode, IBlob, IBlobFunction, IBooleanMap, IBounds, IBoundsData, IBoundsDataHandle, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasContext2D, ICanvasManager, ICanvasStrokeOptions, ICanvasType, IChildEvent, IControl, ICreator, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDragEvent, IDropEvent, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IFunction, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IKeepTouchData, IKeyEvent, ILayoutBlockData, ILayoutBoundsType, ILayoutChangedData, ILayoutEvent, ILayoutLocationType, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMask, ILeafMaskModule, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeafer, ILeaferCanvas, ILeaferCanvasConfig, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, IMatrix, IMatrixData, IMatrixDecompositionAttr, IMatrixDecompositionData, IMatrixWithBoundsData, IMatrixWithLayoutData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumberMap, IObject, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPlatform, IPlugin, IPoint, IPointData, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResizeType, IRotateEvent, IScreenSizeData, ISelectPathOptions, ISelectPathResult, ISelector, ISelectorConfig, ISize, ISizeData, ISkiaCanvas, ISkiaCanvasExportConfig, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITransformEvent, ITransformEventData, ITwoPointBounds, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, TransformMode, VCommandData, ZCommandData, __Boolean, __Number, __Object, __String, __Value };
2138
+ export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAlign, IAnimateEvent, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDirection, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFindCondition, IFindMethod, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IGap, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IJSONOptions, IKeepTouchData, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafAttrDescriptor, ILeafAttrDescriptorFn, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeaferAttrData, ILeaferBase, ILeaferCanvas, ILeaferCanvasConfig, ILeaferCanvasView, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IRotateEvent, IScaleData, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomType, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };