@leafer/interface 1.0.0-beta.15 → 1.0.0-beta.16

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 (42) hide show
  1. package/package.json +2 -1
  2. package/src/app/IApp.ts +6 -0
  3. package/src/app/ILeafer.ts +103 -0
  4. package/src/canvas/ICanvas.ts +334 -0
  5. package/src/canvas/ICanvasManager.ts +10 -0
  6. package/src/canvas/IHitCanvasManager.ts +9 -0
  7. package/src/canvas/ILeaferCanvas.ts +205 -0
  8. package/src/canvas/ISkiaCanvas.ts +20 -0
  9. package/src/control/IControl.ts +5 -0
  10. package/src/data/IData.ts +28 -0
  11. package/src/data/ILeafData.ts +27 -0
  12. package/src/data/IList.ts +45 -0
  13. package/src/display/IBranch.ts +10 -0
  14. package/src/display/ILeaf.ts +385 -0
  15. package/src/display/IView.ts +10 -0
  16. package/src/display/module/IBranchRender.ts +10 -0
  17. package/src/display/module/ILeafBounds.ts +23 -0
  18. package/src/display/module/ILeafDataProxy.ts +10 -0
  19. package/src/display/module/ILeafEventer.ts +18 -0
  20. package/src/display/module/ILeafHit.ts +12 -0
  21. package/src/display/module/ILeafMask.ts +12 -0
  22. package/src/display/module/ILeafMatrix.ts +8 -0
  23. package/src/display/module/ILeafRender.ts +16 -0
  24. package/src/event/IEvent.ts +111 -0
  25. package/src/event/IEventer.ts +43 -0
  26. package/src/event/IUIEvent.ts +88 -0
  27. package/src/file/IFileType.ts +2 -0
  28. package/src/function/IFunction.ts +13 -0
  29. package/src/image/IImageManager.ts +18 -0
  30. package/src/image/ILeaferImage.ts +43 -0
  31. package/src/interaction/IInteraction.ts +106 -0
  32. package/src/layout/ILeafLayout.ts +94 -0
  33. package/src/layouter/ILayouter.ts +60 -0
  34. package/src/math/IMath.ts +182 -0
  35. package/src/path/IPathCommand.ts +50 -0
  36. package/src/path/IPathDrawer.ts +41 -0
  37. package/src/platform/IPlatform.ts +49 -0
  38. package/src/plugin/IPlugin.ts +10 -0
  39. package/src/renderer/IRenderer.ts +53 -0
  40. package/src/selector/ISelector.ts +35 -0
  41. package/src/task/ITaskProcessor.ts +44 -0
  42. package/src/watcher/IWatcher.ts +34 -0
