@leafer/interface 1.0.0-rc.3 → 1.0.0-rc.5
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 +1 -1
- package/src/app/ILeafer.ts +5 -2
- package/src/display/ILeaf.ts +5 -2
- package/src/display/IView.ts +1 -4
- package/src/event/IEvent.ts +3 -23
- package/src/event/IUIEvent.ts +6 -8
- package/src/image/IImageManager.ts +3 -0
- package/src/index.ts +1 -1
- package/src/interaction/IInteraction.ts +6 -0
- package/src/layout/ILeafLayout.ts +3 -5
- package/src/math/IMath.ts +1 -1
- package/src/platform/IPlatform.ts +5 -0
- package/src/renderer/IRenderer.ts +1 -0
- package/src/selector/ISelector.ts +2 -0
- package/types/index.d.ts +33 -39
package/package.json
CHANGED
package/src/app/ILeafer.ts
CHANGED
|
@@ -5,7 +5,7 @@ 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, IPointData, IScreenSizeData } from '../math/IMath'
|
|
9
9
|
import { ICanvasManager } from '../canvas/ICanvasManager'
|
|
10
10
|
import { IHitCanvasManager } from '../canvas/IHitCanvasManager'
|
|
11
11
|
import { IEventListenerId } from '../event/IEventer'
|
|
@@ -56,11 +56,14 @@ export interface ILeafer extends IZoomView, IControl {
|
|
|
56
56
|
|
|
57
57
|
config: ILeaferConfig
|
|
58
58
|
|
|
59
|
+
readonly cursorPoint: IPointData
|
|
60
|
+
leafs: number
|
|
61
|
+
|
|
59
62
|
__eventIds: IEventListenerId[]
|
|
60
63
|
__nextRenderWait: IFunction[]
|
|
61
64
|
|
|
62
65
|
init(userConfig?: ILeaferConfig, parentApp?: IApp): void
|
|
63
|
-
setZoomLayer(zoomLayer: ILeaf
|
|
66
|
+
setZoomLayer(zoomLayer: ILeaf): void
|
|
64
67
|
forceFullRender(): void
|
|
65
68
|
updateCursor(): void
|
|
66
69
|
resize(size: IScreenSizeData): void
|
package/src/display/ILeaf.ts
CHANGED
|
@@ -96,6 +96,7 @@ export type IBlendMode =
|
|
|
96
96
|
| 'destination-in'
|
|
97
97
|
| 'destination-out'
|
|
98
98
|
| 'destination-atop'
|
|
99
|
+
| 'xor'
|
|
99
100
|
|
|
100
101
|
export type IResizeType = 'size' | 'scale'
|
|
101
102
|
export interface IImageCursor {
|
|
@@ -108,6 +109,7 @@ export type IAround = 'center' | IPointData
|
|
|
108
109
|
|
|
109
110
|
export type ICursorType =
|
|
110
111
|
| IImageCursor
|
|
112
|
+
| ''
|
|
111
113
|
| 'auto'
|
|
112
114
|
| 'default'
|
|
113
115
|
| 'none'
|
|
@@ -268,8 +270,6 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
268
270
|
|
|
269
271
|
readonly worldOpacity: number
|
|
270
272
|
|
|
271
|
-
__renderTime?: number // μs 1000微秒 = 1毫秒
|
|
272
|
-
|
|
273
273
|
__level: number // 图层级别 root(1) -> hight
|
|
274
274
|
__tempNumber?: number // 用于临时运算储存状态
|
|
275
275
|
|
|
@@ -289,6 +289,9 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
|
|
|
289
289
|
|
|
290
290
|
destroyed: boolean
|
|
291
291
|
|
|
292
|
+
reset(data?: ILeafInputData): void
|
|
293
|
+
resetCustom(): void
|
|
294
|
+
|
|
292
295
|
waitParent(item: IFunction): void
|
|
293
296
|
waitLeafer(item: IFunction): void
|
|
294
297
|
nextRender(item: IFunction): void
|
package/src/display/IView.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { IBranch } from './IBranch'
|
|
2
2
|
import { ILeaf } from './ILeaf'
|
|
3
|
-
import { ITransformEventData } from '../event/IEvent'
|
|
4
3
|
|
|
5
4
|
export interface IZoomView extends IBranch {
|
|
6
5
|
zoomLayer?: ILeaf
|
|
7
|
-
|
|
8
|
-
transformData?: ITransformEventData
|
|
9
|
-
setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void
|
|
6
|
+
setZoomLayer(zoomLayer: ILeaf): void
|
|
10
7
|
}
|
package/src/event/IEvent.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { IWatchEventData } from '../watcher/IWatcher'
|
|
|
3
3
|
import { ILayoutBlockData } from '../layouter/ILayouter'
|
|
4
4
|
import { ILeaf } from '../display/ILeaf'
|
|
5
5
|
import { IScreenSizeData, IPointData } from '../math/IMath'
|
|
6
|
+
import { IObject } from '../data/IData'
|
|
6
7
|
|
|
7
8
|
export interface IEvent {
|
|
9
|
+
origin?: IObject
|
|
10
|
+
|
|
8
11
|
type?: string
|
|
9
12
|
target?: IEventTarget
|
|
10
13
|
current?: IEventTarget
|
|
@@ -75,29 +78,6 @@ export interface IWatchEvent extends IEvent {
|
|
|
75
78
|
readonly data: IWatchEventData
|
|
76
79
|
}
|
|
77
80
|
|
|
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
81
|
export interface IMultiTouchData {
|
|
102
82
|
move: IPointData,
|
|
103
83
|
scale: number,
|
package/src/event/IUIEvent.ts
CHANGED
|
@@ -23,10 +23,8 @@ export interface IUIEvent extends IEvent {
|
|
|
23
23
|
path?: ILeafList
|
|
24
24
|
throughPath?: ILeafList // 穿透path,不受层级影响,从上到下只要碰撞到区域就算,一般点击的时候
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
getInner?(target?: ILeaf): IPointData
|
|
29
|
-
getLocal?(target?: ILeaf): IPointData
|
|
26
|
+
getInner?(relative?: ILeaf): IPointData
|
|
27
|
+
getLocal?(relative?: ILeaf): IPointData
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
|
|
@@ -48,10 +46,10 @@ export interface IDragEvent extends IPointerEvent {
|
|
|
48
46
|
totalX?: number
|
|
49
47
|
totalY?: number
|
|
50
48
|
|
|
51
|
-
getInnerMove?(
|
|
52
|
-
getLocalMove?(
|
|
53
|
-
getInnerTotal?(
|
|
54
|
-
getLocalTotal?(
|
|
49
|
+
getInnerMove?(relative?: ILeaf): IPointData
|
|
50
|
+
getLocalMove?(relative?: ILeaf): IPointData
|
|
51
|
+
getInnerTotal?(relative?: ILeaf): IPointData
|
|
52
|
+
getLocalTotal?(relative?: ILeaf): IPointData
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
export interface IDropEvent extends IPointerEvent {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ILeaferImage, ILeaferImageConfig } from './ILeaferImage'
|
|
2
2
|
import { ITaskProcessor } from '../task/ITaskProcessor'
|
|
3
|
+
import { IExportFileType } from '../file/IFileType'
|
|
3
4
|
|
|
4
5
|
interface ILeaferImageMap {
|
|
5
6
|
[name: string]: ILeaferImage
|
|
@@ -14,5 +15,7 @@ export interface IImageManager {
|
|
|
14
15
|
get(config: ILeaferImageConfig): ILeaferImage
|
|
15
16
|
recycle(image: ILeaferImage): void
|
|
16
17
|
clearRecycled(): void
|
|
18
|
+
isPixel(config: ILeaferImageConfig): boolean // png / svg / webp
|
|
19
|
+
isFormat(format: IExportFileType, config: ILeaferImageConfig): boolean
|
|
17
20
|
destroy(): void
|
|
18
21
|
}
|
package/src/index.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { ILeaferImage, ILeaferImageConfig, ILeaferImageOnLoaded, ILeaferImageOnE
|
|
|
44
44
|
export { IExportFileType, IExportImageType } from './file/IFileType'
|
|
45
45
|
|
|
46
46
|
export { InnerId, IEventer, IEventListener, IEventListenerOptions, IEventListenerMap, IEventListenerItem, IEventListenerId } from './event/IEventer'
|
|
47
|
-
export { IEventTarget, IEvent, ILeaferEvent, IPropertyEvent, ILayoutEvent, IRenderEvent, IAnimateEvent, IChildEvent, IResizeEvent, IResizeEventListener, IUpdateEvent, IWatchEvent,
|
|
47
|
+
export { IEventTarget, IEvent, ILeaferEvent, IPropertyEvent, ILayoutEvent, IRenderEvent, IAnimateEvent, IChildEvent, IResizeEvent, IResizeEventListener, IUpdateEvent, IWatchEvent, IMultiTouchData, IKeepTouchData } from './event/IEvent'
|
|
48
48
|
export { IUIEvent, IPointerEvent, PointerType, IDragEvent, IDropEvent, ISwipeEvent, IMoveEvent, IZoomEvent, IRotateEvent, IKeyEvent, IImageEvent } from './event/IUIEvent'
|
|
49
49
|
export { IInteraction, IInteractionCanvas, IInteractionConfig, IWheelConfig, IPointerConfig } from './interaction/IInteraction'
|
|
50
50
|
|
|
@@ -48,6 +48,7 @@ export interface IInteraction extends IControl {
|
|
|
48
48
|
keyUp(data: IKeyEvent): void
|
|
49
49
|
|
|
50
50
|
findPath(data: IPointerEvent, options?: ISelectPathOptions): ILeafList
|
|
51
|
+
isDrag(leaf: ILeaf): boolean
|
|
51
52
|
|
|
52
53
|
updateDownData(data?: IPointerEvent): void
|
|
53
54
|
updateHoverData(data: IPointerEvent): void
|
|
@@ -63,6 +64,7 @@ export interface IInteractionCanvas extends ILeaferCanvas {
|
|
|
63
64
|
export interface IInteractionConfig {
|
|
64
65
|
wheel?: IWheelConfig
|
|
65
66
|
pointer?: IPointerConfig
|
|
67
|
+
cursor?: ICursorConfig
|
|
66
68
|
zoom?: IZoomConfig
|
|
67
69
|
move?: IMoveConfig
|
|
68
70
|
eventer?: IObject
|
|
@@ -103,4 +105,8 @@ export interface IPointerConfig {
|
|
|
103
105
|
swipeDistance?: number
|
|
104
106
|
ignoreMove?: boolean // 性能优化字段, 控制move事件触发次数
|
|
105
107
|
preventDefault?: boolean
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ICursorConfig {
|
|
111
|
+
stop?: boolean
|
|
106
112
|
}
|
|
@@ -8,7 +8,7 @@ export interface ILeafLayout {
|
|
|
8
8
|
|
|
9
9
|
leaf: ILeaf
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
proxyZoom: boolean
|
|
12
12
|
|
|
13
13
|
// inner
|
|
14
14
|
|
|
@@ -30,10 +30,8 @@ export interface ILeafLayout {
|
|
|
30
30
|
|
|
31
31
|
// matrix changed
|
|
32
32
|
matrixChanged: boolean // include positionChanged scaleChanged skewChanged
|
|
33
|
-
positionChanged: boolean // x, y
|
|
34
|
-
originChanged?: boolean // originX originY
|
|
35
33
|
scaleChanged: boolean // scaleX scaleY
|
|
36
|
-
rotationChanged: boolean // rotaiton, skewX
|
|
34
|
+
rotationChanged: boolean // rotaiton, skewX skewY 数据更新
|
|
37
35
|
|
|
38
36
|
// bounds changed
|
|
39
37
|
boundsChanged: boolean
|
|
@@ -80,9 +78,9 @@ export interface ILeafLayout {
|
|
|
80
78
|
renderChange(): void
|
|
81
79
|
|
|
82
80
|
// matrix
|
|
83
|
-
positionChange(): void
|
|
84
81
|
scaleChange(): void
|
|
85
82
|
rotationChange(): void
|
|
83
|
+
matrixChange(): void
|
|
86
84
|
|
|
87
85
|
// face
|
|
88
86
|
surfaceChange(): void
|
package/src/math/IMath.ts
CHANGED
|
@@ -60,7 +60,7 @@ export interface IBounds extends IBoundsData {
|
|
|
60
60
|
toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds
|
|
61
61
|
getFitMatrix(put: IBoundsData): IMatrix
|
|
62
62
|
|
|
63
|
-
spread(
|
|
63
|
+
spread(spreadX: number, spreadY?: number): IBounds
|
|
64
64
|
ceil(): IBounds
|
|
65
65
|
unsign(): IBounds
|
|
66
66
|
|
|
@@ -28,6 +28,11 @@ export interface IPlatform {
|
|
|
28
28
|
loadImage(url: string): Promise<any>
|
|
29
29
|
noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
|
|
30
30
|
},
|
|
31
|
+
event?: {
|
|
32
|
+
stopDefault(origin: IObject): void
|
|
33
|
+
stopNow(origin: IObject): void
|
|
34
|
+
stop(origin: IObject): void
|
|
35
|
+
},
|
|
31
36
|
miniapp?: IMiniapp
|
|
32
37
|
imageSuffix?: string // 需要带上后缀区分dom中image标签的缓存,否则会导致浏览器缓存跨域问题
|
|
33
38
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -135,7 +135,7 @@ interface IBounds extends IBoundsData {
|
|
|
135
135
|
scale(scaleX: number, scaleY?: number): IBounds;
|
|
136
136
|
toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds;
|
|
137
137
|
getFitMatrix(put: IBoundsData): IMatrix;
|
|
138
|
-
spread(
|
|
138
|
+
spread(spreadX: number, spreadY?: number): IBounds;
|
|
139
139
|
ceil(): IBounds;
|
|
140
140
|
unsign(): IBounds;
|
|
141
141
|
add(bounds: IBoundsData): IBounds;
|
|
@@ -269,6 +269,7 @@ interface ILayouter extends IControl {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
interface IEvent {
|
|
272
|
+
origin?: IObject;
|
|
272
273
|
type?: string;
|
|
273
274
|
target?: IEventTarget;
|
|
274
275
|
current?: IEventTarget;
|
|
@@ -319,25 +320,6 @@ interface ILayoutEvent extends IEvent {
|
|
|
319
320
|
interface IWatchEvent extends IEvent {
|
|
320
321
|
readonly data: IWatchEventData;
|
|
321
322
|
}
|
|
322
|
-
interface ITransformEventData {
|
|
323
|
-
x: number;
|
|
324
|
-
y: number;
|
|
325
|
-
scaleX: number;
|
|
326
|
-
scaleY: number;
|
|
327
|
-
rotation: number;
|
|
328
|
-
readonly zooming: boolean;
|
|
329
|
-
readonly moving: boolean;
|
|
330
|
-
readonly rotating: boolean;
|
|
331
|
-
readonly changing: boolean;
|
|
332
|
-
}
|
|
333
|
-
interface ITransformEvent extends IEvent, ITransformEventData {
|
|
334
|
-
readonly x: number;
|
|
335
|
-
readonly y: number;
|
|
336
|
-
readonly scaleX: number;
|
|
337
|
-
readonly scaleY: number;
|
|
338
|
-
readonly rotation: number;
|
|
339
|
-
}
|
|
340
|
-
type TransformMode = 'move' | 'zoom' | 'rotate';
|
|
341
323
|
interface IMultiTouchData {
|
|
342
324
|
move: IPointData;
|
|
343
325
|
scale: number;
|
|
@@ -886,6 +868,7 @@ interface IPointDataFunction {
|
|
|
886
868
|
}
|
|
887
869
|
|
|
888
870
|
interface IRenderOptions {
|
|
871
|
+
includes?: boolean;
|
|
889
872
|
bounds?: IBounds;
|
|
890
873
|
hideBounds?: IBounds;
|
|
891
874
|
matrix?: IMatrix;
|
|
@@ -953,7 +936,7 @@ type ILayoutLocationType = 'world' | 'local' | 'inner';
|
|
|
953
936
|
type ILayoutBoundsType = 'content' | 'box' | 'stroke' | 'margin' | 'render';
|
|
954
937
|
interface ILeafLayout {
|
|
955
938
|
leaf: ILeaf;
|
|
956
|
-
|
|
939
|
+
proxyZoom: boolean;
|
|
957
940
|
boxBounds: IBoundsData;
|
|
958
941
|
strokeBounds: IBoundsData;
|
|
959
942
|
renderBounds: IBoundsData;
|
|
@@ -962,8 +945,6 @@ interface ILeafLayout {
|
|
|
962
945
|
localStrokeBounds: IBoundsData;
|
|
963
946
|
localRenderBounds: IBoundsData;
|
|
964
947
|
matrixChanged: boolean;
|
|
965
|
-
positionChanged: boolean;
|
|
966
|
-
originChanged?: boolean;
|
|
967
948
|
scaleChanged: boolean;
|
|
968
949
|
rotationChanged: boolean;
|
|
969
950
|
boundsChanged: boolean;
|
|
@@ -993,9 +974,9 @@ interface ILeafLayout {
|
|
|
993
974
|
localBoxChange(): void;
|
|
994
975
|
strokeChange(): void;
|
|
995
976
|
renderChange(): void;
|
|
996
|
-
positionChange(): void;
|
|
997
977
|
scaleChange(): void;
|
|
998
978
|
rotationChange(): void;
|
|
979
|
+
matrixChange(): void;
|
|
999
980
|
surfaceChange(): void;
|
|
1000
981
|
opacityChange(): void;
|
|
1001
982
|
childrenSortChange(): void;
|
|
@@ -1082,7 +1063,7 @@ interface ILeafAttrData {
|
|
|
1082
1063
|
cursor: ICursorType | ICursorType[];
|
|
1083
1064
|
}
|
|
1084
1065
|
type IHitType = 'path' | 'pixel' | 'all' | 'none';
|
|
1085
|
-
type IBlendMode = 'pass-through' | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop';
|
|
1066
|
+
type IBlendMode = 'pass-through' | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'xor';
|
|
1086
1067
|
type IResizeType = 'size' | 'scale';
|
|
1087
1068
|
interface IImageCursor {
|
|
1088
1069
|
url: string;
|
|
@@ -1090,7 +1071,7 @@ interface IImageCursor {
|
|
|
1090
1071
|
y?: number;
|
|
1091
1072
|
}
|
|
1092
1073
|
type IAround = 'center' | IPointData;
|
|
1093
|
-
type ICursorType = IImageCursor | 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom -in' | 'zoom-out';
|
|
1074
|
+
type ICursorType = IImageCursor | '' | 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom -in' | 'zoom-out';
|
|
1094
1075
|
interface ICursorTypeMap {
|
|
1095
1076
|
[name: string]: ICursorType | ICursorType[];
|
|
1096
1077
|
}
|
|
@@ -1183,7 +1164,6 @@ interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatr
|
|
|
1183
1164
|
readonly worldStrokeBounds: IBoundsData;
|
|
1184
1165
|
readonly worldRenderBounds: IBoundsData;
|
|
1185
1166
|
readonly worldOpacity: number;
|
|
1186
|
-
__renderTime?: number;
|
|
1187
1167
|
__level: number;
|
|
1188
1168
|
__tempNumber?: number;
|
|
1189
1169
|
readonly resizeable: boolean;
|
|
@@ -1196,6 +1176,8 @@ interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, ILeafMatr
|
|
|
1196
1176
|
__parentWait?: IFunction[];
|
|
1197
1177
|
__leaferWait?: IFunction[];
|
|
1198
1178
|
destroyed: boolean;
|
|
1179
|
+
reset(data?: ILeafInputData): void;
|
|
1180
|
+
resetCustom(): void;
|
|
1199
1181
|
waitParent(item: IFunction): void;
|
|
1200
1182
|
waitLeafer(item: IFunction): void;
|
|
1201
1183
|
nextRender(item: IFunction): void;
|
|
@@ -1274,6 +1256,7 @@ interface ISelectorConfig {
|
|
|
1274
1256
|
}
|
|
1275
1257
|
interface ISelector {
|
|
1276
1258
|
target: ILeaf;
|
|
1259
|
+
list: ILeafList;
|
|
1277
1260
|
config: ISelectorConfig;
|
|
1278
1261
|
getByPoint(hitPoint: IPointData, hitRadius: number, options?: ISelectPathOptions): ISelectPathResult;
|
|
1279
1262
|
find(name: number | string, branch?: ILeaf): ILeaf | ILeaf[];
|
|
@@ -1331,9 +1314,8 @@ interface IUIEvent extends IEvent {
|
|
|
1331
1314
|
buttons?: number;
|
|
1332
1315
|
path?: ILeafList;
|
|
1333
1316
|
throughPath?: ILeafList;
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
getLocal?(target?: ILeaf): IPointData;
|
|
1317
|
+
getInner?(relative?: ILeaf): IPointData;
|
|
1318
|
+
getLocal?(relative?: ILeaf): IPointData;
|
|
1337
1319
|
}
|
|
1338
1320
|
interface IPointerEvent extends IUIEvent {
|
|
1339
1321
|
width?: number;
|
|
@@ -1351,10 +1333,10 @@ interface IDragEvent extends IPointerEvent {
|
|
|
1351
1333
|
moveY: number;
|
|
1352
1334
|
totalX?: number;
|
|
1353
1335
|
totalY?: number;
|
|
1354
|
-
getInnerMove?(
|
|
1355
|
-
getLocalMove?(
|
|
1356
|
-
getInnerTotal?(
|
|
1357
|
-
getLocalTotal?(
|
|
1336
|
+
getInnerMove?(relative?: ILeaf): IPointData;
|
|
1337
|
+
getLocalMove?(relative?: ILeaf): IPointData;
|
|
1338
|
+
getInnerTotal?(relative?: ILeaf): IPointData;
|
|
1339
|
+
getLocalTotal?(relative?: ILeaf): IPointData;
|
|
1358
1340
|
}
|
|
1359
1341
|
interface IDropEvent extends IPointerEvent {
|
|
1360
1342
|
list: ILeafList;
|
|
@@ -1408,6 +1390,7 @@ interface IInteraction extends IControl {
|
|
|
1408
1390
|
keyDown(data: IKeyEvent): void;
|
|
1409
1391
|
keyUp(data: IKeyEvent): void;
|
|
1410
1392
|
findPath(data: IPointerEvent, options?: ISelectPathOptions): ILeafList;
|
|
1393
|
+
isDrag(leaf: ILeaf): boolean;
|
|
1411
1394
|
updateDownData(data?: IPointerEvent): void;
|
|
1412
1395
|
updateHoverData(data: IPointerEvent): void;
|
|
1413
1396
|
updateCursor(hoverData?: IPointerEvent): void;
|
|
@@ -1418,6 +1401,7 @@ interface IInteractionCanvas extends ILeaferCanvas {
|
|
|
1418
1401
|
interface IInteractionConfig {
|
|
1419
1402
|
wheel?: IWheelConfig;
|
|
1420
1403
|
pointer?: IPointerConfig;
|
|
1404
|
+
cursor?: ICursorConfig;
|
|
1421
1405
|
zoom?: IZoomConfig;
|
|
1422
1406
|
move?: IMoveConfig;
|
|
1423
1407
|
eventer?: IObject;
|
|
@@ -1455,6 +1439,9 @@ interface IPointerConfig {
|
|
|
1455
1439
|
ignoreMove?: boolean;
|
|
1456
1440
|
preventDefault?: boolean;
|
|
1457
1441
|
}
|
|
1442
|
+
interface ICursorConfig {
|
|
1443
|
+
stop?: boolean;
|
|
1444
|
+
}
|
|
1458
1445
|
|
|
1459
1446
|
interface IHitCanvasManager extends ICanvasManager {
|
|
1460
1447
|
getPathType(leaf: ILeaf): IHitCanvas;
|
|
@@ -1470,9 +1457,7 @@ interface IBranch extends ILeaf {
|
|
|
1470
1457
|
|
|
1471
1458
|
interface IZoomView extends IBranch {
|
|
1472
1459
|
zoomLayer?: ILeaf;
|
|
1473
|
-
|
|
1474
|
-
transformData?: ITransformEventData;
|
|
1475
|
-
setZoomLayer(zoomLayer: ILeaf, moveLayer?: ILeaf): void;
|
|
1460
|
+
setZoomLayer(zoomLayer: ILeaf): void;
|
|
1476
1461
|
}
|
|
1477
1462
|
|
|
1478
1463
|
type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'user';
|
|
@@ -1502,10 +1487,12 @@ interface ILeafer extends IZoomView, IControl {
|
|
|
1502
1487
|
hitCanvasManager?: IHitCanvasManager;
|
|
1503
1488
|
autoLayout?: IAutoBounds;
|
|
1504
1489
|
config: ILeaferConfig;
|
|
1490
|
+
readonly cursorPoint: IPointData;
|
|
1491
|
+
leafs: number;
|
|
1505
1492
|
__eventIds: IEventListenerId[];
|
|
1506
1493
|
__nextRenderWait: IFunction[];
|
|
1507
1494
|
init(userConfig?: ILeaferConfig, parentApp?: IApp): void;
|
|
1508
|
-
setZoomLayer(zoomLayer: ILeaf
|
|
1495
|
+
setZoomLayer(zoomLayer: ILeaf): void;
|
|
1509
1496
|
forceFullRender(): void;
|
|
1510
1497
|
updateCursor(): void;
|
|
1511
1498
|
resize(size: IScreenSizeData): void;
|
|
@@ -1601,6 +1588,8 @@ interface IImageManager {
|
|
|
1601
1588
|
get(config: ILeaferImageConfig): ILeaferImage;
|
|
1602
1589
|
recycle(image: ILeaferImage): void;
|
|
1603
1590
|
clearRecycled(): void;
|
|
1591
|
+
isPixel(config: ILeaferImageConfig): boolean;
|
|
1592
|
+
isFormat(format: IExportFileType, config: ILeaferImageConfig): boolean;
|
|
1604
1593
|
destroy(): void;
|
|
1605
1594
|
}
|
|
1606
1595
|
|
|
@@ -1627,6 +1616,11 @@ interface IPlatform {
|
|
|
1627
1616
|
loadImage(url: string): Promise<any>;
|
|
1628
1617
|
noRepeat?: string;
|
|
1629
1618
|
};
|
|
1619
|
+
event?: {
|
|
1620
|
+
stopDefault(origin: IObject): void;
|
|
1621
|
+
stopNow(origin: IObject): void;
|
|
1622
|
+
stop(origin: IObject): void;
|
|
1623
|
+
};
|
|
1630
1624
|
miniapp?: IMiniapp;
|
|
1631
1625
|
imageSuffix?: string;
|
|
1632
1626
|
}
|
|
@@ -1669,4 +1663,4 @@ interface ISkiaCanvasExportConfig {
|
|
|
1669
1663
|
outline?: boolean;
|
|
1670
1664
|
}
|
|
1671
1665
|
|
|
1672
|
-
export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAnimateEvent, IApp, IAround, IAutoBounds, IAutoBoundsData, IBlendMode, IBlob, IBlobFunction, IBooleanMap, IBounds, IBoundsData, IBoundsDataHandle, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasContext2D, ICanvasManager, ICanvasStrokeOptions, ICanvasType, IChildEvent, IControl, ICreator, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDragEvent, IDropEvent, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IFunction, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IKeepTouchData, IKeyEvent, ILayoutBlockData, ILayoutBoundsType, ILayoutChangedData, ILayoutEvent, ILayoutLocationType, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMask, ILeafMaskModule, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeafer, ILeaferCanvas, ILeaferCanvasConfig, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, IMatrix, IMatrixData, IMatrixDecompositionAttr, IMatrixDecompositionData, IMatrixWithBoundsData, IMatrixWithLayoutData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumberMap, IObject, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPlatform, IPlugin, IPoint, IPointData, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResizeType, IRotateEvent, IScreenSizeData, ISelectPathOptions, ISelectPathResult, ISelector, ISelectorConfig, ISize, ISizeData, ISkiaCanvas, ISkiaCanvasExportConfig, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer,
|
|
1666
|
+
export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAnimateEvent, IApp, IAround, IAutoBounds, IAutoBoundsData, IBlendMode, IBlob, IBlobFunction, IBooleanMap, IBounds, IBoundsData, IBoundsDataHandle, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasContext2D, ICanvasManager, ICanvasStrokeOptions, ICanvasType, IChildEvent, IControl, ICreator, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDragEvent, IDropEvent, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IFunction, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IKeepTouchData, IKeyEvent, ILayoutBlockData, ILayoutBoundsType, ILayoutChangedData, ILayoutEvent, ILayoutLocationType, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMask, ILeafMaskModule, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeafer, ILeaferCanvas, ILeaferCanvasConfig, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, IMatrix, IMatrixData, IMatrixDecompositionAttr, IMatrixDecompositionData, IMatrixWithBoundsData, IMatrixWithLayoutData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumberMap, IObject, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPlatform, IPlugin, IPoint, IPointData, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResizeType, IRotateEvent, IScreenSizeData, ISelectPathOptions, ISelectPathResult, ISelector, ISelectorConfig, ISize, ISizeData, ISkiaCanvas, ISkiaCanvasExportConfig, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBounds, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData, __Boolean, __Number, __Object, __String, __Value };
|