@leafer-ui/interface 1.0.0-rc.3 → 1.0.0-rc.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interface",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0-rc.30",
4
4
  "description": "@leafer-ui/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,6 +22,6 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/interface": "1.0.0-rc.3"
25
+ "@leafer/interface": "1.0.0-rc.30"
26
26
  }
27
27
  }
@@ -1,15 +1,17 @@
1
- import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData } from './type/IType'
1
+ import { INumber, IBoolean, IString, IFourNumber, IUnitData } from '@leafer/interface'
2
+ import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IStroke, IFill, IArrowType } from './type/IType'
2
3
  import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
3
- import { IPaintString, IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
4
+ import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
5
+
4
6
 
5
7
  // corner---
6
8
  export interface ICornerRadiusAttrData {
7
- cornerRadius: number | number[] | ICornerRadiusString
8
- cornerSmoothing: number
9
+ cornerRadius?: IFourNumber | ICornerRadiusString
10
+ cornerSmoothing?: INumber
9
11
  }
10
12
  export interface ICornerRadiusInputData {
11
- cornerRadius?: number | number[] | ICornerRadiusString
12
- cornerSmoothing?: number
13
+ cornerRadius?: IFourNumber | ICornerRadiusString
14
+ cornerSmoothing?: INumber
13
15
  }
14
16
  export interface ICornerRadiusComputedData {
15
17
  cornerRadius?: number
@@ -18,10 +20,10 @@ export interface ICornerRadiusComputedData {
18
20
 
19
21
  // fill---
20
22
  export interface IFillAttrData {
21
- fill: IPaint | IPaint[] | IPaintString
23
+ fill?: IFill
22
24
  }
23
25
  export interface IFillInputData {
24
- fill?: IPaint | IPaint[] | IPaintString
26
+ fill?: IFill
25
27
  }
26
28
  export interface IFillComputedData {
27
29
  fill?: IColorString | ILeafPaint[]
@@ -35,26 +37,34 @@ export interface IBorderComputedData {
35
37
 
36
38
  // stroke---
37
39
  export interface IStrokeAttrData {
38
- stroke: IPaint | IPaint[] | IPaintString
40
+ stroke?: IStroke
39
41
 
40
- strokeAlign: IStrokeAlign
41
- strokeWidth: number | number[] | IStrokeWidthString
42
- strokeCap: IStrokeCap
43
- strokeJoin: IStrokeJoin
44
- dashPattern: number[] | IDashPatternString
45
- dashOffset: number
46
- miterLimit: number
42
+ strokeAlign?: IStrokeAlign
43
+ strokeWidth?: IFourNumber | IStrokeWidthString
44
+ strokeWidthFixed?: IBoolean
45
+ strokeCap?: IStrokeCap
46
+ strokeJoin?: IStrokeJoin
47
+ dashPattern?: INumber[] | IDashPatternString
48
+ dashOffset?: INumber
49
+ miterLimit?: INumber
50
+
51
+ startArrow?: IArrowType
52
+ endArrow?: IArrowType
47
53
  }
48
54
  export interface IStrokeInputData {
49
- stroke?: IPaint | IPaint[] | IPaintString
55
+ stroke?: IStroke
50
56
 
51
57
  strokeAlign?: IStrokeAlign
52
- strokeWidth?: number | number[] | IStrokeWidthString
58
+ strokeWidth?: IFourNumber | IStrokeWidthString
59
+ strokeWidthFixed?: IBoolean
53
60
  strokeCap?: IStrokeCap
54
61
  strokeJoin?: IStrokeJoin
55
- dashPattern?: number[] | IDashPatternString
56
- dashOffset?: number
57
- miterLimit?: number
62
+ dashPattern?: INumber[] | IDashPatternString
63
+ dashOffset?: INumber
64
+ miterLimit?: INumber
65
+
66
+ startArrow?: IArrowType
67
+ endArrow?: IArrowType
58
68
  }
59
69
  export interface IStrokeComputedData {
60
70
  stroke?: IColorString | ILeafStrokePaint[]
@@ -62,48 +72,54 @@ export interface IStrokeComputedData {
62
72
  strokeAlign?: IStrokeAlign
63
73
  strokeWidth?: number
64
74
  strokeWidths?: number[]
75
+ strokeWidthFixed?: boolean
65
76
  strokeCap?: IStrokeCap
66
77
  strokeJoin?: IStrokeJoin
67
78
  dashPattern?: number[]
68
79
  dashOffset?: number
69
80
  miterLimit?: number
81
+
82
+ startArrow?: IArrowType
83
+ endArrow?: IArrowType
70
84
  }
71
85
 
72
86
  // text---
73
87
  export interface ITextStyleAttrData {
74
- fontFamily: string
75
- fontSize: number
76
- fontWeight: IFontWeight
77
- italic: boolean
78
- textCase: ITextCase
79
- textDecoration: ITextDecoration
80
- letterSpacing: number | IUnitData
81
- lineHeight: number | IUnitData
88
+ fontFamily?: IString
89
+ fontSize?: INumber
90
+ fontWeight?: IFontWeight
91
+ italic?: IBoolean
92
+ textCase?: ITextCase
93
+ textDecoration?: ITextDecoration
94
+ letterSpacing?: INumber | IUnitData
95
+ lineHeight?: INumber | IUnitData
82
96
 
83
- paraIndent: number
84
- paraSpacing: number
97
+ paraIndent?: INumber
98
+ paraSpacing?: INumber
85
99
 
86
- textAlign: ITextAlign
87
- verticalAlign: IVerticalAlign
100
+ textAlign?: ITextAlign
101
+ verticalAlign?: IVerticalAlign
88
102
 
89
- textOverflow: IOverflow | string
103
+ textWrap?: ITextWrap
104
+ textOverflow?: IOverflow | string
90
105
  }
91
106
  export interface ITextStyleInputData {
92
- fontFamily?: string
93
- fontSize?: number
107
+ fontFamily?: IString
108
+ fontSize?: INumber
94
109
  fontWeight?: IFontWeight
95
- italic?: boolean
110
+ italic?: IBoolean
96
111
  textCase?: ITextCase
97
112
  textDecoration?: ITextDecoration
98
- letterSpacing?: number | IUnitData
99
- lineHeight?: number | IUnitData
113
+ letterSpacing?: INumber | IUnitData
114
+ lineHeight?: INumber | IUnitData
100
115
 
101
- paraIndent?: number
102
- paraSpacing?: number
116
+ paraIndent?: INumber
117
+ paraSpacing?: INumber
103
118
 
104
119
  textAlign?: ITextAlign
105
120
  verticalAlign?: IVerticalAlign
106
121
 
122
+ textWrap?: ITextWrap
107
123
  textOverflow?: IOverflow | string
108
124
  }
109
125
  export interface ITextStyleComputedData {
@@ -121,23 +137,25 @@ export interface ITextStyleComputedData {
121
137
 
122
138
  textAlign?: ITextAlign
123
139
  verticalAlign?: IVerticalAlign
124
- textOverflow?: IOverflow
140
+
141
+ textWrap?: ITextWrap
142
+ textOverflow?: IOverflow | string
125
143
  }
126
144
 
127
145
  // effect---
128
146
  export interface IEffectAttrData {
129
- shadow: IShadowEffect | IShadowEffect[] | IShadowString
130
- innerShadow: IShadowEffect | IShadowEffect[] | IShadowString
131
- blur: number | IBlurEffect
132
- backgroundBlur: number | IBlurEffect
133
- grayscale: number | IGrayscaleEffect
147
+ shadow?: IShadowEffect | IShadowEffect[] | IShadowString
148
+ innerShadow?: IShadowEffect | IShadowEffect[] | IShadowString
149
+ blur?: INumber | IBlurEffect
150
+ backgroundBlur?: INumber | IBlurEffect
151
+ grayscale?: INumber | IGrayscaleEffect
134
152
  }
135
153
  export interface IEffectInputData {
136
154
  shadow?: IShadowEffect | IShadowEffect[] | IShadowString
137
155
  innerShadow?: IShadowEffect | IShadowEffect[] | IShadowString
138
- blur?: number | IBlurEffect
139
- backgroundBlur?: number | IBlurEffect
140
- grayscale?: number | IGrayscaleEffect
156
+ blur?: INumber | IBlurEffect
157
+ backgroundBlur?: INumber | IBlurEffect
158
+ grayscale?: INumber | IGrayscaleEffect
141
159
  }
142
160
  export interface IEffectComputedData {
143
161
  shadow?: ILeafShadowEffect[]
package/src/IUI.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob, IPathCreator } from '@leafer/interface'
1
+ import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber, IFindCondition, IBoolean, ICanvasContext2D, IJSONOptions, IMatrixData } from '@leafer/interface'
2
2
 
3
3
  import {
4
4
  IFillAttrData, IFillInputData, IFillComputedData,
@@ -9,22 +9,47 @@ import {
9
9
  ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData
10
10
  } from './ICommonAttr'
11
11
  import { IOverflow } from './type/IType'
12
- import { IExportOptions } from './module/IExport'
13
-
12
+ import { ILeafer } from './app/ILeafer'
13
+ import { IEditorConfig } from './editor/IEditor'
14
14
 
15
15
  // Line
16
16
  export interface ILine extends IUI {
17
17
  __: ILineData
18
- toPoint: IPointData
19
- points: number[]
20
- curve: boolean | number
18
+ toPoint?: IPointData
19
+ points?: number[]
20
+ curve?: boolean | number
21
21
  }
22
- export interface ILineData extends IUIData { }
23
- export interface ILineInputData extends IUIBaseInputData {
22
+
23
+ interface ILineAttrData {
24
24
  toPoint?: IPointData
25
25
  points?: number[]
26
26
  curve?: boolean | number
27
27
  }
28
+ export interface ILineData extends ILineAttrData, IUIData { }
29
+ export interface ILineInputData extends ILineAttrData, IUIBaseInputData { }
30
+
31
+
32
+ // Arrow
33
+ export interface IArrow extends ILine {
34
+ __: IArrowData
35
+ }
36
+
37
+ interface IArrowAttrData {
38
+
39
+ }
40
+ export interface IArrowData extends IArrowAttrData, ILineData { }
41
+ export interface IArrowInputData extends IArrowAttrData, ILineInputData { }
42
+
43
+ // Flow
44
+ export interface IFlow extends IBox {
45
+ __: IFlowData
46
+ }
47
+
48
+ interface IFlowAttrData {
49
+
50
+ }
51
+ export interface IFlowData extends IFlowAttrData, IBoxData { }
52
+ export interface IFlowInputData extends IFlowAttrData, IBoxInputData { }
28
53
 
29
54
 
30
55
  // Rect
@@ -38,9 +63,9 @@ export interface IRectInputData extends IUIBaseInputData { }
38
63
  // Ellipse
39
64
  export interface IEllipse extends IUI {
40
65
  __: IEllipseData
41
- startAngle: number
42
- endAngle: number
43
- innerRadius: number
66
+ startAngle?: number
67
+ endAngle?: number
68
+ innerRadius?: number
44
69
  }
45
70
  interface IEllipseAttrData {
46
71
  startAngle?: number
@@ -54,9 +79,9 @@ export interface IEllipseInputData extends IEllipseAttrData, IUIBaseInputData {
54
79
  // Polygon
55
80
  export interface IPolygon extends IUI {
56
81
  __: IPolygonData
57
- sides: number
58
- points: number[]
59
- curve: boolean | number
82
+ sides?: number
83
+ points?: number[]
84
+ curve?: boolean | number
60
85
  }
61
86
  interface IPolygonAttrData {
62
87
  sides?: number
@@ -70,8 +95,8 @@ export interface IPolygonInputData extends IPolygonAttrData, IUIBaseInputData {
70
95
  // Star
71
96
  export interface IStar extends IUI {
72
97
  __: IStarData
73
- corners: number
74
- innerRadius: number
98
+ corners?: number
99
+ innerRadius?: number
75
100
  }
76
101
  interface IStarAttrData {
77
102
  corners?: number
@@ -84,16 +109,10 @@ export interface IStarInputData extends IStarAttrData, IUIBaseInputData { }
84
109
  // Path
85
110
  export interface IPath extends IUI {
86
111
  __: IPathData
87
- path: IPathCommandData | IPathString
88
- windingRule: IWindingRule
89
112
  }
90
113
  export interface IPathData extends IUIData {
91
- path?: IPathCommandData
92
- windingRule?: IWindingRule
93
114
  }
94
115
  export interface IPathInputData extends IUIBaseInputData {
95
- path?: IPathCommandData | IPathString
96
- windingRule?: IWindingRule
97
116
  }
98
117
 
99
118
  // Pen
@@ -104,7 +123,6 @@ export interface IPen extends IGroup, IPathCreator {
104
123
  pathStyle: IPathInputData
105
124
  path: IPathCommandData
106
125
  paint(): void
107
- clear(): void
108
126
  }
109
127
 
110
128
  export interface IPenData extends IGroupData { }
@@ -114,16 +132,23 @@ export interface IPenInputData extends IGroupInputData { }
114
132
  // Text
115
133
  export interface IText extends ITextStyleAttrData, IUI {
116
134
  __: ITextData
117
- text: string
135
+ text?: string
136
+ padding?: IFourNumber
137
+ resizeFontSize?: IBoolean
118
138
  }
119
139
  interface ITextAttrData {
120
140
  text?: string
141
+ padding?: IFourNumber
142
+ resizeFontSize?: boolean
121
143
  }
122
144
 
123
145
  export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
124
146
  __baseLine?: number
125
147
  __lineHeight?: number
126
148
  __letterSpacing?: number
149
+ __padding?: number[]
150
+ __clipText?: boolean
151
+ __textBoxBounds?: IBoundsData
127
152
  }
128
153
  export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
129
154
 
@@ -144,6 +169,7 @@ export interface ITextRowData {
144
169
  paraStart?: boolean // paragraph start
145
170
  paraEnd?: boolean // paragraph end
146
171
  isOverflow?: boolean
172
+ textMode?: boolean
147
173
  }
148
174
 
149
175
  export interface ITextWordData {
@@ -182,19 +208,22 @@ export interface IImage extends IRect, ILeaferImageConfig {
182
208
  interface IImageAttrData {
183
209
  url?: string
184
210
  }
185
- export interface IImageData extends IImageAttrData, IRectData { }
211
+ export interface IImageData extends IImageAttrData, IRectData {
212
+ __setImageFill(value: string): void
213
+ }
186
214
  export interface IImageInputData extends IImageAttrData, IUIBaseInputData { }
187
215
 
188
216
  export interface ICanvas extends IRect {
189
217
  __: ICanvasData
190
- pixelRatio: number
191
- smooth: boolean
192
- canvas: ILeaferCanvas
218
+ smooth?: boolean
219
+ contextSettings?: ICanvasContext2DSettings
220
+ canvas?: ILeaferCanvas
221
+ context?: ICanvasContext2D
193
222
  __updateSize(): void
194
223
  }
195
224
  interface ICanvasAttrData {
196
- pixelRatio?: number
197
225
  smooth?: boolean
226
+ contextSettings?: ICanvasContext2DSettings
198
227
  }
199
228
  export interface ICanvasData extends ICanvasAttrData, IRectData { }
200
229
  export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
@@ -202,13 +231,19 @@ export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { }
202
231
 
203
232
  // Leafer
204
233
  export interface ILeaferData extends IGroupData {
205
- pixelRatio?: number
234
+
206
235
  }
207
236
 
208
237
  export interface ILeaferInputData extends IGroupInputData {
209
- pixelRatio?: number
238
+
210
239
  }
211
240
 
241
+ export interface IAppData extends ILeaferData {
242
+
243
+ }
244
+ export interface IAppInputData extends ILeaferInputData {
245
+
246
+ }
212
247
 
213
248
  // Frame
214
249
  export interface IFrame extends IBox {
@@ -225,14 +260,17 @@ export interface IFrameInputData extends IBoxInputData {
225
260
  // Box
226
261
  export interface IBox extends IGroup {
227
262
  __: IBoxData
228
- overflow: IOverflow
263
+ resizeChildren?: IBoolean
264
+ overflow?: IOverflow
229
265
  __updateRectRenderBounds(): void
230
266
  __renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void
231
267
  }
232
268
  export interface IBoxData extends IGroupData {
269
+ resizeChildren?: boolean
233
270
  overflow?: IOverflow
234
271
  }
235
272
  export interface IBoxInputData extends IGroupInputData {
273
+ resizeChildren?: boolean
236
274
  overflow?: IOverflow
237
275
  }
238
276
 
@@ -241,13 +279,15 @@ export interface IBoxInputData extends IGroupInputData {
241
279
  export interface IGroup extends IUI {
242
280
  __: IGroupData
243
281
  children: IUI[]
244
- mask?: IUI
282
+ pick(hitPoint: IPointData, options?: IPickOptions): IPickResult
245
283
  add(child: IUI, index?: number): void
246
284
  addAt(child: IUI, index: number): void
247
285
  addAfter(child: IUI, after: IUI): void
248
286
  addBefore(child: IUI, before: IUI): void
287
+ addMany(...children: ILeaf[]): void
249
288
  remove(child?: IUI): void
250
289
  removeAll(): void
290
+ clear(): void
251
291
  }
252
292
  export interface IGroupData extends IUIData { }
253
293
  export interface IGroupInputData extends IUIBaseInputData { }
@@ -255,45 +295,90 @@ export interface IGroupInputData extends IUIBaseInputData { }
255
295
  // UI
256
296
  export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf {
257
297
  __: IUIData
298
+
299
+ readonly app: ILeafer
300
+ leafer?: ILeafer
258
301
  parent?: IGroup
302
+ zoomLayer?: IGroup
303
+ readonly isFrame?: boolean
304
+
305
+ proxyData?: IUIInputData
306
+ __proxyData?: IUIInputData
307
+
308
+ normalStyle?: IUIInputData
309
+ hoverStyle?: IUIInputData
310
+ pressStyle?: IUIInputData
311
+ focusStyle?: IUIInputData
312
+ selectedStyle?: IUIInputData
313
+ disabledStyle?: IUIInputData
314
+
315
+ editConfig?: IEditorConfig
316
+ editOuter: string
317
+ editInner: string
318
+
319
+ children?: IUI[]
320
+
321
+ readonly pen: IPathCreator
322
+
323
+ reset(data?: IUIInputData): void
259
324
 
260
325
  set(data: IUIInputData): void
261
- toJSON(): IUIInputData
326
+ toJSON(options?: IJSONOptions): IUIJSONData
327
+
328
+ get(name?: string | string[] | IUIInputData): IUIInputData | IValue
329
+ createProxyData(): IUIInputData
330
+
331
+ find(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI[]
332
+ findTag(tag: string | string[]): IUI[]
333
+ findOne(condition: number | string | IFindCondition | IFindUIMethod, options?: any): IUI | undefined
334
+ findId(id: number | string): IUI | undefined
262
335
 
263
- getPath(curve?: boolean): IPathCommandData
264
- getPathString(curve?: boolean): IPathString
336
+ getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData
337
+ getPathString(curve?: boolean, pathForRender?: boolean): IPathString
338
+
339
+ load(): void
265
340
 
266
341
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
342
+ __drawPathByBox(drawer: IPathDrawer): void
267
343
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void
268
344
 
269
- export(filename: string, options?: IExportOptions | number): Promise<IBlob | string | boolean>
345
+ export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>
270
346
  clone(): IUI
347
+ }
271
348
 
349
+ export interface IFindUIMethod {
350
+ (leaf: IUI, options?: any): IAnswer
272
351
  }
273
352
 
274
353
  export interface IUIData extends IUIComputedData, ILeafData {
275
354
 
276
355
  padding?: number | number[]
277
- locked?: boolean
356
+
357
+ normalStyle?: IUIInputData
358
+ hoverStyle?: IUIInputData
359
+ pressStyle?: IUIInputData
360
+ focusStyle?: IUIInputData
361
+ selectedStyle?: IUIInputData
362
+ disabledStyle?: IUIInputData
278
363
 
279
364
  // 非数据属性, 自动计算的缓存数据
280
365
  __isFills?: boolean
281
366
  __isStrokes?: boolean
282
- __drawAfterFill?: boolean
283
- __isOverflow?: boolean
284
- __blendLayer?: boolean
285
367
 
286
- __isTranslucentFill?: boolean // 半透明的
287
- __isTranslucentStroke?: boolean
368
+ readonly __strokeWidth: number
288
369
 
289
- __useEffect?: boolean
370
+ __pixelFill?: boolean // png / svg / webp
371
+ __pixelStroke?: boolean
290
372
 
291
- // path
292
- path?: IPathCommandData
293
- windingRule?: IWindingRule
373
+ __isHitPixel?: boolean
374
+ __isCanvas?: boolean // canvas 等需单独绘制的元素
294
375
 
295
- __pathForRender?: IPathCommandData
296
- __path2DForRender?: IPath2D
376
+ __opacityFill?: boolean // 半透明的
377
+ __opacityStroke?: boolean
378
+
379
+ __drawAfterFill?: boolean
380
+ __isOverflow?: boolean
381
+ __blendLayer?: boolean
297
382
 
298
383
  __boxStroke?: boolean
299
384
 
@@ -301,17 +386,25 @@ export interface IUIData extends IUIComputedData, ILeafData {
301
386
  __font?: string
302
387
  __textDrawData?: ITextDrawData
303
388
 
389
+ __needComputePaint: boolean
390
+ __computePaint(): void
391
+
304
392
  }
305
393
  export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
306
394
  padding?: number | number[]
307
-
308
- locked?: boolean
309
395
  }
310
396
 
311
397
  export interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
312
398
  padding?: number | number[]
313
- locked?: boolean
314
- children?: IUIBaseInputData[]
399
+
400
+ normalStyle?: IUIInputData
401
+ hoverStyle?: IUIInputData
402
+ pressStyle?: IUIInputData
403
+ focusStyle?: IUIInputData
404
+ selectedStyle?: IUIInputData
405
+ disabledStyle?: IUIInputData
406
+
407
+ children?: IUIInputData[]
315
408
  }
316
409
 
317
410
 
@@ -334,5 +427,9 @@ export type IUITag =
334
427
 
335
428
 
336
429
  export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject {
430
+ children?: IUIInputData[]
431
+ }
337
432
 
433
+ export interface IUIJSONData extends IUIInputData {
434
+ matrix?: IMatrixData
338
435
  }
@@ -0,0 +1,16 @@
1
+ import { ILeaferConfig } from '@leafer/interface'
2
+
3
+ import { ILeafer } from './ILeafer'
4
+ import { IEditorConfig } from '../editor/IEditor'
5
+
6
+ export interface IApp extends ILeafer {
7
+ children: ILeafer[]
8
+ realCanvas: boolean
9
+ }
10
+
11
+ export interface IAppConfig extends ILeaferConfig {
12
+ ground?: ILeaferConfig
13
+ tree?: ILeaferConfig
14
+ sky?: ILeaferConfig
15
+ editor?: IEditorConfig
16
+ }
@@ -0,0 +1,22 @@
1
+ import { IControl, ILeaferAttrData, ILeaferConfig, ILeaferType } from '@leafer/interface'
2
+ import { IApp } from './IApp'
3
+ import { IGroup } from '../IUI'
4
+ import { IEditorBase } from '../editor/IEditor'
5
+
6
+ export interface ILeafer extends IGroup, ILeaferAttrData, IControl {
7
+ readonly isApp: boolean
8
+ readonly app: ILeafer
9
+ parent?: IApp
10
+ zoomLayer: IGroup
11
+ editor: IEditorBase
12
+
13
+ ground?: ILeafer
14
+ tree?: ILeafer
15
+ sky?: ILeafer
16
+
17
+ userConfig?: ILeaferConfig
18
+
19
+ onInit(): void
20
+ initType(type: ILeaferType): void
21
+ destroy(sync?: boolean): void
22
+ }