@leafer/interface 1.0.0-rc.19 → 1.0.0-rc.20
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/canvas/ICanvas.ts +5 -2
- package/src/canvas/IHitCanvasManager.ts +3 -3
- package/src/canvas/ILeaferCanvas.ts +6 -3
- package/src/display/ILeaf.ts +17 -5
- package/src/display/module/ILeafDataProxy.ts +1 -1
- package/src/display/module/ILeafHit.ts +2 -1
- package/src/display/module/ILeafRender.ts +1 -1
- package/src/event/IUIEvent.ts +1 -0
- package/src/image/IImageManager.ts +1 -0
- package/src/index.ts +2 -2
- package/src/interaction/IInteraction.ts +5 -1
- package/src/layout/ILeafLayout.ts +1 -1
- package/src/math/IMath.ts +6 -2
- package/src/path/IPathDrawer.ts +3 -1
- package/src/platform/IPlatform.ts +2 -0
- package/types/index.d.ts +48 -16
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, IBoundsData, IPointData, IScreenSizeData } from '../math/IMath'
|
|
8
|
+
import { IAutoBounds, IBoundsData, IPointData, IScreenSizeData, IBounds } from '../math/IMath'
|
|
9
9
|
import { ICanvasManager } from '../canvas/ICanvasManager'
|
|
10
10
|
import { IHitCanvasManager } from '../canvas/IHitCanvasManager'
|
|
11
11
|
import { IEventListenerId } from '../event/IEventer'
|
|
@@ -22,6 +22,7 @@ export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IIn
|
|
|
22
22
|
start?: boolean
|
|
23
23
|
type?: ILeaferType
|
|
24
24
|
realCanvas?: boolean
|
|
25
|
+
lazySpeard?: IFourNumber
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface ILeaferAttrData {
|
|
@@ -50,6 +51,7 @@ export interface ILeaferAttrData {
|
|
|
50
51
|
hitCanvasManager?: IHitCanvasManager
|
|
51
52
|
|
|
52
53
|
autoLayout?: IAutoBounds
|
|
54
|
+
lazyBounds: IBounds
|
|
53
55
|
|
|
54
56
|
config: ILeaferConfig
|
|
55
57
|
|
|
@@ -77,7 +79,8 @@ export interface ILeaferAttrData {
|
|
|
77
79
|
waitViewCompleted(item: IFunction, bind?: IObject): void
|
|
78
80
|
|
|
79
81
|
zoom(zoomType: IZoomType, padding?: IFourNumber, fixedScale?: boolean): IBoundsData
|
|
80
|
-
|
|
82
|
+
getValidMove(moveX: number, moveY: number): IPointData
|
|
83
|
+
getValidScale(changeScale: number): number
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
export type IZoomType = 'in' | 'out' | 'fit' | 'fit-width' | 'fit-height' | number | ILeaf | ILeaf[] | IBoundsData
|
package/src/canvas/ICanvas.ts
CHANGED
|
@@ -125,15 +125,18 @@ interface CanvasRect {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
type PredefinedColorSpace = 'display-p3' | 'srgb'
|
|
128
|
-
interface
|
|
128
|
+
interface ICanvasRenderingContext2DSettings {
|
|
129
129
|
alpha?: boolean
|
|
130
130
|
colorSpace?: PredefinedColorSpace
|
|
131
131
|
desynchronized?: boolean
|
|
132
132
|
willReadFrequently?: boolean
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
export type ICanvasContext2DSettings = ICanvasRenderingContext2DSettings
|
|
136
|
+
|
|
134
137
|
export interface ICanvasContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
|
|
135
138
|
readonly canvas: HTMLCanvasElement
|
|
136
|
-
getContextAttributes():
|
|
139
|
+
getContextAttributes(): ICanvasRenderingContext2DSettings
|
|
137
140
|
}
|
|
138
141
|
|
|
139
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
|
-
|
|
8
|
+
getPixelType(leaf: ILeaf, config: ILeaferCanvasConfig): IHitCanvas
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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'
|
|
@@ -15,6 +15,7 @@ export interface ILeaferCanvasConfig extends IAutoBoundsData {
|
|
|
15
15
|
smooth?: boolean
|
|
16
16
|
hittable?: boolean
|
|
17
17
|
webgl?: boolean
|
|
18
|
+
contextSettings?: ICanvasContext2DSettings
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export type IHitCanvasConfig = ILeaferCanvasConfig
|
|
@@ -111,6 +112,8 @@ interface ICanvasMethod {
|
|
|
111
112
|
|
|
112
113
|
hitFill(point: IPointData, fillRule?: string): boolean
|
|
113
114
|
hitStroke(point: IPointData, strokeWidth?: number): boolean
|
|
115
|
+
hitPixel(radiusPoint: IRadiusPointData, offset?: IPointData, scale?: number): boolean
|
|
116
|
+
|
|
114
117
|
|
|
115
118
|
setStroke(strokeStyle: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void
|
|
116
119
|
setStrokeOptions(options: ICanvasStrokeOptions): void
|
|
@@ -199,7 +202,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
|
|
|
199
202
|
|
|
200
203
|
|
|
201
204
|
export interface IHitCanvas extends ILeaferCanvas {
|
|
202
|
-
|
|
205
|
+
hitScale?: number
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
|
package/src/display/ILeaf.ts
CHANGED
|
@@ -66,9 +66,11 @@ export interface ILeafAttrData {
|
|
|
66
66
|
|
|
67
67
|
path: IPathCommandData | IPathString
|
|
68
68
|
windingRule: IWindingRule
|
|
69
|
+
closed: boolean
|
|
69
70
|
|
|
70
71
|
editable: IBoolean
|
|
71
72
|
editSize: IEditSize
|
|
73
|
+
editorStyle: IObject
|
|
72
74
|
|
|
73
75
|
hittable: IBoolean
|
|
74
76
|
hitFill: IHitType
|
|
@@ -235,9 +237,11 @@ export interface ILeafInputData {
|
|
|
235
237
|
|
|
236
238
|
path?: IPathCommandData | IPathString
|
|
237
239
|
windingRule?: IWindingRule
|
|
240
|
+
closed?: boolean
|
|
238
241
|
|
|
239
242
|
editable?: IBoolean
|
|
240
243
|
editSize?: IEditSize
|
|
244
|
+
editorStyle?: IObject
|
|
241
245
|
|
|
242
246
|
hittable?: IBoolean
|
|
243
247
|
hitFill?: IHitType
|
|
@@ -297,11 +301,13 @@ export interface ILeafComputedData {
|
|
|
297
301
|
|
|
298
302
|
path?: IPathCommandData
|
|
299
303
|
windingRule?: IWindingRule
|
|
304
|
+
closed?: boolean
|
|
300
305
|
|
|
301
306
|
draggable?: boolean
|
|
302
307
|
|
|
303
308
|
editable?: boolean
|
|
304
309
|
editSize?: IEditSize
|
|
310
|
+
editorStyle?: IObject
|
|
305
311
|
|
|
306
312
|
hittable?: boolean
|
|
307
313
|
hitFill?: IHitType
|
|
@@ -397,7 +403,6 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
397
403
|
readonly __ignoreHitWorld: boolean
|
|
398
404
|
|
|
399
405
|
readonly pathInputed: boolean
|
|
400
|
-
pathClosed: boolean
|
|
401
406
|
|
|
402
407
|
__parentWait?: IFunction[]
|
|
403
408
|
__leaferWait?: IFunction[]
|
|
@@ -422,7 +427,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
422
427
|
toHTML?(): string
|
|
423
428
|
|
|
424
429
|
// ILeafData ->
|
|
425
|
-
__setAttr(attrName: string, newValue: IValue):
|
|
430
|
+
__setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean
|
|
426
431
|
__getAttr(attrName: string): IValue
|
|
427
432
|
setProxyAttr(name: string, newValue: IValue): void
|
|
428
433
|
getProxyAttr(name: string): IValue
|
|
@@ -512,8 +517,9 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
512
517
|
// ILeafHit ->
|
|
513
518
|
__hitWorld(point: IRadiusPointData): boolean
|
|
514
519
|
__hit(local: IRadiusPointData): boolean
|
|
515
|
-
__hitFill(inner: IRadiusPointData
|
|
520
|
+
__hitFill(inner: IRadiusPointData): boolean
|
|
516
521
|
__hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean
|
|
522
|
+
__hitPixel(inner: IRadiusPointData): boolean
|
|
517
523
|
__drawHitPath(canvas: ILeaferCanvas): void
|
|
518
524
|
__updateHitCanvas(): void
|
|
519
525
|
|
|
@@ -523,7 +529,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
523
529
|
__draw(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
524
530
|
|
|
525
531
|
__clip(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
526
|
-
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
532
|
+
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void
|
|
527
533
|
|
|
528
534
|
__updateWorldOpacity(): void
|
|
529
535
|
__updateChange(): void
|
|
@@ -543,4 +549,10 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
543
549
|
add(child: ILeaf, index?: number): void
|
|
544
550
|
remove(child?: ILeaf, destroy?: boolean): void
|
|
545
551
|
dropTo(parent: ILeaf, index?: number, resize?: boolean): void
|
|
546
|
-
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export type ILeafAttrDescriptor = IObject & ThisType<ILeaf>
|
|
555
|
+
|
|
556
|
+
export interface ILeafAttrDescriptorFn {
|
|
557
|
+
(key: string): ILeafAttrDescriptor
|
|
558
|
+
}
|
|
@@ -4,7 +4,7 @@ import { IValue } from '../../data/IData'
|
|
|
4
4
|
export type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>
|
|
5
5
|
|
|
6
6
|
export interface ILeafDataProxy {
|
|
7
|
-
__setAttr?(name: string, newValue: IValue):
|
|
7
|
+
__setAttr?(name: string, newValue: IValue): boolean
|
|
8
8
|
__getAttr?(name: string): IValue
|
|
9
9
|
setProxyAttr?(name: string, newValue: IValue): void
|
|
10
10
|
getProxyAttr?(name: string): IValue
|
|
@@ -7,8 +7,9 @@ export type ILeafHitModule = ILeafHit & ThisType<ILeaf>
|
|
|
7
7
|
export interface ILeafHit {
|
|
8
8
|
__hitWorld?(point: IRadiusPointData): boolean
|
|
9
9
|
__hit?(inner: IRadiusPointData): boolean
|
|
10
|
-
__hitFill?(inner: IRadiusPointData
|
|
10
|
+
__hitFill?(inner: IRadiusPointData): boolean
|
|
11
11
|
__hitStroke?(inner: IRadiusPointData, strokeWidth: number): boolean
|
|
12
|
+
__hitPixel(inner: IRadiusPointData): boolean
|
|
12
13
|
__drawHitPath?(canvas: ILeaferCanvas): void
|
|
13
14
|
__updateHitCanvas?(): void
|
|
14
15
|
}
|
|
@@ -10,7 +10,7 @@ export interface ILeafRender {
|
|
|
10
10
|
__drawFast?(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
11
11
|
|
|
12
12
|
__clip?(_canvas: ILeaferCanvas, _options: IRenderOptions): void
|
|
13
|
-
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
13
|
+
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void
|
|
14
14
|
|
|
15
15
|
__updateWorldOpacity?(): void
|
|
16
16
|
__updateChange?(): void
|
package/src/event/IUIEvent.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface IImageManager {
|
|
|
11
11
|
recycledList: ILeaferImage[]
|
|
12
12
|
tasker: ITaskProcessor
|
|
13
13
|
patternTasker: ITaskProcessor
|
|
14
|
+
patternLocked?: boolean // 锁定pattern不更新, 一般用于创建碰撞位图 UIHit.ts
|
|
14
15
|
readonly isComplete: boolean
|
|
15
16
|
get(config: ILeaferImageConfig): ILeaferImage
|
|
16
17
|
recycle(image: ILeaferImage): void
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { IAppBase } from './app/IApp'
|
|
2
2
|
export { ILeaferBase, ILeaferAttrData, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator, IZoomType } from './app/ILeafer'
|
|
3
|
-
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IMaskType, IBlendMode, IEditSize, IImageCursor, ICursorType, IStateStyleType, IAround } from './display/ILeaf'
|
|
3
|
+
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IMaskType, IBlendMode, IEditSize, IImageCursor, ICursorType, IStateStyleType, IAround, ILeafAttrDescriptor, ILeafAttrDescriptorFn } from './display/ILeaf'
|
|
4
4
|
export { IBranch } from './display/IBranch'
|
|
5
5
|
export { IZoomView } from './display/IView'
|
|
6
6
|
|
|
@@ -36,7 +36,7 @@ export { IPlugin } from './plugin/IPlugin'
|
|
|
36
36
|
export { ILeaferCanvas, ILeaferCanvasView, IHitCanvas, ICanvasAttr, ICanvasStrokeOptions, ICanvasCacheOptions, ILeaferCanvasConfig, IHitCanvasConfig, IBlobFunction, IBlob } from './canvas/ILeaferCanvas'
|
|
37
37
|
export { ISkiaCanvas, ISkiaCanvasExportConfig, ICanvasType, ISkiaNAPICanvas } from './canvas/ISkiaCanvas'
|
|
38
38
|
export { IPathDrawer, IPathCreator } from './path/IPathDrawer'
|
|
39
|
-
export { IWindingRule, ICanvasContext2D, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
|
|
39
|
+
export { IWindingRule, ICanvasContext2D, ICanvasContext2DSettings, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
|
|
40
40
|
export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData } from './path/IPathCommand'
|
|
41
41
|
|
|
42
42
|
export { ILeaferImage, ILeaferImageConfig, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
|
|
@@ -52,6 +52,7 @@ export interface IInteraction extends IControl {
|
|
|
52
52
|
|
|
53
53
|
findPath(data: IPointerEvent, options?: IPickOptions): ILeafList
|
|
54
54
|
isRootPath(data: IPointerEvent): boolean
|
|
55
|
+
isTreePath(data: IPointerEvent): boolean
|
|
55
56
|
canMove(data: IPointerEvent): boolean
|
|
56
57
|
|
|
57
58
|
isDrag(leaf: ILeaf): boolean
|
|
@@ -84,15 +85,17 @@ export interface IInteractionConfig {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface IZoomConfig {
|
|
88
|
+
disabled?: boolean
|
|
87
89
|
min?: number
|
|
88
90
|
max?: number
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
export interface IMoveConfig {
|
|
94
|
+
disabled?: boolean
|
|
92
95
|
holdSpaceKey?: boolean
|
|
93
96
|
holdMiddleKey?: boolean
|
|
94
97
|
holdRightKey?: boolean
|
|
95
|
-
scroll?: boolean
|
|
98
|
+
scroll?: boolean | 'limit'
|
|
96
99
|
drag?: boolean
|
|
97
100
|
dragAnimate?: boolean
|
|
98
101
|
dragEmpty?: boolean
|
|
@@ -118,6 +121,7 @@ export interface IPointerConfig {
|
|
|
118
121
|
tapTime?: number
|
|
119
122
|
longPressTime?: number
|
|
120
123
|
transformTime?: number
|
|
124
|
+
hover?: boolean
|
|
121
125
|
dragHover?: boolean
|
|
122
126
|
dragDistance?: number
|
|
123
127
|
swipeDistance?: number
|
package/src/math/IMath.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface IBounds extends IBoundsData, ITwoPointBoundsData {
|
|
|
68
68
|
scaleOf(origin: IPointData, scaleX: number, scaleY?: number): IBounds
|
|
69
69
|
toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds
|
|
70
70
|
toInnerOf(matrix: IMatrixData, to?: IBoundsData): IBounds
|
|
71
|
-
getFitMatrix(put: IBoundsData): IMatrix
|
|
71
|
+
getFitMatrix(put: IBoundsData, baseScale?: number): IMatrix
|
|
72
72
|
|
|
73
73
|
spread(fourNumber: IFourNumber, spreadY?: number): IBounds
|
|
74
74
|
shrink(fourNumber: IFourNumber): IBounds
|
|
@@ -83,6 +83,7 @@ export interface IBounds extends IBoundsData, ITwoPointBoundsData {
|
|
|
83
83
|
setListWithFn(list: IObject[], boundsDataHandle: IBoundsDataFn): IBounds
|
|
84
84
|
|
|
85
85
|
setPoints(points: IPointData[]): IBounds
|
|
86
|
+
addPoint(point: IPointData): IBounds
|
|
86
87
|
getPoints(): IPointData[] // topLeft, topRight, bottomRight, bottomLeft
|
|
87
88
|
|
|
88
89
|
hitPoint(point: IPointData, pointMatrix?: IMatrixData): boolean
|
|
@@ -162,9 +163,10 @@ export type ILayoutAttr =
|
|
|
162
163
|
|
|
163
164
|
export interface ILayoutBoundsData extends ILayoutData, IBoundsData {
|
|
164
165
|
}
|
|
165
|
-
export interface IMatrix extends
|
|
166
|
+
export interface IMatrix extends IMatrixWithScaleData {
|
|
166
167
|
|
|
167
168
|
set(a: number | IMatrixData, b: number, c: number, d: number, e: number, f: number): IMatrix
|
|
169
|
+
setWith(dataWithScale: IMatrixWithScaleData): IMatrix // set scaleX scaleY
|
|
168
170
|
get(): IMatrixData
|
|
169
171
|
clone(): IMatrix
|
|
170
172
|
|
|
@@ -172,6 +174,7 @@ export interface IMatrix extends IMatrixData {
|
|
|
172
174
|
translateInner(x: number, y: number): IMatrix
|
|
173
175
|
|
|
174
176
|
scale(x: number, y?: number): IMatrix
|
|
177
|
+
scaleWith(x: number, y?: number): IMatrix // change scaleX scaleY
|
|
175
178
|
scaleOfOuter(origin: IPointData, x: number, y?: number): IMatrix
|
|
176
179
|
scaleOfInner(origin: IPointData, x: number, y?: number): IMatrix
|
|
177
180
|
|
|
@@ -189,6 +192,7 @@ export interface IMatrix extends IMatrixData {
|
|
|
189
192
|
divide(child: IMatrixData): IMatrix
|
|
190
193
|
divideParent(parent: IMatrixData): IMatrix
|
|
191
194
|
invert(): IMatrix
|
|
195
|
+
invertWith(): IMatrix // change scaleX scaleY
|
|
192
196
|
|
|
193
197
|
toOuterPoint(inner: IPointData, to?: IPointData, distance?: boolean): void
|
|
194
198
|
toInnerPoint(outer: IPointData, to?: IPointData, distance?: boolean): void
|
package/src/path/IPathDrawer.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface IPathDrawer {
|
|
|
16
16
|
roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): void
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export interface IPathCreator {
|
|
19
|
+
export interface IPathCreator extends IPathDrawer {
|
|
20
20
|
path: IPathCommandData
|
|
21
21
|
__path: IPathCommandData
|
|
22
22
|
|
|
@@ -39,4 +39,6 @@ export interface IPathCreator {
|
|
|
39
39
|
drawEllipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator
|
|
40
40
|
drawArc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator
|
|
41
41
|
drawPoints(points: number[], curve?: boolean | number, close?: boolean): IPathCreator
|
|
42
|
+
|
|
43
|
+
clearPath(): IPathCreator
|
|
42
44
|
}
|
|
@@ -26,6 +26,7 @@ export interface IPlatform {
|
|
|
26
26
|
canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string | Promise<string>
|
|
27
27
|
canvasToBolb(canvas: any, type?: IExportFileType, quality?: number): Promise<any>
|
|
28
28
|
canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>
|
|
29
|
+
download(url: string, filename: string): Promise<void>
|
|
29
30
|
loadImage(url: string): Promise<any>
|
|
30
31
|
noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
|
|
31
32
|
},
|
|
@@ -38,6 +39,7 @@ export interface IPlatform {
|
|
|
38
39
|
},
|
|
39
40
|
miniapp?: IMiniapp
|
|
40
41
|
image: {
|
|
42
|
+
hitCanvasSize: number // 图片生成碰撞画布的最大尺寸(单边)
|
|
41
43
|
maxCacheSize: number // 最大等级缓存,一般取当前屏幕大小,默认2k: 2560 * 1600
|
|
42
44
|
maxPatternSize: number // 最大repeat pattern缓存, 默认4k: 4096 * 2160
|
|
43
45
|
suffix: string // 需要带上后缀区分dom中image标签的缓存,否则会导致浏览器缓存跨域问题
|
package/types/index.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ interface IBounds extends IBoundsData, ITwoPointBoundsData {
|
|
|
144
144
|
scaleOf(origin: IPointData, scaleX: number, scaleY?: number): IBounds;
|
|
145
145
|
toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds;
|
|
146
146
|
toInnerOf(matrix: IMatrixData, to?: IBoundsData): IBounds;
|
|
147
|
-
getFitMatrix(put: IBoundsData): IMatrix;
|
|
147
|
+
getFitMatrix(put: IBoundsData, baseScale?: number): IMatrix;
|
|
148
148
|
spread(fourNumber: IFourNumber, spreadY?: number): IBounds;
|
|
149
149
|
shrink(fourNumber: IFourNumber): IBounds;
|
|
150
150
|
ceil(): IBounds;
|
|
@@ -156,6 +156,7 @@ interface IBounds extends IBoundsData, ITwoPointBoundsData {
|
|
|
156
156
|
addListWithFn(list: IObject[], boundsDataHandle: IBoundsDataFn): IBounds;
|
|
157
157
|
setListWithFn(list: IObject[], boundsDataHandle: IBoundsDataFn): IBounds;
|
|
158
158
|
setPoints(points: IPointData[]): IBounds;
|
|
159
|
+
addPoint(point: IPointData): IBounds;
|
|
159
160
|
getPoints(): IPointData[];
|
|
160
161
|
hitPoint(point: IPointData, pointMatrix?: IMatrixData): boolean;
|
|
161
162
|
hitRadiusPoint(point: IRadiusPointData, pointMatrix?: IMatrixWithLayoutData): boolean;
|
|
@@ -210,13 +211,15 @@ interface ILayoutData extends IScaleRotationData, ISkewData, IPointData {
|
|
|
210
211
|
type ILayoutAttr = 'x' | 'y' | 'scaleX' | 'scaleY' | 'rotation' | 'skewX' | 'skewY';
|
|
211
212
|
interface ILayoutBoundsData extends ILayoutData, IBoundsData {
|
|
212
213
|
}
|
|
213
|
-
interface IMatrix extends
|
|
214
|
+
interface IMatrix extends IMatrixWithScaleData {
|
|
214
215
|
set(a: number | IMatrixData, b: number, c: number, d: number, e: number, f: number): IMatrix;
|
|
216
|
+
setWith(dataWithScale: IMatrixWithScaleData): IMatrix;
|
|
215
217
|
get(): IMatrixData;
|
|
216
218
|
clone(): IMatrix;
|
|
217
219
|
translate(x: number, y: number): IMatrix;
|
|
218
220
|
translateInner(x: number, y: number): IMatrix;
|
|
219
221
|
scale(x: number, y?: number): IMatrix;
|
|
222
|
+
scaleWith(x: number, y?: number): IMatrix;
|
|
220
223
|
scaleOfOuter(origin: IPointData, x: number, y?: number): IMatrix;
|
|
221
224
|
scaleOfInner(origin: IPointData, x: number, y?: number): IMatrix;
|
|
222
225
|
rotate(angle: number): IMatrix;
|
|
@@ -230,6 +233,7 @@ interface IMatrix extends IMatrixData {
|
|
|
230
233
|
divide(child: IMatrixData): IMatrix;
|
|
231
234
|
divideParent(parent: IMatrixData): IMatrix;
|
|
232
235
|
invert(): IMatrix;
|
|
236
|
+
invertWith(): IMatrix;
|
|
233
237
|
toOuterPoint(inner: IPointData, to?: IPointData, distance?: boolean): void;
|
|
234
238
|
toInnerPoint(outer: IPointData, to?: IPointData, distance?: boolean): void;
|
|
235
239
|
setLayout(data: ILayoutData, origin?: IPointData): IMatrix;
|
|
@@ -511,15 +515,16 @@ interface CanvasRect {
|
|
|
511
515
|
strokeRect(x: number, y: number, w: number, h: number): void;
|
|
512
516
|
}
|
|
513
517
|
type PredefinedColorSpace = 'display-p3' | 'srgb';
|
|
514
|
-
interface
|
|
518
|
+
interface ICanvasRenderingContext2DSettings {
|
|
515
519
|
alpha?: boolean;
|
|
516
520
|
colorSpace?: PredefinedColorSpace;
|
|
517
521
|
desynchronized?: boolean;
|
|
518
522
|
willReadFrequently?: boolean;
|
|
519
523
|
}
|
|
524
|
+
type ICanvasContext2DSettings = ICanvasRenderingContext2DSettings;
|
|
520
525
|
interface ICanvasContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
|
|
521
526
|
readonly canvas: HTMLCanvasElement;
|
|
522
|
-
getContextAttributes():
|
|
527
|
+
getContextAttributes(): ICanvasRenderingContext2DSettings;
|
|
523
528
|
}
|
|
524
529
|
interface CanvasShadowStyles {
|
|
525
530
|
shadowBlur: number;
|
|
@@ -739,7 +744,7 @@ interface IPathDrawer {
|
|
|
739
744
|
rect(x: number, y: number, width: number, height: number): void;
|
|
740
745
|
roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): void;
|
|
741
746
|
}
|
|
742
|
-
interface IPathCreator {
|
|
747
|
+
interface IPathCreator extends IPathDrawer {
|
|
743
748
|
path: IPathCommandData;
|
|
744
749
|
__path: IPathCommandData;
|
|
745
750
|
beginPath(): IPathCreator;
|
|
@@ -756,6 +761,7 @@ interface IPathCreator {
|
|
|
756
761
|
drawEllipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
|
|
757
762
|
drawArc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPathCreator;
|
|
758
763
|
drawPoints(points: number[], curve?: boolean | number, close?: boolean): IPathCreator;
|
|
764
|
+
clearPath(): IPathCreator;
|
|
759
765
|
}
|
|
760
766
|
|
|
761
767
|
interface ICanvasManager {
|
|
@@ -869,6 +875,7 @@ interface ILeaferCanvasConfig extends IAutoBoundsData {
|
|
|
869
875
|
smooth?: boolean;
|
|
870
876
|
hittable?: boolean;
|
|
871
877
|
webgl?: boolean;
|
|
878
|
+
contextSettings?: ICanvasContext2DSettings;
|
|
872
879
|
}
|
|
873
880
|
type IHitCanvasConfig = ILeaferCanvasConfig;
|
|
874
881
|
interface ICanvasStrokeOptions {
|
|
@@ -938,6 +945,7 @@ interface ICanvasMethod {
|
|
|
938
945
|
restoreBlendMode(): void;
|
|
939
946
|
hitFill(point: IPointData, fillRule?: string): boolean;
|
|
940
947
|
hitStroke(point: IPointData, strokeWidth?: number): boolean;
|
|
948
|
+
hitPixel(radiusPoint: IRadiusPointData, offset?: IPointData, scale?: number): boolean;
|
|
941
949
|
setStroke(strokeStyle: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void;
|
|
942
950
|
setStrokeOptions(options: ICanvasStrokeOptions): void;
|
|
943
951
|
setWorld(matrix: IMatrixData, parentMatrix?: IMatrixData): void;
|
|
@@ -996,6 +1004,7 @@ interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
|
|
|
996
1004
|
destroy(): void;
|
|
997
1005
|
}
|
|
998
1006
|
interface IHitCanvas extends ILeaferCanvas {
|
|
1007
|
+
hitScale?: number;
|
|
999
1008
|
}
|
|
1000
1009
|
interface IBlobFunction {
|
|
1001
1010
|
(blob: IBlob | null): void;
|
|
@@ -1043,7 +1052,7 @@ interface IRenderer extends IControl {
|
|
|
1043
1052
|
|
|
1044
1053
|
type ILeafDataProxyModule = ILeafDataProxy & ThisType<ILeaf>;
|
|
1045
1054
|
interface ILeafDataProxy {
|
|
1046
|
-
__setAttr?(name: string, newValue: IValue):
|
|
1055
|
+
__setAttr?(name: string, newValue: IValue): boolean;
|
|
1047
1056
|
__getAttr?(name: string): IValue;
|
|
1048
1057
|
setProxyAttr?(name: string, newValue: IValue): void;
|
|
1049
1058
|
getProxyAttr?(name: string): IValue;
|
|
@@ -1076,8 +1085,9 @@ type ILeafHitModule = ILeafHit & ThisType<ILeaf>;
|
|
|
1076
1085
|
interface ILeafHit {
|
|
1077
1086
|
__hitWorld?(point: IRadiusPointData): boolean;
|
|
1078
1087
|
__hit?(inner: IRadiusPointData): boolean;
|
|
1079
|
-
__hitFill?(inner: IRadiusPointData
|
|
1088
|
+
__hitFill?(inner: IRadiusPointData): boolean;
|
|
1080
1089
|
__hitStroke?(inner: IRadiusPointData, strokeWidth: number): boolean;
|
|
1090
|
+
__hitPixel(inner: IRadiusPointData): boolean;
|
|
1081
1091
|
__drawHitPath?(canvas: ILeaferCanvas): void;
|
|
1082
1092
|
__updateHitCanvas?(): void;
|
|
1083
1093
|
}
|
|
@@ -1088,7 +1098,7 @@ interface ILeafRender {
|
|
|
1088
1098
|
__draw?(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1089
1099
|
__drawFast?(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1090
1100
|
__clip?(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|
|
1091
|
-
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1101
|
+
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void;
|
|
1092
1102
|
__updateWorldOpacity?(): void;
|
|
1093
1103
|
__updateChange?(): void;
|
|
1094
1104
|
}
|
|
@@ -1197,8 +1207,10 @@ interface ILeafAttrData {
|
|
|
1197
1207
|
draggable: IBoolean;
|
|
1198
1208
|
path: IPathCommandData | IPathString;
|
|
1199
1209
|
windingRule: IWindingRule;
|
|
1210
|
+
closed: boolean;
|
|
1200
1211
|
editable: IBoolean;
|
|
1201
1212
|
editSize: IEditSize;
|
|
1213
|
+
editorStyle: IObject;
|
|
1202
1214
|
hittable: IBoolean;
|
|
1203
1215
|
hitFill: IHitType;
|
|
1204
1216
|
hitStroke: IHitType;
|
|
@@ -1258,8 +1270,10 @@ interface ILeafInputData {
|
|
|
1258
1270
|
draggable?: IBoolean;
|
|
1259
1271
|
path?: IPathCommandData | IPathString;
|
|
1260
1272
|
windingRule?: IWindingRule;
|
|
1273
|
+
closed?: boolean;
|
|
1261
1274
|
editable?: IBoolean;
|
|
1262
1275
|
editSize?: IEditSize;
|
|
1276
|
+
editorStyle?: IObject;
|
|
1263
1277
|
hittable?: IBoolean;
|
|
1264
1278
|
hitFill?: IHitType;
|
|
1265
1279
|
hitStroke?: IHitType;
|
|
@@ -1305,9 +1319,11 @@ interface ILeafComputedData {
|
|
|
1305
1319
|
pixelRatio?: number;
|
|
1306
1320
|
path?: IPathCommandData;
|
|
1307
1321
|
windingRule?: IWindingRule;
|
|
1322
|
+
closed?: boolean;
|
|
1308
1323
|
draggable?: boolean;
|
|
1309
1324
|
editable?: boolean;
|
|
1310
1325
|
editSize?: IEditSize;
|
|
1326
|
+
editorStyle?: IObject;
|
|
1311
1327
|
hittable?: boolean;
|
|
1312
1328
|
hitFill?: IHitType;
|
|
1313
1329
|
hitStroke?: IHitType;
|
|
@@ -1377,7 +1393,6 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1377
1393
|
readonly __onlyHitMask: boolean;
|
|
1378
1394
|
readonly __ignoreHitWorld: boolean;
|
|
1379
1395
|
readonly pathInputed: boolean;
|
|
1380
|
-
pathClosed: boolean;
|
|
1381
1396
|
__parentWait?: IFunction[];
|
|
1382
1397
|
__leaferWait?: IFunction[];
|
|
1383
1398
|
destroyed: boolean;
|
|
@@ -1394,7 +1409,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1394
1409
|
toString(): string;
|
|
1395
1410
|
toSVG?(): string;
|
|
1396
1411
|
toHTML?(): string;
|
|
1397
|
-
__setAttr(attrName: string, newValue: IValue):
|
|
1412
|
+
__setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean;
|
|
1398
1413
|
__getAttr(attrName: string): IValue;
|
|
1399
1414
|
setProxyAttr(name: string, newValue: IValue): void;
|
|
1400
1415
|
getProxyAttr(name: string): IValue;
|
|
@@ -1454,15 +1469,16 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1454
1469
|
__scaleResize(scaleX: number, scaleY: number): void;
|
|
1455
1470
|
__hitWorld(point: IRadiusPointData): boolean;
|
|
1456
1471
|
__hit(local: IRadiusPointData): boolean;
|
|
1457
|
-
__hitFill(inner: IRadiusPointData
|
|
1472
|
+
__hitFill(inner: IRadiusPointData): boolean;
|
|
1458
1473
|
__hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean;
|
|
1474
|
+
__hitPixel(inner: IRadiusPointData): boolean;
|
|
1459
1475
|
__drawHitPath(canvas: ILeaferCanvas): void;
|
|
1460
1476
|
__updateHitCanvas(): void;
|
|
1461
1477
|
__render(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1462
1478
|
__drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1463
1479
|
__draw(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1464
1480
|
__clip(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1465
|
-
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
1481
|
+
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void;
|
|
1466
1482
|
__updateWorldOpacity(): void;
|
|
1467
1483
|
__updateChange(): void;
|
|
1468
1484
|
__drawPath(canvas: ILeaferCanvas): void;
|
|
@@ -1475,6 +1491,10 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1475
1491
|
remove(child?: ILeaf, destroy?: boolean): void;
|
|
1476
1492
|
dropTo(parent: ILeaf, index?: number, resize?: boolean): void;
|
|
1477
1493
|
}
|
|
1494
|
+
type ILeafAttrDescriptor = IObject & ThisType<ILeaf>;
|
|
1495
|
+
interface ILeafAttrDescriptorFn {
|
|
1496
|
+
(key: string): ILeafAttrDescriptor;
|
|
1497
|
+
}
|
|
1478
1498
|
|
|
1479
1499
|
interface ILeaferImageConfig {
|
|
1480
1500
|
url: string;
|
|
@@ -1542,6 +1562,7 @@ interface IPointerEvent extends IUIEvent {
|
|
|
1542
1562
|
tiltX?: number;
|
|
1543
1563
|
tiltY?: number;
|
|
1544
1564
|
twist?: number;
|
|
1565
|
+
isCancel?: boolean;
|
|
1545
1566
|
}
|
|
1546
1567
|
type PointerType = 'mouse' | 'pen' | 'touch';
|
|
1547
1568
|
interface IDragEvent extends IPointerEvent {
|
|
@@ -1612,6 +1633,7 @@ interface IInteraction extends IControl {
|
|
|
1612
1633
|
keyUp(data: IKeyEvent): void;
|
|
1613
1634
|
findPath(data: IPointerEvent, options?: IPickOptions): ILeafList;
|
|
1614
1635
|
isRootPath(data: IPointerEvent): boolean;
|
|
1636
|
+
isTreePath(data: IPointerEvent): boolean;
|
|
1615
1637
|
canMove(data: IPointerEvent): boolean;
|
|
1616
1638
|
isDrag(leaf: ILeaf): boolean;
|
|
1617
1639
|
isPress(leaf: ILeaf): boolean;
|
|
@@ -1635,14 +1657,16 @@ interface IInteractionConfig {
|
|
|
1635
1657
|
eventer?: IObject;
|
|
1636
1658
|
}
|
|
1637
1659
|
interface IZoomConfig {
|
|
1660
|
+
disabled?: boolean;
|
|
1638
1661
|
min?: number;
|
|
1639
1662
|
max?: number;
|
|
1640
1663
|
}
|
|
1641
1664
|
interface IMoveConfig {
|
|
1665
|
+
disabled?: boolean;
|
|
1642
1666
|
holdSpaceKey?: boolean;
|
|
1643
1667
|
holdMiddleKey?: boolean;
|
|
1644
1668
|
holdRightKey?: boolean;
|
|
1645
|
-
scroll?: boolean;
|
|
1669
|
+
scroll?: boolean | 'limit';
|
|
1646
1670
|
drag?: boolean;
|
|
1647
1671
|
dragAnimate?: boolean;
|
|
1648
1672
|
dragEmpty?: boolean;
|
|
@@ -1666,6 +1690,7 @@ interface IPointerConfig {
|
|
|
1666
1690
|
tapTime?: number;
|
|
1667
1691
|
longPressTime?: number;
|
|
1668
1692
|
transformTime?: number;
|
|
1693
|
+
hover?: boolean;
|
|
1669
1694
|
dragHover?: boolean;
|
|
1670
1695
|
dragDistance?: number;
|
|
1671
1696
|
swipeDistance?: number;
|
|
@@ -1678,8 +1703,9 @@ interface ICursorConfig {
|
|
|
1678
1703
|
}
|
|
1679
1704
|
|
|
1680
1705
|
interface IHitCanvasManager extends ICanvasManager {
|
|
1706
|
+
maxTotal: number;
|
|
1681
1707
|
getPathType(leaf: ILeaf): IHitCanvas;
|
|
1682
|
-
|
|
1708
|
+
getPixelType(leaf: ILeaf, config: ILeaferCanvasConfig): IHitCanvas;
|
|
1683
1709
|
}
|
|
1684
1710
|
|
|
1685
1711
|
interface IZoomView extends IBranch {
|
|
@@ -1690,6 +1716,7 @@ interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteracti
|
|
|
1690
1716
|
start?: boolean;
|
|
1691
1717
|
type?: ILeaferType;
|
|
1692
1718
|
realCanvas?: boolean;
|
|
1719
|
+
lazySpeard?: IFourNumber;
|
|
1693
1720
|
}
|
|
1694
1721
|
interface ILeaferAttrData {
|
|
1695
1722
|
running: boolean;
|
|
@@ -1710,6 +1737,7 @@ interface ILeaferAttrData {
|
|
|
1710
1737
|
canvasManager: ICanvasManager;
|
|
1711
1738
|
hitCanvasManager?: IHitCanvasManager;
|
|
1712
1739
|
autoLayout?: IAutoBounds;
|
|
1740
|
+
lazyBounds: IBounds;
|
|
1713
1741
|
config: ILeaferConfig;
|
|
1714
1742
|
readonly cursorPoint: IPointData;
|
|
1715
1743
|
leafs: number;
|
|
@@ -1728,7 +1756,8 @@ interface ILeaferAttrData {
|
|
|
1728
1756
|
waitViewReady(item: IFunction, bind?: IObject): void;
|
|
1729
1757
|
waitViewCompleted(item: IFunction, bind?: IObject): void;
|
|
1730
1758
|
zoom(zoomType: IZoomType, padding?: IFourNumber, fixedScale?: boolean): IBoundsData;
|
|
1731
|
-
|
|
1759
|
+
getValidMove(moveX: number, moveY: number): IPointData;
|
|
1760
|
+
getValidScale(changeScale: number): number;
|
|
1732
1761
|
}
|
|
1733
1762
|
type IZoomType = 'in' | 'out' | 'fit' | 'fit-width' | 'fit-height' | number | ILeaf | ILeaf[] | IBoundsData;
|
|
1734
1763
|
interface ILeaferBase extends IZoomView, IControl, ILeaferAttrData {
|
|
@@ -1822,6 +1851,7 @@ interface IImageManager {
|
|
|
1822
1851
|
recycledList: ILeaferImage[];
|
|
1823
1852
|
tasker: ITaskProcessor;
|
|
1824
1853
|
patternTasker: ITaskProcessor;
|
|
1854
|
+
patternLocked?: boolean;
|
|
1825
1855
|
readonly isComplete: boolean;
|
|
1826
1856
|
get(config: ILeaferImageConfig): ILeaferImage;
|
|
1827
1857
|
recycle(image: ILeaferImage): void;
|
|
@@ -1880,6 +1910,7 @@ interface IPlatform {
|
|
|
1880
1910
|
canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string | Promise<string>;
|
|
1881
1911
|
canvasToBolb(canvas: any, type?: IExportFileType, quality?: number): Promise<any>;
|
|
1882
1912
|
canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>;
|
|
1913
|
+
download(url: string, filename: string): Promise<void>;
|
|
1883
1914
|
loadImage(url: string): Promise<any>;
|
|
1884
1915
|
noRepeat?: string;
|
|
1885
1916
|
};
|
|
@@ -1892,6 +1923,7 @@ interface IPlatform {
|
|
|
1892
1923
|
};
|
|
1893
1924
|
miniapp?: IMiniapp;
|
|
1894
1925
|
image: {
|
|
1926
|
+
hitCanvasSize: number;
|
|
1895
1927
|
maxCacheSize: number;
|
|
1896
1928
|
maxPatternSize: number;
|
|
1897
1929
|
suffix: string;
|
|
@@ -1931,4 +1963,4 @@ interface ICursorRotateMap {
|
|
|
1931
1963
|
[name: string]: ICursorRotate;
|
|
1932
1964
|
}
|
|
1933
1965
|
|
|
1934
|
-
export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAnimateEvent, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasManager, ICanvasPattern, ICanvasStrokeOptions, ICanvasType, IChildEvent, IControl, ICreator, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDragEvent, IDropEvent, IEditSize, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFindMethod, IFourNumber, IFunction, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IKeepTouchData, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeaferAttrData, ILeaferBase, ILeaferCanvas, ILeaferCanvasConfig, ILeaferCanvasView, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumber, INumberMap, IObject, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPickOptions, IPickResult, IPlatform, IPlugin, IPoint, IPointData, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IRotateEvent, IScaleData, IScaleRotationData, IScreenSizeData, ISelector, ISelectorConfig, ISelectorProxy, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IString, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomType, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|
|
1966
|
+
export type { ACommandData, ArcCommandData, ArcToCommandData, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAnimateEvent, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasStrokeOptions, ICanvasType, IChildEvent, IControl, ICreator, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDragEvent, IDropEvent, IEditSize, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFindMethod, IFourNumber, IFunction, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IKeepTouchData, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafAttrDescriptor, ILeafAttrDescriptorFn, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeaferAttrData, ILeaferBase, ILeaferCanvas, ILeaferCanvasConfig, ILeaferCanvasView, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMoveEvent, IMultiTouchData, INumber, INumberMap, IObject, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCreator, IPathDrawer, IPathString, IPickOptions, IPickResult, IPlatform, IPlugin, IPoint, IPointData, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IRotateEvent, IScaleData, IScaleRotationData, IScreenSizeData, ISelector, ISelectorConfig, ISelectorProxy, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IString, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomType, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|