@leafer/interface 1.0.0-beta.12 → 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 +4 -2
- package/src/index.ts +2 -2
- package/types/index.d.ts +1672 -0
- package/src/app/IApp.ts +0 -6
- package/src/app/ILeafer.ts +0 -96
- package/src/canvas/ICanvas.ts +0 -334
- package/src/canvas/ICanvasManager.ts +0 -10
- package/src/canvas/IHitCanvasManager.ts +0 -9
- package/src/canvas/ILeaferCanvas.ts +0 -198
- package/src/canvas/ISkiaCanvas.ts +0 -20
- package/src/control/IControl.ts +0 -5
- package/src/data/IData.ts +0 -29
- package/src/data/ILeafData.ts +0 -27
- package/src/data/IList.ts +0 -45
- package/src/display/IBranch.ts +0 -9
- package/src/display/ILeaf.ts +0 -295
- package/src/display/IView.ts +0 -10
- package/src/display/module/IBranchRender.ts +0 -10
- package/src/display/module/ILeafBounds.ts +0 -21
- package/src/display/module/ILeafDataProxy.ts +0 -10
- package/src/display/module/ILeafEventer.ts +0 -18
- package/src/display/module/ILeafHit.ts +0 -12
- package/src/display/module/ILeafMask.ts +0 -12
- package/src/display/module/ILeafMatrix.ts +0 -8
- package/src/display/module/ILeafRender.ts +0 -16
- package/src/event/IEvent.ts +0 -111
- package/src/event/IEventer.ts +0 -43
- package/src/event/IUIEvent.ts +0 -85
- package/src/file/IFileType.ts +0 -2
- package/src/function/IFunction.ts +0 -13
- package/src/image/IImageManager.ts +0 -18
- package/src/image/ILeaferImage.ts +0 -41
- package/src/interaction/IInteraction.ts +0 -92
- package/src/layout/ILeafLayout.ts +0 -95
- package/src/layouter/ILayouter.ts +0 -60
- package/src/math/IMath.ts +0 -183
- package/src/path/IPathCommand.ts +0 -50
- package/src/path/IPathDrawer.ts +0 -36
- package/src/platform/IPlatform.ts +0 -47
- package/src/plugin/IPlugin.ts +0 -10
- package/src/renderer/IRenderer.ts +0 -53
- package/src/selector/ISelector.ts +0 -35
- package/src/task/ITaskProcessor.ts +0 -44
- package/src/watcher/IWatcher.ts +0 -30
package/src/data/IData.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
}
|
|
29
|
-
|
package/src/data/ILeafData.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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): unknown
|
|
13
|
-
|
|
14
|
-
__setInput(name: string, value: unknown): void
|
|
15
|
-
__getInput(name: string): unknown
|
|
16
|
-
__removeInput(name: string): void
|
|
17
|
-
__getInputData(): IObject
|
|
18
|
-
|
|
19
|
-
__setMiddle(name: string, value: unknown): void
|
|
20
|
-
__getMiddle(name: string): unknown
|
|
21
|
-
|
|
22
|
-
destroy(): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ILeafData extends IDataProcessor, ILeafComputedData {
|
|
26
|
-
|
|
27
|
-
}
|
package/src/data/IList.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
}
|
package/src/display/IBranch.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
removeAll(destroy?: boolean): void
|
|
9
|
-
}
|
package/src/display/ILeaf.ts
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
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, IMatrixData, IRadiusPointData, IMatrixDecompositionAttr } 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
|
-
draggable: __Boolean
|
|
53
|
-
|
|
54
|
-
hittable: __Boolean
|
|
55
|
-
hitFill: IHitType
|
|
56
|
-
hitStroke: IHitType
|
|
57
|
-
hitChildren: __Boolean
|
|
58
|
-
hitSelf: __Boolean
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type IHitType =
|
|
62
|
-
| 'path'
|
|
63
|
-
| 'pixel'
|
|
64
|
-
| 'all'
|
|
65
|
-
| 'none'
|
|
66
|
-
|
|
67
|
-
export type IBlendMode =
|
|
68
|
-
| 'pass-through'
|
|
69
|
-
| 'normal'
|
|
70
|
-
| 'multiply'
|
|
71
|
-
| 'screen'
|
|
72
|
-
| 'overlay'
|
|
73
|
-
| 'darken'
|
|
74
|
-
| 'lighten'
|
|
75
|
-
| 'color-dodge'
|
|
76
|
-
| 'color-burn'
|
|
77
|
-
| 'hard-light'
|
|
78
|
-
| 'soft-light'
|
|
79
|
-
| 'difference'
|
|
80
|
-
| 'exclusion'
|
|
81
|
-
| 'hue'
|
|
82
|
-
| 'saturation'
|
|
83
|
-
| 'color'
|
|
84
|
-
| 'luminosity'
|
|
85
|
-
| 'source-over' // other
|
|
86
|
-
| 'source-in'
|
|
87
|
-
| 'source-out'
|
|
88
|
-
| 'source-atop'
|
|
89
|
-
| 'destination-over'
|
|
90
|
-
| 'destination-in'
|
|
91
|
-
| 'destination-out'
|
|
92
|
-
| 'destination-atop'
|
|
93
|
-
|
|
94
|
-
export interface ILeafInputData {
|
|
95
|
-
// layer data
|
|
96
|
-
id?: __String
|
|
97
|
-
name?: __String
|
|
98
|
-
className?: __String
|
|
99
|
-
|
|
100
|
-
blendMode?: IBlendMode
|
|
101
|
-
opacity?: __Number
|
|
102
|
-
visible?: __Boolean
|
|
103
|
-
isMask?: __Boolean
|
|
104
|
-
isEraser?: __Boolean
|
|
105
|
-
zIndex?: __Number
|
|
106
|
-
|
|
107
|
-
// layout data
|
|
108
|
-
x?: __Number
|
|
109
|
-
y?: __Number
|
|
110
|
-
width?: __Number
|
|
111
|
-
height?: __Number
|
|
112
|
-
scaleX?: __Number
|
|
113
|
-
scaleY?: __Number
|
|
114
|
-
rotation?: __Number
|
|
115
|
-
skewX?: __Number
|
|
116
|
-
skewY?: __Number
|
|
117
|
-
|
|
118
|
-
draggable?: __Boolean
|
|
119
|
-
|
|
120
|
-
hittable?: __Boolean
|
|
121
|
-
hitFill?: IHitType
|
|
122
|
-
hitStroke?: IHitType
|
|
123
|
-
hitChildren?: __Boolean
|
|
124
|
-
hitSelf?: __Boolean
|
|
125
|
-
}
|
|
126
|
-
export interface ILeafComputedData {
|
|
127
|
-
// layer data
|
|
128
|
-
id?: string
|
|
129
|
-
name?: string
|
|
130
|
-
className?: string
|
|
131
|
-
|
|
132
|
-
blendMode?: IBlendMode
|
|
133
|
-
opacity?: number
|
|
134
|
-
visible?: boolean
|
|
135
|
-
isMask?: boolean
|
|
136
|
-
isEraser?: boolean
|
|
137
|
-
zIndex?: number
|
|
138
|
-
|
|
139
|
-
// layout data
|
|
140
|
-
x?: number
|
|
141
|
-
y?: number
|
|
142
|
-
width?: number
|
|
143
|
-
height?: number
|
|
144
|
-
scaleX?: number
|
|
145
|
-
scaleY?: number
|
|
146
|
-
rotation?: number
|
|
147
|
-
skewX?: number
|
|
148
|
-
skewY?: number
|
|
149
|
-
|
|
150
|
-
draggable?: boolean
|
|
151
|
-
|
|
152
|
-
hittable?: boolean
|
|
153
|
-
hitFill?: IHitType
|
|
154
|
-
hitStroke?: IHitType
|
|
155
|
-
hitChildren?: boolean
|
|
156
|
-
hitSelf?: boolean
|
|
157
|
-
|
|
158
|
-
// other
|
|
159
|
-
__childBranchNumber?: number // 存在子分支的个数
|
|
160
|
-
__complex?: boolean // 外观是否复杂
|
|
161
|
-
__naturalWidth?: number
|
|
162
|
-
__naturalHeight?: number
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
|
|
166
|
-
tag: string
|
|
167
|
-
readonly __tag: string
|
|
168
|
-
readonly innerName: string
|
|
169
|
-
|
|
170
|
-
readonly __DataProcessor: IObject // IDataProcessor
|
|
171
|
-
readonly __LayoutProcessor: IObject // ILeafLayout
|
|
172
|
-
|
|
173
|
-
leafer?: ILeafer
|
|
174
|
-
parent?: ILeaf
|
|
175
|
-
|
|
176
|
-
readonly isApp?: boolean
|
|
177
|
-
isLeafer?: boolean
|
|
178
|
-
isBranch?: boolean
|
|
179
|
-
isBranchLeaf?: boolean
|
|
180
|
-
|
|
181
|
-
__: ILeafData
|
|
182
|
-
__layout: ILeafLayout
|
|
183
|
-
|
|
184
|
-
__local: IMatrixWithBoundsData
|
|
185
|
-
__world: IMatrixWithBoundsData
|
|
186
|
-
__worldOpacity: number
|
|
187
|
-
|
|
188
|
-
readonly worldTransform: IMatrixData
|
|
189
|
-
readonly localTransform: IMatrixData
|
|
190
|
-
|
|
191
|
-
readonly worldBoxBounds: IBoundsData
|
|
192
|
-
readonly worldStrokeBounds: IBoundsData
|
|
193
|
-
readonly worldRenderBounds: IBoundsData
|
|
194
|
-
|
|
195
|
-
readonly worldOpacity: number
|
|
196
|
-
|
|
197
|
-
__renderTime?: number // μs 1000微秒 = 1毫秒
|
|
198
|
-
|
|
199
|
-
__level: number // 图层级别 root(1) -> hight
|
|
200
|
-
__tempNumber?: number // 用于临时运算储存状态
|
|
201
|
-
|
|
202
|
-
__hasMask?: boolean
|
|
203
|
-
__hasEraser?: boolean
|
|
204
|
-
__hitCanvas?: IHitCanvas
|
|
205
|
-
|
|
206
|
-
readonly __onlyHitMask: boolean
|
|
207
|
-
readonly __ignoreHitWorld: boolean
|
|
208
|
-
|
|
209
|
-
__parentWait?: IFunction[]
|
|
210
|
-
__leaferWait?: IFunction[]
|
|
211
|
-
|
|
212
|
-
destroyed: boolean
|
|
213
|
-
|
|
214
|
-
waitParent(item: IFunction): void
|
|
215
|
-
waitLeafer(item: IFunction): void
|
|
216
|
-
|
|
217
|
-
__bindLeafer(leafer: ILeafer | null): void
|
|
218
|
-
|
|
219
|
-
set(data: IObject): void
|
|
220
|
-
get(attrNames?: string[]): IObject
|
|
221
|
-
|
|
222
|
-
// ILeafData ->
|
|
223
|
-
__setAttr(attrName: string, newValue: __Value): void
|
|
224
|
-
__getAttr(attrName: string): __Value
|
|
225
|
-
|
|
226
|
-
forceUpdate(attrName?: string): void
|
|
227
|
-
|
|
228
|
-
// ILeafMatrix ->
|
|
229
|
-
__updateWorldMatrix(): void
|
|
230
|
-
__updateLocalMatrix(): void
|
|
231
|
-
|
|
232
|
-
// ILeafBounds ->
|
|
233
|
-
__updateWorldBounds(): void
|
|
234
|
-
|
|
235
|
-
__updateLocalBoxBounds(): void
|
|
236
|
-
__updateLocalStrokeBounds(): void
|
|
237
|
-
__updateLocalRenderBounds(): void
|
|
238
|
-
|
|
239
|
-
__updateBoxBounds(): void
|
|
240
|
-
__updateStrokeBounds(): void
|
|
241
|
-
__updateRenderBounds(): void
|
|
242
|
-
|
|
243
|
-
__updateStrokeSpread(): number
|
|
244
|
-
__updateRenderSpread(): number
|
|
245
|
-
|
|
246
|
-
__onUpdateSize(): void
|
|
247
|
-
|
|
248
|
-
// IBranchMask ->
|
|
249
|
-
__updateEraser(value?: boolean): void
|
|
250
|
-
__updateMask(value?: boolean): void
|
|
251
|
-
__renderMask(canvas: ILeaferCanvas, content: ILeaferCanvas, mask: ILeaferCanvas): void
|
|
252
|
-
__removeMask(child?: ILeaf): void
|
|
253
|
-
|
|
254
|
-
// convert
|
|
255
|
-
getWorld(attrName: IMatrixDecompositionAttr): number
|
|
256
|
-
getBounds(type: ILayoutBoundsType, locationType?: ILayoutLocationType): IBoundsData
|
|
257
|
-
|
|
258
|
-
worldToLocal(world: IPointData, to?: IPointData, isMovePoint?: boolean): void
|
|
259
|
-
localToWorld(local: IPointData, to?: IPointData, isMovePoint?: boolean): void
|
|
260
|
-
worldToInner(world: IPointData, to?: IPointData, isMovePoint?: boolean): void
|
|
261
|
-
innerToWorld(inner: IPointData, to?: IPointData, isMovePoint?: boolean): void
|
|
262
|
-
|
|
263
|
-
move(x: number, y?: number): void
|
|
264
|
-
scaleOf(origin: IPointData, x: number, y?: number): void
|
|
265
|
-
rotateOf(origin: IPointData, rotation: number): void
|
|
266
|
-
|
|
267
|
-
// ILeafHit ->
|
|
268
|
-
__hitWorld(point: IRadiusPointData): boolean
|
|
269
|
-
__hit(local: IRadiusPointData): boolean
|
|
270
|
-
__drawHitPath(canvas: ILeaferCanvas): void
|
|
271
|
-
__updateHitCanvas(): void
|
|
272
|
-
|
|
273
|
-
// ILeafRender ->
|
|
274
|
-
__render(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
275
|
-
__drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
276
|
-
__draw(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
277
|
-
|
|
278
|
-
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
279
|
-
|
|
280
|
-
__updateWorldOpacity(): void
|
|
281
|
-
__updateChange(): void
|
|
282
|
-
|
|
283
|
-
// path
|
|
284
|
-
__drawPath(canvas: ILeaferCanvas): void
|
|
285
|
-
__drawRenderPath(canvas: ILeaferCanvas): void
|
|
286
|
-
__updatePath(): void
|
|
287
|
-
__updateRenderPath(): void
|
|
288
|
-
|
|
289
|
-
// branch
|
|
290
|
-
children?: ILeaf[]
|
|
291
|
-
|
|
292
|
-
__updateSortChildren(): void
|
|
293
|
-
add(child: ILeaf, index?: number): void
|
|
294
|
-
remove(child?: ILeaf, destroy?: boolean): void
|
|
295
|
-
}
|
package/src/display/IView.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
__updateStrokeSpread?(): number
|
|
17
|
-
__updateRenderSpread?(): number
|
|
18
|
-
|
|
19
|
-
__onUpdateSize?(): void
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
package/src/event/IEvent.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { IEventer } from './IEventer'
|
|
2
|
-
import { IWatchEventData } from '../watcher/IWatcher'
|
|
3
|
-
import { ILayoutBlockData } from '../layouter/ILayouter'
|
|
4
|
-
import { ILeaf } from '../display/ILeaf'
|
|
5
|
-
import { IScreenSizeData, IPointData } from '../math/IMath'
|
|
6
|
-
|
|
7
|
-
export interface IEvent {
|
|
8
|
-
type?: string
|
|
9
|
-
target?: IEventTarget
|
|
10
|
-
current?: IEventTarget
|
|
11
|
-
|
|
12
|
-
bubbles?: boolean
|
|
13
|
-
phase?: number
|
|
14
|
-
|
|
15
|
-
isStopDefault?: boolean
|
|
16
|
-
isStop?: boolean
|
|
17
|
-
isStopNow?: boolean
|
|
18
|
-
stopDefault?(): void
|
|
19
|
-
stopNow?(): void
|
|
20
|
-
stop?(): void
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface IEventTarget extends IEventer {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ILeaferEvent {
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface IRenderEvent {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IAnimateEvent {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IChildEvent extends IEvent {
|
|
40
|
-
parent?: ILeaf
|
|
41
|
-
child?: ILeaf
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface IResizeEvent extends IEvent {
|
|
45
|
-
readonly width: number
|
|
46
|
-
readonly height: number
|
|
47
|
-
readonly pixelRatio: number
|
|
48
|
-
|
|
49
|
-
readonly bigger: boolean
|
|
50
|
-
readonly smaller: boolean
|
|
51
|
-
readonly samePixelRatio: boolean
|
|
52
|
-
readonly old: IScreenSizeData
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface IResizeEventListener {
|
|
56
|
-
(event: IResizeEvent): void
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface IUpdateEvent extends IEvent {
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface IPropertyEvent extends IEvent {
|
|
64
|
-
readonly attrName: string
|
|
65
|
-
readonly oldValue: unknown
|
|
66
|
-
readonly newValue: unknown
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface ILayoutEvent extends IEvent {
|
|
70
|
-
readonly data: ILayoutBlockData[]
|
|
71
|
-
readonly times: number
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface IWatchEvent extends IEvent {
|
|
75
|
-
readonly data: IWatchEventData
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface ITransformEventData {
|
|
79
|
-
x: number
|
|
80
|
-
y: number
|
|
81
|
-
scaleX: number
|
|
82
|
-
scaleY: number
|
|
83
|
-
rotation: number
|
|
84
|
-
|
|
85
|
-
readonly zooming: boolean
|
|
86
|
-
readonly moving: boolean
|
|
87
|
-
readonly rotating: boolean
|
|
88
|
-
readonly changing: boolean
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface ITransformEvent extends IEvent, ITransformEventData {
|
|
92
|
-
readonly x: number
|
|
93
|
-
readonly y: number
|
|
94
|
-
readonly scaleX: number
|
|
95
|
-
readonly scaleY: number
|
|
96
|
-
readonly rotation: number
|
|
97
|
-
}
|
|
98
|
-
export type TransformMode = 'move' | 'zoom' | 'rotate'
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export interface IMultiTouchData {
|
|
102
|
-
move: IPointData,
|
|
103
|
-
scale: number,
|
|
104
|
-
angle: number,
|
|
105
|
-
center: IPointData
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface IKeepTouchData {
|
|
109
|
-
from: IPointData
|
|
110
|
-
to: IPointData
|
|
111
|
-
}
|
package/src/event/IEventer.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IEvent, IFunction, IObject } from '@leafer/interface'
|
|
2
|
-
import { ILeafEventer } from '../display/module/ILeafEventer'
|
|
3
|
-
|
|
4
|
-
export type IEventListener = IFunction
|
|
5
|
-
|
|
6
|
-
export interface IEventListenerOptions {
|
|
7
|
-
capture?: boolean
|
|
8
|
-
once?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface IEventListenerItem extends IEventListenerOptions {
|
|
12
|
-
listener: IEventListener
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IEventListenerMap {
|
|
16
|
-
[name: string]: IEventListenerItem[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface IEventListenerId {
|
|
20
|
-
type: string | string[]
|
|
21
|
-
listener: IEventListener
|
|
22
|
-
options?: IEventListenerOptions | boolean
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type InnerId = number
|
|
26
|
-
|
|
27
|
-
export interface IEventer extends ILeafEventer {
|
|
28
|
-
|
|
29
|
-
readonly innerId: InnerId
|
|
30
|
-
__captureMap?: IEventListenerMap
|
|
31
|
-
__bubbleMap?: IEventListenerMap
|
|
32
|
-
|
|
33
|
-
on(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void
|
|
34
|
-
off(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void
|
|
35
|
-
on_(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventListenerOptions | boolean): IEventListenerId
|
|
36
|
-
off_(id: IEventListenerId | IEventListenerId[]): void
|
|
37
|
-
once(type: string | string[], listener: IEventListener): void
|
|
38
|
-
emit(type: string, event?: IEvent | IObject, capture?: boolean): void
|
|
39
|
-
emitEvent(event?: IEvent, capture?: boolean): void
|
|
40
|
-
hasEvent(type: string, capture?: boolean): boolean
|
|
41
|
-
|
|
42
|
-
destroy(): void
|
|
43
|
-
}
|