@leafer/interface 1.0.0-rc.12 → 1.0.0-rc.17
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 +1 -3
- package/src/canvas/ILeaferCanvas.ts +5 -0
- package/src/data/IData.ts +1 -1
- package/src/data/ILeafData.ts +3 -4
- package/src/display/ILeaf.ts +34 -8
- package/src/file/IExport.ts +7 -0
- package/src/index.ts +2 -2
- package/src/math/IMath.ts +1 -1
- package/src/path/IPathDrawer.ts +1 -0
- package/types/index.d.ts +103 -78
package/package.json
CHANGED
package/src/app/ILeafer.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { IControl } from '../control/IControl'
|
|
|
17
17
|
import { IFunction } from '../function/IFunction'
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
export type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'app' | 'game' | 'player' | 'chart'
|
|
20
|
+
export type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'app' | 'website' | 'game' | 'player' | 'chart'
|
|
21
21
|
export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteractionConfig, ILayouterConfig {
|
|
22
22
|
start?: boolean
|
|
23
23
|
type?: ILeaferType
|
|
@@ -35,8 +35,6 @@ export interface ILeaferAttrData {
|
|
|
35
35
|
|
|
36
36
|
transforming: boolean
|
|
37
37
|
|
|
38
|
-
pixelRatio: number
|
|
39
|
-
|
|
40
38
|
view: unknown
|
|
41
39
|
|
|
42
40
|
canvas: ILeaferCanvas
|
|
@@ -30,6 +30,11 @@ export interface ICanvasStrokeOptions {
|
|
|
30
30
|
miterLimit?: number
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export interface ICanvasCacheOptions extends ICanvasStrokeOptions {
|
|
34
|
+
fillStyle?: string | object
|
|
35
|
+
strokeStyle?: string | object
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
export interface ICanvasAttr extends ICanvasStrokeOptions, IObject {
|
|
34
39
|
|
|
35
40
|
smooth: boolean // imageSmoothingEnabled: boolean
|
package/src/data/IData.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type INumber = number // number | string will convert to number
|
|
2
2
|
export type IBoolean = boolean // boolean | string will convert to boolean
|
|
3
3
|
export type IString = string // string | other will convert to string
|
|
4
|
-
export type IValue = INumber | IBoolean | IString | IObject
|
|
4
|
+
export type IValue = INumber | IBoolean | IString | IObject
|
|
5
5
|
export type ITimer = any
|
|
6
6
|
|
|
7
7
|
export type IPathString = string
|
package/src/data/ILeafData.ts
CHANGED
|
@@ -6,9 +6,6 @@ export interface IDataProcessor {
|
|
|
6
6
|
__input: IObject
|
|
7
7
|
__middle: IObject
|
|
8
8
|
|
|
9
|
-
__single: boolean
|
|
10
|
-
__checkSingle(): void
|
|
11
|
-
|
|
12
9
|
__get(name: string): any
|
|
13
10
|
__getData(): IObject
|
|
14
11
|
|
|
@@ -29,5 +26,7 @@ export interface ILeafDataOptions {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
export interface ILeafData extends IDataProcessor, ILeafComputedData {
|
|
32
|
-
|
|
29
|
+
__single?: boolean
|
|
30
|
+
__checkSingle(): void
|
|
31
|
+
__removeNaturalSize(): void
|
|
33
32
|
}
|
package/src/display/ILeaf.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { IEventer } from '../event/IEventer'
|
|
|
4
4
|
import { ILeaferCanvas, IHitCanvas } from '../canvas/ILeaferCanvas'
|
|
5
5
|
import { IRenderOptions } from '../renderer/IRenderer'
|
|
6
6
|
|
|
7
|
-
import { IObject, INumber, IBoolean, IValue, IString } from '../data/IData'
|
|
8
|
-
import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData } from '../math/IMath'
|
|
7
|
+
import { IObject, INumber, IBoolean, IValue, IString, IPathString } from '../data/IData'
|
|
8
|
+
import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutAttr, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData, IMatrixWithScaleData } from '../math/IMath'
|
|
9
9
|
import { IFunction } from '../function/IFunction'
|
|
10
10
|
|
|
11
11
|
import { ILeafDataProxy } from './module/ILeafDataProxy'
|
|
@@ -16,6 +16,8 @@ import { ILeafHit } from './module/ILeafHit'
|
|
|
16
16
|
import { ILeafRender } from './module/ILeafRender'
|
|
17
17
|
import { ILeafData } from '../data/ILeafData'
|
|
18
18
|
import { IFindMethod } from '../selector/ISelector'
|
|
19
|
+
import { IPathCommandData } from '../path/IPathCommand'
|
|
20
|
+
import { IWindingRule, IPath2D } from '../canvas/ICanvas'
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
export interface ICachedLeaf {
|
|
@@ -54,10 +56,15 @@ export interface ILeafAttrData {
|
|
|
54
56
|
|
|
55
57
|
scale: INumber | IPointData // helper
|
|
56
58
|
around: IAround
|
|
59
|
+
|
|
57
60
|
lazy: IBoolean
|
|
61
|
+
pixelRatio: INumber
|
|
58
62
|
|
|
59
63
|
draggable: IBoolean
|
|
60
64
|
|
|
65
|
+
path: IPathCommandData | IPathString
|
|
66
|
+
windingRule: IWindingRule
|
|
67
|
+
|
|
61
68
|
editable: IBoolean
|
|
62
69
|
editSize?: IEditSize
|
|
63
70
|
|
|
@@ -203,10 +210,15 @@ export interface ILeafInputData {
|
|
|
203
210
|
|
|
204
211
|
scale?: INumber | IPointData // helper
|
|
205
212
|
around?: IAround
|
|
213
|
+
|
|
206
214
|
lazy?: IBoolean
|
|
215
|
+
pixelRatio?: INumber
|
|
207
216
|
|
|
208
217
|
draggable?: IBoolean
|
|
209
218
|
|
|
219
|
+
path?: IPathCommandData | IPathString
|
|
220
|
+
windingRule?: IWindingRule
|
|
221
|
+
|
|
210
222
|
editable?: IBoolean
|
|
211
223
|
editSize?: IEditSize
|
|
212
224
|
|
|
@@ -253,8 +265,12 @@ export interface ILeafComputedData {
|
|
|
253
265
|
skewY?: number
|
|
254
266
|
|
|
255
267
|
around?: IAround
|
|
268
|
+
|
|
256
269
|
lazy?: boolean
|
|
257
|
-
|
|
270
|
+
pixelRatio?: number
|
|
271
|
+
|
|
272
|
+
path?: IPathCommandData
|
|
273
|
+
windingRule?: IWindingRule
|
|
258
274
|
|
|
259
275
|
draggable?: boolean
|
|
260
276
|
|
|
@@ -277,6 +293,13 @@ export interface ILeafComputedData {
|
|
|
277
293
|
__naturalWidth?: number
|
|
278
294
|
__naturalHeight?: number
|
|
279
295
|
readonly __blendMode: string
|
|
296
|
+
|
|
297
|
+
__useArrow?: boolean
|
|
298
|
+
__useEffect?: boolean
|
|
299
|
+
|
|
300
|
+
__pathInputed?: number // 是否为输入path, 0:否,1:是,2:永远是(不自动检测)
|
|
301
|
+
__pathForRender?: IPathCommandData
|
|
302
|
+
__path2DForRender?: IPath2D
|
|
280
303
|
}
|
|
281
304
|
|
|
282
305
|
export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
|
|
@@ -292,9 +315,9 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
292
315
|
parent?: ILeaf
|
|
293
316
|
|
|
294
317
|
readonly isApp?: boolean
|
|
295
|
-
isLeafer?: boolean
|
|
296
|
-
isBranch?: boolean
|
|
297
|
-
isBranchLeaf?: boolean
|
|
318
|
+
readonly isLeafer?: boolean
|
|
319
|
+
readonly isBranch?: boolean
|
|
320
|
+
readonly isBranchLeaf?: boolean
|
|
298
321
|
|
|
299
322
|
__: ILeafData
|
|
300
323
|
|
|
@@ -314,7 +337,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
314
337
|
|
|
315
338
|
__worldOpacity: number
|
|
316
339
|
|
|
317
|
-
readonly worldTransform:
|
|
340
|
+
readonly worldTransform: IMatrixWithScaleData
|
|
318
341
|
readonly localTransform: IMatrixData
|
|
319
342
|
|
|
320
343
|
readonly boxBounds: IBoundsData
|
|
@@ -338,6 +361,9 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
338
361
|
readonly __onlyHitMask: boolean
|
|
339
362
|
readonly __ignoreHitWorld: boolean
|
|
340
363
|
|
|
364
|
+
readonly pathInputed: boolean
|
|
365
|
+
pathClosed: boolean
|
|
366
|
+
|
|
341
367
|
__parentWait?: IFunction[]
|
|
342
368
|
__leaferWait?: IFunction[]
|
|
343
369
|
|
|
@@ -353,7 +379,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
|
|
|
353
379
|
__bindLeafer(leafer: ILeaferBase | null): void
|
|
354
380
|
|
|
355
381
|
set(data: IObject): void
|
|
356
|
-
get(): ILeafInputData
|
|
382
|
+
get(name?: string): ILeafInputData | IValue
|
|
357
383
|
toJSON(): IObject
|
|
358
384
|
toString(): string
|
|
359
385
|
toSVG?(): string
|
package/src/file/IExport.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IBlob, ILeaferCanvas } from '../canvas/ILeaferCanvas'
|
|
2
|
+
import { ILocationType } from '../layout/ILeafLayout'
|
|
2
3
|
import { IBoundsData } from '../math/IMath'
|
|
3
4
|
|
|
4
5
|
|
|
@@ -11,6 +12,8 @@ export interface IExportOptions {
|
|
|
11
12
|
trim?: boolean
|
|
12
13
|
fill?: string
|
|
13
14
|
screenshot?: IBoundsData | boolean
|
|
15
|
+
location?: ILocationType
|
|
16
|
+
onCanvas?: IExportOnCanvasFunction
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export interface IExportResult {
|
|
@@ -23,4 +26,8 @@ export interface IExportResult {
|
|
|
23
26
|
|
|
24
27
|
export interface IExportResultFunction {
|
|
25
28
|
(data: IExportResult): void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IExportOnCanvasFunction {
|
|
32
|
+
(data: ILeaferCanvas): void
|
|
26
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -33,7 +33,7 @@ export { IPlatform, IMiniapp, IMiniappSelect, IMiniappSizeView } from './platfor
|
|
|
33
33
|
export { IPlugin } from './plugin/IPlugin'
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
export { ILeaferCanvas, ILeaferCanvasView, IHitCanvas, ICanvasAttr, ICanvasStrokeOptions, ILeaferCanvasConfig, IHitCanvasConfig, IBlobFunction, IBlob } from './canvas/ILeaferCanvas'
|
|
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
39
|
export { IWindingRule, ICanvasContext2D, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
|
|
@@ -41,7 +41,7 @@ export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VComma
|
|
|
41
41
|
|
|
42
42
|
export { ILeaferImage, ILeaferImageConfig, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
|
|
43
43
|
export { IExportFileType, IExportImageType } from './file/IFileType'
|
|
44
|
-
export { IExportOptions, IExportResult, IExportResultFunction } from './file/IExport'
|
|
44
|
+
export { IExportOptions, IExportResult, IExportResultFunction, IExportOnCanvasFunction } from './file/IExport'
|
|
45
45
|
|
|
46
46
|
export { InnerId, IEventer, IEventListener, IEventListenerOptions, IEventListenerMap, IEventListenerItem, IEventListenerId } from './event/IEventer'
|
|
47
47
|
export { IEventTarget, IEvent, ILeaferEvent, IPropertyEvent, ILayoutEvent, IRenderEvent, IAnimateEvent, IChildEvent, IResizeEvent, IResizeEventListener, IUpdateEvent, IWatchEvent, IMultiTouchData, IKeepTouchData } from './event/IEvent'
|
package/src/math/IMath.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface IPoint extends IPointData {
|
|
|
22
22
|
|
|
23
23
|
getCenter(to: IPointData): IPoint
|
|
24
24
|
getDistance(to: IPointData): number
|
|
25
|
-
getDistancePoint(to: IPointData, distance: number): IPoint
|
|
25
|
+
getDistancePoint(to: IPointData, distance: number, changeTo?: boolean): IPoint
|
|
26
26
|
|
|
27
27
|
getAngle(to: IPointData): number
|
|
28
28
|
getAtan2(to: IPointData): number
|
package/src/path/IPathDrawer.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ interface IPoint extends IPointData {
|
|
|
107
107
|
toOuterOf(matrix: IMatrixData, to?: IPointData): IPoint;
|
|
108
108
|
getCenter(to: IPointData): IPoint;
|
|
109
109
|
getDistance(to: IPointData): number;
|
|
110
|
-
getDistancePoint(to: IPointData, distance: number): IPoint;
|
|
110
|
+
getDistancePoint(to: IPointData, distance: number, changeTo?: boolean): IPoint;
|
|
111
111
|
getAngle(to: IPointData): number;
|
|
112
112
|
getAtan2(to: IPointData): number;
|
|
113
113
|
reset(): IPoint;
|
|
@@ -739,6 +739,7 @@ interface IPathDrawer {
|
|
|
739
739
|
}
|
|
740
740
|
interface IPathCreator {
|
|
741
741
|
path: IPathCommandData;
|
|
742
|
+
__path: IPathCommandData;
|
|
742
743
|
beginPath(): IPathCreator;
|
|
743
744
|
moveTo(x: number, y: number): IPathCreator;
|
|
744
745
|
lineTo(x: number, y: number): IPathCreator;
|
|
@@ -767,6 +768,72 @@ interface ICanvasManager {
|
|
|
767
768
|
type IExportImageType = 'jpg' | 'png' | 'webp';
|
|
768
769
|
type IExportFileType = IExportImageType | 'svg' | 'pdf' | 'json';
|
|
769
770
|
|
|
771
|
+
type ILocationType = 'world' | 'local' | 'inner';
|
|
772
|
+
type IBoundsType = 'content' | 'box' | 'stroke' | 'margin' | 'render';
|
|
773
|
+
interface ILeafLayout {
|
|
774
|
+
leaf: ILeaf;
|
|
775
|
+
proxyZoom: boolean;
|
|
776
|
+
boxBounds: IBoundsData;
|
|
777
|
+
strokeBounds: IBoundsData;
|
|
778
|
+
renderBounds: IBoundsData;
|
|
779
|
+
marginBounds: IBoundsData;
|
|
780
|
+
contentBounds: IBoundsData;
|
|
781
|
+
localStrokeBounds?: IBoundsData;
|
|
782
|
+
localRenderBounds?: IBoundsData;
|
|
783
|
+
resized: boolean;
|
|
784
|
+
waitAutoLayout: boolean;
|
|
785
|
+
matrixChanged: boolean;
|
|
786
|
+
scaleChanged: boolean;
|
|
787
|
+
rotationChanged: boolean;
|
|
788
|
+
boundsChanged: boolean;
|
|
789
|
+
boxChanged: boolean;
|
|
790
|
+
strokeChanged: boolean;
|
|
791
|
+
renderChanged: boolean;
|
|
792
|
+
localBoxChanged: boolean;
|
|
793
|
+
surfaceChanged: boolean;
|
|
794
|
+
opacityChanged: boolean;
|
|
795
|
+
hitCanvasChanged: boolean;
|
|
796
|
+
childrenSortChanged?: boolean;
|
|
797
|
+
affectScaleOrRotation: boolean;
|
|
798
|
+
affectRotation: boolean;
|
|
799
|
+
affectChildrenSort?: boolean;
|
|
800
|
+
strokeSpread: number;
|
|
801
|
+
renderSpread: number;
|
|
802
|
+
strokeBoxSpread: number;
|
|
803
|
+
renderShapeSpread: number;
|
|
804
|
+
a: number;
|
|
805
|
+
b: number;
|
|
806
|
+
c: number;
|
|
807
|
+
d: number;
|
|
808
|
+
e: number;
|
|
809
|
+
f: number;
|
|
810
|
+
x: number;
|
|
811
|
+
y: number;
|
|
812
|
+
width: number;
|
|
813
|
+
height: number;
|
|
814
|
+
createLocal(): void;
|
|
815
|
+
update(): void;
|
|
816
|
+
getTransform(relative?: ILocationType | ILeaf): IMatrixData;
|
|
817
|
+
getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData;
|
|
818
|
+
getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData;
|
|
819
|
+
getLayoutPoints(type?: IBoundsType, relative?: ILocationType | ILeaf): IPointData[];
|
|
820
|
+
spreadStroke(): void;
|
|
821
|
+
spreadRender(): void;
|
|
822
|
+
spreadStrokeCancel(): void;
|
|
823
|
+
spreadRenderCancel(): void;
|
|
824
|
+
boxChange(): void;
|
|
825
|
+
localBoxChange(): void;
|
|
826
|
+
strokeChange(): void;
|
|
827
|
+
renderChange(): void;
|
|
828
|
+
scaleChange(): void;
|
|
829
|
+
rotationChange(): void;
|
|
830
|
+
matrixChange(): void;
|
|
831
|
+
surfaceChange(): void;
|
|
832
|
+
opacityChange(): void;
|
|
833
|
+
childrenSortChange(): void;
|
|
834
|
+
destroy(): void;
|
|
835
|
+
}
|
|
836
|
+
|
|
770
837
|
interface IExportOptions {
|
|
771
838
|
quality?: number;
|
|
772
839
|
blob?: boolean;
|
|
@@ -776,6 +843,8 @@ interface IExportOptions {
|
|
|
776
843
|
trim?: boolean;
|
|
777
844
|
fill?: string;
|
|
778
845
|
screenshot?: IBoundsData | boolean;
|
|
846
|
+
location?: ILocationType;
|
|
847
|
+
onCanvas?: IExportOnCanvasFunction;
|
|
779
848
|
}
|
|
780
849
|
interface IExportResult {
|
|
781
850
|
data: ILeaferCanvas | IBlob | string | boolean;
|
|
@@ -787,6 +856,9 @@ interface IExportResult {
|
|
|
787
856
|
interface IExportResultFunction {
|
|
788
857
|
(data: IExportResult): void;
|
|
789
858
|
}
|
|
859
|
+
interface IExportOnCanvasFunction {
|
|
860
|
+
(data: ILeaferCanvas): void;
|
|
861
|
+
}
|
|
790
862
|
|
|
791
863
|
interface ILeaferCanvasConfig extends IAutoBoundsData {
|
|
792
864
|
view?: string | IObject;
|
|
@@ -806,6 +878,10 @@ interface ICanvasStrokeOptions {
|
|
|
806
878
|
dashOffset?: number;
|
|
807
879
|
miterLimit?: number;
|
|
808
880
|
}
|
|
881
|
+
interface ICanvasCacheOptions extends ICanvasStrokeOptions {
|
|
882
|
+
fillStyle?: string | object;
|
|
883
|
+
strokeStyle?: string | object;
|
|
884
|
+
}
|
|
809
885
|
interface ICanvasAttr extends ICanvasStrokeOptions, IObject {
|
|
810
886
|
smooth: boolean;
|
|
811
887
|
smoothLevel: string;
|
|
@@ -993,72 +1069,6 @@ interface ILeafBounds {
|
|
|
993
1069
|
__onUpdateSize?(): void;
|
|
994
1070
|
}
|
|
995
1071
|
|
|
996
|
-
type ILocationType = 'world' | 'local' | 'inner';
|
|
997
|
-
type IBoundsType = 'content' | 'box' | 'stroke' | 'margin' | 'render';
|
|
998
|
-
interface ILeafLayout {
|
|
999
|
-
leaf: ILeaf;
|
|
1000
|
-
proxyZoom: boolean;
|
|
1001
|
-
boxBounds: IBoundsData;
|
|
1002
|
-
strokeBounds: IBoundsData;
|
|
1003
|
-
renderBounds: IBoundsData;
|
|
1004
|
-
marginBounds: IBoundsData;
|
|
1005
|
-
contentBounds: IBoundsData;
|
|
1006
|
-
localStrokeBounds?: IBoundsData;
|
|
1007
|
-
localRenderBounds?: IBoundsData;
|
|
1008
|
-
resized: boolean;
|
|
1009
|
-
waitAutoLayout: boolean;
|
|
1010
|
-
matrixChanged: boolean;
|
|
1011
|
-
scaleChanged: boolean;
|
|
1012
|
-
rotationChanged: boolean;
|
|
1013
|
-
boundsChanged: boolean;
|
|
1014
|
-
boxChanged: boolean;
|
|
1015
|
-
strokeChanged: boolean;
|
|
1016
|
-
renderChanged: boolean;
|
|
1017
|
-
localBoxChanged: boolean;
|
|
1018
|
-
surfaceChanged: boolean;
|
|
1019
|
-
opacityChanged: boolean;
|
|
1020
|
-
hitCanvasChanged: boolean;
|
|
1021
|
-
childrenSortChanged?: boolean;
|
|
1022
|
-
affectScaleOrRotation: boolean;
|
|
1023
|
-
affectRotation: boolean;
|
|
1024
|
-
affectChildrenSort?: boolean;
|
|
1025
|
-
strokeSpread: number;
|
|
1026
|
-
renderSpread: number;
|
|
1027
|
-
strokeBoxSpread: number;
|
|
1028
|
-
renderShapeSpread: number;
|
|
1029
|
-
a: number;
|
|
1030
|
-
b: number;
|
|
1031
|
-
c: number;
|
|
1032
|
-
d: number;
|
|
1033
|
-
e: number;
|
|
1034
|
-
f: number;
|
|
1035
|
-
x: number;
|
|
1036
|
-
y: number;
|
|
1037
|
-
width: number;
|
|
1038
|
-
height: number;
|
|
1039
|
-
createLocal(): void;
|
|
1040
|
-
update(): void;
|
|
1041
|
-
getTransform(relative?: ILocationType | ILeaf): IMatrixData;
|
|
1042
|
-
getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData;
|
|
1043
|
-
getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData;
|
|
1044
|
-
getLayoutPoints(type?: IBoundsType, relative?: ILocationType | ILeaf): IPointData[];
|
|
1045
|
-
spreadStroke(): void;
|
|
1046
|
-
spreadRender(): void;
|
|
1047
|
-
spreadStrokeCancel(): void;
|
|
1048
|
-
spreadRenderCancel(): void;
|
|
1049
|
-
boxChange(): void;
|
|
1050
|
-
localBoxChange(): void;
|
|
1051
|
-
strokeChange(): void;
|
|
1052
|
-
renderChange(): void;
|
|
1053
|
-
scaleChange(): void;
|
|
1054
|
-
rotationChange(): void;
|
|
1055
|
-
matrixChange(): void;
|
|
1056
|
-
surfaceChange(): void;
|
|
1057
|
-
opacityChange(): void;
|
|
1058
|
-
childrenSortChange(): void;
|
|
1059
|
-
destroy(): void;
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
1072
|
type ILeafHitModule = ILeafHit & ThisType<ILeaf>;
|
|
1063
1073
|
interface ILeafHit {
|
|
1064
1074
|
__hitWorld?(point: IRadiusPointData): boolean;
|
|
@@ -1084,8 +1094,6 @@ interface IDataProcessor {
|
|
|
1084
1094
|
__leaf: ILeaf;
|
|
1085
1095
|
__input: IObject;
|
|
1086
1096
|
__middle: IObject;
|
|
1087
|
-
__single: boolean;
|
|
1088
|
-
__checkSingle(): void;
|
|
1089
1097
|
__get(name: string): any;
|
|
1090
1098
|
__getData(): IObject;
|
|
1091
1099
|
__setInput(name: string, value: any): void;
|
|
@@ -1101,6 +1109,9 @@ interface ILeafDataOptions {
|
|
|
1101
1109
|
children?: boolean;
|
|
1102
1110
|
}
|
|
1103
1111
|
interface ILeafData extends IDataProcessor, ILeafComputedData {
|
|
1112
|
+
__single?: boolean;
|
|
1113
|
+
__checkSingle(): void;
|
|
1114
|
+
__removeNaturalSize(): void;
|
|
1104
1115
|
}
|
|
1105
1116
|
|
|
1106
1117
|
interface IBranch extends ILeaf {
|
|
@@ -1177,7 +1188,10 @@ interface ILeafAttrData {
|
|
|
1177
1188
|
scale: INumber | IPointData;
|
|
1178
1189
|
around: IAround;
|
|
1179
1190
|
lazy: IBoolean;
|
|
1191
|
+
pixelRatio: INumber;
|
|
1180
1192
|
draggable: IBoolean;
|
|
1193
|
+
path: IPathCommandData | IPathString;
|
|
1194
|
+
windingRule: IWindingRule;
|
|
1181
1195
|
editable: IBoolean;
|
|
1182
1196
|
editSize?: IEditSize;
|
|
1183
1197
|
hittable: IBoolean;
|
|
@@ -1226,7 +1240,10 @@ interface ILeafInputData {
|
|
|
1226
1240
|
scale?: INumber | IPointData;
|
|
1227
1241
|
around?: IAround;
|
|
1228
1242
|
lazy?: IBoolean;
|
|
1243
|
+
pixelRatio?: INumber;
|
|
1229
1244
|
draggable?: IBoolean;
|
|
1245
|
+
path?: IPathCommandData | IPathString;
|
|
1246
|
+
windingRule?: IWindingRule;
|
|
1230
1247
|
editable?: IBoolean;
|
|
1231
1248
|
editSize?: IEditSize;
|
|
1232
1249
|
hittable?: IBoolean;
|
|
@@ -1263,7 +1280,9 @@ interface ILeafComputedData {
|
|
|
1263
1280
|
skewY?: number;
|
|
1264
1281
|
around?: IAround;
|
|
1265
1282
|
lazy?: boolean;
|
|
1266
|
-
|
|
1283
|
+
pixelRatio?: number;
|
|
1284
|
+
path?: IPathCommandData;
|
|
1285
|
+
windingRule?: IWindingRule;
|
|
1267
1286
|
draggable?: boolean;
|
|
1268
1287
|
editable?: boolean;
|
|
1269
1288
|
editSize?: IEditSize;
|
|
@@ -1280,6 +1299,11 @@ interface ILeafComputedData {
|
|
|
1280
1299
|
__naturalWidth?: number;
|
|
1281
1300
|
__naturalHeight?: number;
|
|
1282
1301
|
readonly __blendMode: string;
|
|
1302
|
+
__useArrow?: boolean;
|
|
1303
|
+
__useEffect?: boolean;
|
|
1304
|
+
__pathInputed?: number;
|
|
1305
|
+
__pathForRender?: IPathCommandData;
|
|
1306
|
+
__path2DForRender?: IPath2D;
|
|
1283
1307
|
}
|
|
1284
1308
|
interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
|
|
1285
1309
|
tag: string;
|
|
@@ -1291,9 +1315,9 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1291
1315
|
leafer?: ILeaferBase;
|
|
1292
1316
|
parent?: ILeaf;
|
|
1293
1317
|
readonly isApp?: boolean;
|
|
1294
|
-
isLeafer?: boolean;
|
|
1295
|
-
isBranch?: boolean;
|
|
1296
|
-
isBranchLeaf?: boolean;
|
|
1318
|
+
readonly isLeafer?: boolean;
|
|
1319
|
+
readonly isBranch?: boolean;
|
|
1320
|
+
readonly isBranchLeaf?: boolean;
|
|
1297
1321
|
__: ILeafData;
|
|
1298
1322
|
proxyData?: ILeafInputData;
|
|
1299
1323
|
__proxyData?: ILeafInputData;
|
|
@@ -1305,7 +1329,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1305
1329
|
readonly __localMatrix: IMatrixData;
|
|
1306
1330
|
readonly __localBoxBounds: IBoundsData;
|
|
1307
1331
|
__worldOpacity: number;
|
|
1308
|
-
readonly worldTransform:
|
|
1332
|
+
readonly worldTransform: IMatrixWithScaleData;
|
|
1309
1333
|
readonly localTransform: IMatrixData;
|
|
1310
1334
|
readonly boxBounds: IBoundsData;
|
|
1311
1335
|
readonly renderBounds: IBoundsData;
|
|
@@ -1322,6 +1346,8 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1322
1346
|
__hitCanvas?: IHitCanvas;
|
|
1323
1347
|
readonly __onlyHitMask: boolean;
|
|
1324
1348
|
readonly __ignoreHitWorld: boolean;
|
|
1349
|
+
readonly pathInputed: boolean;
|
|
1350
|
+
pathClosed: boolean;
|
|
1325
1351
|
__parentWait?: IFunction[];
|
|
1326
1352
|
__leaferWait?: IFunction[];
|
|
1327
1353
|
destroyed: boolean;
|
|
@@ -1332,7 +1358,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
|
|
|
1332
1358
|
nextRender(item: IFunction, off?: 'off'): void;
|
|
1333
1359
|
__bindLeafer(leafer: ILeaferBase | null): void;
|
|
1334
1360
|
set(data: IObject): void;
|
|
1335
|
-
get(): ILeafInputData;
|
|
1361
|
+
get(name?: string): ILeafInputData | IValue;
|
|
1336
1362
|
toJSON(): IObject;
|
|
1337
1363
|
toString(): string;
|
|
1338
1364
|
toSVG?(): string;
|
|
@@ -1613,7 +1639,7 @@ interface IZoomView extends IBranch {
|
|
|
1613
1639
|
setZoomLayer(zoomLayer: ILeaf): void;
|
|
1614
1640
|
}
|
|
1615
1641
|
|
|
1616
|
-
type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'app' | 'game' | 'player' | 'chart';
|
|
1642
|
+
type ILeaferType = 'draw' | 'design' | 'board' | 'document' | 'app' | 'website' | 'game' | 'player' | 'chart';
|
|
1617
1643
|
interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteractionConfig, ILayouterConfig {
|
|
1618
1644
|
start?: boolean;
|
|
1619
1645
|
type?: ILeaferType;
|
|
@@ -1628,7 +1654,6 @@ interface ILeaferAttrData {
|
|
|
1628
1654
|
viewCompleted: boolean;
|
|
1629
1655
|
layoutLocked: boolean;
|
|
1630
1656
|
transforming: boolean;
|
|
1631
|
-
pixelRatio: number;
|
|
1632
1657
|
view: unknown;
|
|
1633
1658
|
canvas: ILeaferCanvas;
|
|
1634
1659
|
renderer: IRenderer;
|
|
@@ -1858,4 +1883,4 @@ interface ICursorRotateMap {
|
|
|
1858
1883
|
[name: string]: ICursorRotate;
|
|
1859
1884
|
}
|
|
1860
1885
|
|
|
1861
|
-
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, 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, IExportOptions, IExportResult, IExportResultFunction, IFindMethod, 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, IString, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|
|
1886
|
+
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, 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, IString, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITwoPointBoundsData, IUICreator, IUIEvent, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWindingRule, IZoomEvent, IZoomView, InnerId, LCommandData, MCommandData, PointerType, QCommandData, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|