@leafer/interface 1.0.0-alpha.21 → 1.0.0-alpha.30

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.
@@ -24,6 +24,10 @@ export interface IEventTarget extends IEventer {
24
24
 
25
25
  }
26
26
 
27
+ export interface ILeaferEvent {
28
+
29
+ }
30
+
27
31
  export interface IRenderEvent {
28
32
 
29
33
  }
@@ -52,7 +56,7 @@ export interface IUpdateEvent extends IEvent {
52
56
 
53
57
  }
54
58
 
55
- export interface IAttrEvent extends IEvent {
59
+ export interface IPropertyEvent extends IEvent {
56
60
  readonly attrName: string
57
61
  readonly oldValue: unknown
58
62
  readonly newValue: unknown
@@ -60,6 +64,7 @@ export interface IAttrEvent extends IEvent {
60
64
 
61
65
  export interface ILayoutEvent extends IEvent {
62
66
  readonly data: ILayoutBlockData[]
67
+ readonly times: number
63
68
  }
64
69
 
65
70
  export interface IWatchEvent extends IEvent {
@@ -1,5 +1,7 @@
1
+ import { IObject } from '../data/IData'
1
2
  import { ILeafList } from '../data/IList'
2
3
  import { IEvent } from './IEvent'
4
+ import { ILeaferImage } from '../image/ILeaferImage'
3
5
 
4
6
  export interface IUIEvent extends IEvent {
5
7
  x: number
@@ -19,6 +21,8 @@ export interface IUIEvent extends IEvent {
19
21
  path: ILeafList
20
22
  throughPath?: ILeafList // 穿透path,不受层级影响,从上到下只要碰撞到区域就算,一般点击的时候
21
23
 
24
+ origin: IObject
25
+
22
26
  stopDefault(): void
23
27
  stopNow(): void
24
28
  stop(): void
@@ -46,6 +50,7 @@ export interface IDragEvent extends IPointerEvent {
46
50
 
47
51
  export interface IDropEvent extends IPointerEvent {
48
52
  list: ILeafList
53
+ data?: IObject
49
54
  }
50
55
 
51
56
  export interface IRotateEvent extends IUIEvent {
@@ -66,4 +71,9 @@ export interface ISwipeEvent extends IDragEvent {
66
71
 
67
72
  export interface IKeyEvent extends IUIEvent {
68
73
 
74
+ }
75
+
76
+ export interface IImageEvent extends IEvent {
77
+ image: ILeaferImage
78
+ error: string | IObject
69
79
  }
@@ -1,3 +1,9 @@
1
+ import { ILeaferImage, ILeaferImageConfig, ILeaferImageOnError, ILeaferImageOnLoaded } from './ILeaferImage'
2
+
3
+
1
4
  export interface IImageManager {
5
+ get(config: ILeaferImageConfig): ILeaferImage
6
+ onLoad(config: ILeaferImageConfig, onLoaded: ILeaferImageOnLoaded): void
7
+ onError(config: ILeaferImageConfig, onError: ILeaferImageOnError): void
2
8
  destory(): void
3
9
  }
@@ -1,12 +1,25 @@
1
+ import { IObject } from '../data/IData'
2
+
1
3
  export interface ILeaferImageConfig {
2
4
  url: string
3
5
  thumb?: string
4
6
  }
5
7
 
8
+ export interface ILeaferImageOnLoaded {
9
+ (image?: ILeaferImage): any
10
+ }
6
11
 
12
+ export interface ILeaferImageOnError {
13
+ (error?: string | IObject, image?: ILeaferImage): any
14
+ }
7
15
 
8
16
  export interface ILeaferImage {
9
- //load(url: string):Promise<>
17
+ view: unknown
18
+ width: number
19
+ height: number
20
+ ready: boolean
21
+ load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError): void
22
+ getCanvas(width: number, height: number, opacity?: number, _filters?: IObject): unknown
10
23
  }
11
24
 
12
25
  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 { IApp } from './app/IApp'
2
- export { ILeafer, ILeaferConfig, ICreator, IUICreator } from './app/ILeafer'
3
- export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType } from './display/ILeaf'
2
+ export { ILeafer, ILeaferType, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator } from './app/ILeafer'
3
+ export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IBlendMode } from './display/ILeaf'
4
4
  export { IBranch } from './display/IBranch'
5
5
  export { IZoomView } from './display/IView'
6
6
 
@@ -14,35 +14,37 @@ export { ILeafBounds, ILeafBoundsModule } from './display/module/ILeafBounds'
14
14
  export { ILeafHit, ILeafHitModule } from './display/module/ILeafHit'
15
15
  export { ILeafRender, ILeafRenderModule } from './display/module/ILeafRender'
16
16
  export { ILeafEventer, ILeafEventerModule } from './display/module/ILeafEventer'
17
+ export { ILeafMask, ILeafMaskModule } from './display/module/ILeafMask'
17
18
 
18
19
  export { IRenderer, IRendererConfig, IRenderOptions } from './renderer/IRenderer'
19
20
  export { IWatcher, IWatchEventData, IWatcherConfig } from './watcher/IWatcher'
20
21
  export { ILayouter, ILayoutChangedData, ILayoutBlockData, ILayouterConfig, IPartLayoutConfig } from './layouter/ILayouter'
21
- export { ISelector, ISelectPathResult, ISelectPathOptions } from './selector/ISelector'
22
+ export { ISelector, ISelectorConfig, ISelectPathResult, ISelectPathOptions } from './selector/ISelector'
22
23
 
23
24
  export { ICanvasManager } from './canvas/ICanvasManager'
24
25
  export { IHitCanvasManager } from './canvas/IHitCanvasManager'
25
26
  export { IImageManager } from './image/IImageManager'
26
27
 
27
28
 
29
+ export { IControl } from './control/IControl'
28
30
  export { IPlatform } from './platform/IPlatform'
29
31
  export { IPlugin } from './plugin/IPlugin'
30
32
 
31
33
 
32
34
  export { ILeaferCanvas, IHitCanvas, ICanvasAttr, ICanvasStrokeOptions, ILeaferCanvasConfig, IHitCanvasConfig } from './canvas/ILeaferCanvas'
33
- export { IPathDrawer } from './path/IPathDrawer'
35
+ export { IPathDrawer, IPathCreator } from './path/IPathDrawer'
34
36
  export { IWindingRule, ICanvasContext2D, ITextMetrics, IPath2D } from './canvas/ICanvas'
35
37
  export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData } from './path/IPathCommand'
36
38
 
37
- export { ILeaferImage, ILeaferImageConfig } from './image/ILeaferImage'
39
+ export { ILeaferImage, ILeaferImageConfig, ILeaferImageOnLoaded, ILeaferImageOnError } from './image/ILeaferImage'
38
40
 
39
41
  export { InnerId, IEventer, IEventListener, IEventListenerOptions, IEventListenerMap, IEventListenerItem, IEventListenerId } from './event/IEventer'
40
- export { IEventTarget, IEvent, IAttrEvent, ILayoutEvent, IRenderEvent, IChildEvent, IResizeEvent, IResizeEventListener, IUpdateEvent, IWatchEvent, ITransformEvent, ITransformEventData, TransformMode } from './event/IEvent'
41
- export { IUIEvent, IPointerEvent, PointerType, IDragEvent, IDropEvent, ISwipeEvent, IMoveEvent, IZoomEvent, IRotateEvent, IKeyEvent } from './event/IUIEvent'
42
- export { IInteraction, IInteractionConfig, IWheelConfig, IPointerConfig } from './interaction/IInteraction'
42
+ export { IEventTarget, IEvent, ILeaferEvent, IPropertyEvent, ILayoutEvent, IRenderEvent, IChildEvent, IResizeEvent, IResizeEventListener, IUpdateEvent, IWatchEvent, ITransformEvent, ITransformEventData, TransformMode } from './event/IEvent'
43
+ export { IUIEvent, IPointerEvent, PointerType, IDragEvent, IDropEvent, ISwipeEvent, IMoveEvent, IZoomEvent, IRotateEvent, IKeyEvent, IImageEvent } from './event/IUIEvent'
44
+ export { IInteraction, IInteractionCanvas, IInteractionConfig, IWheelConfig, IPointerConfig } from './interaction/IInteraction'
43
45
 
44
46
 
45
- export { __Number, __Boolean, __String, __Object, __Value, IObject, INumberMap, IStringMap, IBooleanMap, IDataTypeHandle } from './data/IData'
47
+ export { __Number, __Boolean, __String, __Object, __Value, ITimer, IObject, INumberMap, IStringMap, IBooleanMap, IDataTypeHandle } from './data/IData'
46
48
  export { ILeafList, ILeafArrayMap, ILeafMap, ILeafLevelList, ILeafListItemCallback } from './data/IList'
47
- export { IPoint, IPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData, IBoundsDataHandle, IOffsetBoundsData, ITwoPointBounds, ITwoPointBoundsData, IAutoBounds, IAutoBoundsData, IMatrix, IMatrixData, IMatrixWithBoundsData } from './math/IMath'
49
+ export { IPoint, IPointData, IRadiusPointData, ISize, ISizeData, IScreenSizeData, IBounds, IBoundsData, IBoundsDataHandle, IOffsetBoundsData, ITwoPointBounds, ITwoPointBoundsData, IAutoBounds, IAutoBoundsData, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixDecompositionData, IMatrixDecompositionAttr } from './math/IMath'
48
50
  export { IFunction } from './function/IFunction'
@@ -4,12 +4,12 @@ import { ILeaf } from '../display/ILeaf'
4
4
  import { ILeafList } from '../data/IList'
5
5
  import { IPointData } from '../math/IMath'
6
6
  import { ISelector } from '../selector/ISelector'
7
- import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
8
7
  import { IBounds } from '../math/IMath'
8
+ import { IControl } from '../control/IControl'
9
9
 
10
- export interface IInteraction {
10
+ export interface IInteraction extends IControl {
11
11
  target: ILeaf
12
- canvas: ILeaferCanvas
12
+ canvas: IInteractionCanvas
13
13
  selector: ISelector
14
14
 
15
15
  running: boolean
@@ -21,9 +21,7 @@ export interface IInteraction {
21
21
  shrinkCanvasBounds: IBounds
22
22
 
23
23
  downData: IPointerEvent
24
-
25
- start(): void
26
- stop(): void
24
+ downTime: number
27
25
 
28
26
  pointerDown(data: IPointerEvent): void
29
27
  pointerMove(data: IPointerEvent): void
@@ -36,8 +34,11 @@ export interface IInteraction {
36
34
  rotate(data: IRotateEvent): void
37
35
 
38
36
  emit(type: string, data: IUIEvent, path?: ILeafList, excludePath?: ILeafList): void
37
+ }
39
38
 
40
- destroy(): void
39
+ export interface IInteractionCanvas {
40
+ bounds: IBounds
41
+ view: unknown
41
42
  }
42
43
 
43
44
  export interface IInteractionConfig {
@@ -54,16 +55,20 @@ export interface IWheelConfig {
54
55
  delta?: IPointData // 以chrome为基准, 鼠标滚动一格的距离
55
56
  getScale?: INumberFunction
56
57
  getMove?: IPointDataFunction
58
+ preventDefault?: boolean
57
59
  }
58
60
 
59
61
  export interface IPointerConfig {
60
62
  hitRadius?: number
61
63
  through?: boolean
62
- clickTime?: number
64
+ tapMore?: boolean
65
+ tapTime?: number
63
66
  longPressTime?: number
64
67
  transformTime?: number
68
+ dragHover?: boolean
65
69
  dragDistance?: number
66
70
  swipeDistance?: number
67
71
  autoMoveDistance?: number
68
- ignoreMove: boolean // 性能优化字段, 控制move事件触发次数
72
+ ignoreMove?: boolean // 性能优化字段, 控制move事件触发次数
73
+ preventDefault?: boolean
69
74
  }
@@ -1,8 +1,8 @@
1
- import { IBoundsData, IMatrixData } from '../math/IMath'
1
+ import { IBoundsData, IMatrixData, IMatrixDecompositionData } from '../math/IMath'
2
2
  import { ILeaf } from '../display/ILeaf'
3
3
 
4
- export type ILayoutLocationType = 'world' | 'relative' | 'local'
5
- export type ILayoutBoundsType = 'content' | 'box' | 'event' | 'margin' | 'render'
4
+ export type ILayoutLocationType = 'world' | 'local' | 'inner'
5
+ export type ILayoutBoundsType = 'content' | 'box' | 'stroke' | 'margin' | 'render'
6
6
 
7
7
  export interface ILeafLayout {
8
8
 
@@ -13,23 +13,23 @@ export interface ILeafLayout {
13
13
  // local
14
14
 
15
15
  boxBounds: IBoundsData // | content + padding |
16
- eventBounds: IBoundsData // | boxBounds + border |
17
- renderBounds: IBoundsData // | eventBounds + shadow |
16
+ strokeBounds: IBoundsData // | boxBounds + border |
17
+ renderBounds: IBoundsData // | strokeBounds + shadow |
18
18
 
19
19
  // auto layout
20
- marginBounds: IBoundsData // | eventBounds + margin |
20
+ marginBounds: IBoundsData // | strokeBounds + margin |
21
21
  contentBounds: IBoundsData // | content |
22
22
 
23
- // relative
23
+ // local
24
24
 
25
- //relativeBoxBounds: IBoundsData = leaf.__local
26
- relativeEventBounds: IBoundsData
27
- relativeRenderBounds: IBoundsData
25
+ //localBoxBounds: IBoundsData = leaf.__local
26
+ localStrokeBounds: IBoundsData
27
+ localRenderBounds: IBoundsData
28
28
 
29
29
  // state
30
30
 
31
31
  // matrix changed
32
- matrixChanged: boolean
32
+ matrixChanged: boolean // include positionChanged scaleChanged skewChanged
33
33
  positionChanged: boolean // x, y
34
34
  scaleChanged: boolean // scaleX scaleY
35
35
  rotationChanged: boolean // rotaiton, skewX scaleY 数据更新
@@ -38,7 +38,7 @@ export interface ILeafLayout {
38
38
  boundsChanged: boolean
39
39
 
40
40
  boxBoundsChanged: boolean
41
- eventBoundsChanged: boolean
41
+ strokeBoundsChanged: boolean
42
42
  renderBoundsChanged: boolean
43
43
 
44
44
  localBoxBoundsChanged: boolean // position
@@ -54,24 +54,25 @@ export interface ILeafLayout {
54
54
  // keep state
55
55
  affectScaleOrRotation: boolean
56
56
  affectRotation: boolean
57
- eventBoundsSpreadWidth: number
57
+ strokeBoundsSpreadWidth: number
58
58
  renderBoundsSpreadWidth: number
59
59
  renderShapeBoundsSpreadWidth: number
60
60
 
61
- update(): void
61
+ checkUpdate(): void
62
62
 
63
- getTransform(type: ILayoutLocationType): IMatrixData
64
- getBounds(type: ILayoutLocationType, boundsType: ILayoutBoundsType): IBoundsData
63
+ getTransform(locationType: ILayoutLocationType): IMatrixData
64
+ getMatrixDecompositionData(locationType: ILayoutLocationType): IMatrixDecompositionData
65
+ getBounds(type: ILayoutBoundsType, locationType: ILayoutLocationType): IBoundsData
65
66
 
66
67
  // 独立 / 引用 boxBounds
67
- eventBoundsSpread(): void
68
+ strokeBoundsSpread(): void
68
69
  renderBoundsSpread(): void
69
- eventBoundsSpreadCancel(): void
70
+ strokeBoundsSpreadCancel(): void
70
71
  renderBoundsSpreadCancel(): void
71
72
 
72
73
  // bounds
73
74
  boxBoundsChange(): void
74
- eventBoundsChange(): void
75
+ strokeBoundsChange(): void
75
76
  renderBoundsChange(): void
76
77
 
77
78
  // matrix
@@ -1,6 +1,7 @@
1
1
  import { IBounds } from '../math/IMath'
2
2
  import { ILeaf } from '../display/ILeaf'
3
3
  import { ILeafList } from '../data/IList'
4
+ import { IControl } from '../control/IControl'
4
5
 
5
6
  export interface ILayoutChangedData {
6
7
  matrixList: ILeaf[]
@@ -30,30 +31,30 @@ export interface ILayouterConfig {
30
31
  partLayout?: IPartLayoutConfig
31
32
  }
32
33
 
33
- export interface ILayouter {
34
+ export interface ILayouter extends IControl {
34
35
  target: ILeaf
35
36
  layoutedBlocks: ILayoutBlockData[]
36
37
 
37
38
  totalTimes: number
38
39
  times: number
39
40
 
41
+ disabled: boolean
40
42
  running: boolean
41
- changed: boolean
43
+ layouting: boolean
44
+
45
+ waitAgain: boolean
42
46
 
43
47
  config: ILayouterConfig
44
48
 
45
- start(): void
46
- stop(): void
47
- update(): void
49
+ disable(): void
48
50
 
49
51
  layout(): void
52
+ layoutAgain(): void
50
53
  layoutOnce(): void
51
54
  partLayout(): void
52
55
  fullLayout(): void
53
56
 
54
57
  createBlock(data: ILeafList | ILeaf[]): ILayoutBlockData
55
58
  getBlocks(list: ILeafList): ILayoutBlockData[]
56
- setBlocks(current: ILayoutBlockData[]): void
57
-
58
- destroy(): void
59
+ addBlocks(current: ILayoutBlockData[]): void
59
60
  }
package/src/math/IMath.ts CHANGED
@@ -12,13 +12,15 @@ export interface IPoint extends IPointData {
12
12
 
13
13
  rotate(angle: number, center?: IPointData): IPoint
14
14
 
15
- toLocal(matrix: IMatrixData, to?: IPointData): IPoint
16
- toWorld(matrix: IMatrixData, to?: IPointData): IPoint
15
+ toInnerOf(matrix: IMatrixData, to?: IPointData): IPoint
16
+ toOuterOf(matrix: IMatrixData, to?: IPointData): IPoint
17
17
 
18
18
  getCenter(to: IPointData): IPointData
19
19
  getDistance(to: IPointData): number
20
20
  getAngle(to: IPointData): number
21
21
  getAtan2(to: IPointData): number
22
+
23
+ reset(): void
22
24
  }
23
25
 
24
26
  export interface IRadiusPointData extends IPointData {
@@ -55,7 +57,7 @@ export interface IBounds extends IBoundsData {
55
57
  clone(): IBounds
56
58
 
57
59
  scale(scale: number): IBounds
58
- toWorld(matrix: IMatrixData, to?: IBoundsData): IBounds
60
+ toOuterOf(matrix: IMatrixData, to?: IBoundsData): IBounds
59
61
  getFitMatrix(put: IBoundsData): IMatrix
60
62
 
61
63
  spread(size: number): IBounds
@@ -78,7 +80,7 @@ export interface IBounds extends IBoundsData {
78
80
 
79
81
  isSame(bounds: IBoundsData): boolean
80
82
  isEmpty(): boolean
81
- empty(): void
83
+ reset(): void
82
84
  }
83
85
 
84
86
  export interface ITwoPointBoundsData {
@@ -90,6 +92,7 @@ export interface ITwoPointBoundsData {
90
92
 
91
93
  export interface ITwoPointBounds extends ITwoPointBoundsData {
92
94
  addPoint(x: number, y: number): void
95
+ addBounds(x: number, y: number, width: number, height: number): void
93
96
  add(pointBounds: ITwoPointBoundsData): void
94
97
  }
95
98
 
@@ -120,21 +123,57 @@ export interface IMatrixData {
120
123
  e: number
121
124
  f: number
122
125
  }
126
+
127
+ export interface IMatrixDecompositionData {
128
+ x: number
129
+ y: number
130
+ scaleX: number
131
+ scaleY: number
132
+ rotation: number
133
+ skewX: number
134
+ skewY: number
135
+ }
136
+
137
+ export type IMatrixDecompositionAttr =
138
+ | 'x'
139
+ | 'y'
140
+ | 'scaleX'
141
+ | 'scaleY'
142
+ | 'rotation'
143
+ | 'skewX'
144
+ | 'skewY'
145
+
123
146
  export interface IMatrix extends IMatrixData {
124
147
  set(a: number, b: number, c: number, d: number, e: number, f: number): void
125
148
  copy(matrix: IMatrixData): IMatrix
126
149
  clone(): IMatrix
127
150
 
128
151
  translate(x: number, y: number): IMatrix
152
+ translateInner(x: number, y: number): IMatrix
153
+
129
154
  scale(x: number, y?: number): IMatrix
155
+ scaleOf(center: IPointData, x: number, y?: number): IMatrix
156
+ scaleOfInner(center: IPointData, x: number, y?: number): IMatrix
157
+
130
158
  rotate(angle: number): IMatrix
159
+ rotateOf(center: IPointData, angle: number): IMatrix
160
+ rotateOfInner(center: IPointData, angle: number): IMatrix
131
161
 
132
- times(matrix: IMatrixData): IMatrix
162
+ skew(x: number, y?: number): IMatrix
163
+ skewOf(center: IPointData, x: number, y?: number): IMatrix
164
+ skewOfInner(center: IPointData, x: number, y?: number): IMatrix
165
+
166
+ multiply(matrix: IMatrixData): IMatrix
133
167
  divide(matrix: IMatrixData): IMatrix
168
+ preMultiply(matrix: IMatrixData): IMatrix
134
169
  invert(): IMatrix
135
170
 
136
- toWorldPoint(local: IPointData, to?: IPointData): void
137
- toLocalPoint(world: IPointData, to?: IPointData): void
171
+ toOuterPoint(inner: IPointData, to?: IPointData): void
172
+ toInnerPoint(outer: IPointData, to?: IPointData): void
173
+
174
+ decompose(): IMatrixDecompositionData
175
+
176
+ reset(): void
138
177
  }
139
178
 
140
179
 
@@ -34,14 +34,14 @@ type height = number
34
34
  type rotation = number
35
35
  type startAngle = number
36
36
  type endAngle = number
37
- type counterclockwise = boolean
37
+ type anticlockwise = boolean
38
38
  type cornerRadius = number | number[]
39
39
  type radius = number
40
40
 
41
41
  export type RectCommandData = [Command, x, y, width, height]
42
42
  export type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]
43
- export type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise]
44
- export type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, counterclockwise]
43
+ export type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]
44
+ export type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]
45
45
  export type ArcToCommandData = [Command, x1, y1, x2, y2, radius]
46
46
 
47
47
 
@@ -1,3 +1,4 @@
1
+ import { IPathCommandData } from './IPathCommand'
1
2
  export interface IPathDrawer {
2
3
  beginPath?(): void
3
4
 
@@ -7,10 +8,29 @@ export interface IPathDrawer {
7
8
  quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
8
9
  closePath(): void
9
10
 
10
- arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void
11
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void
11
12
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
12
- ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void
13
+ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void
13
14
 
14
15
  rect(x: number, y: number, width: number, height: number): void
15
16
  roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): void
17
+ }
18
+
19
+ export interface IPathCreator {
20
+ path: IPathCommandData
21
+
22
+ beginPath(): IPathCreator
23
+
24
+ moveTo(x: number, y: number): IPathCreator
25
+ lineTo(x: number, y: number): IPathCreator
26
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): IPathCreator
27
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): IPathCreator
28
+ closePath(): IPathCreator
29
+
30
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): IPathCreator
31
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): IPathCreator
32
+ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): IPathCreator
33
+
34
+ rect(x: number, y: number, width: number, height: number): IPathCreator
35
+ roundRect(x: number, y: number, width: number, height: number, radius?: number | number[]): IPathCreator
16
36
  }
@@ -1,8 +1,11 @@
1
1
  import { IFunction } from '../function/IFunction'
2
2
  import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
3
+ import { ILeaf } from '../display/ILeaf'
3
4
 
4
5
  export interface IPlatform {
5
6
  requestRender?(render: IFunction): void
6
7
  canvas?: ILeaferCanvas
7
8
  isWorker?: boolean
9
+ conicGradientRotate90?: boolean // fixfox need rotate
10
+ layout(target: ILeaf): void
8
11
  }
@@ -2,6 +2,7 @@ import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
2
2
  import { ILeaf } from '../display/ILeaf'
3
3
  import { IBounds, IMatrix } from '../math/IMath'
4
4
  import { IFunction } from '../function/IFunction'
5
+ import { IControl } from '../control/IControl'
5
6
 
6
7
  export interface IRenderOptions {
7
8
  bounds?: IBounds,
@@ -13,9 +14,10 @@ export interface IRenderOptions {
13
14
  export interface IRendererConfig {
14
15
  usePartRender?: boolean
15
16
  maxFPS?: number
17
+ fill?: string
16
18
  }
17
19
 
18
- export interface IRenderer {
20
+ export interface IRenderer extends IControl {
19
21
  target: ILeaf
20
22
  canvas: ILeaferCanvas
21
23
  updateBlocks: IBounds[]
@@ -25,24 +27,27 @@ export interface IRenderer {
25
27
  times: number
26
28
 
27
29
  running: boolean
30
+ rendering: boolean
31
+
32
+ waitAgain: boolean
28
33
  changed: boolean
29
34
 
30
35
  config: IRendererConfig
31
36
 
32
- start(): void
33
- stop(): void
34
37
  update(): void
35
38
 
36
39
  requestLayout(): void
37
40
 
38
41
  render(callback?: IFunction): void
42
+ renderAgain(): void
39
43
  renderOnce(callback?: IFunction): void
40
44
  partRender(): void
41
- clipRender(bounds: IBounds, fullMode?: boolean): void
42
- fullRender(bounds?: IBounds): void
45
+ clipRender(bounds: IBounds): void
46
+ fullRender(): void
47
+
48
+ renderHitView(options: IRenderOptions): void
49
+ renderBoundsView(options: IRenderOptions): void
43
50
 
44
51
  addBlock(block: IBounds): void
45
52
  mergeBlocks(): void
46
-
47
- destroy(): void
48
53
  }
@@ -9,15 +9,22 @@ export interface ISelectPathResult {
9
9
  }
10
10
 
11
11
  export interface ISelectPathOptions {
12
+ name?: string
12
13
  through?: boolean
13
14
  exclude?: ILeafList
15
+ ignoreHittable?: boolean
16
+ }
17
+
18
+ export interface ISelectorConfig {
19
+
14
20
  }
15
21
 
16
22
  export interface ISelector {
17
23
  target: ILeaf
18
- defaultPath: ILeafList
19
24
 
20
- getHitPointPath(hitPoint: IPointData, hitRadius: number, options?: ISelectPathOptions): ISelectPathResult
25
+ config: ISelectorConfig
26
+
27
+ getByPoint(hitPoint: IPointData, hitRadius: number, options?: ISelectPathOptions): ISelectPathResult
21
28
 
22
29
  find(name: number | string, branch?: ILeaf): ILeaf | ILeaf[]
23
30
  getByInnerId(name: number, branch?: ILeaf): ILeaf
@@ -1,5 +1,6 @@
1
1
  import { ILeaf } from '../display/ILeaf'
2
2
  import { ILeafList } from '../data/IList'
3
+ import { IControl } from '../control/IControl'
3
4
 
4
5
  export interface IWatchEventData {
5
6
  updatedList: ILeafList
@@ -9,20 +10,19 @@ export interface IWatcherConfig {
9
10
 
10
11
  }
11
12
 
12
- export interface IWatcher {
13
+ export interface IWatcher extends IControl {
13
14
  target: ILeaf
14
15
  updatedList: ILeafList
15
16
 
16
17
  totalTimes: number
17
18
 
19
+ disabled: boolean
18
20
  running: boolean
19
21
  changed: boolean
20
22
 
21
23
  config: IWatcherConfig
22
24
 
23
- start(): void
24
- stop(): void
25
+ disable(): void
25
26
 
26
27
  update(): void
27
- destroy(): void
28
28
  }