@leafer/interface 1.0.0-rc.2 → 1.0.0-rc.21

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 (39) hide show
  1. package/package.json +1 -1
  2. package/src/app/IApp.ts +3 -3
  3. package/src/app/ILeafer.ts +44 -20
  4. package/src/canvas/ICanvas.ts +7 -2
  5. package/src/canvas/IHitCanvasManager.ts +3 -3
  6. package/src/canvas/ILeaferCanvas.ts +19 -11
  7. package/src/canvas/ISkiaCanvas.ts +20 -1
  8. package/src/data/IData.ts +6 -5
  9. package/src/data/ILeafData.ts +11 -6
  10. package/src/data/IList.ts +9 -6
  11. package/src/display/IBranch.ts +2 -1
  12. package/src/display/ILeaf.ts +266 -93
  13. package/src/display/IView.ts +2 -6
  14. package/src/display/module/IBranchRender.ts +2 -2
  15. package/src/display/module/ILeafBounds.ts +2 -0
  16. package/src/display/module/ILeafDataProxy.ts +5 -3
  17. package/src/display/module/ILeafHit.ts +4 -1
  18. package/src/display/module/ILeafRender.ts +2 -1
  19. package/src/event/IEvent.ts +3 -23
  20. package/src/event/IEventer.ts +6 -1
  21. package/src/event/IUIEvent.ts +11 -8
  22. package/src/file/IExport.ts +34 -0
  23. package/src/file/IFileType.ts +1 -1
  24. package/src/function/IFunction.ts +9 -0
  25. package/src/image/IImageManager.ts +4 -0
  26. package/src/image/ILeaferImage.ts +13 -0
  27. package/src/index.ts +16 -15
  28. package/src/interaction/ICursor.ts +16 -0
  29. package/src/interaction/IInteraction.ts +33 -4
  30. package/src/layout/ILeafLayout.ts +30 -14
  31. package/src/layouter/ILayouter.ts +3 -0
  32. package/src/math/IMath.ts +72 -35
  33. package/src/path/IPathDrawer.ts +6 -3
  34. package/src/platform/IPlatform.ts +17 -2
  35. package/src/plugin/IPlugin.ts +2 -2
  36. package/src/renderer/IRenderer.ts +4 -2
  37. package/src/selector/ISelector.ts +26 -9
  38. package/types/index.d.ts +619 -325
  39. package/src/display/module/ILeafMask.ts +0 -12
@@ -1,21 +1,23 @@
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, IPathString } from '../data/IData'
8
+ import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData, IMatrixWithScaleData } 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
- import { ILeafMask } from './module/ILeafMask'
18
17
  import { ILeafData } from '../data/ILeafData'
18
+ import { IFindMethod } from '../selector/ISelector'
19
+ import { IPathCommandData } from '../path/IPathCommand'
20
+ import { IWindingRule, IPath2D } from '../canvas/ICanvas'
19
21
 
20
22
 