@@ -0,0 +1,20 @@
1
+ import { IExportFileType, IExportImageType } from '../file/IFileType'
2
+
3
+ export type ICanvasType = 'skia' | 'canvas' | 'wx'
4
+
5
+ export interface ISkiaCanvas {
6
+ toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>
7
+ toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any
8
+ toDataURL(format: IExportImageType, config: ISkiaCanvasExportConfig): Promise<string>
9
+ toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string
10
+ saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>
11
+ saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void
12
+ }
13
+
14
+ export interface ISkiaCanvasExportConfig {
15
+ page?: number,
16
+ matte?: string,
17
+ density?: number,
18
+ quality?: number,
19
+ outline?: boolean
20
+ }
@@ -0,0 +1,5 @@
1
+ export interface IControl {
2
+ start(): void
3
+ stop(): void
4
+ destroy(): void
5
+ }
@@ -0,0 +1,28 @@
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 //
6
+ export type ITimer = any
7
+
8
+ export type IPathString = string
9
+
10
+ export interface IObject {
11
+ [name: string]: any
12
+ }
13
+
14
+ export interface IBooleanMap {
15
+ [name: string]: boolean
16
+ }
17
+
18
+ export interface INumberMap {
19
+ [name: string]: number
20
+ }
21
+
22
+ export interface IStringMap {
23
+ [name: string]: string
24
+ }
25
+
26
+ export interface IDataTypeHandle {
27
+ (target: any): void
28
+ }
@@ -0,0 +1,27 @@
1
+ import { ILeaf, ILeafComputedData } from '../display/ILeaf'
2
+ import { IObject } from './IData'
3
+
4
+ export interface IDataProcessor extends IObject {
5
+ __leaf: ILeaf
6
+ __input: IObject
7
+ __middle: IObject
8
+
9
+ __single: boolean
10
+ __checkSingle(): void
11
+
12
+ __get(name: string): any
13
+
14
+ __setInput(name: string, value: any): void
15
+ __getInput(name: string): any
16
+ __removeInput(name: string): void
17
+ __getInputData(): IObject
18
+
19
+ __setMiddle(name: string, value: any): void
20
+ __getMiddle(name: string): any
21
+
22
+ destroy(): void
23
+ }
24
+
25
+ export interface ILeafData extends IDataProcessor, ILeafComputedData {
26
+
27
+ }
@@ -0,0 +1,45 @@
1
+ import { ILeaf } from '../display/ILeaf'
2
+ import { INumberMap } from './IData'
3
+
4
+ export interface ILeafMap {
5
+ [name: string]: ILeaf
6
+ }
7
+
8
+ export interface ILeafArrayMap {
9
+ [name: string]: ILeaf[]
10
+ }
11
+
12
+ export type ILeafListItemCallback = (item: ILeaf, index?: number) => void
13
+
14
+ export interface ILeafList {
15
+ list: ILeaf[]
16
+ keys: INumberMap
17
+ readonly length: number
18
+ has(leaf: ILeaf): boolean
19
+ indexAt(index: number): ILeaf
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
25
+ remove(leaf: ILeaf): void
26
+ forEach(itemCallback: ILeafListItemCallback): void
27
+ clone(): ILeafList
28
+ reset(): void
29
+ destroy(): void
30
+ }
31
+
32
+ export interface ILeafLevelList {
33
+ levelMap: ILeafArrayMap
34
+ keys: INumberMap
35
+ levels: number[]
36
+ readonly length: number
37
+ has(leaf: ILeaf): boolean
38
+ without(leaf: ILeaf): boolean
39
+ sort(reverse?: boolean): void
40
+ pushList(list: ILeaf[]): void
41
+ push(leaf: ILeaf): void
42
+ forEach(itemCallback: ILeafListItemCallback): void
43
+ reset(): void
44
+ destroy(): void
45
+ }
@@ -0,0 +1,10 @@
1
+ import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
2
+ import { IRenderOptions } from '../renderer/IRenderer'
3
+ import { ILeaf } from './ILeaf'
4
+
5
+ export interface IBranch extends ILeaf {
6
+ children: ILeaf[]
7
+ __renderBranch?(canvas: ILeaferCanvas, options: IRenderOptions): void
8
+ addMany(...children: ILeaf[]): void
9
+ removeAll(destroy?: boolean): void
10
+ }
@@ -0,0 +1,385 @@
1
+ import { ILeafer } from '../app/ILeafer'
2
+ import { IEventer } from '../event/IEventer'
3
+
4
+ import { ILeaferCanvas, IHitCanvas } from '../canvas/ILeaferCanvas'
5
+ import { IRenderOptions } from '../renderer/IRenderer'
6
+
7
+ import { IObject, __Number, __Boolean, __Value, __String } from '../data/IData'
8
+ import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, IMatrixDecompositionAttr, IMatrixWithLayoutData } from '../math/IMath'
9
+ import { IFunction } from '../function/IFunction'
10
+
11
+ import { ILeafDataProxy } from './module/ILeafDataProxy'
12
+ import { ILeafMatrix } from './module/ILeafMatrix'
13
+ import { ILeafBounds } from './module/ILeafBounds'
14
+ import { ILeafLayout, ILayoutBoundsType, ILayoutLocationType } from '../layout/ILeafLayout'
15
+ import { ILeafHit } from './module/ILeafHit'
16
+ import { ILeafRender } from './module/ILeafRender'
17
+ import { ILeafMask } from './module/ILeafMask'
18
+ import { ILeafData } from '../data/ILeafData'
19
+
20
+
21
+ export interface ICachedLeaf {
22
+ canvas: ILeaferCanvas,
23
+ matrix?: IMatrix,
24
+ bounds: IBoundsData
25
+ }
26
+
27
+
28
+ export interface ILeafAttrData {
29
+ // layer data
30
+ id: __String
31
+ name: __String
32
+ className: __String
33
+
34
+ blendMode: IBlendMode
35
+ opacity: __Number
36
+ visible: __Boolean
37
+ isMask: __Boolean
38
+ isEraser: __Boolean
39
+ zIndex: __Number
40
+
41
+ // 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
58
+ hitFill: IHitType
59
+ hitStroke: IHitType
60
+ hitChildren: __Boolean
61
+ hitSelf: __Boolean
62
+ hitRadius: __Number
63
+
64
+ cursor: ICursorType | ICursorType[]
65
+ }
66
+
67
+ export type IHitType =
68
+ | 'path'
69
+ | 'pixel'
70
+ | 'all'
71
+ | 'none'
72
+
73
+ export type IBlendMode =
74
+ | 'pass-through'
75
+ | 'normal'
76
+ | 'multiply'
77
+ | 'screen'
78
+ | 'overlay'
79
+ | 'darken'
80
+ | 'lighten'
81
+ | 'color-dodge'
82
+ | 'color-burn'
83
+ | 'hard-light'
84
+ | 'soft-light'
85
+ | 'difference'
86
+ | 'exclusion'
87
+ | 'hue'
88
+ | 'saturation'
89
+ | 'color'
90
+ | 'luminosity'
91
+ | 'source-over' // other
92
+ | 'source-in'
93
+ | 'source-out'
94
+ | 'source-atop'
95
+ | 'destination-over'
96
+ | 'destination-in'
97
+ | 'destination-out'
98
+ | 'destination-atop'
99
+
100
+ export type IResizeType = 'size' | 'scale'
101
+ export interface IImageCursor {
102
+ url: string
103
+ x?: number
104
+ y?: number
105
+ }
106
+
107
+ export type IAround = 'center' | IPointData
108
+
109
+ export type ICursorType =
110
+ | IImageCursor
111
+ | 'auto'
112
+ | 'default'
113
+ | 'none'
114
+ | 'context-menu'
115
+ | 'help'
116
+ | 'pointer'
117
+ | 'progress'
118
+ | 'wait'
119
+ | 'cell'
120
+ | 'crosshair'
121
+ | 'text'
122
+ | 'vertical-text'
123
+ | 'alias'
124
+ | 'copy'
125
+ | 'move'
126
+ | 'no-drop'
127
+ | 'not-allowed'
128
+ | 'grab'
129
+ | 'grabbing'
130
+ | 'e-resize'
131
+ | 'n-resize'
132
+ | 'ne-resize'
133
+ | 'nw-resize'
134
+ | 's-resize'
135
+ | 'se-resize'
136
+ | 'sw-resize'
137
+ | 'w-resize'
138
+ | 'ew-resize'
139
+ | 'ns-resize'
140
+ | 'nesw-resize'
141
+ | 'nwse-resize'
142
+ | 'col-resize'
143
+ | 'row-resize'
144
+ | 'all-scroll'
145
+ | 'zoom -in'
146
+ | 'zoom-out'
147
+
148
+ export interface ICursorTypeMap {
149
+ [name: string]: ICursorType | ICursorType[]
150
+ }
151
+ export interface ILeafInputData extends IObject {
152
+ tag?: string
153
+
154
+ // layer data
155
+ id?: __String
156
+ name?: __String
157
+ className?: __String
158
+
159
+ blendMode?: IBlendMode
160
+ opacity?: __Number
161
+ visible?: __Boolean
162
+ isMask?: __Boolean
163
+ isEraser?: __Boolean
164
+ zIndex?: __Number
165
+
166
+ // 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
178
+ around?: IAround
179
+
180
+ draggable?: __Boolean
181
+
182
+ hittable?: __Boolean
183
+ hitFill?: IHitType
184
+ hitStroke?: IHitType
185
+ hitChildren?: __Boolean
186
+ hitSelf?: __Boolean
187
+ hitRadius?: __Number
188
+
189
+ cursor?: ICursorType | ICursorType[]
190
+
191
+ children?: ILeafInputData[]
192
+ }
193
+ export interface ILeafComputedData {
194
+ // layer data
195
+ id?: string
196
+ name?: string
197
+ className?: string
198
+
199
+ blendMode?: IBlendMode
200
+ opacity?: number
201
+ visible?: boolean
202
+ isMask?: boolean
203
+ isEraser?: boolean
204
+ zIndex?: number
205
+
206
+ // layout data
207
+ x?: number
208
+ y?: number
209
+ width?: number
210
+ height?: number
211
+ scaleX?: number
212
+ scaleY?: number
213
+ rotation?: number
214
+ skewX?: number
215
+ skewY?: number
216
+
217
+ around?: IAround
218
+
219
+ draggable?: boolean
220
+
221
+ hittable?: boolean
222
+ hitFill?: IHitType
223
+ hitStroke?: IHitType
224
+ hitChildren?: boolean
225
+ hitSelf?: boolean
226
+ hitRadius?: number
227
+
228
+ cursor?: ICursorType | ICursorType[]
229
+
230
+ // other
231
+ __childBranchNumber?: number // 存在子分支的个数
232
+ __complex?: boolean // 外观是否复杂
233
+ __naturalWidth?: number
234
+ __naturalHeight?: number
235
+ }
236
+
237
+ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
238
+ tag: string
239
+ readonly __tag: string
240
+ readonly innerName: string
241
+
242
+ readonly __DataProcessor: IObject // IDataProcessor
243
+ readonly __LayoutProcessor: IObject // ILeafLayout
244
+
245
+ leafer?: ILeafer
246
+ parent?: ILeaf
247
+
248
+ readonly isApp?: boolean
249
+ isLeafer?: boolean
250
+ isBranch?: boolean
251
+ isBranchLeaf?: boolean
252
+
253
+ __: ILeafData
254
+ __layout: ILeafLayout
255
+
256
+ __world: IMatrixWithLayoutData
257
+ __local: IMatrixWithBoundsData
258
+
259
+ __worldOpacity: number
260
+
261
+ readonly worldTransform: IMatrixWithLayoutData
262
+ readonly localTransform: IMatrixWithBoundsData
263
+
264
+ readonly boxBounds: IBoundsData
265
+ readonly worldBoxBounds: IBoundsData
266
+ readonly worldStrokeBounds: IBoundsData
267
+ readonly worldRenderBounds: IBoundsData
268
+
269
+ readonly worldOpacity: number
270
+
271
+ __renderTime?: number // μs 1000微秒 = 1毫秒
272
+
273
+ __level: number // 图层级别 root(1) -> hight
274
+ __tempNumber?: number // 用于临时运算储存状态
275
+
276
+ readonly resizeable: boolean
277
+
278
+ readonly __hasMirror: boolean
279
+
280
+ __hasMask?: boolean
281
+ __hasEraser?: boolean
282
+ __hitCanvas?: IHitCanvas
283
+
284
+ readonly __onlyHitMask: boolean
285
+ readonly __ignoreHitWorld: boolean
286
+
287
+ __parentWait?: IFunction[]
288
+ __leaferWait?: IFunction[]
289
+
290
+ destroyed: boolean
291
+
292
+ waitParent(item: IFunction): void
293
+ waitLeafer(item: IFunction): void
294
+ nextRender(item: IFunction): void
295
+
296
+ __bindLeafer(leafer: ILeafer | null): void
297
+
298
+ set(data: IObject): void
299
+ toJSON(): IObject
300
+ toString(): string
301
+
302
+ // ILeafData ->
303
+ __setAttr(attrName: string, newValue: __Value): void
304
+ __getAttr(attrName: string): __Value
305
+
306
+ forceUpdate(attrName?: string): void
307
+
308
+ // ILeafMatrix ->
309
+ __updateWorldMatrix(): void
310
+ __updateLocalMatrix(): void
311
+
312
+ // ILeafBounds ->
313
+ __updateWorldBounds(): void
314
+
315
+ __updateLocalBoxBounds(): void
316
+ __updateLocalStrokeBounds(): void
317
+ __updateLocalRenderBounds(): void
318
+
319
+ __updateBoxBounds(): void
320
+ __updateStrokeBounds(): void
321
+ __updateRenderBounds(): void
322
+
323
+ __updateNaturalSize(): void
324
+
325
+ __updateStrokeSpread(): number
326
+ __updateRenderSpread(): number
327
+
328
+ __onUpdateSize(): void
329
+
330
+ // IBranchMask ->
331
+ __updateEraser(value?: boolean): void
332
+ __updateMask(value?: boolean): void
333
+ __renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
334
+ __removeMask(child?: ILeaf): void
335
+
336
+ // convert
337
+ getWorld(attrName: IMatrixDecompositionAttr): number
338
+ getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData
339
+
340
+ worldToLocal(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
341
+ localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
342
+ worldToInner(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
343
+ innerToWorld(inner: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void
344
+
345
+ getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
346
+ getInnerPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
347
+ getLocalPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
348
+ getLocalPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
349
+ getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
350
+ getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData
351
+
352
+ move(x: number, y?: number): void
353
+ scaleOf(origin: IPointData, x: number, y?: number): void
354
+ rotateOf(origin: IPointData, rotation: number): void
355
+ skewOf(origin: IPointData, x: number, y: number): void
356
+
357
+ // ILeafHit ->
358
+ __hitWorld(point: IRadiusPointData): boolean
359
+ __hit(local: IRadiusPointData): boolean
360
+ __drawHitPath(canvas: ILeaferCanvas): void
361
+ __updateHitCanvas(): void
362
+
363
+ // ILeafRender ->
364
+ __render(canvas: ILeaferCanvas, options: IRenderOptions): void
365
+ __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void
366
+ __draw(canvas: ILeaferCanvas, options: IRenderOptions): void
367
+
368
+ __renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
369
+
370
+ __updateWorldOpacity(): void
371
+ __updateChange(): void
372
+
373
+ // path
374
+ __drawPath(canvas: ILeaferCanvas): void
375
+ __drawRenderPath(canvas: ILeaferCanvas): void
376
+ __updatePath(): void
377
+ __updateRenderPath(): void
378
+
379
+ // branch
380
+ children?: ILeaf[]
381
+
382
+ __updateSortChildren(): void
383
+ add(child: ILeaf, index?: number): void
384
+ remove(child?: ILeaf, destroy?: boolean): void
385
+ }
@@ -0,0 +1,10 @@
1
+ import { IBranch } from './IBranch'
2
+ import { ILeaf } from './ILeaf'
3
+ import { ITransformEventData } from '../event/IEvent'
4
+
5
+ export interface IZoomView extends IBranch {
6
+ zoomLayer?: ILeaf
7
+ moveLayer?: ILeaf
8
+ transformData?: ITransformEventData
9
+ setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void
10
+ }
@@ -0,0 +1,10 @@
1
+ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
2
+ import { IRenderOptions } from '../../renderer/IRenderer'
3
+ import { IBranch } from '../IBranch'
4
+ import { ILeafRender } from './ILeafRender'
5
+
6
+ export type IBranchRenderModule = IBranchRender & ThisType<IBranch>
7
+
8
+ export interface IBranchRender extends ILeafRender {
9
+ __renderBranch?(canvas: ILeaferCanvas, options: IRenderOptions): void
10
+ }
@@ -0,0 +1,23 @@
1
+ import { ILeaf } from '../ILeaf'
2
+
3
+ export type ILeafBoundsModule = ILeafBounds & ThisType<ILeaf>
4
+
5
+ export interface ILeafBounds {
6
+ __updateWorldBounds?(): void
7
+
8
+ __updateLocalBoxBounds?(): void
9
+ __updateLocalStrokeBounds?(): void
10
+ __updateLocalRenderBounds?(): void
11
+
12
+ __updateBoxBounds?(): void
13
+ __updateStrokeBounds?(): void
14
+ __updateRenderBounds?(): void
15
+
16
+ __updateNaturalSize?(): void
17
+
18
+ __updateStrokeSpread?(): number
19
+ __updateRenderSpread?(): number
20
+
21
+ __onUpdateSize?(): void
22
+ }
23
+
@@ -0,0 +1,10 @@
1
+ import { ILeaf } from '../ILeaf'
2
+ import { __Value } from '../../data/IData'
3
+
4
+ export type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>
5
+
6
+ export interface ILeafDataProxy {
7
+ __setAttr?(name: string, newValue: __Value): void
8
+ __getAttr?(name: string): __Value
9
+ }
10
+
@@ -0,0 +1,18 @@
1
+ import { ILeaf } from '../ILeaf'
2
+ import { IEventListener, IEventListenerId, IEventListenerOptions } from '../../event/IEventer'
3
+ import { } from '@leafer/interface'
4
+ import { IEvent } from '../../event/IEvent'
5
+ import { IObject } from '../../data/IData'
6
+
7
+ export type ILeafEventerModule = ILeafEventer & ThisType<ILeaf>
8
+
9
+ export interface ILeafEventer {
10
+ on?(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void
11
+ off?(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void
12
+ on_?(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventListenerOptions | boolean): IEventListenerId
13
+ off_?(id: IEventListenerId | IEventListenerId[]): void
14
+ once?(type: string | string[], listener: IEventListener, capture?: boolean): void
15
+ emit?(type: string, event?: IEvent | IObject, capture?: boolean): void
16
+ emitEvent?(event?: IEvent, capture?: boolean): void
17
+ hasEvent?(type: string, capture?: boolean): boolean
18
+ }
@@ -0,0 +1,12 @@
1
+ import { IRadiusPointData } from '../../math/IMath'
2
+ import { ILeaf } from '../ILeaf'
3
+ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
4
+
5
+ export type ILeafHitModule = ILeafHit & ThisType<ILeaf>
6
+
7
+ export interface ILeafHit {
8
+ __hitWorld?(point: IRadiusPointData): boolean
9
+ __hit?(local: IRadiusPointData): boolean
10
+ __drawHitPath?(canvas: ILeaferCanvas): void
11
+ __updateHitCanvas?(): void
12
+ }
@@ -0,0 +1,12 @@
1
+ import { ILeaf } from '../ILeaf'
2
+ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
3
+
4
+ export type ILeafMaskModule = ILeafMask & ThisType<ILeaf>
5
+
6
+ export interface ILeafMask {
7
+ __updateEraser?(value?: boolean): void
8
+ __updateMask?(value?: boolean): void
9
+ __renderMask?(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
10
+ __removeMask?(child?: ILeaf): void
11
+ }
12
+
@@ -0,0 +1,8 @@
1
+ import { ILeaf } from '../ILeaf'
2
+
3
+ export type ILeafMatrixModule = ILeafMatrix & ThisType<ILeaf>
4
+
5
+ export interface ILeafMatrix {
6
+ __updateWorldMatrix?(): void
7
+ __updateLocalMatrix?(): void
8
+ }
@@ -0,0 +1,16 @@
1
+ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'
2
+ import { IRenderOptions } from '../../renderer/IRenderer'
3
+ import { ILeaf } from '../ILeaf'
4
+
5
+ export type ILeafRenderModule = ILeafRender & ThisType<ILeaf>
6
+
7
+ export interface ILeafRender {
8
+ __render?(canvas: ILeaferCanvas, options: IRenderOptions): void
9
+ __draw?(canvas: ILeaferCanvas, options: IRenderOptions): void
10
+ __drawFast?(canvas: ILeaferCanvas, options: IRenderOptions): void
11
+
12
+ __renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void
13
+
14
+ __updateWorldOpacity?(): void
15
+ __updateChange?(): void
16
+ }