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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/app/IApp.ts +3 -3
  3. package/src/app/ILeafer.ts +46 -21
  4. package/src/canvas/ICanvas.ts +7 -2
  5. package/src/canvas/IHitCanvasManager.ts +3 -3
  6. package/src/canvas/ILeaferCanvas.ts +23 -11
  7. package/src/canvas/ISkiaCanvas.ts +20 -1
  8. package/src/data/IData.ts +12 -5
  9. package/src/data/ILeafData.ts +12 -6
  10. package/src/data/IList.ts +9 -6
  11. package/src/display/IBranch.ts +2 -1
  12. package/src/display/ILeaf.ts +452 -108
  13. package/src/display/IView.ts +2 -6
  14. package/src/display/module/IBranchRender.ts +2 -2
  15. package/src/display/module/ILeafBounds.ts +3 -0
  16. package/src/display/module/ILeafDataProxy.ts +5 -3
  17. package/src/display/module/ILeafEventer.ts +1 -1
  18. package/src/display/module/ILeafHit.ts +4 -1
  19. package/src/display/module/ILeafRender.ts +2 -1
  20. package/src/event/IEvent.ts +3 -23
  21. package/src/event/IEventer.ts +7 -2
  22. package/src/event/IUIEvent.ts +14 -9
  23. package/src/file/IExport.ts +41 -0
  24. package/src/file/IFileType.ts +1 -1
  25. package/src/function/IFunction.ts +18 -0
  26. package/src/image/IImageManager.ts +4 -0
  27. package/src/image/ILeaferImage.ts +13 -0
  28. package/src/index.ts +16 -15
  29. package/src/interaction/ICursor.ts +16 -0
  30. package/src/interaction/IInteraction.ts +40 -5
  31. package/src/layout/ILeafLayout.ts +41 -18
  32. package/src/layouter/ILayouter.ts +3 -0
  33. package/src/math/IMath.ts +98 -37
  34. package/src/path/IPathDrawer.ts +6 -3
  35. package/src/platform/IPlatform.ts +22 -4
  36. package/src/plugin/IPlugin.ts +2 -2
  37. package/src/renderer/IRenderer.ts +4 -2
  38. package/src/selector/ISelector.ts +38 -9
  39. package/types/index.d.ts +884 -418
  40. package/src/display/module/ILeafMask.ts +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/interface",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0-rc.30",
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
  }
@@ -1,42 +1,40 @@
1
- import { ILeaf } from '../display/ILeaf'
1
+ import { ILeaf, ICursorType } from '../display/ILeaf'
2
2
  import { IRenderer, IRendererConfig } from '../renderer/IRenderer'
3
3
  import { IHitCanvas, ILeaferCanvas, ILeaferCanvasConfig, IHitCanvasConfig } from '../canvas/ILeaferCanvas'
4
4
  import { ILayouter, ILayouterConfig } from '../layouter/ILayouter'
5
5
  import { ISelector, ISelectorConfig } from '../selector/ISelector'
6
6
  import { IInteraction, IInteractionCanvas, IInteractionConfig } from '../interaction/IInteraction'
7
7
  import { IWatcher, IWatcherConfig } from '../watcher/IWatcher'
8
- import { IAutoBounds, IScreenSizeData } from '../math/IMath'
8
+ import { IAutoBounds, IBoundsData, IPointData, IScreenSizeData, IBounds, IClientPointData } from '../math/IMath'
9
9
  import { ICanvasManager } from '../canvas/ICanvasManager'
10
10
  import { IHitCanvasManager } from '../canvas/IHitCanvasManager'
11
11
  import { IEventListenerId } from '../event/IEventer'
12
- import { IObject } from '../data/IData'
12
+ import { IFourNumber, 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'
18
18
 
19
19
 
20
- export type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'user'
20
+ export type ILeaferType = 'draw' | 'editor' | 'design' | 'board' | 'document' | 'app' | 'website' | 'game' | 'player' | 'chart' | 'custom'
21
21
  export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteractionConfig, ILayouterConfig {
22
22
  start?: boolean
23
23
  type?: ILeaferType
24
24
  realCanvas?: boolean
25
+ lazySpeard?: IFourNumber
25
26
  }
26
27
 
27
- export interface ILeafer extends IZoomView, IControl {
28
-
29
- readonly isApp: boolean
30
- readonly app: ILeafer
31
- parent?: IApp
32
-
28
+ export interface ILeaferAttrData {
33
29
  running: boolean
34
30
  created: boolean
35
31
  ready: boolean
36
32
  viewReady: boolean
33
+ imageReady: boolean
37
34
  viewCompleted: boolean
35
+ layoutLocked: boolean
38
36
 
39
- pixelRatio: number
37
+ transforming: boolean
40
38
 
41
39
  view: unknown
42
40
 
@@ -53,31 +51,55 @@ export interface ILeafer extends IZoomView, IControl {
53
51
  hitCanvasManager?: IHitCanvasManager
54
52
 
55
53
  autoLayout?: IAutoBounds
54
+ lazyBounds: IBounds
56
55
 
57
56
  config: ILeaferConfig
58
57
 
58
+ readonly cursorPoint: IPointData
59
+ readonly clientBounds: IBoundsData
60
+ leafs: number
61
+
59
62
  __eventIds: IEventListenerId[]
60
63
  __nextRenderWait: IFunction[]
61
64
 
62
- init(userConfig?: ILeaferConfig, parentApp?: IApp): void
63
- setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void
64
- forceFullRender(): void
65
- updateCursor(): void
65
+ init(userConfig?: ILeaferConfig, parentApp?: IAppBase): void
66
+
67
+ start(): void
68
+ stop(): void
69
+
70
+ unlockLayout(): void
71
+ lockLayout(): void
72
+
73
+ updateCursor(cursor?: ICursorType): void
66
74
  resize(size: IScreenSizeData): void
67
75
 
68
- waitReady(item: IFunction): void
69
- waitViewReady(item: IFunction): void
70
- waitViewCompleted(item: IFunction): void
76
+ waitReady(item: IFunction, bind?: IObject): void
77
+ waitViewReady(item: IFunction, bind?: IObject): void
78
+ waitViewCompleted(item: IFunction, bind?: IObject): void
79
+
80
+ zoom(zoomType: IZoomType, padding?: IFourNumber, fixedScale?: boolean): IBoundsData
81
+ getValidMove(moveX: number, moveY: number): IPointData
82
+ getValidScale(changeScale: number): number
83
+
84
+ getWorldPointByClient(clientPoint: IClientPointData, updateClient?: boolean): IPointData
85
+ }
86
+
87
+ export type IZoomType = 'in' | 'out' | 'fit' | 'fit-width' | 'fit-height' | number | ILeaf | ILeaf[] | IBoundsData
88
+
89
+ export interface ILeaferBase extends IZoomView, IControl, ILeaferAttrData {
90
+ readonly isApp: boolean
91
+ readonly app: ILeaferBase
92
+ parent?: IAppBase
71
93
  }
72
94
 
73
95
  export interface ILeaferTypeCreator {
74
96
  list: ILeaferTypeList
75
97
  register(name: string, fn: ILeaferTypeFunction): void
76
- run(name: string, leafer: ILeafer): void
98
+ run(name: string, leafer: ILeaferBase): void
77
99
  }
78
100
 
79
101
  export interface ILeaferTypeFunction {
80
- (leafer: ILeafer): void
102
+ (leafer: ILeaferBase): void
81
103
  }
82
104
 
83
105
  export interface ILeaferTypeList {
@@ -88,6 +110,7 @@ export interface ICreator {
88
110
  image?(options?: ILeaferImageConfig): ILeaferImage
89
111
  canvas?(options?: ILeaferCanvasConfig, manager?: ICanvasManager): ILeaferCanvas
90
112
  hitCanvas?(options?: IHitCanvasConfig, manager?: ICanvasManager): IHitCanvas
113
+ hitCanvasManager?(): IHitCanvasManager
91
114
 
92
115
  watcher?(target: ILeaf, options?: IWatcherConfig): IWatcher
93
116
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter
@@ -95,6 +118,8 @@ export interface ICreator {
95
118
  selector?(target: ILeaf, options?: ISelectorConfig): ISelector
96
119
 
97
120
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction
121
+
122
+ editor?(options?: IObject): ILeaf
98
123
  }
99
124
 
100
125
  export interface IUICreator {
@@ -111,6 +111,8 @@ export interface CanvasPattern {
111
111
  setTransform(transform?: DOMMatrix2DInit): void
112
112
  }
113
113
 
114
+ export type ICanvasPattern = CanvasPattern
115
+
114
116
  declare var CanvasPattern: {
115
117
  prototype: CanvasPattern
116
118
  new(): CanvasPattern
@@ -123,15 +125,18 @@ interface CanvasRect {
123
125
  }
124
126
 
125
127
  type PredefinedColorSpace = 'display-p3' | 'srgb'
126
- interface CanvasRenderingContext2DSettings {
128
+ interface ICanvasRenderingContext2DSettings {
127
129
  alpha?: boolean
128
130
  colorSpace?: PredefinedColorSpace
129
131
  desynchronized?: boolean
130
132
  willReadFrequently?: boolean
131
133
  }
134
+
135
+ export type ICanvasContext2DSettings = ICanvasRenderingContext2DSettings
136
+
132
137
  export interface ICanvasContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
133
138
  readonly canvas: HTMLCanvasElement
134
- getContextAttributes(): CanvasRenderingContext2DSettings
139
+ getContextAttributes(): ICanvasRenderingContext2DSettings
135
140
  }
136
141
 
137
142
  declare var ICanvasContext2D: {
@@ -1,9 +1,9 @@
1
1
  import { ILeaf } from '../display/ILeaf'
2
- import { IScreenSizeData } from '../math/IMath'
3
2
  import { ICanvasManager } from './ICanvasManager'
4
- import { IHitCanvas } from './ILeaferCanvas'
3
+ import { IHitCanvas, ILeaferCanvasConfig } from './ILeaferCanvas'
5
4
 
6
5
  export interface IHitCanvasManager extends ICanvasManager {
6
+ maxTotal: number // 最多缓存多少张画布
7
7
  getPathType(leaf: ILeaf): IHitCanvas
8
- getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas
8
+ getPixelType(leaf: ILeaf, config?: ILeaferCanvasConfig): IHitCanvas
9
9
  }
@@ -1,11 +1,12 @@
1
1
  import { IObject } from '../data/IData'
2
- import { IBounds, IMatrixData, IBoundsData, IAutoBoundsData, IAutoBounds, IScreenSizeData, IMatrixWithBoundsData, IPointData } from '../math/IMath'
3
- import { ICanvasContext2D, IWindingRule, IPath2D, ITextMetrics, CanvasGradient, CanvasPattern } from './ICanvas'
2
+ import { IBounds, IMatrixData, IBoundsData, IAutoBoundsData, IAutoBounds, IScreenSizeData, IMatrixWithBoundsData, IPointData, IRadiusPointData } from '../math/IMath'
3
+ import { ICanvasContext2D, IWindingRule, IPath2D, ITextMetrics, CanvasGradient, CanvasPattern, ICanvasContext2DSettings } from './ICanvas'
4
4
  import { IResizeEventListener } from '../event/IEvent'
5
5
  import { IPathDrawer } from '../path/IPathDrawer'
6
6
  import { InnerId } from '../event/IEventer'
7
7
  import { ICanvasManager } from './ICanvasManager'
8
- import { ICursorType } from '../display/ILeaf'
8
+ import { IExportFileType } from '../file/IFileType'
9
+ import { IExportOptions } from '../file/IExport'
9
10
 
10
11
  export interface ILeaferCanvasConfig extends IAutoBoundsData {
11
12
  view?: string | IObject
@@ -14,6 +15,7 @@ export interface ILeaferCanvasConfig extends IAutoBoundsData {
14
15
  smooth?: boolean
15
16
  hittable?: boolean
16
17
  webgl?: boolean
18
+ contextSettings?: ICanvasContext2DSettings
17
19
  }
18
20
 
19
21
  export type IHitCanvasConfig = ILeaferCanvasConfig
@@ -29,6 +31,11 @@ export interface ICanvasStrokeOptions {
29
31
  miterLimit?: number
30
32
  }
31
33
 
34
+ export interface ICanvasCacheOptions extends ICanvasStrokeOptions {
35
+ fillStyle?: string | object
36
+ strokeStyle?: string | object
37
+ }
38
+
32
39
  export interface ICanvasAttr extends ICanvasStrokeOptions, IObject {
33
40
 
34
41
  smooth: boolean // imageSmoothingEnabled: boolean
@@ -105,6 +112,8 @@ interface ICanvasMethod {
105
112
 
106
113
  hitFill(point: IPointData, fillRule?: string): boolean
107
114
  hitStroke(point: IPointData, strokeWidth?: number): boolean
115
+ hitPixel(radiusPoint: IRadiusPointData, offset?: IPointData, scale?: number): boolean
116
+
108
117
 
109
118
  setStroke(strokeStyle: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void
110
119
  setStrokeOptions(options: ICanvasStrokeOptions): void
@@ -116,7 +125,7 @@ interface ICanvasMethod {
116
125
  setWorldBlur(blur: number): void
117
126
 
118
127
  copyWorld(canvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData, blendMode?: string): void
119
- copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string): void
128
+ copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string, onlyResetTransform?: boolean): void
120
129
  copyWorldToInner(canvas: ILeaferCanvas, fromWorld: IMatrixWithBoundsData, toInnerBounds: IBoundsData, blendMode?: string): void
121
130
 
122
131
  useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void
@@ -130,6 +139,7 @@ interface ICanvasMethod {
130
139
  clear(): void
131
140
  }
132
141
 
142
+ export type ILeaferCanvasView = any
133
143
  export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
134
144
 
135
145
  readonly innerId: InnerId
@@ -148,6 +158,9 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
148
158
  backgroundColor?: string
149
159
  hittable?: boolean
150
160
 
161
+ zIndex?: number
162
+ childIndex?: number
163
+
151
164
  bounds: IBounds
152
165
  clientBounds: IBoundsData
153
166
 
@@ -155,7 +168,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
155
168
 
156
169
  autoLayout: boolean
157
170
 
158
- view: any
171
+ view: ILeaferCanvasView
159
172
  parentView: any
160
173
 
161
174
  unreal?: boolean
@@ -168,6 +181,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
168
181
 
169
182
  init(): void
170
183
 
184
+ export(filename: IExportFileType | string, options?: IExportOptions | number | boolean): string | Promise<any>
171
185
  toBlob(type?: string, quality?: number): Promise<IBlob>
172
186
  toDataURL(type?: string, quality?: number): string | Promise<string>
173
187
  saveAs(filename: string, quality?: number): Promise<boolean>
@@ -178,14 +192,12 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
178
192
  resize(size: IScreenSizeData): void
179
193
  updateViewSize(): void
180
194
  updateClientBounds(): void
181
-
182
- setCursor(cursor: ICursorType | ICursorType[]): void
195
+ getClientBounds(update?: boolean): IBoundsData
183
196
 
184
197
  // other
185
198
  isSameSize(options: ILeaferCanvasConfig): boolean
186
- getSameCanvas(useSameWorldTransform?: boolean): ILeaferCanvas
187
- getBiggerCanvas(addWidth: number, addHeight: number): ILeaferCanvas
188
- recycle(): void
199
+ getSameCanvas(useSameWorldTransform?: boolean, useSameSmooth?: boolean): ILeaferCanvas
200
+ recycle(clearBounds?: IBoundsData): void
189
201
 
190
202
  updateRender(): void
191
203
  unrealCanvas(): void
@@ -194,7 +206,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
194
206
 
195
207
 
196
208
  export interface IHitCanvas extends ILeaferCanvas {
197
-
209
+ hitScale?: number
198
210
  }
199
211
 
200
212
 
@@ -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,12 +1,15 @@
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
+ import { IPointData } from '../math/IMath'
2
+
3
+ export type INumber = number // number | string will convert to number
4
+ export type IBoolean = boolean // boolean | string will convert to boolean
5
+ export type IString = string // string | other will convert to string
6
+ export type IValue = INumber | IBoolean | IString | IObject
6
7
  export type ITimer = any
7
8
 
8
9
  export type IPathString = string
9
10
 
11
+ export type IFourNumber = number | number[]
12
+
10
13
  export interface IObject {
11
14
  [name: string]: any
12
15
  }
@@ -23,6 +26,10 @@ export interface IStringMap {
23
26
  [name: string]: string
24
27
  }
25
28
 
29
+ export interface IPointDataMap {
30
+ [name: string]: IPointData
31
+ }
32
+
26
33
  export interface IDataTypeHandle {
27
34
  (target: any): void
28
35
  }
@@ -1,20 +1,19 @@
1
1
  import { ILeaf, ILeafComputedData } from '../display/ILeaf'
2
+ import { IJSONOptions } from '../file/IExport'
2
3
  import { IObject } from './IData'
3
4
 
4
- export interface IDataProcessor extends IObject {
5
+ export interface IDataProcessor {
5
6
  __leaf: ILeaf
6
7
  __input: IObject
7
8
  __middle: IObject
8
9
 
9
- __single: boolean
10
- __checkSingle(): void
11
-
12
10
  __get(name: string): any
11
+ __getData(): IObject
13
12
 
14
13
  __setInput(name: string, value: any): void
15
14
  __getInput(name: string): any
16
15
  __removeInput(name: string): void
17
- __getInputData(): IObject
16
+ __getInputData(names?: string[] | IObject, options?: IJSONOptions): IObject
18
17
 
19
18
  __setMiddle(name: string, value: any): void
20
19
  __getMiddle(name: string): any
@@ -22,6 +21,13 @@ export interface IDataProcessor extends IObject {
22
21
  destroy(): void
23
22
  }
24
23
 
25
- export interface ILeafData extends IDataProcessor, ILeafComputedData {
24
+ export interface ILeafDataOptions {
25
+ attrs?: 'all' | string[]
26
+ children?: boolean
27
+ }
26
28
 
29
+ export interface ILeafData extends IDataProcessor, ILeafComputedData {
30
+ __single?: boolean
31
+ __checkSingle(): void
32
+ __removeNaturalSize(): void
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,10 +1,11 @@
1
+ import { ILeaf } from './ILeaf'
1
2
  import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
2
3
  import { IRenderOptions } from '../renderer/IRenderer'
3
- import { ILeaf } from './ILeaf'
4
4
 
5
5
  export interface IBranch extends ILeaf {
6
6
  children: ILeaf[]
7
7
  __renderBranch?(canvas: ILeaferCanvas, options: IRenderOptions): void
8
8
  addMany(...children: ILeaf[]): void
9
9
  removeAll(destroy?: boolean): void
10
+ clear(): void
10
11
  }