@leafer/interface 1.0.0-rc.5 → 1.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/interface",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.7",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
package/src/app/IApp.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ILeafer } from './ILeafer'
1
+ import { ILeaferBase } from './ILeafer'
2
2
 
3
- export interface IApp extends ILeafer {
4
- children: ILeafer[]
3
+ export interface IAppBase extends ILeaferBase {
4
+ children: ILeaferBase[]
5
5
  realCanvas: boolean
6
6
  }
@@ -11,7 +11,7 @@ import { IHitCanvasManager } from '../canvas/IHitCanvasManager'
11
11
  import { IEventListenerId } from '../event/IEventer'
12
12
  import { IObject } from '../data/IData'
13
13
  import { IZoomView } from '../display/IView'
14
- import { IApp } from './IApp'
14
+ import { IAppBase } from './IApp'
15
15
  import { ILeaferImage, ILeaferImageConfig } from '../image/ILeaferImage'
16
16
  import { IControl } from '../control/IControl'
17
17
  import { IFunction } from '../function/IFunction'
@@ -24,17 +24,13 @@ export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IIn
24
24
  realCanvas?: boolean
25
25
  }
26
26
 
27
- export interface ILeafer extends IZoomView, IControl {
28
-
29
- readonly isApp: boolean
30
- readonly app: ILeafer
31
- parent?: IApp
32
-
27
+ export interface ILeaferAttrData {
33
28
  running: boolean
34
29
  created: boolean
35
30
  ready: boolean
36
31
  viewReady: boolean
37
32
  viewCompleted: boolean
33
+ layoutLocked: boolean
38
34
 
39
35
  pixelRatio: number
40
36
 
@@ -62,7 +58,14 @@ export interface ILeafer extends IZoomView, IControl {
62
58
  __eventIds: IEventListenerId[]
63
59
  __nextRenderWait: IFunction[]
64
60
 
65
- init(userConfig?: ILeaferConfig, parentApp?: IApp): void
61
+ init(userConfig?: ILeaferConfig, parentApp?: IAppBase): void
62
+
63
+ start(): void
64
+ stop(): void
65
+
66
+ unlockLayout(): void
67
+ lockLayout(): void
68
+
66
69
  setZoomLayer(zoomLayer: ILeaf): void
67
70
  forceFullRender(): void
68
71
  updateCursor(): void
@@ -73,14 +76,20 @@ export interface ILeafer extends IZoomView, IControl {
73
76
  waitViewCompleted(item: IFunction): void
74
77
  }
75
78
 
79
+ export interface ILeaferBase extends IZoomView, IControl, ILeaferAttrData {
80
+ readonly isApp: boolean
81
+ readonly app: ILeaferBase
82
+ parent?: IAppBase
83
+ }
84
+
76
85
  export interface ILeaferTypeCreator {
77
86
  list: ILeaferTypeList
78
87
  register(name: string, fn: ILeaferTypeFunction): void
79
- run(name: string, leafer: ILeafer): void
88
+ run(name: string, leafer: ILeaferBase): void
80
89
  }
81
90
 
82
91
  export interface ILeaferTypeFunction {
83
- (leafer: ILeafer): void
92
+ (leafer: ILeaferBase): void
84
93
  }
85
94
 
86
95
  export interface ILeaferTypeList {
@@ -98,6 +107,8 @@ export interface ICreator {
98
107
  selector?(target: ILeaf, options?: ISelectorConfig): ISelector
99
108
 
100
109
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction
110
+
111
+ editor?(options?: IObject): ILeaf
101
112
  }
102
113
 
103
114
  export interface IUICreator {
@@ -183,7 +183,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
183
183
 
184
184
  // other
185
185
  isSameSize(options: ILeaferCanvasConfig): boolean
186
- getSameCanvas(useSameWorldTransform?: boolean): ILeaferCanvas
186
+ getSameCanvas(useSameWorldTransform?: boolean, useSameSmooth?: boolean): ILeaferCanvas
187
187
  getBiggerCanvas(addWidth: number, addHeight: number): ILeaferCanvas
188
188
  recycle(): void
189
189
 
@@ -1,7 +1,8 @@
1
1
  import { IExportFileType, IExportImageType } from '../file/IFileType'
2
2
 
3
- export type ICanvasType = 'skia' | 'canvas' | 'wx'
3
+ export type ICanvasType = 'skia' | 'napi' | 'canvas' | 'wx'
4
4
 
5
+ // skia
5
6
  export interface ISkiaCanvas {
6
7
  toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>
7
8
  toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any
@@ -17,4 +18,22 @@ export interface ISkiaCanvasExportConfig {
17
18
  density?: number,
18
19
  quality?: number,
19
20
  outline?: boolean
21
+ }
22
+
23
+ // skia-napi
24
+ export interface ISkiaNAPICanvas {
25
+ encodeSync(format: 'webp' | 'jpeg', quality?: number): any
26
+ encodeSync(format: 'png'): any
27
+
28
+ encode(format: 'webp' | 'jpeg' | string, quality?: number): Promise<any>
29
+ encode(format: 'png'): Promise<any>
30
+
31
+ toBuffer(mime: 'image/png'): any
32
+ toBuffer(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): any
33
+
34
+ toDataURL(mime?: 'image/png'): string
35
+ toDataURL(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): string
36
+
37
+ toDataURLAsync(mime?: 'image/png'): Promise<string>
38
+ toDataURLAsync(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): Promise<string>
20
39
  }
package/src/data/IData.ts CHANGED
@@ -1,8 +1,7 @@
1
- export type __Number = number // number | string will convert to number
2
- export type __Boolean = boolean // boolean | string will convert to boolean
3
- export type __String = string // string | other will convert to string
4
- export type __Object = IObject // will convert to object
5
- export type __Value = __Number | __Boolean | __String | __Object //
1
+ export type INumber = number // number | string will convert to number
2
+ export type IBoolean = boolean // boolean | string will convert to boolean
3
+ export type IString = string // string | other will convert to string
4
+ export type IValue = INumber | IBoolean | IString | IObject //
6
5
  export type ITimer = any
7
6
 
8
7
  export type IPathString = string
@@ -1,7 +1,7 @@
1
1
  import { ILeaf, ILeafComputedData } from '../display/ILeaf'
2
2
  import { IObject } from './IData'
3
3
 
4
- export interface IDataProcessor extends IObject {
4
+ export interface IDataProcessor {
5
5
  __leaf: ILeaf
6
6
  __input: IObject
7
7
  __middle: IObject
@@ -10,6 +10,7 @@ export interface IDataProcessor extends IObject {
10
10
  __checkSingle(): void
11
11
 
12
12
  __get(name: string): any
13
+ __getData(): IObject
13
14
 
14
15
  __setInput(name: string, value: any): void
15
16
  __getInput(name: string): any
@@ -22,6 +23,11 @@ export interface IDataProcessor extends IObject {
22
23
  destroy(): void
23
24
  }
24
25
 
26
+ export interface ILeafDataOptions {
27
+ attrs?: 'all' | string[]
28
+ children?: boolean
29
+ }
30
+
25
31
  export interface ILeafData extends IDataProcessor, ILeafComputedData {
26
32
 
27
33
  }
package/src/data/IList.ts CHANGED
@@ -18,13 +18,16 @@ export interface ILeafList {
18
18
  has(leaf: ILeaf): boolean
19
19
  indexAt(index: number): ILeaf
20
20
  indexOf(leaf: ILeaf): number
21
- unshift(leaf: ILeaf): void
22
- pushList(list: ILeaf[]): void
23
- push(leaf: ILeaf): void
24
- sort(reverse?: boolean): void
21
+
22
+ add(leaf: ILeaf): void
23
+ addAt(leaf: ILeaf, index: number): void
24
+ addList(list: ILeaf[]): void
25
25
  remove(leaf: ILeaf): void
26
+
26
27
  forEach(itemCallback: ILeafListItemCallback): void
28
+ sort(reverse?: boolean): void
27
29
  clone(): ILeafList
30
+ update(): void
28
31
  reset(): void
29
32
  destroy(): void
30
33
  }
@@ -37,8 +40,8 @@ export interface ILeafLevelList {
37
40
  has(leaf: ILeaf): boolean
38
41
  without(leaf: ILeaf): boolean
39
42
  sort(reverse?: boolean): void
40
- pushList(list: ILeaf[]): void
41
- push(leaf: ILeaf): void
43
+ addList(list: ILeaf[]): void
44
+ add(leaf: ILeaf): void
42
45
  forEach(itemCallback: ILeafListItemCallback): void
43
46
  reset(): void
44
47
  destroy(): void
@@ -1,21 +1,22 @@
1
- import { ILeafer } from '../app/ILeafer'
1
+ import { ILeaferBase } from '../app/ILeafer'
2
2
  import { IEventer } from '../event/IEventer'
3
3
 
4
4
  import { ILeaferCanvas, IHitCanvas } from '../canvas/ILeaferCanvas'
5
5
  import { IRenderOptions } from '../renderer/IRenderer'
6
6
 
7
- import { IObject, __Number, __Boolean, __Value, __String } from '../data/IData'
8
- import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, IMatrixDecompositionAttr, IMatrixWithLayoutData } from '../math/IMath'
7
+ import { IObject, INumber, IBoolean, IValue, IString } from '../data/IData'
8
+ import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, IMatrixWithLayoutData, ILayoutBoundsData, IMatrixData } from '../math/IMath'
9
9
  import { IFunction } from '../function/IFunction'
10
10
 
11
11
  import { ILeafDataProxy } from './module/ILeafDataProxy'
12
12
  import { ILeafMatrix } from './module/ILeafMatrix'
13
13
  import { ILeafBounds } from './module/ILeafBounds'
14
- import { ILeafLayout, ILayoutBoundsType, ILayoutLocationType } from '../layout/ILeafLayout'
14
+ import { ILeafLayout, IBoundsType, ILocationType } from '../layout/ILeafLayout'
15
15
  import { ILeafHit } from './module/ILeafHit'
16
16
  import { ILeafRender } from './module/ILeafRender'
17
17
  import { ILeafMask } from './module/ILeafMask'
18
18
  import { ILeafData } from '../data/ILeafData'
19
+ import { IFindMethod } from '../selector/ISelector'
19
20
 
20
21
 
21
22
  export interface ICachedLeaf {
@@ -27,39 +28,44 @@ export interface ICachedLeaf {
27
28
 
28
29
  export interface ILeafAttrData {
29
30
  // layer data
30
- id: __String
31
- name: __String
32
- className: __String
31
+ id: IString
32
+ name: IString
33
+ className: IString
33
34
 
34
35
  blendMode: IBlendMode
35
- opacity: __Number
36
- visible: __Boolean
37
- isMask: __Boolean
38
- isEraser: __Boolean
39
- zIndex: __Number
36
+ opacity: INumber
37
+ visible: IBoolean
38
+ isMask: IBoolean
39
+ isEraser: IBoolean
40
+ locked: IBoolean
41
+ zIndex: INumber
40
42
 
41
43
  // layout data
42
- x: __Number
43
- y: __Number
44
- width: __Number
45
- height: __Number
46
- scaleX: __Number
47
- scaleY: __Number
48
- rotation: __Number
49
- skewX: __Number
50
- skewY: __Number
51
-
52
- scale: __Number | IPointData // helper
53
- around: 'center' | IPointData
54
-
55
- draggable: __Boolean
56
-
57
- hittable: __Boolean
44
+ x: INumber
45
+ y: INumber
46
+ width: INumber
47
+ height: INumber
48
+ scaleX: INumber
49
+ scaleY: INumber
50
+ rotation: INumber
51
+ skewX: INumber
52
+ skewY: INumber
53
+
54
+ scale: INumber | IPointData // helper
55
+ around: IAround
56
+
57
+ draggable: IBoolean
58
+
59
+ editable: IBoolean
60
+ editSize?: IEditSize
61
+
62
+ hittable: IBoolean
58
63
  hitFill: IHitType
59
64
  hitStroke: IHitType
60
- hitChildren: __Boolean
61
- hitSelf: __Boolean
62
- hitRadius: __Number
65
+ hitBox: IBoolean
66
+ hitChildren: IBoolean
67
+ hitSelf: IBoolean
68
+ hitRadius: INumber
63
69
 
64
70
  cursor: ICursorType | ICursorType[]
65
71
  }
@@ -98,14 +104,16 @@ export type IBlendMode =
98
104
  | 'destination-atop'
99
105
  | 'xor'
100
106
 
101
- export type IResizeType = 'size' | 'scale'
107
+ export type IEditSize = 'size' | 'scale'
102
108
  export interface IImageCursor {
103
109
  url: string
104
110
  x?: number
105
111
  y?: number
106
112
  }
107
113
 
108
- export type IAround = 'center' | IPointData
114
+ export type IAround =
115
+ | 'center'
116
+ | IPointData
109
117
 
110
118
  export type ICursorType =
111
119
  | IImageCursor
@@ -150,47 +158,55 @@ export type ICursorType =
150
158
  export interface ICursorTypeMap {
151
159
  [name: string]: ICursorType | ICursorType[]
152
160
  }
153
- export interface ILeafInputData extends IObject {
161
+ export interface ILeafInputData {
154
162
  tag?: string
155
163
 
156
164
  // layer data
157
- id?: __String
158
- name?: __String
159
- className?: __String
165
+ id?: IString
166
+ name?: IString
167
+ className?: IString
160
168
 
161
169
  blendMode?: IBlendMode
162
- opacity?: __Number
163
- visible?: __Boolean
164
- isMask?: __Boolean
165
- isEraser?: __Boolean
166
- zIndex?: __Number
170
+ opacity?: INumber
171
+ visible?: IBoolean
172
+ isMask?: IBoolean
173
+ isEraser?: IBoolean
174
+ locked?: IBoolean
175
+ zIndex?: INumber
167
176
 
168
177
  // layout data
169
- x?: __Number
170
- y?: __Number
171
- width?: __Number
172
- height?: __Number
173
- scaleX?: __Number
174
- scaleY?: __Number
175
- rotation?: __Number
176
- skewX?: __Number
177
- skewY?: __Number
178
-
179
- scale?: __Number | IPointData // helper
178
+ x?: INumber
179
+ y?: INumber
180
+ width?: INumber
181
+ height?: INumber
182
+ scaleX?: INumber
183
+ scaleY?: INumber
184
+ rotation?: INumber
185
+ skewX?: INumber
186
+ skewY?: INumber
187
+
188
+ scale?: INumber | IPointData // helper
180
189
  around?: IAround
181
190
 
182
- draggable?: __Boolean
191
+ draggable?: IBoolean
183
192
 
184
- hittable?: __Boolean
193
+ editable?: IBoolean
194
+ editSize?: IEditSize
195
+
196
+ hittable?: IBoolean
185
197
  hitFill?: IHitType
186
198
  hitStroke?: IHitType
187
- hitChildren?: __Boolean
188
- hitSelf?: __Boolean
189
- hitRadius?: __Number
199
+ hitBox?: IBoolean
200
+ hitChildren?: IBoolean
201
+ hitSelf?: IBoolean
202
+ hitRadius?: INumber
190
203
 
191
204
  cursor?: ICursorType | ICursorType[]
192
205
 
193
206
  children?: ILeafInputData[]
207
+
208
+ // other
209
+ noBounds?: boolean
194
210
  }
195
211
  export interface ILeafComputedData {
196
212
  // layer data
@@ -203,6 +219,7 @@ export interface ILeafComputedData {
203
219
  visible?: boolean
204
220
  isMask?: boolean
205
221
  isEraser?: boolean
222
+ locked?: boolean
206
223
  zIndex?: number
207
224
 
208
225
  // layout data
@@ -220,9 +237,13 @@ export interface ILeafComputedData {
220
237
 
221
238
  draggable?: boolean
222
239
 
240
+ editable?: boolean
241
+ editSize?: IEditSize
242
+
223
243
  hittable?: boolean
224
244
  hitFill?: IHitType
225
245
  hitStroke?: IHitType
246
+ hitBox?: boolean
226
247
  hitChildren?: boolean
227
248
  hitSelf?: boolean
228
249
  hitRadius?: number
@@ -244,7 +265,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
244
265
  readonly __DataProcessor: IObject // IDataProcessor
245
266
  readonly __LayoutProcessor: IObject // ILeafLayout
246
267
 
247
- leafer?: ILeafer
268
+ readonly app?: ILeaferBase
269
+ leafer?: ILeaferBase
248
270
  parent?: ILeaf
249
271
 
250
272
  readonly isApp?: boolean
@@ -253,10 +275,17 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
253
275
  isBranchLeaf?: boolean
254
276
 
255
277
  __: ILeafData
278
+
279
+ proxyData?: ILeafInputData
280
+ __proxyData?: ILeafInputData
281
+
256
282
  __layout: ILeafLayout
257
283
 
258
284
  __world: IMatrixWithLayoutData
259
- __local: IMatrixWithBoundsData
285
+ __local?: IMatrixWithBoundsData
286
+
287
+ readonly __localMatrix: IMatrixData
288
+ readonly __localBounds: IBoundsData
260
289
 
261
290
  __worldOpacity: number
262
291
 
@@ -273,10 +302,9 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
273
302
  __level: number // 图层级别 root(1) -> hight
274
303
  __tempNumber?: number // 用于临时运算储存状态
275
304
 
276
- readonly resizeable: boolean
277
-
278
- readonly __hasMirror: boolean
305
+ readonly __worldFlipped: boolean
279
306
 
307
+ __hasAutoLayout?: boolean
280
308
  __hasMask?: boolean
281
309
  __hasEraser?: boolean
282
310
  __hitCanvas?: IHitCanvas
@@ -296,24 +324,34 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
296
324
  waitLeafer(item: IFunction): void
297
325
  nextRender(item: IFunction): void
298
326
 
299
- __bindLeafer(leafer: ILeafer | null): void
327
+ __bindLeafer(leafer: ILeaferBase | null): void
300
328
 
301
329
  set(data: IObject): void
330
+ get(): ILeafInputData
302
331
  toJSON(): IObject
303
332
  toString(): string
304
333
 
305
334
  // ILeafData ->
306
- __setAttr(attrName: string, newValue: __Value): void
307
- __getAttr(attrName: string): __Value
335
+ __setAttr(attrName: string, newValue: IValue): void
336
+ __getAttr(attrName: string): IValue
337
+ setProxyAttr(name: string, newValue: IValue): void
338
+ getProxyAttr(name: string): IValue
339
+
340
+ // find
341
+ find(condition: number | string | IFindMethod, options?: any): ILeaf[]
342
+ findOne(condition: number | string | IFindMethod, options?: any): ILeaf
308
343
 
309
344
  forceUpdate(attrName?: string): void
310
345
 
346
+ updateLayout(): void
347
+
311
348
  // ILeafMatrix ->
312
349
  __updateWorldMatrix(): void
313
350
  __updateLocalMatrix(): void
314
351
 
315
352
  // ILeafBounds ->
316
353
  __updateWorldBounds(): void
354
+ __updateLocalBounds(): void
317
355
 
318
356
  __updateLocalBoxBounds(): void
319
357
  __updateLocalStrokeBounds(): void
@@ -323,6 +361,7 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
323
361
  __updateStrokeBounds(): void
324
362
  __updateRenderBounds(): void
325
363
 
364
+ __updateAutoLayout(): void
326
365
  __updateNaturalSize(): void
327
366
 
328
367
  __updateStrokeSpread(): number
@@ -333,12 +372,13 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
333
372
  // IBranchMask ->
334
373
  __updateEraser(value?: boolean): void
335
374
  __updateMask(value?: boolean): void
336
- __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
375
+ __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas, recycle?: boolean): void
337
376
  __removeMask(child?: ILeaf): void
338
377
 
339
378
  // convert
340
- getWorld(attrName: IMatrixDecompositionAttr): number
341
- getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData
379
+ getWorld(attrName: ILayoutAttr): number
380
+ getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData
381
+ getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData
342
382
 
343
383
  worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
344
384
  localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
@@ -352,10 +392,17 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
352
392
  getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
353
393
  getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
354
394
 
395
+ // transform
396
+ setTransform(transform?: IMatrixData, resize?: boolean): void
397
+ transform(transform?: IMatrixData, resize?: boolean): void
398
+
355
399
  move(x: number, y?: number): void
356
- scaleOf(origin: IPointData, x: number, y?: number): void
400
+ scaleOf(origin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
357
401
  rotateOf(origin: IPointData, rotation: number): void
358
- skewOf(origin: IPointData, x: number, y: number): void
402
+ skewOf(origin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
403
+
404
+ scaleResize(scaleX: number, scaleY: number, noResize?: boolean): void
405
+ __scaleResize(scaleX: number, scaleY: number): void
359
406
 
360
407
  // ILeafHit ->
361
408
  __hitWorld(point: IRadiusPointData): boolean
@@ -385,4 +432,5 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
385
432
  __updateSortChildren(): void
386
433
  add(child: ILeaf, index?: number): void
387
434
  remove(child?: ILeaf, destroy?: boolean): void
435
+ dropTo(parent: ILeaf, index?: number, resize?: boolean): void
388
436
  }
@@ -4,6 +4,7 @@ export type ILeafBoundsModule = ILeafBounds & ThisType<ILeaf>
4
4
 
5
5
  export interface ILeafBounds {
6
6
  __updateWorldBounds?(): void
7
+ __updateLocalBounds?(): void
7
8
 
8
9
  __updateLocalBoxBounds?(): void
9
10
  __updateLocalStrokeBounds?(): void
@@ -13,6 +14,7 @@ export interface ILeafBounds {
13
14
  __updateStrokeBounds?(): void
14
15
  __updateRenderBounds?(): void
15
16
 
17
+ __updateAutoLayout?(): void
16
18
  __updateNaturalSize?(): void
17
19
 
18
20
  __updateStrokeSpread?(): number
@@ -1,10 +1,12 @@
1
1
  import { ILeaf } from '../ILeaf'
2
- import { __Value } from '../../data/IData'
2
+ import { IValue } from '../../data/IData'
3
3
 
4
4
  export type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>
5
5
 
6
6
  export interface ILeafDataProxy {
7
- __setAttr?(name: string, newValue: __Value): void
8
- __getAttr?(name: string): __Value
7
+ __setAttr?(name: string, newValue: IValue): void
8
+ __getAttr?(name: string): IValue
9
+ setProxyAttr?(name: string, newValue: IValue): void
10
+ getProxyAttr?(name: string): IValue
9
11
  }
10
12
 
@@ -6,7 +6,7 @@ export type ILeafMaskModule = ILeafMask & ThisType<ILeaf>
6
6
  export interface ILeafMask {
7
7
  __updateEraser?(value?: boolean): void
8
8
  __updateMask?(value?: boolean): void
9
- __renderMask?(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
9
+ __renderMask?(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas, recycle?: boolean): void
10
10
  __removeMask?(child?: ILeaf): void
11
11
  }
12
12
 
@@ -1,5 +1,9 @@
1
- import { IEvent, IFunction, IObject } from '@leafer/interface'
2
1
  import { ILeafEventer } from '../display/module/ILeafEventer'
2
+ import { ILeaf } from '../display/ILeaf'
3
+ import { IFunction } from '../function/IFunction'
4
+ import { IEvent } from './IEvent'
5
+ import { IObject } from '../data/IData'
6
+
3
7
 
4
8
  export type IEventListener = IFunction
5
9
 
@@ -18,6 +22,7 @@ export interface IEventListenerMap {
18
22
 
19
23
  export interface IEventListenerId {
20
24
  type: string | string[]
25
+ current: ILeaf
21
26
  listener: IEventListener
22
27
  options?: IEventListenerOptions | boolean
23
28
  }
@@ -10,4 +10,13 @@ export interface INumberFunction {
10
10
 
11
11
  export interface IPointDataFunction {
12
12
  (...arg: any): IPointData
13
+ }
14
+
15
+
16
+ export interface IAttrDecorator {
17
+ (...arg: any): IAttrDecoratorInner
18
+ }
19
+
20
+ interface IAttrDecoratorInner {
21
+ (target: any, key: string): any
13
22
  }