@leafer/interface 2.0.2 → 2.0.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/interface",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -18,6 +18,7 @@ import { ILeaferVideo, ILeaferVideoConfig } from '../image/ILeaferVideo'
18
18
  import { IControl } from '../control/IControl'
19
19
  import { IFunction } from '../function/IFunction'
20
20
  import { ITransition } from '../animate/ITransition'
21
+ import { ILeafMap } from '../data/IList'
21
22
 
22
23
 
23
24
  export type ILeaferType = 'draw' | 'block' | 'viewport' | 'editor' | 'design' | 'board' | 'document' | 'app' | 'website' | 'game' | 'player' | 'chart' | 'custom' // 应用场景类型
@@ -66,6 +67,12 @@ export interface ILeaferAttrData {
66
67
  config: ILeaferConfig
67
68
  userConfig?: ILeaferConfig
68
69
 
70
+ // @leafer-in/find
71
+ cacheId?: boolean
72
+ cacheInnerId?: boolean
73
+ innerIdMap?: ILeafMap
74
+ idMap?: ILeafMap
75
+
69
76
  readonly cursorPoint: IPointData
70
77
  readonly clientBounds: IBoundsData
71
78
  leafs: number
@@ -147,7 +154,7 @@ export interface ICreator {
147
154
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter
148
155
  renderer?(target: ILeaf, canvas: ILeaferCanvas, options?: IRendererConfig): IRenderer
149
156
  selector?(target?: ILeaf, options?: ISelectorConfig): ISelector
150
- finder?(target?: ILeaf): IFinder
157
+ finder?(target?: ILeaf, options?: ISelectorConfig): IFinder
151
158
 
152
159
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction
153
160
 
@@ -29,6 +29,7 @@ export interface ILeafDataOptions {
29
29
  export interface ILeafData extends IDataProcessor, ILeafComputedData {
30
30
  __single?: boolean
31
31
  readonly __hasMultiPaint?: boolean // fill 、stroke 、shadow 等同时存在两次以上外观绘制的情况
32
+ __willDestroy?: boolean
32
33
  __checkSingle(): void
33
34
  __removeNaturalSize(): void
34
35
  }
@@ -21,14 +21,7 @@ import { IWindingRule, IPath2D } from '../canvas/ICanvas'
21
21
  import { IJSONOptions } from '../file/IExport'
22
22
  import { IMotionPathData } from '../path/IPathData'
23
23
  import { ITransition } from '../animate/ITransition'
24
-
25
-
26
- export interface ICachedLeaf {
27
- canvas: ILeaferCanvas, // 完整的元素缓存画布
28
- matrix?: IMatrix, // 包含导出时附加的 options.matrix
29
- fitMatrix?: IMatrix, // 不包含导出时附加的 options.matrix
30
- bounds: IBoundsData
31
- }
24
+ import { ITaskItem } from '../task/ITaskProcessor'
32
25
 
33
26
 
34
27
  export type ISide = 'width' | 'height'
@@ -434,6 +427,7 @@ export interface ILeafComputedData {
434
427
  // other
435
428
  __childBranchNumber?: number // 存在子分支的个数
436
429
  __complex?: boolean // 外观是否复杂
430
+ __complexData?: ILeafComplexCachedData // 复杂元素的缓存图
437
431
 
438
432
  __naturalWidth?: number
439
433
  __naturalHeight?: number
@@ -456,12 +450,19 @@ export interface ILeafComputedData {
456
450
  __pathInputed?: number // 是否为输入path, 0:否,1:是,2:永远是(不自动检测)
457
451
  __pathForRender?: IPathCommandData
458
452
  __path2DForRender?: IPath2D
459
- __pathForArrow?: IPathCommandData
453
+
454
+ __startArrowPath?: IArrowPathData
455
+ __endArrowPath?: IArrowPathData
460
456
  __pathForMotion?: IMotionPathData
461
457
 
462
458
  __clipAfterFill?: boolean // 一般用于判断是否裁剪 Box
463
459
  }
464
460
 
461
+ export interface IArrowPathData {
462
+ data: IPathCommandData
463
+ fill?: boolean
464
+ }
465
+
465
466
  export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
466
467
  tag: string
467
468
  readonly __tag: string
@@ -532,6 +533,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
532
533
 
533
534
  __hasAutoLayout?: boolean
534
535
  __hasMotionPath?: boolean
536
+ __hasComplex?: boolean
535
537
 
536
538
  __hasMask?: boolean
537
539
  __hasEraser?: boolean
@@ -635,7 +637,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
635
637
  // convert
636
638
  __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData // when render use other matrix
637
639
  getClampRenderScale(): number // 获取当前渲染元素的缩放比例,限制最小为1
638
- getRenderScaleData(abs?: boolean, scaleFixed?: IScaleFixed): IScaleData // 当前渲染的比例数据,必须马上分解使用
640
+ getRenderScaleData(abs?: boolean, scaleFixed?: IScaleFixed, unscale?: boolean): IScaleData // 当前渲染的比例数据,必须马上分解使用
639
641
 
640
642
  getTransform(relative?: ILocationType | ILeaf): IMatrixData
641
643
 
@@ -699,7 +701,6 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
699
701
 
700
702
  // ILeafRender ->
701
703
  __render(canvas: ILeaferCanvas, options: IRenderOptions): void
702
- __renderComplex(canvas: ILeaferCanvas, options: IRenderOptions): void
703
704
  __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void
704
705
  __draw(canvas: ILeaferCanvas, options: IRenderOptions, originCanvas?: ILeaferCanvas): void
705
706
 
@@ -714,7 +715,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
714
715
  __drawPath(canvas: ILeaferCanvas): void
715
716
  __drawRenderPath(canvas: ILeaferCanvas): void
716
717
  __updatePath(): void
717
- __updateRenderPath(): void
718
+ __updateRenderPath(updateCache?: boolean): void
718
719
 
719
720
  // motion path
720
721
  getMotionPathData(): IMotionPathData
@@ -742,3 +743,19 @@ export type ILeafAttrDescriptor = IObject & ThisType<ILeaf>
742
743
  export interface ILeafAttrDescriptorFn {
743
744
  (key: string): ILeafAttrDescriptor
744
745
  }
746
+
747
+ export interface ICachedLeaf {
748
+ canvas: ILeaferCanvas, // 完整的元素缓存画布
749
+ matrix?: IMatrix, // 包含导出时附加的 options.matrix
750
+ fitMatrix?: IMatrix, // 不包含导出时附加的 options.matrix
751
+ bounds: IBoundsData
752
+ }
753
+
754
+ export interface ILeafComplexCachedData { // 复杂元素缓存对象
755
+ canvas?: ILeaferCanvas
756
+ scaleX?: number
757
+ scaleY?: number
758
+ changed?: boolean
759
+ task?: ITaskItem
760
+ destroy(): void
761
+ }
@@ -1,7 +1,7 @@
1
1
  import { ICanvasPattern } from '../canvas/ICanvas'
2
2
  import { IObject } from '../data/IData'
3
3
  import { InnerId } from '../event/IEventer'
4
- import { IExportFileType } from '../file/IFileType'
4
+ import { IExportFileType, IFilmFileType, IVideoFileType } from '../file/IFileType'
5
5
  import { IBoundsData, IMatrixData, IPointData, ISizeData } from '../math/IMath'
6
6
  import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
7
7
  import { IProgressData } from '../event/IProgress'
@@ -13,7 +13,7 @@ import { IFunction } from '../function/IFunction'
13
13
  export interface ILeaferImageConfig {
14
14
  url: string
15
15
  lod?: IImageLOD
16
- format?: IExportFileType
16
+ format?: IExportFileType | IFilmFileType | IVideoFileType
17
17
  crossOrigin?: IImageCrossOrigin
18
18
  showProgress?: boolean | string // 是否显示进度
19
19
  view?: IObject | ILeaferImage | ILeaferCanvas
@@ -102,6 +102,12 @@ export interface ILeaferImage {
102
102
 
103
103
  isPlacehold?: boolean // 是否显示占位符,一般在加载100ms后自动判断
104
104
 
105
+ // filter
106
+ parent?: ILeaferImage
107
+ childrenMap?: ILeaferImageMap
108
+ filterKey?: string
109
+
110
+ // lod
105
111
  largeThumb?: ILeaferImageLevel
106
112
  thumb?: ILeaferImageLevel
107
113
  levels?: ILeaferImageLevel[]
@@ -130,7 +136,12 @@ export interface ILeaferImage {
130
136
  getLevelData(level: number, width?: number, height?: number): ILeaferImageLevel
131
137
  clearLevels(checkUse?: boolean): void
132
138
 
139
+ destroyFilter(): void // parent and childrenMap
133
140
  destroy(): void
134
141
  }
135
142
 
143
+ export interface ILeaferImageMap {
144
+ [name: string]: ILeaferImage
145
+ }
146
+
136
147
  export type IImageStatus = 'wait' | 'thumb-loading' | 'thumb-success' | 'thumb-error' | 'loading' | 'success' | 'error'
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { IAppBase } from './app/IApp'
2
2
  export { ILeaferBase, ILeaferAttrData, ILeaferType, ILeaferMode, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator, IZoomType, IZoomOptions } from './app/ILeafer'
3
- export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IFlowType, IFlowBoxType, IAlign, IAxisAlign, IFlowAlign, IFlowAxisAlign, ISide, IAxis, IGap, IPointGap, IAxisReverse, IBaseLineAlign, IFlowWrap, IAutoSize, IRangeSize, IInterlace, IPercentData, IUnitData, IConstraint, IConstraintType, IScaleFixed, IHitType, IMaskType, IEraserType, IBlendMode, IEditSize, IDragBoundsType, IImageCursor, ICursorType, IStateStyleType, IDirection, IDirection4, IAround, IFilter, ILeafAttrDescriptor, ILeafAttrDescriptorFn } from './display/ILeaf'
3
+ export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, ILeafComplexCachedData, IFlowType, IFlowBoxType, IAlign, IAxisAlign, IFlowAlign, IFlowAxisAlign, ISide, IAxis, IGap, IPointGap, IAxisReverse, IBaseLineAlign, IFlowWrap, IAutoSize, IRangeSize, IInterlace, IPercentData, IUnitData, IConstraint, IConstraintType, IScaleFixed, IHitType, IMaskType, IEraserType, IBlendMode, IEditSize, IDragBoundsType, IImageCursor, ICursorType, IStateStyleType, IDirection, IDirection4, IAround, IFilter, ILeafAttrDescriptor, ILeafAttrDescriptorFn, IArrowPathData } from './display/ILeaf'
4
4
  export { IBranch } from './display/IBranch'
5
5
  export { IZoomView } from './display/IView'
6
6
 
@@ -40,7 +40,7 @@ export { IMotionPathData } from './path/IPathData'
40
40
  export { IWindingRule, ICanvasContext2D, ICanvasContext2DSettings, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
41
41
  export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData, MoveToCommandObject, LineToCommandObject, BezierCurveToCommandObject, QuadraticCurveToCommandObject, IPathCommandObject, IPathCommandNodeBase, MoveToCommandNode, LineToCommandNode, BezierCurveToCommandNode, ClosePathCommandNode, IPathCommandNode, PathNodeHandleType, PathNodeHandleName, IPathNodeBase } from './path/IPathCommand'
42
42
 
43
- export { ILeaferImage, ILeaferImageConfig, IImageLOD, IImageTileLOD, ILeaferImageSliceData, ILeaferImageSlice, ILeaferImageLevel, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
43
+ export { ILeaferImage, ILeaferImageMap, ILeaferImageConfig, IImageLOD, IImageTileLOD, ILeaferImageSliceData, ILeaferImageSlice, ILeaferImageLevel, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
44
44
  export { ILeaferFilm, ILeaferFilmConfig, IFilmDecoder, IFilmFrame, IFilmOptions, IFilmPlayOptions } from './image/ILeaferFilm'
45
45
  export { ILeaferVideo, ILeaferVideoConfig } from './image/ILeaferVideo'
46
46
  export { IResource } from './file/IResource'
@@ -24,6 +24,7 @@ export interface ILeafLayout {
24
24
  // localBoxBounds: IBoundsData // use leaf.__localBoxBounds
25
25
  localStrokeBounds: IBoundsData
26
26
  localRenderBounds: IBoundsData
27
+ localOuterBounds?: IBoundsData // | renderBounds * (1 / scaleFixed) |
27
28
 
28
29
  // world
29
30
 
@@ -57,13 +58,14 @@ export interface ILeafLayout {
57
58
  localBoxChanged: boolean // position
58
59
 
59
60
  // face changed
60
- surfaceChanged: boolean
61
+ surfaceChanged: boolean // 不能包含透明度变化
61
62
  opacityChanged: boolean
62
63
 
63
64
  hitCanvasChanged: boolean
64
65
 
65
66
  childrenSortChanged?: boolean
66
67
  stateStyleChanged?: boolean // hoverStyle ...
68
+ linkerChanged?: boolean
67
69
 
68
70
  // config changed
69
71
  scrollConfigChanged?: boolean
@@ -79,6 +81,10 @@ export interface ILeafLayout {
79
81
  renderSpread: IFourNumber // -1 表示需监视变化,不影响实际renderBounds,目前用在Box上
80
82
  renderShapeSpread: IFourNumber
81
83
 
84
+ // scale fixed
85
+ scaleFixed?: number
86
+ outerScale?: number // localOuterBounds: scaleFixed < 1
87
+
82
88
  // temp local
83
89
  a: number
84
90
  b: number
package/src/math/IMath.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IFourNumber, IObject } from '../data/IData'
2
- import { IAlign, ISide } from '../display/ILeaf'
2
+ import { IAlign, ISide, IAround } from '../display/ILeaf'
3
3
 
4
4
  export interface IPointData {
5
5
  x: number
@@ -56,6 +56,8 @@ export interface IPoint extends IPointData {
56
56
  getAngle(to: IPointData): number
57
57
  getAtan2(to: IPointData): number
58
58
 
59
+ isSame(point: IPointData, quick?: boolean): boolean
60
+
59
61
  reset(): IPoint
60
62
  }
61
63
 
@@ -126,6 +128,7 @@ export interface IBounds extends IBoundsData, ITwoPointBoundsData {
126
128
  setPoints(points: IPointData[]): IBounds
127
129
  addPoint(point: IPointData): IBounds
128
130
  getPoints(): IPointData[] // topLeft, topRight, bottomRight, bottomLeft
131
+ getPoint(around: IAround, onlyBoxSize?: boolean, to?: IPointData): IPointData
129
132
 
130
133
  hitPoint(point: IPointData, pointMatrix?: IMatrixData): boolean
131
134
  hitRadiusPoint(point: IRadiusPointData, pointMatrix?: IMatrixWithLayoutData): boolean
@@ -25,6 +25,9 @@ export interface IRenderOptions {
25
25
  ignoreFill?: boolean, // 绘制外形时忽略fill
26
26
  ignoreStroke?: boolean // 绘制外形时忽略stroke
27
27
 
28
+ ignoreOpacity?: boolean // 绘制时忽略元素的opacity
29
+
30
+
28
31
  cellList?: ILeafList
29
32
  }
30
33
 
package/types/index.d.ts CHANGED
@@ -43,6 +43,7 @@ interface IPoint extends IPointData {
43
43
  getDistancePoint(to: IPointData, distance: number, changeTo?: boolean): IPoint;
44
44
  getAngle(to: IPointData): number;
45
45
  getAtan2(to: IPointData): number;
46
+ isSame(point: IPointData, quick?: boolean): boolean;
46
47
  reset(): IPoint;
47
48
  }
48
49
  interface IRadiusPointData extends IPointData {
@@ -99,6 +100,7 @@ interface IBounds extends IBoundsData, ITwoPointBoundsData {
99
100
  setPoints(points: IPointData[]): IBounds;
100
101
  addPoint(point: IPointData): IBounds;
101
102
  getPoints(): IPointData[];
103
+ getPoint(around: IAround, onlyBoxSize?: boolean, to?: IPointData): IPointData;
102
104
  hitPoint(point: IPointData, pointMatrix?: IMatrixData): boolean;
103
105
  hitRadiusPoint(point: IRadiusPointData, pointMatrix?: IMatrixWithLayoutData): boolean;
104
106
  hit(bounds: IBoundsData, boundsMatrix?: IMatrixData): boolean;
@@ -934,6 +936,7 @@ interface ILeafLayout {
934
936
  localContentBounds: IBoundsData;
935
937
  localStrokeBounds: IBoundsData;
936
938
  localRenderBounds: IBoundsData;
939
+ localOuterBounds?: IBoundsData;
937
940
  worldContentBounds: IBoundsData;
938
941
  worldBoxBounds: IBoundsData;
939
942
  worldStrokeBounds: IBoundsData;
@@ -955,6 +958,7 @@ interface ILeafLayout {
955
958
  hitCanvasChanged: boolean;
956
959
  childrenSortChanged?: boolean;
957
960
  stateStyleChanged?: boolean;
961
+ linkerChanged?: boolean;
958
962
  scrollConfigChanged?: boolean;
959
963
  editConfigChanged?: boolean;
960
964
  affectScaleOrRotation: boolean;
@@ -964,6 +968,8 @@ interface ILeafLayout {
964
968
  strokeBoxSpread: number;
965
969
  renderSpread: IFourNumber;
966
970
  renderShapeSpread: IFourNumber;
971
+ scaleFixed?: number;
972
+ outerScale?: number;
967
973
  a: number;
968
974
  b: number;
969
975
  c: number;
@@ -1206,6 +1212,7 @@ interface IRenderOptions {
1206
1212
  shape?: boolean;
1207
1213
  ignoreFill?: boolean;
1208
1214
  ignoreStroke?: boolean;
1215
+ ignoreOpacity?: boolean;
1209
1216
  cellList?: ILeafList;
1210
1217
  }
1211
1218
  interface IRendererConfig {
@@ -1319,6 +1326,7 @@ interface ILeafDataOptions {
1319
1326
  interface ILeafData extends IDataProcessor, ILeafComputedData {
1320
1327
  __single?: boolean;
1321
1328
  readonly __hasMultiPaint?: boolean;
1329
+ __willDestroy?: boolean;
1322
1330
  __checkSingle(): void;
1323
1331
  __removeNaturalSize(): void;
1324
1332
  }
@@ -1444,12 +1452,49 @@ interface IAnimateEventFunction {
1444
1452
  (animate?: any): any;
1445
1453
  }
1446
1454
 
1447
- interface ICachedLeaf {
1448
- canvas: ILeaferCanvas;
1449
- matrix?: IMatrix;
1450
- fitMatrix?: IMatrix;
1451
- bounds: IBoundsData;
1455
+ interface ITaskProcessorConfig {
1456
+ onComplete?: IFunction;
1457
+ onTask?: IFunction;
1458
+ onError?: IFunction;
1459
+ parallel?: number;
1460
+ }
1461
+ interface ITaskProcessor {
1462
+ config: ITaskProcessorConfig;
1463
+ running: boolean;
1464
+ isComplete: boolean;
1465
+ percent: number;
1466
+ total: number;
1467
+ index: number;
1468
+ finishedIndex: number;
1469
+ remain: number;
1470
+ start(): void;
1471
+ pause(): void;
1472
+ resume(): void;
1473
+ skip(): void;
1474
+ stop(): void;
1475
+ add(taskCallback: IFunction, options?: ITaskOptions | number, canUse?: IFunction): ITaskItem;
1476
+ destroy(): void;
1452
1477
  }
1478
+ interface ITaskItem {
1479
+ parent: ITaskProcessor;
1480
+ parallel: boolean;
1481
+ isComplete: boolean;
1482
+ isCancel: boolean;
1483
+ time: number;
1484
+ task?: IFunction;
1485
+ canUse?: IFunction;
1486
+ run(): Promise<void>;
1487
+ complete(): void;
1488
+ cancel(): void;
1489
+ }
1490
+ interface ITaskOptions {
1491
+ start?: boolean;
1492
+ time?: number;
1493
+ parallel?: boolean;
1494
+ delay?: number;
1495
+ canUse?: IFunction;
1496
+ }
1497
+
1453
1498
  type ISide = 'width' | 'height';
1454
1499
  type IAxis = 'x' | 'y';
1455
1500
  type IAxisReverse = 'x-reverse' | 'y-reverse';
@@ -1666,6 +1711,7 @@ interface ILeafComputedData {
1666
1711
  data?: IObject;
1667
1712
  __childBranchNumber?: number;
1668
1713
  __complex?: boolean;
1714
+ __complexData?: ILeafComplexCachedData;
1669
1715
  __naturalWidth?: number;
1670
1716
  __naturalHeight?: number;
1671
1717
  readonly __autoWidth?: boolean;
@@ -1683,10 +1729,15 @@ interface ILeafComputedData {
1683
1729
  __pathInputed?: number;
1684
1730
  __pathForRender?: IPathCommandData;
1685
1731
  __path2DForRender?: IPath2D;
1686
- __pathForArrow?: IPathCommandData;
1732
+ __startArrowPath?: IArrowPathData;
1733
+ __endArrowPath?: IArrowPathData;
1687
1734
  __pathForMotion?: IMotionPathData;
1688
1735
  __clipAfterFill?: boolean;
1689
1736
  }
1737
+ interface IArrowPathData {
1738
+ data: IPathCommandData;
1739
+ fill?: boolean;
1740
+ }
1690
1741
  interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
1691
1742
  tag: string;
1692
1743
  readonly __tag: string;
@@ -1736,6 +1787,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1736
1787
  animationOut?: IObject | IObject[];
1737
1788
  __hasAutoLayout?: boolean;
1738
1789
  __hasMotionPath?: boolean;
1790
+ __hasComplex?: boolean;
1739
1791
  __hasMask?: boolean;
1740
1792
  __hasEraser?: boolean;
1741
1793
  __hitCanvas?: IHitCanvas;
@@ -1807,7 +1859,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1807
1859
  __renderEraser(canvas: ILeaferCanvas, options: IRenderOptions): void;
1808
1860
  __getNowWorld(options: IRenderOptions): IMatrixWithBoundsScaleData;
1809
1861
  getClampRenderScale(): number;
1810
- getRenderScaleData(abs?: boolean, scaleFixed?: IScaleFixed): IScaleData;
1862
+ getRenderScaleData(abs?: boolean, scaleFixed?: IScaleFixed, unscale?: boolean): IScaleData;
1811
1863
  getTransform(relative?: ILocationType | ILeaf): IMatrixData;
1812
1864
  getBounds(type?: IBoundsType, relative?: ILocationType | ILeaf): IBoundsData;
1813
1865
  getLayoutBounds(type?: IBoundsType, relative?: ILocationType | ILeaf, unscale?: boolean): ILayoutBoundsData;
@@ -1855,7 +1907,6 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1855
1907
  __drawHitPath(canvas: ILeaferCanvas): void;
1856
1908
  __updateHitCanvas(): void;
1857
1909
  __render(canvas: ILeaferCanvas, options: IRenderOptions): void;
1858
- __renderComplex(canvas: ILeaferCanvas, options: IRenderOptions): void;
1859
1910
  __drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void;
1860
1911
  __draw(canvas: ILeaferCanvas, options: IRenderOptions, originCanvas?: ILeaferCanvas): void;
1861
1912
  __clip(canvas: ILeaferCanvas, options: IRenderOptions): void;
@@ -1866,7 +1917,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1866
1917
  __drawPath(canvas: ILeaferCanvas): void;
1867
1918
  __drawRenderPath(canvas: ILeaferCanvas): void;
1868
1919
  __updatePath(): void;
1869
- __updateRenderPath(): void;
1920
+ __updateRenderPath(updateCache?: boolean): void;
1870
1921
  getMotionPathData(): IMotionPathData;
1871
1922
  getMotionPoint(motionDistance: number | IUnitData): IRotationPointData;
1872
1923
  getMotionTotal(): number;
@@ -1884,6 +1935,20 @@ type ILeafAttrDescriptor = IObject & ThisType<ILeaf>;
1884
1935
  interface ILeafAttrDescriptorFn {
1885
1936
  (key: string): ILeafAttrDescriptor;
1886
1937
  }
1938
+ interface ICachedLeaf {
1939
+ canvas: ILeaferCanvas;
1940
+ matrix?: IMatrix;
1941
+ fitMatrix?: IMatrix;
1942
+ bounds: IBoundsData;
1943
+ }
1944
+ interface ILeafComplexCachedData {
1945
+ canvas?: ILeaferCanvas;
1946
+ scaleX?: number;
1947
+ scaleY?: number;
1948
+ changed?: boolean;
1949
+ task?: ITaskItem;
1950
+ destroy(): void;
1951
+ }
1887
1952
 
1888
1953
  interface IProgressData {
1889
1954
  value: number;
@@ -2050,53 +2115,10 @@ interface IMiniapp {
2050
2115
  saveToAlbum(path: string): Promise<any>;
2051
2116
  }
2052
2117
 
2053
- interface ITaskProcessorConfig {
2054
- onComplete?: IFunction;
2055
- onTask?: IFunction;
2056
- onError?: IFunction;
2057
- parallel?: number;
2058
- }
2059
- interface ITaskProcessor {
2060
- config: ITaskProcessorConfig;
2061
- running: boolean;
2062
- isComplete: boolean;
2063
- percent: number;
2064
- total: number;
2065
- index: number;
2066
- finishedIndex: number;
2067
- remain: number;
2068
- start(): void;
2069
- pause(): void;
2070
- resume(): void;
2071
- skip(): void;
2072
- stop(): void;
2073
- add(taskCallback: IFunction, options?: ITaskOptions | number, canUse?: IFunction): ITaskItem;
2074
- destroy(): void;
2075
- }
2076
- interface ITaskItem {
2077
- parent: ITaskProcessor;
2078
- parallel: boolean;
2079
- isComplete: boolean;
2080
- isCancel: boolean;
2081
- time: number;
2082
- task?: IFunction;
2083
- canUse?: IFunction;
2084
- run(): Promise<void>;
2085
- complete(): void;
2086
- cancel(): void;
2087
- }
2088
- interface ITaskOptions {
2089
- start?: boolean;
2090
- time?: number;
2091
- parallel?: boolean;
2092
- delay?: number;
2093
- canUse?: IFunction;
2094
- }
2095
-
2096
2118
  interface ILeaferImageConfig {
2097
2119
  url: string;
2098
2120
  lod?: IImageLOD;
2099
- format?: IExportFileType;
2121
+ format?: IExportFileType | IFilmFileType | IVideoFileType;
2100
2122
  crossOrigin?: IImageCrossOrigin;
2101
2123
  showProgress?: boolean | string;
2102
2124
  view?: IObject | ILeaferImage | ILeaferCanvas;
@@ -2167,6 +2189,9 @@ interface ILeaferImage {
2167
2189
  error: IObject;
2168
2190
  loading: boolean;
2169
2191
  isPlacehold?: boolean;
2192
+ parent?: ILeaferImage;
2193
+ childrenMap?: ILeaferImageMap;
2194
+ filterKey?: string;
2170
2195
  largeThumb?: ILeaferImageLevel;
2171
2196
  thumb?: ILeaferImageLevel;
2172
2197
  levels?: ILeaferImageLevel[];
@@ -2188,8 +2213,12 @@ interface ILeaferImage {
2188
2213
  getMinLevel(): number;
2189
2214
  getLevelData(level: number, width?: number, height?: number): ILeaferImageLevel;
2190
2215
  clearLevels(checkUse?: boolean): void;
2216
+ destroyFilter(): void;
2191
2217
  destroy(): void;
2192
2218
  }
2219
+ interface ILeaferImageMap {
2220
+ [name: string]: ILeaferImage;
2221
+ }
2193
2222
 
2194
2223
  interface IUIEvent extends IEvent {
2195
2224
  x: number;
@@ -2464,6 +2493,10 @@ interface ILeaferAttrData {
2464
2493
  lazyBounds: IBounds;
2465
2494
  config: ILeaferConfig;
2466
2495
  userConfig?: ILeaferConfig;
2496
+ cacheId?: boolean;
2497
+ cacheInnerId?: boolean;
2498
+ innerIdMap?: ILeafMap;
2499
+ idMap?: ILeafMap;
2467
2500
  readonly cursorPoint: IPointData;
2468
2501
  readonly clientBounds: IBoundsData;
2469
2502
  leafs: number;
@@ -2526,7 +2559,7 @@ interface ICreator {
2526
2559
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter;
2527
2560
  renderer?(target: ILeaf, canvas: ILeaferCanvas, options?: IRendererConfig): IRenderer;
2528
2561
  selector?(target?: ILeaf, options?: ISelectorConfig): ISelector;
2529
- finder?(target?: ILeaf): IFinder;
2562
+ finder?(target?: ILeaf, options?: ISelectorConfig): IFinder;
2530
2563
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction;
2531
2564
  editor?(options?: IObject, app?: IAppBase): ILeaf;
2532
2565
  }
@@ -2607,4 +2640,4 @@ interface ITransformer {
2607
2640
  }
2608
2641
 
2609
2642
  export { PathNodeHandleType };
2610
- export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandNode, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, ClosePathCommandNode, EllipseCommandData, HCommandData, IAlign, IAnimateEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvent, IAnimateEventFunction, IAnimateEvents, IAnimateOptions, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsDataWithOptionRotation, IBoundsEvent, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasSizeAttr, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICubicBezierEasing, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, ICustomEasingFunction, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragBoundsType, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventOption, IEventParams, IEventParamsMap, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFilmDecoder, IFilmFileType, IFilmFrame, IFilmOptions, IFilmPlayOptions, IFilter, IFindCondition, IFindMethod, IFinder, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IGestureType, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCrossOrigin, IImageCursor, IImageEvent, IImageLOD, IImageManager, IImageTileLOD, IInteraction, IInteractionCanvas, IInteractionConfig, IInterlace, IJSONOptions, IKeepTouchData, IKeyCodes, 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, ILeaferFilm, ILeaferFilmConfig, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageLevel, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferImageSlice, ILeaferImageSliceData, ILeaferMode, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferVideo, ILeaferVideoConfig, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionHalfData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, IMultimediaType, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IOptionPointData, IOptionSizeData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandNode, IPathCommandNodeBase, IPathCommandObject, IPathCreator, IPathDrawer, IPathNodeBase, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPicker, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IProgressData, IProgressFunction, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResource, IResponseType, IRotateEvent, IRotationPointData, IScaleData, IScaleFixed, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, IShortcutKeyCodes, IShortcutKeys, IShortcutKeysCheck, ISide, ISingleGestureConfig, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IStepsEasing, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITouchEvent, ITransformer, ITransition, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IValueFunction, IVideoFileType, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IWindingRuleData, IZoomConfig, IZoomEvent, IZoomOptions, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandNode, LineToCommandObject, MCommandData, MoveToCommandNode, MoveToCommandObject, PathNodeHandleName, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
2643
+ export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandNode, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, ClosePathCommandNode, EllipseCommandData, HCommandData, IAlign, IAnimateEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvent, IAnimateEventFunction, IAnimateEvents, IAnimateOptions, IAnswer, IAppBase, IAround, IArrowPathData, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsDataWithOptionRotation, IBoundsEvent, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasSizeAttr, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICubicBezierEasing, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, ICustomEasingFunction, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragBoundsType, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventOption, IEventParams, IEventParamsMap, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFilmDecoder, IFilmFileType, IFilmFrame, IFilmOptions, IFilmPlayOptions, IFilter, IFindCondition, IFindMethod, IFinder, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IGestureType, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCrossOrigin, IImageCursor, IImageEvent, IImageLOD, IImageManager, IImageTileLOD, IInteraction, IInteractionCanvas, IInteractionConfig, IInterlace, IJSONOptions, IKeepTouchData, IKeyCodes, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafAttrDescriptor, ILeafAttrDescriptorFn, ILeafBounds, ILeafBoundsModule, ILeafComplexCachedData, 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, ILeaferFilm, ILeaferFilmConfig, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageLevel, ILeaferImageMap, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferImageSlice, ILeaferImageSliceData, ILeaferMode, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferVideo, ILeaferVideoConfig, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionHalfData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, IMultimediaType, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IOptionPointData, IOptionSizeData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandNode, IPathCommandNodeBase, IPathCommandObject, IPathCreator, IPathDrawer, IPathNodeBase, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPicker, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IProgressData, IProgressFunction, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResource, IResponseType, IRotateEvent, IRotationPointData, IScaleData, IScaleFixed, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, IShortcutKeyCodes, IShortcutKeys, IShortcutKeysCheck, ISide, ISingleGestureConfig, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IStepsEasing, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITouchEvent, ITransformer, ITransition, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IValueFunction, IVideoFileType, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IWindingRuleData, IZoomConfig, IZoomEvent, IZoomOptions, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandNode, LineToCommandObject, MCommandData, MoveToCommandNode, MoveToCommandObject, PathNodeHandleName, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };