@leafer/interface
Advanced tools
| import { IPathCommandData } from './IPathCommand' | ||
| export interface IMotionPathData { | ||
| total: number | ||
| segments: number[] // 每个命令对应一个片段距离 | ||
| data: IPathCommandData // M L C Z 命令的路径数据 | ||
| } |
+1
-1
| { | ||
| "name": "@leafer/interface", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "@leafer/interface", | ||
@@ -5,0 +5,0 @@ "author": "Chao (Leafer) Wan", |
+46
-115
@@ -8,3 +8,3 @@ import { ILeaferBase } from '../app/ILeafer' | ||
| import { IObject, INumber, IBoolean, IValue, IString, IPathString, IFourNumber } from '../data/IData' | ||
| import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData, IMatrixWithScaleData, IAutoBoxData, IUnitPointData } from '../math/IMath' | ||
| import { IMatrixWithBoundsData, IMatrix, IPointData, IBoundsData, IRadiusPointData, ILayoutBoundsData, IMatrixData, IMatrixWithBoundsScaleData, IMatrixWithScaleData, IAutoBoxData, IUnitPointData, IRotationPointData } from '../math/IMath' | ||
| import { IFunction } from '../function/IFunction' | ||
@@ -23,2 +23,3 @@ | ||
| import { IJSONOptions } from '../file/IExport' | ||
| import { IMotionPathData } from '../path/IPathData' | ||
@@ -33,93 +34,2 @@ | ||
| export interface ILeafAttrData { | ||
| // layer data | ||
| id?: IString | ||
| name?: IString | ||
| className?: IString | ||
| blendMode?: IBlendMode | ||
| opacity?: INumber | ||
| visible?: IBoolean | 0 // 0 = display: none | ||
| selected?: IBoolean | ||
| disabled?: IBoolean | ||
| locked?: IBoolean | ||
| zIndex?: INumber | ||
| mask?: IBoolean | IMaskType | ||
| eraser?: IBoolean | IEraserType | ||
| // layout data | ||
| x?: INumber | ||
| y?: INumber | ||
| width?: INumber | ||
| height?: INumber | ||
| scaleX?: INumber | ||
| scaleY?: INumber | ||
| rotation?: INumber | ||
| skewX?: INumber | ||
| skewY?: INumber | ||
| scale?: INumber | IPointData // helper | ||
| offsetX?: INumber | ||
| offsetY?: INumber | ||
| scrollX?: INumber | ||
| scrollY?: INumber | ||
| origin?: IAlign | IUnitPointData | ||
| around?: IAlign | IUnitPointData | ||
| lazy?: IBoolean | ||
| pixelRatio?: INumber | ||
| path?: IPathCommandData | IPathString | ||
| windingRule?: IWindingRule | ||
| closed?: IBoolean | ||
| // auto layout | ||
| flow?: IFlowType | ||
| padding?: IFourNumber | ||
| gap?: IGap | IPointGap | ||
| flowAlign?: IFlowAlign | IFlowAxisAlign | ||
| flowWrap?: IFlowWrap | ||
| itemBox?: IFlowBoxType | ||
| inFlow?: IBoolean | ||
| autoWidth?: IAutoSize | ||
| autoHeight?: IAutoSize | ||
| lockRatio?: IBoolean | ||
| autoBox?: IAutoBoxData | IConstraint | ||
| widthRange?: IRangeSize | ||
| heightRange?: IRangeSize | ||
| // interactive | ||
| draggable?: IBoolean | IAxis | ||
| dragBounds?: IBoundsData | 'parent' | ||
| editable?: IBoolean | ||
| hittable?: IBoolean | ||
| hitFill?: IHitType | ||
| hitStroke?: IHitType | ||
| hitBox?: IBoolean | ||
| hitChildren?: IBoolean | ||
| hitSelf?: IBoolean | ||
| hitRadius?: INumber | ||
| cursor?: ICursorType | ICursorType[] | ||
| event?: IEventMap | ||
| normalStyle?: ILeafInputData // restore hover / press / focus / selected / disabled style | ||
| hoverStyle?: ILeafInputData | ||
| pressStyle?: ILeafInputData | ||
| focusStyle?: ILeafInputData | ||
| selectedStyle?: ILeafInputData | ||
| disabledStyle?: ILeafInputData | ||
| // 预留给用户使用的数据对象 | ||
| data: IObject | ||
| } | ||
| export type ISide = 'width' | 'height' | ||
@@ -299,5 +209,5 @@ | ||
| export interface ILeafInputData { | ||
| tag?: string | ||
| export interface ILeafAttrData { | ||
| // layer data | ||
@@ -310,3 +220,3 @@ id?: IString | ||
| opacity?: INumber | ||
| visible?: IBoolean | 0 | ||
| visible?: IBoolean | 0 // 0 = display: none | ||
| selected?: IBoolean | ||
@@ -379,16 +289,20 @@ disabled?: IBoolean | ||
| button?: IBoolean | ||
| cursor?: ICursorType | ICursorType[] | ||
| motionPath?: IBoolean | ||
| motion?: INumber | IUnitData | ||
| motionRotation?: INumber | IBoolean | ||
| normalStyle?: IObject | ||
| event?: IEventMap | ||
| normalStyle?: ILeafInputData | ||
| hoverStyle?: ILeafInputData | ||
| pressStyle?: ILeafInputData | ||
| focusStyle?: ILeafInputData | ||
| selectedStyle?: ILeafInputData | ||
| disabledStyle?: ILeafInputData | ||
| // 预留给用户使用的数据对象 | ||
| data?: IObject | ||
| } | ||
| export interface ILeafInputData extends ILeafAttrData { | ||
| tag?: string | ||
| children?: ILeafInputData[] | ||
@@ -399,2 +313,3 @@ | ||
| } | ||
| export interface ILeafComputedData { | ||
@@ -474,11 +389,10 @@ // layer data | ||
| button?: boolean | ||
| cursor?: ICursorType | ICursorType[] | ||
| normalStyle?: ILeafInputData | ||
| hoverStyle?: ILeafInputData | ||
| pressStyle?: ILeafInputData | ||
| focusStyle?: ILeafInputData | ||
| selectedStyle?: ILeafInputData | ||
| disabledStyle?: ILeafInputData | ||
| motionPath?: boolean | ||
| motion?: number | IUnitData | ||
| motionRotation?: number | boolean | ||
| normalStyle?: IObject | ||
@@ -510,2 +424,3 @@ // 预留给用户使用的数据对象 | ||
| __path2DForRender?: IPath2D | ||
| __pathForMotion?: IMotionPathData | ||
| } | ||
@@ -538,2 +453,3 @@ | ||
| syncEventer?: ILeaf // 同步触发一样事件的元素 | ||
| lockNormalStyle?: boolean | ||
@@ -569,3 +485,8 @@ __layout: ILeafLayout | ||
| animation?: IObject | ||
| animationOut?: IObject | ||
| __hasAutoLayout?: boolean | ||
| __hasMotionPath?: boolean | ||
| __hasMask?: boolean | ||
@@ -586,5 +507,2 @@ __hasEraser?: boolean | ||
| __parentWait?: IFunction[] | ||
| __leaferWait?: IFunction[] | ||
| destroyed: boolean | ||
@@ -602,3 +520,3 @@ | ||
| set(data: IObject): void | ||
| set(data: IObject, isTemp?: boolean): void | ||
| get(name?: string | string[] | IObject): ILeafInputData | IValue | ||
@@ -629,2 +547,3 @@ setAttr(name: string, value: any): void | ||
| updateState(): void | ||
| updateLayout(): void | ||
@@ -682,12 +601,15 @@ forceUpdate(attrName?: string): void | ||
| getBoxPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getBoxPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getInnerPointByBox(box: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getInnerPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getLocalPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getLocalPointByInner(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getWorldPointByBox(box: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData | ||
| // transform | ||
@@ -743,4 +665,13 @@ setTransform(transform?: IMatrixData, resize?: boolean): void | ||
| // | ||
| // motion path | ||
| getMotionPathData(): IMotionPathData | ||
| getMotionPoint(motionDistance: number | IUnitData): IRotationPointData | ||
| getMotionTotal(): number | ||
| __updateMotionPath(): void | ||
| __runAnimation(type: 'in' | 'out', complete?: IFunction): void | ||
| __emitLifeEvent(type: string): void | ||
| // branch | ||
@@ -747,0 +678,0 @@ children?: ILeaf[] |
@@ -9,2 +9,3 @@ import { ILeaf } from '../ILeaf' | ||
| __getAttr?(name: string): IValue | ||
| __realSetAttr?(name: string, newValue: IValue): void | ||
| setProxyAttr?(name: string, newValue: IValue): void | ||
@@ -11,0 +12,0 @@ getProxyAttr?(name: string): IValue |
| import { ILeaf } from '../ILeaf' | ||
| import { IEventListener, IEventListenerId, IEventListenerOptions } from '../../event/IEventer' | ||
| import { IEventListener, IEventListenerId, IEventListenerOptions, IEventMap } from '../../event/IEventer' | ||
| import { } from '@leafer/interface' | ||
@@ -10,3 +10,3 @@ import { IEvent } from '../../event/IEvent' | ||
| export interface ILeafEventer { | ||
| on?(type: string | string[], listener: IEventListener, options?: IEventListenerOptions | boolean): void | ||
| on?(type: string | string[] | IEventMap, listener?: IEventListener, options?: IEventListenerOptions | boolean): void | ||
| off?(type?: string | string[], listener?: IEventListener, options?: IEventListenerOptions | boolean): void | ||
@@ -19,2 +19,3 @@ on_?(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventListenerOptions | boolean): IEventListenerId | ||
| hasEvent?(type: string, capture?: boolean): boolean | ||
| destroyEventer?(): void | ||
| } |
@@ -39,8 +39,9 @@ import { ILeafEventer } from '../display/module/ILeafEventer' | ||
| export interface IEventer extends ILeafEventer { | ||
| readonly innerId: InnerId | ||
| __captureMap?: IEventListenerMap | ||
| __bubbleMap?: IEventListenerMap | ||
| syncEventer?: IEventer | ||
| event?: IEventMap | ||
| on(type: string | string[], listener: IEventListener, options?: IEventOption): void | ||
| on(type: string | string[] | IEventMap, listener?: IEventListener, options?: IEventOption): void | ||
| off(type?: string | string[], listener?: IEventListener, options?: IEventOption): void | ||
@@ -47,0 +48,0 @@ on_(type: string | string[], listener: IEventListener, bind?: IObject, options?: IEventOption): IEventListenerId |
@@ -26,5 +26,11 @@ import { IObject } from '../data/IData' | ||
| getPage?(): IPointData | ||
| getBoxPoint?(relative?: ILeaf): IPointData | ||
| getInnerPoint?(relative?: ILeaf): IPointData | ||
| getLocalPoint?(relative?: ILeaf): IPointData | ||
| getPagePoint?(): IPointData | ||
| // 兼容代码,未来可移除 | ||
| getInner?(relative?: ILeaf): IPointData | ||
| getLocal?(relative?: ILeaf): IPointData | ||
| getPage?(): IPointData | ||
| } | ||
@@ -31,0 +37,0 @@ |
+2
-1
@@ -39,2 +39,3 @@ export { IAppBase } from './app/IApp' | ||
| export { IPathDrawer, IPathCreator } from './path/IPathDrawer' | ||
| export { IMotionPathData } from './path/IPathData' | ||
| export { IWindingRule, ICanvasContext2D, ICanvasContext2DSettings, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas' | ||
@@ -56,3 +57,3 @@ export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData } from './path/IPathCommand' | ||
| export { ILeafList, ILeafArrayMap, ILeafMap, ILeafLevelList, ILeafListItemCallback } from './data/IList' | ||
| export { IPoint, IPointData, IFromToData, IUnitPointData, IScrollPointData, IClientPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData, IBoundsDataFn, IOffsetBoundsData, ITwoPointBoundsData, IAutoBounds, IAutoBoxData, IAutoBoundsData, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithScaleData, IMatrixWithOptionScaleData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IScaleRotationData, IScaleData, ISkewData, ILayoutBoundsData, ILayoutData, ILayoutAttr } from './math/IMath' | ||
| export { IPoint, IPointData, IFromToData, IUnitPointData, IRotationPointData, IScrollPointData, IClientPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData, IBoundsDataFn, IOffsetBoundsData, ITwoPointBoundsData, IAutoBounds, IAutoBoxData, IAutoBoundsData, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithScaleData, IMatrixWithOptionScaleData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IScaleRotationData, IScaleData, ISkewData, ILayoutBoundsData, ILayoutData, ILayoutAttr } from './math/IMath' | ||
| export { IFunction, IStringFunction, INumberFunction, IObjectFunction, IPointDataFunction, IAttrDecorator } from './function/IFunction' |
@@ -56,2 +56,5 @@ import { INumberFunction, IPointDataFunction } from '../function/IFunction' | ||
| menu(data: IPointerEvent): void | ||
| menuTap(data: IPointerEvent): void | ||
| move(data: IMoveEvent): void | ||
@@ -58,0 +61,0 @@ zoom(data: IZoomEvent): void |
@@ -59,2 +59,3 @@ import { IBoundsData, IMatrixData, ILayoutBoundsData, IPointData } from '../math/IMath' | ||
| childrenSortChanged?: boolean | ||
| stateStyleChanged?: boolean // hoverStyle ... | ||
@@ -61,0 +62,0 @@ // keep state |
@@ -9,6 +9,4 @@ import { IFourNumber, IObject } from '../data/IData' | ||
| export interface IUnitPointData { | ||
| export interface IUnitPointData extends IPointData { | ||
| type?: 'percent' | 'px' | ||
| x: number | ||
| y: number | ||
| } | ||
@@ -21,2 +19,6 @@ | ||
| export interface IRotationPointData extends IPointData { | ||
| rotation: number | ||
| } | ||
| export interface IScrollPointData { | ||
@@ -23,0 +25,0 @@ scrollX: number |
Sorry, the diff of this file is too big to display
48
2.13%176003
-0.32%4542
-1.6%