@leafer/interface 1.0.0-rc.9 → 1.0.0

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.
@@ -4,8 +4,8 @@ import { IEventer } from '../event/IEventer'
4
4
  import { ILeaferCanvas, IHitCanvas } from '../canvas/ILeaferCanvas'
5
5
  import { IRenderOptions } from '../renderer/IRenderer'
6
6
 
7
- import { IObject, INumber, IBoolean, IValue, IString } from '../data/IData'
8
- import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, IMatrixWithLayoutData, ILayoutBoundsData, IMatrixData } from '../math/IMath'
7
+ import { IObject, INumber, IBoolean, IValue, IString, IPathString, IFourNumber } from '../data/IData'
8
+ import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData, IMatrixWithScaleData, IAutoBoxData, IUnitPointData } from '../math/IMath'
9
9
  import { IFunction } from '../function/IFunction'
10
10
 
11
11
  import { ILeafDataProxy } from './module/ILeafDataProxy'
@@ -14,9 +14,11 @@ import { ILeafBounds } from './module/ILeafBounds'
14
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'
19
18
  import { IFindMethod } from '../selector/ISelector'
19
+ import { IPathCommandData } from '../path/IPathCommand'
20
+ import { IWindingRule, IPath2D } from '../canvas/ICanvas'
21
+ import { IJSONOptions } from '../file/IExport'
20
22
 
21
23
 
