@leafer/interface 1.2.2 → 1.3.0

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": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -2,7 +2,7 @@ import { ILeaf, ICursorType } from '../display/ILeaf'
2
2
  import { IRenderer, IRendererConfig } from '../renderer/IRenderer'
3
3
  import { IHitCanvas, ILeaferCanvas, ILeaferCanvasConfig, IHitCanvasConfig } from '../canvas/ILeaferCanvas'
4
4
  import { ILayouter, ILayouterConfig } from '../layouter/ILayouter'
5
- import { ISelector, ISelectorConfig } from '../selector/ISelector'
5
+ import { IFinder, ISelector, ISelectorConfig } from '../selector/ISelector'
6
6
  import { IInteraction, IInteractionCanvas, IInteractionConfig } from '../interaction/IInteraction'
7
7
  import { IWatcher, IWatcherConfig } from '../watcher/IWatcher'
8
8
  import { IAutoBounds, IBoundsData, IPointData, IScreenSizeData, IBounds, IClientPointData } from '../math/IMath'
@@ -125,6 +125,7 @@ export interface ICreator {
125
125
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter
126
126
  renderer?(target: ILeaf, canvas: ILeaferCanvas, options?: IRendererConfig): IRenderer
127
127
  selector?(target?: ILeaf, options?: ISelectorConfig): ISelector
128
+ finder?(target?: ILeaf): IFinder
128
129
 
129
130
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction
130
131
 
@@ -482,8 +482,8 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
482
482
 
483
483
  readonly __worldFlipped: boolean
484
484
 
485
- animation?: IObject
486
- animationOut?: IObject
485
+ animation?: IObject | IObject[]
486
+ animationOut?: IObject | IObject[]
487
487
 
488
488
  __hasAutoLayout?: boolean
489
489
  __hasMotionPath?: boolean
package/src/index.ts CHANGED
@@ -19,7 +19,7 @@ export { IBranchRender, IBranchRenderModule } from './display/module/IBranchRend
19
19
  export { IRenderer, IRendererConfig, IRenderOptions } from './renderer/IRenderer'
20
20
  export { IWatcher, IWatchEventData, IWatcherConfig } from './watcher/IWatcher'
21
21
  export { ILayouter, ILayoutChangedData, ILayoutBlockData, ILayouterConfig, IPartLayoutConfig } from './layouter/ILayouter'
22
- export { ISelector, ISelectorConfig, ISelectorProxy, IFindCondition, IFindMethod, IPickResult, IPickOptions, IPickBottom, IAnswer } from './selector/ISelector'
22
+ export { ISelector, ISelectorConfig, ISelectorProxy, IFinder, IFindCondition, IFindMethod, IPickResult, IPicker, IPickOptions, IPickBottom, IAnswer } from './selector/ISelector'
23
23
 
24
24
  export { ICanvasManager } from './canvas/ICanvasManager'
25
25
  export { IHitCanvasManager } from './canvas/IHitCanvasManager'
@@ -43,6 +43,7 @@ export interface IPlatform {
43
43
 
44
44
  roundRectPatch?: boolean // fix: skia-canvas roundRect
45
45
  ellipseToCurve?: boolean, // fix: skia 绘制圆环和椭圆弧
46
+ backgrounder?: boolean, // 后台模式运行,如 node、workder
46
47
 
47
48
  event?: {
48
49
  stopDefault(origin: IObject): void
@@ -48,18 +48,30 @@ export interface ISelectorProxy {
48
48
 
49
49
  export interface ISelector {
50
50
  target?: ILeaf
51
-
52
51
  proxy?: ISelectorProxy
53
52
 
54
53
  config: ISelectorConfig
55
54
 
55
+ picker: IPicker
56
+ finder?: IFinder
57
+
58
+ getByPoint(hitPoint: IPointData, hitRadius: number, options?: IPickOptions): IPickResult
59
+ getBy(condition: number | string | IFindCondition | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[]
60
+ destroy(): void
61
+ }
62
+
63
+
64
+ export interface IPicker {
56
65
  getByPoint(hitPoint: IPointData, hitRadius: number, options?: IPickOptions): IPickResult
66
+ destroy(): void
67
+ }
57
68
 
58
- getBy(condition: number | string | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[]
69
+ export interface IFinder {
70
+ getBy(condition: number | string | IFindCondition | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[]
59
71
  getByInnerId(innerId: number, branch?: ILeaf): ILeaf
60
72
  getById(id: string, branch?: ILeaf): ILeaf
61
73
  getByClassName(className: string, branch?: ILeaf): ILeaf[]
62
74
  getByTag(tag: string, branch?: ILeaf): ILeaf[]
63
75
  getByMethod(method: IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[]
64
76
  destroy(): void
65
- }
77
+ }
package/types/index.d.ts CHANGED
@@ -1264,8 +1264,18 @@ interface ISelector {
1264
1264
  target?: ILeaf;
1265
1265
  proxy?: ISelectorProxy;
1266
1266
  config: ISelectorConfig;
1267
+ picker: IPicker;
1268
+ finder?: IFinder;
1267
1269
  getByPoint(hitPoint: IPointData, hitRadius: number, options?: IPickOptions): IPickResult;
1268
- getBy(condition: number | string | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[];
1270
+ getBy(condition: number | string | IFindCondition | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[];
1271
+ destroy(): void;
1272
+ }
1273
+ interface IPicker {
1274
+ getByPoint(hitPoint: IPointData, hitRadius: number, options?: IPickOptions): IPickResult;
1275
+ destroy(): void;
1276
+ }
1277
+ interface IFinder {
1278
+ getBy(condition: number | string | IFindCondition | IFindMethod, branch?: ILeaf, one?: boolean, options?: any): ILeaf | ILeaf[];
1269
1279
  getByInnerId(innerId: number, branch?: ILeaf): ILeaf;
1270
1280
  getById(id: string, branch?: ILeaf): ILeaf;
1271
1281
  getByClassName(className: string, branch?: ILeaf): ILeaf[];
@@ -1534,8 +1544,8 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1534
1544
  __level: number;
1535
1545
  __tempNumber?: number;
1536
1546
  readonly __worldFlipped: boolean;
1537
- animation?: IObject;
1538
- animationOut?: IObject;
1547
+ animation?: IObject | IObject[];
1548
+ animationOut?: IObject | IObject[];
1539
1549
  __hasAutoLayout?: boolean;
1540
1550
  __hasMotionPath?: boolean;
1541
1551
  __hasMask?: boolean;
@@ -2006,6 +2016,7 @@ interface ICreator {
2006
2016
  layouter?(target: ILeaf, options?: ILayouterConfig): ILayouter;
2007
2017
  renderer?(target: ILeaf, canvas: ILeaferCanvas, options?: IRendererConfig): IRenderer;
2008
2018
  selector?(target?: ILeaf, options?: ISelectorConfig): ISelector;
2019
+ finder?(target?: ILeaf): IFinder;
2009
2020
  interaction?(target: ILeaf, canvas: IInteractionCanvas, selector: ISelector, options?: IInteractionConfig): IInteraction;
2010
2021
  editor?(options?: IObject): ILeaf;
2011
2022
  }
@@ -2140,6 +2151,7 @@ interface IPlatform {
2140
2151
  };
2141
2152
  roundRectPatch?: boolean;
2142
2153
  ellipseToCurve?: boolean;
2154
+ backgrounder?: boolean;
2143
2155
  event?: {
2144
2156
  stopDefault(origin: IObject): void;
2145
2157
  stopNow(origin: IObject): void;
@@ -2198,4 +2210,4 @@ interface ITransformer {
2198
2210
  destroy(): void;
2199
2211
  }
2200
2212
 
2201
- export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAlign, IAnimateEvent, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventMap, IEventOption, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFindCondition, IFindMethod, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IJSONOptions, 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, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandObject, IPathCreator, IPathDrawer, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IRotateEvent, IRotationPointData, IScaleData, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, ISide, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITransformer, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IZoomConfig, IZoomEvent, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandObject, MCommandData, MoveToCommandObject, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
2213
+ export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, EllipseCommandData, HCommandData, IAlign, IAnimateEvent, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventMap, IEventOption, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFindCondition, IFindMethod, IFinder, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IJSONOptions, 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, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandObject, IPathCreator, IPathDrawer, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPicker, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IRotateEvent, IRotationPointData, IScaleData, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, ISide, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITransformer, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IZoomConfig, IZoomEvent, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandObject, MCommandData, MoveToCommandObject, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };