@leafer/display 1.0.0-beta.11 → 1.0.0-beta.15

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,12 +1,15 @@
1
1
  {
2
2
  "name": "@leafer/display",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.15",
4
4
  "description": "@leafer/display",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
7
7
  "main": "src/index.ts",
8
+ "types": "types/index.d.ts",
8
9
  "files": [
9
- "src"
10
+ "src",
11
+ "types",
12
+ "dist"
10
13
  ],
11
14
  "repository": {
12
15
  "type": "git",
@@ -19,15 +22,16 @@
19
22
  "leaferjs"
20
23
  ],
21
24
  "dependencies": {
22
- "@leafer/math": "1.0.0-beta.11",
23
- "@leafer/data": "1.0.0-beta.11",
24
- "@leafer/layout": "1.0.0-beta.11",
25
- "@leafer/display-module": "1.0.0-beta.11",
26
- "@leafer/event": "1.0.0-beta.11",
27
- "@leafer/decorator": "1.0.0-beta.11",
28
- "@leafer/helper": "1.0.0-beta.11"
25
+ "@leafer/math": "1.0.0-beta.15",
26
+ "@leafer/data": "1.0.0-beta.15",
27
+ "@leafer/layout": "1.0.0-beta.15",
28
+ "@leafer/display-module": "1.0.0-beta.15",
29
+ "@leafer/event": "1.0.0-beta.15",
30
+ "@leafer/decorator": "1.0.0-beta.15",
31
+ "@leafer/helper": "1.0.0-beta.15",
32
+ "@leafer/platform": "1.0.0-beta.15"
29
33
  },
30
34
  "devDependencies": {
31
- "@leafer/interface": "1.0.0-beta.11"
35
+ "@leafer/interface": "1.0.0-beta.15"
32
36
  }
33
37
  }
package/src/Branch.ts CHANGED
@@ -81,12 +81,16 @@ export class Branch extends Leaf {
81
81
 
82
82
  if (this.leafer) {
83
83
  child.__bindLeafer(this.leafer)
84
- if (this.leafer.ready) this.__emitChildEvent(ChildEvent.ADD, child)
84
+ if (this.leafer.created) this.__emitChildEvent(ChildEvent.ADD, child)
85
85
  }
86
86
 
87
87
  this.__layout.affectChildrenSort && this.__layout.childrenSortChange()
88
88
  }
89
89
 