21
23
  export interface ICachedLeaf {
@@ -27,41 +29,65 @@ export interface ICachedLeaf {
27
29
 
28
30
  export interface ILeafAttrData {
29
31
  // layer data
30
- id: __String
31
- name: __String
32
- className: __String
32
+ id: IString
33
+ name: IString
34
+ className: IString
33
35
 
34
36
  blendMode: IBlendMode
35
- opacity: __Number
36
- visible: __Boolean
37
- isMask: __Boolean
38
- isEraser: __Boolean
39
- zIndex: __Number
37
+ opacity: INumber
38
+ visible: IBoolean
39
+ selected: IBoolean
40
+ disabled: IBoolean
41
+ locked: IBoolean
42
+ zIndex: INumber
43
+
44
+ mask: IBoolean
45
+ maskType: IMaskType
46
+ eraser: IBoolean
40
47
 
41
48
  // 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
49
+ x: INumber
50
+ y: INumber
51
+ width: INumber
52
+ height: INumber
53
+ scaleX: INumber
54
+ scaleY: INumber
55
+ rotation: INumber
56
+ skewX: INumber
57
+ skewY: INumber
58
+
59
+ scale: INumber | IPointData // helper
60
+ around: IAround
61
+
62
+ lazy: IBoolean
63
+ pixelRatio: INumber
64
+
65
+ draggable: IBoolean
66
+
67
+ path: IPathCommandData | IPathString
68
+ windingRule: IWindingRule
69
+ closed: boolean
70
+
71
+ editable: IBoolean
72
+ editSize: IEditSize
73
+ editorStyle: IObject
74
+
75
+ hittable: IBoolean
58
76
  hitFill: IHitType
59
77
  hitStroke: IHitType
60
- hitChildren: __Boolean
61
- hitSelf: __Boolean
62
- hitRadius: __Number
78
+ hitBox: IBoolean
79
+ hitChildren: IBoolean
80
+ hitSelf: IBoolean
81
+ hitRadius: INumber
63
82
 
64
83
  cursor: ICursorType | ICursorType[]
84
+
85
+ normalStyle: ILeafInputData // restore hover / press / focus / selected / disabled style
86
+ hoverStyle: ILeafInputData
87
+ pressStyle: ILeafInputData
88
+ focusStyle: ILeafInputData
89
+ selectedStyle: ILeafInputData
90
+ disabledStyle: ILeafInputData
65
91
  }
66
92
 
67
93
  export type IHitType =
@@ -70,6 +96,11 @@ export type IHitType =
70
96
  | 'all'
71
97
  | 'none'
72
98
 
99
+ export type IMaskType =
100
+ | 'path'
101
+ | 'pixel'
102
+ | 'clipping'
103
+
73
104
  export type IBlendMode =
74
105
  | 'pass-through'
75
106
  | 'normal'
@@ -96,18 +127,31 @@ export type IBlendMode =
96
127
  | 'destination-in'
97
128
  | 'destination-out'
98
129
  | 'destination-atop'
130
+ | 'xor'
99
131
 
100
- export type IResizeType = 'size' | 'scale'
132
+ export type IEditSize = 'size' | 'scale'
101
133
  export interface IImageCursor {
102
134
  url: string
103
135
  x?: number
104
136
  y?: number
137
+ rotation?: number
105
138
  }
106
139
 
107
- export type IAround = 'center' | IPointData
140
+ export type IAround =
141
+ | 'topLeft'
142
+ | 'top'
143
+ | 'topRight'
144
+ | 'right'
145
+ | 'bottomRight'
146
+ | 'bottom'
147
+ | 'bottomLeft'
148
+ | 'left'
149
+ | 'center'
150
+ | IPointData
108
151
 
109
152
  export type ICursorType =
110
153
  | IImageCursor
154
+ | ''
111
155
  | 'auto'
112
156
  | 'default'
113
157
  | 'none'
@@ -142,53 +186,84 @@ export type ICursorType =
142
186
  | 'col-resize'
143
187
  | 'row-resize'
144
188
  | 'all-scroll'
145
- | 'zoom -in'
189
+ | 'zoom-in'
146
190
  | 'zoom-out'
147
191
 
148
- export interface ICursorTypeMap {
149
- [name: string]: ICursorType | ICursorType[]
150
- }
151
- export interface ILeafInputData extends IObject {
192
+ export type IStateStyleType =
193
+ | 'hoverStyle'
194
+ | 'pressStyle'
195
+ | 'focusStyle'
196
+ | 'selectedStyle'
197
+ | 'disabledStyle'
198
+
199
+ export interface ILeafInputData {
152
200
  tag?: string
153
201
 
154
202
  // layer data
155
- id?: __String
156
- name?: __String
157
- className?: __String
203
+ id?: IString
204
+ name?: IString
205
+ className?: IString
158
206
 
159
207
  blendMode?: IBlendMode
160
- opacity?: __Number
161
- visible?: __Boolean
162
- isMask?: __Boolean
163
- isEraser?: __Boolean
164
- zIndex?: __Number
208
+ opacity?: INumber
209
+ visible?: IBoolean
210
+ selected?: IBoolean
211
+ disabled?: IBoolean
212
+ locked?: IBoolean
213
+ zIndex?: INumber
214
+
215
+ mask?: IBoolean
216
+ maskType?: IMaskType
217
+ eraser?: IBoolean
165
218
 
166
219
  // layout data
167
- x?: __Number
168
- y?: __Number
169
- width?: __Number
170
- height?: __Number
171
- scaleX?: __Number
172
- scaleY?: __Number
173
- rotation?: __Number
174
- skewX?: __Number
175
- skewY?: __Number
176
-
177
- scale?: __Number | IPointData // helper
220
+ x?: INumber
221
+ y?: INumber
222
+ width?: INumber
223
+ height?: INumber
224
+ scaleX?: INumber
225
+ scaleY?: INumber
226
+ rotation?: INumber
227
+ skewX?: INumber
228
+ skewY?: INumber
229
+
230
+ scale?: INumber | IPointData // helper
178
231
  around?: IAround
179
232
 
180
- draggable?: __Boolean
233
+ lazy?: IBoolean
234
+ pixelRatio?: INumber
235
+
236
+ draggable?: IBoolean
181
237
 
182
- hittable?: __Boolean
238
+ path?: IPathCommandData | IPathString
239
+ windingRule?: IWindingRule
240
+ closed?: boolean
241
+
242
+ editable?: IBoolean
243
+ editSize?: IEditSize
244
+ editorStyle?: IObject
245
+
246
+ hittable?: IBoolean
183
247
  hitFill?: IHitType
184
248
  hitStroke?: IHitType
185
- hitChildren?: __Boolean
186
- hitSelf?: __Boolean
187
- hitRadius?: __Number
249
+ hitBox?: IBoolean
250
+ hitChildren?: IBoolean
251
+ hitSelf?: IBoolean
252
+ hitRadius?: INumber
188
253
 
189
254
  cursor?: ICursorType | ICursorType[]
190
255
 
256
+ normalStyle?: ILeafInputData
257
+ hoverStyle?: ILeafInputData
258
+ pressStyle?: ILeafInputData
259
+ focusStyle?: ILeafInputData
260
+ selectedStyle?: ILeafInputData
261
+ disabledStyle?: ILeafInputData
262
+
191
263
  children?: ILeafInputData[]
264
+
265
+ // other
266
+ noBounds?: boolean
192
267
  }
193
268
  export interface ILeafComputedData {
194
269
  // layer data
@@ -199,10 +274,15 @@ export interface ILeafComputedData {
199
274
  blendMode?: IBlendMode
200
275
  opacity?: number
201
276
  visible?: boolean
202
- isMask?: boolean
203
- isEraser?: boolean
277
+ selected?: boolean
278
+ disabled?: boolean
279
+ locked?: boolean
204
280
  zIndex?: number
205
281
 
282
+ mask?: boolean
283
+ maskType?: IMaskType
284
+ eraser?: boolean
285
+
206
286
  // layout data
207
287
  x?: number
208
288
  y?: number
@@ -216,25 +296,52 @@ export interface ILeafComputedData {
216
296
 
217
297
  around?: IAround
218
298
 
299
+ lazy?: boolean
300
+ pixelRatio?: number
301
+
302
+ path?: IPathCommandData
303
+ windingRule?: IWindingRule
304
+ closed?: boolean
305
+
219
306
  draggable?: boolean
220
307
 
308
+ editable?: boolean
309
+ editSize?: IEditSize
310
+ editorStyle?: IObject
311
+
221
312
  hittable?: boolean
222
313
  hitFill?: IHitType
223
314
  hitStroke?: IHitType
315
+ hitBox?: boolean
224
316
  hitChildren?: boolean
225
317
  hitSelf?: boolean
226
318
  hitRadius?: number
227
319
 
228
320
  cursor?: ICursorType | ICursorType[]
229
321
 
322
+ normalStyle?: ILeafInputData
323
+ hoverStyle?: ILeafInputData
324
+ pressStyle?: ILeafInputData
325
+ focusStyle?: ILeafInputData
326
+ selectedStyle?: ILeafInputData
327
+ disabledStyle?: ILeafInputData
328
+
230
329
  // other
231
330
  __childBranchNumber?: number // 存在子分支的个数
232
331
  __complex?: boolean // 外观是否复杂
233
332
  __naturalWidth?: number
234
333
  __naturalHeight?: number
334
+ readonly __blendMode: string
335
+
336
+ __useArrow?: boolean
337
+ __useEffect?: boolean
338
+
339
+ __pathInputed?: number // 是否为输入path, 0:否,1:是,2:永远是(不自动检测)
340
+ __pathForRender?: IPathCommandData
341
+ __path2DForRender?: IPath2D
235
342
  }
236
343
 
237
- export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
344
+ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
238
345
  tag: string
239
346
  readonly __tag: string
240
347
  readonly innerName: string
@@ -242,41 +349,52 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
242
349
  readonly __DataProcessor: IObject // IDataProcessor
243
350
  readonly __LayoutProcessor: IObject // ILeafLayout
244
351
 
245
- leafer?: ILeafer
352
+ readonly app?: ILeaferBase
353
+ leafer?: ILeaferBase
246
354
  parent?: ILeaf
355
+ zoomLayer?: ILeaf
247
356
 
248
357
  readonly isApp?: boolean
249
- isLeafer?: boolean
250
- isBranch?: boolean
251
- isBranchLeaf?: boolean
358
+ readonly isLeafer?: boolean
359
+ readonly isBranch?: boolean
360
+ readonly isBranchLeaf?: boolean
361
+ readonly isOutside?: boolean // scrollBar ...
252
362
 
253
363
  __: ILeafData
364
+
365
+ proxyData?: ILeafInputData
366
+ __proxyData?: ILeafInputData
367
+
254
368
  __layout: ILeafLayout
255
369
 
256
- __world: IMatrixWithLayoutData
257
- __local: IMatrixWithBoundsData
370
+ __world: IMatrixWithBoundsScaleData
371
+ __local?: IMatrixWithBoundsData
372
+
373
+ __nowWorld?: IMatrixWithBoundsScaleData // use __world or __cameraWorld render
374
+ __cameraWorld?: IMatrixWithBoundsScaleData // use camera matrix render
375
+
376
+ readonly __localMatrix: IMatrixData
377
+ readonly __localBoxBounds: IBoundsData
258
378
 
259
379
  __worldOpacity: number
260
380
 
261
- readonly worldTransform: IMatrixWithLayoutData
262
- readonly localTransform: IMatrixWithBoundsData
381
+ readonly worldTransform: IMatrixWithScaleData
382
+ readonly localTransform: IMatrixData
263
383
 
264
384
  readonly boxBounds: IBoundsData
385
+ readonly renderBounds: IBoundsData
265
386
  readonly worldBoxBounds: IBoundsData
266
387
  readonly worldStrokeBounds: IBoundsData
267
388
  readonly worldRenderBounds: IBoundsData
268
389
 
269
390
  readonly worldOpacity: number
270
391
 
271
- __renderTime?: number // μs 1000微秒 = 1毫秒
272
-
273
392
  __level: number // 图层级别 root(1) -> hight
274
393
  __tempNumber?: number // 用于临时运算储存状态
275
394
 
276
- readonly resizeable: boolean
277
-
278
- readonly __hasMirror: boolean
395
+ readonly __worldFlipped: boolean
279
396
 
397
+ __hasAutoLayout?: boolean
280
398
  __hasMask?: boolean
281
399
  __hasEraser?: boolean
282
400
  __hitCanvas?: IHitCanvas
@@ -284,33 +402,52 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
284
402
  readonly __onlyHitMask: boolean
285
403
  readonly __ignoreHitWorld: boolean
286
404
 
405
+ readonly pathInputed: boolean
406
+
287
407
  __parentWait?: IFunction[]
288
408
  __leaferWait?: IFunction[]
289
409
 
290
410
  destroyed: boolean
291
411
 
292
- waitParent(item: IFunction): void
293
- waitLeafer(item: IFunction): void
294
- nextRender(item: IFunction): void
412
+ reset(data?: ILeafInputData): void
413
+ resetCustom(): void
295
414
 
296
- __bindLeafer(leafer: ILeafer | null): void
415
+ waitParent(item: IFunction, bind?: IObject): void
416
+ waitLeafer(item: IFunction, bind?: IObject): void
417
+ nextRender(item: IFunction, bind?: IObject, off?: 'off'): void
418
+ removeNextRender(item: IFunction): void
419
+
420
+ __bindLeafer(leafer: ILeaferBase | null): void
297
421
 
298
422
  set(data: IObject): void
423
+ get(name?: string | string[] | IObject): ILeafInputData | IValue
299
424
  toJSON(): IObject
300
425
  toString(): string
426
+ toSVG?(): string
427
+ toHTML?(): string
301
428
 
302
429
  // ILeafData ->
303
- __setAttr(attrName: string, newValue: __Value): void
304
- __getAttr(attrName: string): __Value
430
+ __setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean
431
+ __getAttr(attrName: string): IValue
432
+ setProxyAttr(name: string, newValue: IValue): void
433
+ getProxyAttr(name: string): IValue
434
+
435
+ // find
436
+ find(condition: number | string | IFindMethod, options?: any): ILeaf[]
437
+ findOne(condition: number | string | IFindMethod, options?: any): ILeaf
305
438
 
439
+ focus(value?: boolean): void
306
440
  forceUpdate(attrName?: string): void
307
441
 
442
+ updateLayout(): void
443
+
308
444
  // ILeafMatrix ->
309
445
  __updateWorldMatrix(): void
310
446
  __updateLocalMatrix(): void
311
447
 
312
448
  // ILeafBounds ->
313
449
  __updateWorldBounds(): void
450
+ __updateLocalBounds(): void
314
451
 
315
452
  __updateLocalBoxBounds(): void
316
453
  __updateLocalStrokeBounds(): void
@@ -320,6 +457,7 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
320
457
  __updateStrokeBounds(): void
321
458
  __updateRenderBounds(): void
322
459
 
460
+ __updateAutoLayout(): void
323
461
  __updateNaturalSize(): void
324
462
 
325
463
  __updateStrokeSpread(): number
@@ -330,12 +468,18 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
330
468
  // IBranchMask ->
331
469
  __updateEraser(value?: boolean): void
332
470
  __updateMask(value?: boolean): void
333
- __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
334
- __removeMask(child?: ILeaf): void
471
+ __renderMask(canvas: ILeaferCanvas, options: IRenderOptions): void
335
472
 
336
473
  // convert
337
- getWorld(attrName: IMatrixDecompositionAttr): number
338
- getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData
474
+ __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData // when render use other matrix
475
+
476
+ getWorld(attrName: ILayoutAttr): number // will remove
477
+ getTransform(relative?: ILocationType | ILeaf): IMatrixData
478
+
479
+ getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData
480
+ getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData
481
+
482
+ getWorldBounds(inner: IBoundsData, relative?: ILeaf, change?: boolean): IBoundsData
339
483
 
340
484
  worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
341
485
  localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
@@ -348,15 +492,34 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
348
492
  getLocalPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
349
493
  getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
350
494
  getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
495
+ getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
496
+ getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
497
+
498
+
499
+ // transform
500
+ setTransform(transform?: IMatrixData, resize?: boolean): void
501
+ transform(transform?: IMatrixData, resize?: boolean): void
351
502
 
352
503
  move(x: number, y?: number): void
353
- scaleOf(origin: IPointData, x: number, y?: number): void
504
+ scaleOf(origin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
354
505
  rotateOf(origin: IPointData, rotation: number): void
355
- skewOf(origin: IPointData, x: number, y: number): void
506
+ skewOf(origin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
507
+
508
+ transformWorld(worldTransform?: IMatrixData, resize?: boolean): void
509
+ moveWorld(x: number, y?: number): void
510
+ scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
511
+ rotateOfWorld(worldOrigin: IPointData, rotation: number): void
512
+ skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
513
+
514
+ scaleResize(scaleX: number, scaleY: number, noResize?: boolean): void
515
+ __scaleResize(scaleX: number, scaleY: number): void
356
516
 
357
517
  // ILeafHit ->
358
518
  __hitWorld(point: IRadiusPointData): boolean
359
519
  __hit(local: IRadiusPointData): boolean
520
+ __hitFill(inner: IRadiusPointData): boolean
521
+ __hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean
522
+ __hitPixel(inner: IRadiusPointData): boolean
360
523
  __drawHitPath(canvas: ILeaferCanvas): void
361
524
  __updateHitCanvas(): void
362
525
 
@@ -365,7 +528,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
365
528
  __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void
366
529
  __draw(canvas: ILeaferCanvas, options: IRenderOptions): void
367
530
 
368
- __renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
531
+ __clip(canvas: ILeaferCanvas, options: IRenderOptions): void
532
+ __renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void
369
533
 
370
534
  __updateWorldOpacity(): void
371
535
  __updateChange(): void
@@ -376,10 +540,19 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
376
540
  __updatePath(): void
377
541
  __updateRenderPath(): void
378
542
 
543
+ //
544
+
379
545
  // branch
380
546
  children?: ILeaf[]
381
547
 
382
548
  __updateSortChildren(): void
383
549
  add(child: ILeaf, index?: number): void
384
550
  remove(child?: ILeaf, destroy?: boolean): void
385
- }
551
+ dropTo(parent: ILeaf, index?: number, resize?: boolean): void
552
+ }
553
+
554
+ export type ILeafAttrDescriptor = IObject & ThisType<ILeaf>
555
+
556
+ export interface ILeafAttrDescriptorFn {
557
+ (key: string): ILeafAttrDescriptor
558
+ }
@@ -1,10 +1,6 @@
1
1
  import { IBranch } from './IBranch'
2
- import { ILeaf } from './ILeaf'
3
- import { ITransformEventData } from '../event/IEvent'
2
+
4
3
 
5
4
  export interface IZoomView extends IBranch {
6
- zoomLayer?: ILeaf
7
- moveLayer?: ILeaf
8
- transformData?: ITransformEventData
9
- setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void
5
+
10
6
  }
@@ -1,7 +1,7 @@
1
- import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
2
- import { IRenderOptions } from '../../renderer/IRenderer'
3
1
  import { IBranch } from '../IBranch'
4
2
  import { ILeafRender } from './ILeafRender'
3
+ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
4
+ import { IRenderOptions } from '../../renderer/IRenderer'
5
5
 
6
6
  export type IBranchRenderModule = IBranchRender & ThisType<IBranch>
7
7
 
@@ -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): boolean
8
+ __getAttr?(name: string): IValue
9
+ setProxyAttr?(name: string, newValue: IValue): void
10
+ getProxyAttr?(name: string): IValue
9
11
  }
10
12
 
@@ -6,7 +6,10 @@ export type ILeafHitModule = ILeafHit & ThisType<ILeaf>
6
6
 
7
7
  export interface ILeafHit {
8
8
  __hitWorld?(point: IRadiusPointData): boolean
9
- __hit?(local: IRadiusPointData): boolean
9
+ __hit?(inner: IRadiusPointData): boolean
10
+ __hitFill?(inner: IRadiusPointData): boolean
11
+ __hitStroke?(inner: IRadiusPointData, strokeWidth: number): boolean
12
+ __hitPixel(inner: IRadiusPointData): boolean
10
13
  __drawHitPath?(canvas: ILeaferCanvas): void
11
14
  __updateHitCanvas?(): void
12
15
  }
@@ -9,7 +9,8 @@ export interface ILeafRender {
9
9
  __draw?(canvas: ILeaferCanvas, options: IRenderOptions): void
10
10
  __drawFast?(canvas: ILeaferCanvas, options: IRenderOptions): void
11
11
 
12
- __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void
12
+ __clip?(_canvas: ILeaferCanvas, _options: IRenderOptions): void
13
+ __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void
13
14
 
14
15
  __updateWorldOpacity?(): void
15
16
  __updateChange?(): void