22
24
  export interface ICachedLeaf {
@@ -28,54 +30,150 @@ export interface ICachedLeaf {
28
30
 
29
31
  export interface ILeafAttrData {
30
32
  // layer data
31
- id: IString
32
- name: IString
33
- className: IString
34
-
35
- blendMode: IBlendMode
36
- opacity: INumber
37
- visible: IBoolean
38
- isMask: IBoolean
39
- isEraser: IBoolean
40
- locked: IBoolean
41
- zIndex: INumber
33
+ id?: IString
34
+ name?: IString
35
+ className?: IString
36
+
37
+ blendMode?: IBlendMode
38
+ opacity?: INumber
39
+ visible?: IBoolean | 0 // 0 = display: none
40
+ selected?: IBoolean
41
+ disabled?: IBoolean
42
+ locked?: IBoolean
43
+ zIndex?: INumber
44
+
45
+ mask?: IBoolean | IMaskType
46
+ eraser?: IBoolean | IEraserType
42
47
 
43
48
  // layout data
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
63
- hitFill: IHitType
64
- hitStroke: IHitType
65
- hitBox: IBoolean
66
- hitChildren: IBoolean
67
- hitSelf: IBoolean
68
- hitRadius: INumber
69
-
70
- cursor: ICursorType | ICursorType[]
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
+
61
+ offsetX?: INumber
62
+ offsetY?: INumber
63
+ scrollX?: INumber
64
+ scrollY?: INumber
65
+
66
+ origin?: IAlign | IUnitPointData
67
+ around?: IAlign | IUnitPointData
68
+
69
+ lazy?: IBoolean
70
+ pixelRatio?: INumber
71
+
72
+ path?: IPathCommandData | IPathString
73
+ windingRule?: IWindingRule
74
+ closed?: IBoolean
75
+
76
+ // auto layout
77
+ flow?: IFlowType
78
+ padding?: IFourNumber
79
+ gap?: IGap | IPointGap
80
+ flowAlign?: IFlowAlign | IFlowAxisAlign
81
+ flowWrap?: IFlowWrap
82
+ itemBox?: IFlowBoxType
83
+
84
+ inFlow?: IBoolean
85
+ autoWidth?: IAutoSize
86
+ autoHeight?: IAutoSize
87
+ lockRatio?: IBoolean
88
+ autoBox?: IAutoBoxData | IConstraint
89
+
90
+ widthRange?: IRangeSize
91
+ heightRange?: IRangeSize
92
+
93
+ // interactive
94
+ draggable?: IBoolean | IAxis
95
+ dragBounds?: IBoundsData | 'parent'
96
+
97
+ editable?: IBoolean
98
+
99
+ hittable?: IBoolean
100
+ hitFill?: IHitType
101
+ hitStroke?: IHitType
102
+ hitBox?: IBoolean
103
+ hitChildren?: IBoolean
104
+ hitSelf?: IBoolean
105
+ hitRadius?: INumber
106
+
107
+ cursor?: ICursorType | ICursorType[]
108
+
109
+ normalStyle?: ILeafInputData // restore hover / press / focus / selected / disabled style
110
+ hoverStyle?: ILeafInputData
111
+ pressStyle?: ILeafInputData
112
+ focusStyle?: ILeafInputData
113
+ selectedStyle?: ILeafInputData
114
+ disabledStyle?: ILeafInputData
115
+
116
+ // 预留给用户使用的数据对象
117
+ data: IObject
118
+ }
119
+
120
+
121
+ export type IAxis = 'x' | 'y'
122
+
123
+ export type IAxisReverse = 'x-reverse' | 'y-reverse'
124
+
125
+ export type IFlowType = boolean | IAxis | IAxisReverse
126
+
127
+ export type IFlowBoxType = 'box' | 'stroke'
128
+
129
+ export type IGap = INumber | 'auto' | 'fit'
130
+
131
+ export interface IPointGap { x?: IGap, y?: IGap }
132
+
133
+ export type IAxisAlign = 'from' | 'center' | 'to'
134
+
135
+ export interface IFlowAxisAlign { content?: IFlowAlign, x?: IAxisAlign, y?: IAxisAlign }
136
+
137
+ export type IFlowWrap = boolean | 'reverse'
138
+
139
+ export type IAutoSize = IBoolean | INumber | IPercentData
140
+
141
+ export interface IRangeSize {
142
+ min?: number
143
+ max?: number
144
+ }
145
+
146
+ export interface IUnitData {
147
+ type: 'percent' | 'px'
148
+ value: number
149
+ }
150
+
151
+ export interface IPercentData extends IUnitData {
152
+ type: 'percent'
153
+ }
154
+
155
+ export interface IConstraint {
156
+ x: IConstraintType
157
+ y: IConstraintType
71
158
  }
72
159
 
160
+ export type IConstraintType = 'from' | 'center' | 'to' | 'from-to' | 'scale'
161
+
73
162
  export type IHitType =
74
163
  | 'path'
75
164
  | 'pixel'
76
165
  | 'all'
77
166
  | 'none'
78
167
 
168
+ export type IMaskType =
169
+ | 'path'
170
+ | 'pixel'
171
+ | 'clipping'
172
+
173
+ export type IEraserType =
174
+ | 'path'
175
+ | 'pixel'
176
+
79
177
  export type IBlendMode =
80
178
  | 'pass-through'
81
179
  | 'normal'
@@ -104,24 +202,40 @@ export type IBlendMode =
104
202
  | 'destination-atop'
105
203
  | 'xor'
106
204
 
107
- export type IEditSize = 'size' | 'scale'
205
+ export type IEditSize = 'size' | 'font-size' | 'scale'
108
206
  export interface IImageCursor {
109
207
  url: string
110
208
  x?: number
111
209
  y?: number
210
+ rotation?: number
112
211
  }
113
212
 
114
- export type IAround =
115
- | 'topLeft'
213
+ export type IDirection =
214
+ | 'top-left'
116
215
  | 'top'
117
- | 'topRight'
216
+ | 'top-right'
118
217
  | 'right'
119
- | 'bottomRight'
218
+ | 'bottom-right'
120
219
  | 'bottom'
121
- | 'bottomLeft'
220
+ | 'bottom-left'
122
221
  | 'left'
123
222
  | 'center'
124
- | IPointData
223
+
224
+ export type IAlign = IDirection
225
+
226
+ export type IBaseLineAlign =
227
+ | 'baseline-left'
228
+ | 'baseline-center'
229
+ | 'baseline-right'
230
+
231
+ export type IFlowAlign =
232
+ | IAlign
233
+ | IBaseLineAlign
234
+
235
+
236
+ export type IAround =
237
+ | IAlign
238
+ | IUnitPointData
125
239
 
126
240
  export type ICursorType =
127
241
  | IImageCursor
@@ -160,12 +274,16 @@ export type ICursorType =
160
274
  | 'col-resize'
161
275
  | 'row-resize'
162
276
  | 'all-scroll'
163
- | 'zoom -in'
277
+ | 'zoom-in'
164
278
  | 'zoom-out'
165
279
 
166
- export interface ICursorTypeMap {
167
- [name: string]: ICursorType | ICursorType[]
168
- }
280
+ export type IStateStyleType =
281
+ | 'hoverStyle'
282
+ | 'pressStyle'
283
+ | 'focusStyle'
284
+ | 'selectedStyle'
285
+ | 'disabledStyle'
286
+
169
287
  export interface ILeafInputData {
170
288
  tag?: string
171
289
 
@@ -176,12 +294,15 @@ export interface ILeafInputData {
176
294
 
177
295
  blendMode?: IBlendMode
178
296
  opacity?: INumber
179
- visible?: IBoolean
180
- isMask?: IBoolean
181
- isEraser?: IBoolean
297
+ visible?: IBoolean | 0
298
+ selected?: IBoolean
299
+ disabled?: IBoolean
182
300
  locked?: IBoolean
183
301
  zIndex?: INumber
184
302
 
303
+ mask?: IBoolean | IMaskType
304
+ eraser?: IBoolean | IEraserType
305
+
185
306
  // layout data
186
307
  x?: INumber
187
308
  y?: INumber
@@ -194,12 +315,44 @@ export interface ILeafInputData {
194
315
  skewY?: INumber
195
316
 
196
317
  scale?: INumber | IPointData // helper
197
- around?: IAround
198
318
 
199
- draggable?: IBoolean
319
+ offsetX?: INumber
320
+ offsetY?: INumber
321
+ scrollX?: INumber
322
+ scrollY?: INumber
323
+
324
+ origin?: IAlign | IUnitPointData
325
+ around?: IAlign | IUnitPointData
326
+
327
+ lazy?: IBoolean
328
+ pixelRatio?: INumber
329
+
330
+ path?: IPathCommandData | IPathString
331
+ windingRule?: IWindingRule
332
+ closed?: IBoolean
333
+
334
+ // auto layout
335
+ flow?: IFlowType
336
+ padding?: IFourNumber
337
+ gap?: IGap | IPointGap
338
+ flowAlign?: IFlowAlign | IFlowAxisAlign
339
+ flowWrap?: IFlowWrap
340
+ itemBox?: IFlowBoxType
341
+
342
+ inFlow?: IBoolean
343
+ autoWidth?: IAutoSize
344
+ autoHeight?: IAutoSize
345
+ lockRatio?: IBoolean
346
+ autoBox?: IAutoBoxData | IConstraint
347
+
348
+ widthRange?: IRangeSize
349
+ heightRange?: IRangeSize
350
+
351
+ // interactive
352
+ draggable?: IBoolean | IAxis
353
+ dragBounds?: IBoundsData | 'parent'
200
354
 
201
355
  editable?: IBoolean
202
- editSize?: IEditSize
203
356
 
204
357
  hittable?: IBoolean
205
358
  hitFill?: IHitType
@@ -211,6 +364,16 @@ export interface ILeafInputData {
211
364
 
212
365
  cursor?: ICursorType | ICursorType[]
213
366
 
367
+ normalStyle?: ILeafInputData
368
+ hoverStyle?: ILeafInputData
369
+ pressStyle?: ILeafInputData
370
+ focusStyle?: ILeafInputData
371
+ selectedStyle?: ILeafInputData
372
+ disabledStyle?: ILeafInputData
373
+
374
+ // 预留给用户使用的数据对象
375
+ data?: IObject
376
+
214
377
  children?: ILeafInputData[]
215
378
 
216
379
  // other
@@ -224,12 +387,15 @@ export interface ILeafComputedData {
224
387
 
225
388
  blendMode?: IBlendMode
226
389
  opacity?: number
227
- visible?: boolean
228
- isMask?: boolean
229
- isEraser?: boolean
390
+ visible?: boolean | 0
391
+ selected?: boolean
392
+ disabled?: boolean
230
393
  locked?: boolean
231
394
  zIndex?: number
232
395
 
396
+ mask?: boolean | IMaskType
397
+ eraser?: boolean | IEraserType
398
+
233
399
  // layout data
234
400
  x?: number
235
401
  y?: number
@@ -241,12 +407,43 @@ export interface ILeafComputedData {
241
407
  skewX?: number
242
408
  skewY?: number
243
409
 
244
- around?: IAround
410
+ offsetX?: number
411
+ offsetY?: number
412
+ scrollX?: number
413
+ scrollY?: number
414
+
415
+ origin?: IAlign | IUnitPointData
416
+ around?: IAlign | IUnitPointData
417
+
418
+ lazy?: boolean
419
+ pixelRatio?: number
245
420
 
246
- draggable?: boolean
421
+ path?: IPathCommandData
422
+ windingRule?: IWindingRule
423
+ closed?: boolean
424
+
425
+ // auto layout
426
+ flow?: IFlowType
427
+ padding?: IFourNumber
428
+ gap?: IGap | IPointGap
429
+ flowAlign?: IFlowAlign | IFlowAxisAlign
430
+ flowWrap?: IFlowWrap
431
+ itemBox?: IFlowBoxType
432
+
433
+ inFlow?: boolean
434
+ autoWidth?: IAutoSize
435
+ autoHeight?: IAutoSize
436
+ lockRatio?: boolean
437
+ autoBox?: IAutoBoxData | IConstraint
438
+
439
+ widthRange?: IRangeSize
440
+ heightRange?: IRangeSize
441
+
442
+ // interactive
443
+ draggable?: boolean | IAxis
444
+ dragBounds?: IBoundsData | 'parent'
247
445
 
248
446
  editable?: boolean
249
- editSize?: IEditSize
250
447
 
251
448
  hittable?: boolean
252
449
  hitFill?: IHitType
@@ -258,14 +455,42 @@ export interface ILeafComputedData {
258
455
 
259
456
  cursor?: ICursorType | ICursorType[]
260
457
 
458
+ normalStyle?: ILeafInputData
459
+ hoverStyle?: ILeafInputData
460
+ pressStyle?: ILeafInputData
461
+ focusStyle?: ILeafInputData
462
+ selectedStyle?: ILeafInputData
463
+ disabledStyle?: ILeafInputData
464
+
465
+
466
+ // 预留给用户使用的数据对象
467
+ data?: IObject
468
+
261
469
  // other
262
470
  __childBranchNumber?: number // 存在子分支的个数
263
471
  __complex?: boolean // 外观是否复杂
472
+
264
473
  __naturalWidth?: number
265
474
  __naturalHeight?: number
475
+
476
+ readonly __autoWidth?: boolean
477
+ readonly __autoHeight?: boolean
478
+ readonly __autoSide?: boolean
479
+ readonly __autoSize?: boolean
480
+
481
+ readonly __useNaturalRatio: boolean // 宽高存在一个值时,另一个自动值是否采用natural尺寸比例
482
+ readonly __isLinePath: boolean
483
+ readonly __blendMode: string
484
+
485
+ __useArrow?: boolean
486
+ __useEffect?: boolean
487
+
488
+ __pathInputed?: number // 是否为输入path, 0:否,1:是,2:永远是(不自动检测)
489
+ __pathForRender?: IPathCommandData
490
+ __path2DForRender?: IPath2D
266
491
  }
267
492
 
268
- export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
493
+ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
269
494
  tag: string
270
495
  readonly __tag: string
271
496
  readonly innerName: string
@@ -276,31 +501,39 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
276
501
  readonly app?: ILeaferBase
277
502
  leafer?: ILeaferBase
278
503
  parent?: ILeaf
504
+ zoomLayer?: ILeaf
279
505
 
280
506
  readonly isApp?: boolean
281
- isLeafer?: boolean
282
- isBranch?: boolean
283
- isBranchLeaf?: boolean
507
+ readonly isLeafer?: boolean
508
+ readonly isBranch?: boolean
509
+ readonly isBranchLeaf?: boolean
510
+ readonly isOutside?: boolean // scrollBar ...
284
511
 
285
512
  __: ILeafData
286
513
 
287
514
  proxyData?: ILeafInputData
288
515
  __proxyData?: ILeafInputData
289
516
 
517
+ syncEventer?: ILeaf // 同步触发一样事件的元素
518
+
290
519
  __layout: ILeafLayout
291
520
 
292
- __world: IMatrixWithLayoutData
521
+ __world: IMatrixWithBoundsScaleData
293
522
  __local?: IMatrixWithBoundsData
294
523
 
524
+ __nowWorld?: IMatrixWithBoundsScaleData // use __world or __cameraWorld render
525
+ __cameraWorld?: IMatrixWithBoundsScaleData // use camera matrix render
526
+
295
527
  readonly __localMatrix: IMatrixData
296
- readonly __localBounds: IBoundsData
528
+ readonly __localBoxBounds: IBoundsData
297
529
 
298
530
  __worldOpacity: number
299
531
 
300
- readonly worldTransform: IMatrixWithLayoutData
301
- readonly localTransform: IMatrixWithBoundsData
532
+ readonly worldTransform: IMatrixWithScaleData
533
+ readonly localTransform: IMatrixData
302
534
 
303
535
  readonly boxBounds: IBoundsData
536
+ readonly renderBounds: IBoundsData
304
537
  readonly worldBoxBounds: IBoundsData
305
538
  readonly worldStrokeBounds: IBoundsData
306
539
  readonly worldRenderBounds: IBoundsData
@@ -317,8 +550,16 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
317
550
  __hasEraser?: boolean
318
551
  __hitCanvas?: IHitCanvas
319
552
 
553
+ __flowBounds?: IBoundsData // localBoxBounds or localStrokeBounds
554
+ __widthGrow?: number
555
+ __heightGrow?: number
556
+ __hasGrow?: boolean
557
+
320
558
  readonly __onlyHitMask: boolean
321
559
  readonly __ignoreHitWorld: boolean
560
+ readonly __inLazyBounds: boolean
561
+
562
+ readonly pathInputed: boolean
322
563
 
323
564
  __parentWait?: IFunction[]
324
565
  __leaferWait?: IFunction[]
@@ -328,30 +569,42 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
328
569
  reset(data?: ILeafInputData): void
329
570
  resetCustom(): void
330
571
 
331
- waitParent(item: IFunction): void
332
- waitLeafer(item: IFunction): void
333
- nextRender(item: IFunction): void
572
+ waitParent(item: IFunction, bind?: IObject): void
573
+ waitLeafer(item: IFunction, bind?: IObject): void
574
+ nextRender(item: IFunction, bind?: IObject, off?: 'off'): void
575
+ removeNextRender(item: IFunction): void
334
576
 
335
577
  __bindLeafer(leafer: ILeaferBase | null): void
336
578
 
337
579
  set(data: IObject): void
338
- get(): ILeafInputData
339
- toJSON(): IObject
340
- toString(): string
580
+ get(name?: string | string[] | IObject): ILeafInputData | IValue
581
+ setAttr(name: string, value: any): void
582
+ getAttr(name: string): any
583
+ getComputedAttr(name: string): any
584
+
585
+ toJSON(options?: IJSONOptions): IObject
586
+ toString(options?: IJSONOptions): string
587
+ toSVG(): string
588
+ __SVG(data: IObject): void
589
+ toHTML(): string
341
590
 
342
591
  // ILeafData ->
343
- __setAttr(attrName: string, newValue: IValue): void
592
+ __setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean
344
593
  __getAttr(attrName: string): IValue
345
594
  setProxyAttr(name: string, newValue: IValue): void
346
595
  getProxyAttr(name: string): IValue
347
596
 
348
597
  // find
349
598
  find(condition: number | string | IFindMethod, options?: any): ILeaf[]
350
- findOne(condition: number | string | IFindMethod, options?: any): ILeaf
599
+ findTag(tag: string | string[]): ILeaf[]
600
+ findOne(condition: number | string | IFindMethod, options?: any): ILeaf | undefined
601
+ findId(id: number | string): ILeaf | undefined
351
602
 
352
- forceUpdate(attrName?: string): void
603
+ focus(value?: boolean): void
353
604
 
354
605
  updateLayout(): void
606
+ forceUpdate(attrName?: string): void
607
+ forceRender(_bounds?: IBoundsData): void
355
608
 
356
609
  // ILeafMatrix ->
357
610
  __updateWorldMatrix(): void
@@ -365,11 +618,13 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
365
618
  __updateLocalStrokeBounds(): void
366
619
  __updateLocalRenderBounds(): void
367
620
 
621
+ __updateContentBounds(): void
368
622
  __updateBoxBounds(): void
369
623
  __updateStrokeBounds(): void
370
624
  __updateRenderBounds(): void
371
625
 
372
626
  __updateAutoLayout(): void
627
+ __updateFlowLayout(): void
373
628
  __updateNaturalSize(): void
374
629
 
375
630
  __updateStrokeSpread(): number
@@ -380,13 +635,19 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
380
635
  // IBranchMask ->
381
636
  __updateEraser(value?: boolean): void
382
637
  __updateMask(value?: boolean): void
383
- __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas, recycle?: boolean): void
384
- __removeMask(child?: ILeaf): void
638
+ __renderMask(canvas: ILeaferCanvas, options: IRenderOptions): void
639
+ __renderEraser(canvas: ILeaferCanvas, options: IRenderOptions): void
385
640
 
386
641
  // convert
387
- getWorld(attrName: ILayoutAttr): number
642
+ __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData // when render use other matrix
643
+
644
+ getTransform(relative?: ILocationType | ILeaf): IMatrixData
645
+
388
646
  getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData
389
647
  getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData
648
+ getLayoutPoints(type?: IBoundsType, relative?: ILocationType | ILeaf): IPointData[]
649
+
650
+ getWorldBounds(inner: IBoundsData, relative?: ILeaf, change?: boolean): IBoundsData
390
651
 
391
652
  worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
392
653
  localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
@@ -399,22 +660,37 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
399
660
  getLocalPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
400
661
  getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
401
662
  getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
663
+ getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
664
+ getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
665
+
402
666
 
403
667
  // transform
404
668
  setTransform(transform?: IMatrixData, resize?: boolean): void
405
669
  transform(transform?: IMatrixData, resize?: boolean): void
406
670
 
407
- move(x: number, y?: number): void
408
- scaleOf(origin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
409
- rotateOf(origin: IPointData, rotation: number): void
410
- skewOf(origin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
671
+ move(x: number | IPointData, y?: number): void
672
+ scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number, resize?: boolean): void
673
+ rotateOf(origin: IPointData | IAlign, rotation: number): void
674
+ skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean): void
675
+
676
+ transformWorld(worldTransform?: IMatrixData, resize?: boolean): void
677
+ moveWorld(x: number | IPointData, y?: number): void
678
+ scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
679
+ rotateOfWorld(worldOrigin: IPointData, rotation: number): void
680
+ skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
411
681
 
412
682
  scaleResize(scaleX: number, scaleY: number, noResize?: boolean): void
413
683
  __scaleResize(scaleX: number, scaleY: number): void
414
684
 
685
+ resizeWidth(width: number): void
686
+ resizeHeight(height: number): void
687
+
415
688
  // ILeafHit ->
416
689
  __hitWorld(point: IRadiusPointData): boolean
417
690
  __hit(local: IRadiusPointData): boolean
691
+ __hitFill(inner: IRadiusPointData): boolean
692
+ __hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean
693
+ __hitPixel(inner: IRadiusPointData): boolean
418
694
  __drawHitPath(canvas: ILeaferCanvas): void
419
695
  __updateHitCanvas(): void
420
696
 
@@ -423,7 +699,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
423
699
  __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void
424
700
  __draw(canvas: ILeaferCanvas, options: IRenderOptions): void
425
701
 
426
- __renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
702
+ __clip(canvas: ILeaferCanvas, options: IRenderOptions): void
703
+ __renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void
427
704
 
428
705
  __updateWorldOpacity(): void
429
706
  __updateChange(): void
@@ -434,6 +711,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
434
711
  __updatePath(): void
435
712
  __updateRenderPath(): void
436
713
 
714
+ //
715
+
437
716
  // branch
438
717
  children?: ILeaf[]
439
718
 
@@ -441,4 +720,10 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
441
720
  add(child: ILeaf, index?: number): void
442
721
  remove(child?: ILeaf, destroy?: boolean): void
443
722
  dropTo(parent: ILeaf, index?: number, resize?: boolean): void
444
- }
723
+ }
724
+
725
+ export type ILeafAttrDescriptor = IObject & ThisType<ILeaf>
726
+
727
+ export interface ILeafAttrDescriptorFn {
728
+ (key: string): ILeafAttrDescriptor
729
+ }
@@ -1,7 +1,6 @@
1
1
  import { IBranch } from './IBranch'
2
- import { ILeaf } from './ILeaf'
2
+
3
3
 
4
4
  export interface IZoomView extends IBranch {
5
- zoomLayer?: ILeaf
6
- setZoomLayer(zoomLayer: ILeaf): void
5
+
7
6
  }