90
+ public addMany(...children: ILeaf[]): void {
91
+ children.forEach(child => this.add(child))
92
+ }
93
+
90
94
  public remove(child?: Leaf, destroy?: boolean): void {
91
95
  if (child) {
92
96
  const index = this.children.indexOf(child)
@@ -104,13 +108,15 @@ export class Branch extends Leaf {
104
108
 
105
109
  public removeAll(destroy?: boolean): void {
106
110
  const { children } = this
107
- this.children = []
108
- this.__preRemove()
109
- this.__.__childBranchNumber = 0
110
- children.forEach(child => {
111
- this.__realRemoveChild(child)
112
- if (destroy) child.destroy()
113
- })
111
+ if (children.length) {
112
+ this.children = []
113
+ this.__preRemove()
114
+ this.__.__childBranchNumber = 0
115
+ children.forEach(child => {
116
+ this.__realRemoveChild(child)
117
+ if (destroy) child.destroy()
118
+ })
119
+ }
114
120
  }
115
121
 
116
122
  protected __preRemove(): void {
@@ -124,7 +130,10 @@ export class Branch extends Leaf {
124
130
  child.parent = null
125
131
  if (this.leafer) {
126
132
  child.__bindLeafer(null)
127
- if (this.leafer.ready) this.__emitChildEvent(ChildEvent.REMOVE, child)
133
+ if (this.leafer.created) {
134
+ this.__emitChildEvent(ChildEvent.REMOVE, child)
135
+ if (this.leafer.hitCanvasManager) this.leafer.hitCanvasManager.clear()
136
+ }
128
137
  }
129
138
  }
130
139
 
@@ -134,4 +143,5 @@ export class Branch extends Leaf {
134
143
  if (this.hasEvent(type) && !this.isLeafer) this.emitEvent(event)
135
144
  this.leafer.emitEvent(event)
136
145
  }
146
+
137
147
  }
package/src/Leaf.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeafer, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IMatrixWithBoundsData, __Number, __Boolean, __Value, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener, IEventListenerOptions, IEventListenerId, IEvent, IObject, IFunction, __String, IPointData, IMatrixDecompositionAttr, ILayoutBoundsType, ILayoutLocationType, IBoundsData, IMatrixData, IBranch } from '@leafer/interface'
1
+ import { ILeafer, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IMatrixWithBoundsData, __Number, __Boolean, __Value, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener, IEventListenerOptions, IEventListenerId, IEvent, IObject, IFunction, __String, IPointData, IMatrixDecompositionAttr, ILayoutBoundsType, ILayoutLocationType, IBoundsData, IBranch, IMatrixWithLayoutData } from '@leafer/interface'
2
2
  import { IncrementId, MatrixHelper, PointHelper } from '@leafer/math'
3
3
  import { LeafData } from '@leafer/data'
4
4
  import { LeafLayout } from '@leafer/layout'
@@ -10,7 +10,7 @@ import { LeafHelper, WaitHelper } from '@leafer/helper'
10
10
  const { LEAF, create } = IncrementId
11
11
  const { toInnerPoint, toOuterPoint } = MatrixHelper
12
12
  const { tempToOuterOf, copy } = PointHelper
13
- const { moveLocal, zoomOfLocal, rotateOfLocal } = LeafHelper
13
+ const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal } = LeafHelper
14
14
 
15
15
  @useModule(LeafDataProxy)
16
16
  @useModule(LeafMatrix)
@@ -41,15 +41,17 @@ export class Leaf implements ILeaf {
41
41
  public __: ILeafData
42
42
  public __layout: ILeafLayout
43
43
 
44
+ public __world: IMatrixWithLayoutData
44
45
  public __local: IMatrixWithBoundsData
45
- public __world: IMatrixWithBoundsData
46
+
46
47
  public __worldOpacity: number
47
48
 
48
49
  // now transform
49
- public get worldTransform(): IMatrixData { return this.__layout.getTransform('world') }
50
- public get localTransform(): IMatrixData { return this.__layout.getTransform('local') }
50
+ public get worldTransform(): IMatrixWithLayoutData { return this.__layout.getTransform('world') as IMatrixWithLayoutData }
51
+ public get localTransform(): IMatrixWithBoundsData { return this.__layout.getTransform('local') as IMatrixWithBoundsData }
51
52
 
52
53
  // now bounds
54
+ public get boxBounds(): IBoundsData { return this.getBounds('box', 'inner') }
53
55
  public get worldBoxBounds(): IBoundsData { return this.getBounds('box') }
54
56
  public get worldStrokeBounds(): IBoundsData { return this.getBounds('stroke') }
55
57
  public get worldRenderBounds(): IBoundsData { return this.getBounds('render') }
@@ -60,6 +62,10 @@ export class Leaf implements ILeaf {
60
62
  public __level: number // layer level 0 -> branch -> branch -> deep
61
63
  public __tempNumber: number // temp sort
62
64
 
65
+ public get resizeable(): boolean { return true }
66
+
67
+ public get __hasMirror(): boolean { return this.__world.scaleX < 0 || this.__world.scaleY < 0 }
68
+
63
69
  public __hasMask?: boolean
64
70
  public __hasEraser?: boolean
65
71
  public __hitCanvas?: IHitCanvas
@@ -77,19 +83,29 @@ export class Leaf implements ILeaf {
77
83
  // branch
78
84
  public children?: ILeaf[]
79
85
 
86
+
87
+ public destroyed: boolean
88
+
89
+
80
90
  constructor(data?: ILeafInputData) {
81
91
 
82
92
  this.innerId = create(LEAF)
83
93
 
94
+ this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1, rotation: 0, skewX: 0, skewY: 0 }
84
95
  this.__local = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0 }
85
- this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1 }
86
96
 
87
97
  this.__worldOpacity = 1
88
98
 
89
99
  this.__ = new this.__DataProcessor(this)
90
100
  this.__layout = new this.__LayoutProcessor(this)
91
101
 
92
- if (data) Object.assign(this, data)
102
+ if (data) {
103
+ if (data.children) {
104
+ this.set(data)
105
+ } else {
106
+ Object.assign(this, data)
107
+ }
108
+ }
93
109
  }
94
110
 
95
111
 
@@ -101,14 +117,21 @@ export class Leaf implements ILeaf {
101
117
  this.leafer ? item() : (this.__leaferWait ? this.__leaferWait.push(item) : this.__leaferWait = [item])
102
118
  }
103
119
 
120
+ public nextRender(item: IFunction): void {
121
+ this.leafer ? this.leafer.nextRender(item) : this.waitLeafer(() => this.leafer.nextRender(item))
122
+ }
104
123
 
105
124
  public __bindLeafer(leafer: ILeafer | null): void {
106
- if (this.isLeafer) leafer = this as unknown as ILeafer
125
+ if (this.isLeafer) {
126
+ if (leafer !== null) leafer = this as unknown as ILeafer
127
+ }
107
128
 
108
129
  this.leafer = leafer
109
- this.__level = this.parent ? this.parent.__level + 1 : 1
110
130
 
111
- if (this.__leaferWait && leafer) WaitHelper.run(this.__leaferWait)
131
+ if (leafer) {
132
+ this.__level = this.parent ? this.parent.__level + 1 : 1
133
+ if (this.__leaferWait) WaitHelper.run(this.__leaferWait)
134
+ }
112
135
 
113
136
  if (this.isBranch) {
114
137
  const { children } = this
@@ -118,10 +141,17 @@ export class Leaf implements ILeaf {
118
141
  }
119
142
  }
120
143
 
144
+ // data
145
+
121
146
  public set(_data: IObject): void { }
122
147
 
123
- public get(_attrNames?: string[]): IObject { return undefined }
148
+ public toJSON(): IObject {
149
+ return this.__.__getInputData()
150
+ }
124
151
 
152
+ public toString(): string {
153
+ return JSON.stringify(this.toJSON())
154
+ }
125
155
 
126
156
  // LeafDataProxy rewrite
127
157
 
@@ -132,9 +162,10 @@ export class Leaf implements ILeaf {
132
162
  // ---
133
163
 
134
164
  public forceUpdate(attrName?: string): void {
135
- if (attrName === undefined) attrName = 'x'
165
+ if (attrName === undefined) attrName = 'scaleX'
136
166
  else if (attrName === 'surface') attrName = 'blendMode'
137
- const value = this.__.__getInput(attrName);
167
+ const value = this.__.__getInput(attrName)
168
+ this.__[attrName] = value === undefined ? null : undefined;
138
169
  (this as any)[attrName] = value
139
170
  }
140
171
 
@@ -167,6 +198,9 @@ export class Leaf implements ILeaf {
167
198
  public __updateRenderBounds(): void { }
168
199
 
169
200
 
201
+ public __updateNaturalSize(): void { }
202
+
203
+
170
204
  public __updateStrokeSpread(): number { return 0 }
171
205
 
172
206
  public __updateRenderSpread(): number { return 0 }
@@ -192,7 +226,10 @@ export class Leaf implements ILeaf {
192
226
  // convert
193
227
 
194
228
  public getWorld(attrName: IMatrixDecompositionAttr): number {
195
- return this.__layout.decomposeTransform('world')[attrName]
229
+ this.__layout.checkUpdate()
230
+ if (attrName === 'x') return this.__world.e
231
+ if (attrName === 'y') return this.__world.f
232
+ return this.__world[attrName]
196
233
  }
197
234
 
198
235
  public getBounds(type: ILayoutBoundsType, locationType: ILayoutLocationType = 'world'): IBoundsData {
@@ -200,28 +237,67 @@ export class Leaf implements ILeaf {
200
237
  }
201
238
 
202
239
 
203
- public worldToLocal(world: IPointData, to?: IPointData, isMovePoint?: boolean): void {
240
+ public worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void {
204
241
  if (this.parent) {
205
- toInnerPoint(this.parent.worldTransform, world, to, isMovePoint)
242
+ this.parent.worldToInner(world, to, distance, relative)
206
243
  } else {
207
244
  if (to) copy(to, world)
208
245
  }
209
246
  }
210
247
 
211
- public localToWorld(local: IPointData, to?: IPointData, isMovePoint?: boolean): void {
248
+ public localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void {
212
249
  if (this.parent) {
213
- toOuterPoint(this.parent.worldTransform, local, to, isMovePoint)
250
+ this.parent.innerToWorld(local, to, distance, relative)
214
251
  } else {
215
252
  if (to) copy(to, local)
216
253
  }
217
254
  }
218
255
 
219
- public worldToInner(world: IPointData, to?: IPointData, isMovePoint?: boolean): void {
220
- toInnerPoint(this.worldTransform, world, to, isMovePoint)
256
+ public worldToInner(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void {
257
+ if (relative) {
258
+ relative.innerToWorld(world, to, distance)
259
+ world = to ? to : world
260
+ }
261
+ toInnerPoint(this.worldTransform, world, to, distance)
221
262
  }
222
263
 
223
- public innerToWorld(inner: IPointData, to?: IPointData, isMovePoint?: boolean): void {
224
- toOuterPoint(this.worldTransform, inner, to, isMovePoint)
264
+ public innerToWorld(inner: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void {
265
+ toOuterPoint(this.worldTransform, inner, to, distance)
266
+ if (relative) relative.worldToInner(to ? to : inner, null, distance)
267
+ }
268
+
269
+ // simple
270
+
271
+ public getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
272
+ const point = change ? world : {} as IPointData
273
+ this.worldToInner(world, point, distance, relative)
274
+ return point
275
+ }
276
+
277
+ public getInnerPointByLocal(local: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
278
+ return this.getInnerPoint(local, this.parent, distance, change)
279
+ }
280
+
281
+ public getLocalPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
282
+ const point = change ? world : {} as IPointData
283
+ this.worldToLocal(world, point, distance, relative)
284
+ return point
285
+ }
286
+
287
+ public getLocalPointByInner(inner: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
288
+ return this.getWorldPoint(inner, this.parent, distance, change)
289
+ }
290
+
291
+ public getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
292
+ const point = change ? inner : {} as IPointData
293
+ this.innerToWorld(inner, point, distance, relative)
294
+ return point
295
+ }
296
+
297
+ public getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
298
+ const point = change ? local : {} as IPointData
299
+ this.localToWorld(local, point, distance, relative)
300
+ return point
225
301
  }
226
302
 
227
303
 
@@ -232,13 +308,15 @@ export class Leaf implements ILeaf {
232
308
  }
233
309
 
234
310
  public scaleOf(origin: IPointData, x: number, y?: number): void {
235
- this.__layout.checkUpdate()
236
- zoomOfLocal(this, tempToOuterOf(origin, this.__local), x, y)
311
+ zoomOfLocal(this, tempToOuterOf(origin, this.localTransform), x, y)
237
312
  }
238
313
 
239
314
  public rotateOf(origin: IPointData, angle: number): void {
240
- this.__layout.checkUpdate()
241
- rotateOfLocal(this, tempToOuterOf(origin, this.__local), angle)
315
+ rotateOfLocal(this, tempToOuterOf(origin, this.localTransform), angle)
316
+ }
317
+
318
+ public skewOf(origin: IPointData, x: number, y: number): void {
319
+ skewOfLocal(this, tempToOuterOf(origin, this.localTransform), x, y)
242
320
  }
243
321
 
244
322
 
@@ -317,19 +395,17 @@ export class Leaf implements ILeaf {
317
395
 
318
396
  // ---
319
397
 
320
- public destroy(): void {
321
- if (this.__) {
322
398
 
323
- if (this.children && this.children.length) (this as unknown as IBranch).removeAll(true)
399
+ public destroy(): void {
400
+ if (!this.destroyed) {
324
401
  if (this.parent) this.remove()
325
-
326
- if (this.__hitCanvas) this.__hitCanvas.destroy()
402
+ if (this.children) (this as unknown as IBranch).removeAll(true)
327
403
 
328
404
  this.__.destroy()
329
405
  this.__layout.destroy()
330
406
 
331
- this.leafer = this.parent = this.__hitCanvas = this.__ = this.__layout = this.__captureMap = this.__bubbleMap = null
332
-
407
+ this.__captureMap = this.__bubbleMap = this.__parentWait = this.__leaferWait = null
408
+ this.destroyed = true
333
409
  }
334
410
  }
335
411
 
@@ -0,0 +1,134 @@
1
+ import { ILeaf, InnerId, ILeafer, ILeafData, ILeafLayout, IMatrixWithLayoutData, IMatrixWithBoundsData, IBoundsData, IHitCanvas, IEventListenerMap, IFunction, ILeafInputData, IObject, __Value, ILeaferCanvas, IMatrixDecompositionAttr, ILayoutBoundsType, ILayoutLocationType, IPointData, IRadiusPointData, IRenderOptions, IEventListener, IEventListenerOptions, IEventListenerId, IEvent } from '@leafer/interface';
2
+ import { LeafData } from '@leafer/data';
3
+ import { LeafLayout } from '@leafer/layout';
4
+
5
+ declare class Leaf implements ILeaf {
6
+ get tag(): string;
7
+ set tag(_value: string);
8
+ get __tag(): string;
9
+ readonly innerId: InnerId;
10
+ get innerName(): string;
11
+ get __DataProcessor(): typeof LeafData;
12
+ get __LayoutProcessor(): typeof LeafLayout;
13
+ leafer?: ILeafer;
14
+ parent?: ILeaf;
15
+ isLeafer: boolean;
16
+ isBranch: boolean;
17
+ isBranchLeaf: boolean;
18
+ __: ILeafData;
19
+ __layout: ILeafLayout;
20
+ __world: IMatrixWithLayoutData;
21
+ __local: IMatrixWithBoundsData;
22
+ __worldOpacity: number;
23
+ get worldTransform(): IMatrixWithLayoutData;
24
+ get localTransform(): IMatrixWithBoundsData;
25
+ get boxBounds(): IBoundsData;
26
+ get worldBoxBounds(): IBoundsData;
27
+ get worldStrokeBounds(): IBoundsData;
28
+ get worldRenderBounds(): IBoundsData;
29
+ get worldOpacity(): number;
30
+ __level: number;
31
+ __tempNumber: number;
32
+ get resizeable(): boolean;
33
+ get __hasMirror(): boolean;
34
+ __hasMask?: boolean;
35
+ __hasEraser?: boolean;
36
+ __hitCanvas?: IHitCanvas;
37
+ get __onlyHitMask(): boolean;
38
+ get __ignoreHitWorld(): boolean;
39
+ __captureMap?: IEventListenerMap;
40
+ __bubbleMap?: IEventListenerMap;
41
+ __parentWait?: IFunction[];
42
+ __leaferWait?: IFunction[];
43
+ children?: ILeaf[];
44
+ destroyed: boolean;
45
+ constructor(data?: ILeafInputData);
46
+ waitParent(item: IFunction): void;
47
+ waitLeafer(item: IFunction): void;
48
+ waitRender(item: IFunction): void;
49
+ __bindLeafer(leafer: ILeafer | null): void;
50
+ set(_data: IObject): void;
51
+ toJSON(): IObject;
52
+ toString(): string;
53
+ __setAttr(_attrName: string, _newValue: __Value): void;
54
+ __getAttr(_attrName: string): __Value;
55
+ forceUpdate(attrName?: string): void;
56
+ __updateWorldMatrix(): void;
57
+ __updateLocalMatrix(): void;
58
+ __updateWorldBounds(): void;
59
+ __updateLocalBoxBounds(): void;
60
+ __updateLocalStrokeBounds(): void;
61
+ __updateLocalRenderBounds(): void;
62
+ __updateBoxBounds(): void;
63
+ __updateStrokeBounds(): void;
64
+ __updateRenderBounds(): void;
65
+ __updateNaturalSize(): void;
66
+ __updateStrokeSpread(): number;
67
+ __updateRenderSpread(): number;
68
+ __onUpdateSize(): void;
69
+ __updateEraser(_value?: boolean): void;
70
+ __updateMask(_value?: boolean): void;
71
+ __renderMask(_canvas: ILeaferCanvas, _content: ILeaferCanvas, _mask: ILeaferCanvas): void;
72
+ __removeMask(_child?: ILeaf): void;
73
+ getWorld(attrName: IMatrixDecompositionAttr): number;
74
+ getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData;
75
+ worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
76
+ localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
77
+ worldToInner(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
78
+ innerToWorld(inner: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
79
+ getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
80
+ getInnerPointByLocal(local: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
81
+ getLocalPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
82
+ getLocalPointByInner(inner: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
83
+ getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
84
+ getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
85
+ move(x: number, y?: number): void;
86
+ scaleOf(origin: IPointData, x: number, y?: number): void;
87
+ rotateOf(origin: IPointData, angle: number): void;
88
+ skewOf(origin: IPointData, x: number, y: number): void;
89
+ __hitWorld(_point: IRadiusPointData): boolean;
90
+ __hit(_local: IRadiusPointData): boolean;
91
+ __drawHitPath(_canvas: ILeaferCanvas): void;
92
+ __updateHitCanvas(): void;
93
+ __render(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
94
+ __drawFast(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
95
+ __draw(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
96
+ __renderShape(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
97
+ __updateWorldOpacity(): void;
98
+ __updateChange(): void;
99
+ __drawPath(_canvas: ILeaferCanvas): void;
100
+ __drawRenderPath(_canvas: ILeaferCanvas): void;
101
+ __updatePath(): void;
102
+ __updateRenderPath(): void;
103
+ __updateSortChildren(): void;
104
+ add(_child: ILeaf, _index?: number): void;
105
+ remove(_child?: ILeaf, destroy?: boolean): void;
106
+ on(_type: string | string[], _listener: IEventListener, _options?: IEventListenerOptions | boolean): void;
107
+ off(_type: string | string[], _listener: IEventListener, _options?: IEventListenerOptions | boolean): void;
108
+ on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?: IEventListenerOptions | boolean): IEventListenerId;
109
+ off_(_id: IEventListenerId | IEventListenerId[]): void;
110
+ once(_type: string | string[], _listener: IEventListener, _capture?: boolean): void;
111
+ emit(_type: string, _event?: IEvent | IObject, _capture?: boolean): void;
112
+ emitEvent(_event?: IEvent, _capture?: boolean): void;
113
+ hasEvent(_type: string, _capture?: boolean): boolean;
114
+ destroy(): void;
115
+ }
116
+
117
+ declare class Branch extends Leaf {
118
+ constructor();
119
+ __updateStrokeSpread(): number;
120
+ __updateRenderSpread(): number;
121
+ __updateBoxBounds(): void;
122
+ __updateStrokeBounds(): void;
123
+ __updateRenderBounds(): void;
124
+ __updateSortChildren(): void;
125
+ add(child: ILeaf, index?: number): void;
126
+ addMany(...children: ILeaf[]): void;
127
+ remove(child?: Leaf, destroy?: boolean): void;
128
+ removeAll(destroy?: boolean): void;
129
+ protected __preRemove(): void;
130
+ protected __realRemoveChild(child: ILeaf): void;
131
+ protected __emitChildEvent(type: string, child: ILeaf): void;
132
+ }
133
+
134
+ export { Branch, Leaf };