@leafer-ui/interface 1.0.0-rc.2 → 1.0.0-rc.21

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/types/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
1
+ import { IPointData, IExportFileType, IFourNumber, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ICanvasContext2DSettings, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject as IObject$1, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap } from '@leafer/interface';
2
2
  export * from '@leafer/interface';
3
+ import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject, ILeaf, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAround } from '@leafer-ui/interface';
3
4
 
4
5
  type IPercent = string;
5
6
  type IColorString = string;
@@ -17,6 +18,9 @@ interface IUnitData {
17
18
  value: number;
18
19
  }
19
20
  type IPaint = ISolidPaint | IGradientPaint | IImagePaint;
21
+ type IFill = IPaint | IPaint[] | IPaintString;
22
+ type IStroke = IPaint | IPaint[] | IPaintString;
23
+ type IPaintAttr = 'fill' | 'stroke';
20
24
  interface IPaintBase {
21
25
  type: IPaintType;
22
26
  blendMode?: IBlendMode;
@@ -56,9 +60,12 @@ interface IImagePaint extends IPaintBase {
56
60
  mode?: IImagePaintMode;
57
61
  format?: IExportFileType;
58
62
  filters?: IImageFilters;
63
+ padding?: IFourNumber;
59
64
  offset?: IPointData;
65
+ size?: number | ISizeData;
60
66
  scale?: number | IPointData;
61
67
  rotation?: number;
68
+ repeat?: IRepeat;
62
69
  }
63
70
  interface IImageFilters {
64
71
  exposure?: number;
@@ -70,9 +77,24 @@ interface IImageFilters {
70
77
  shadows?: number;
71
78
  }
72
79
  type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat';
80
+ type IRepeat = boolean | 'x' | 'y';
73
81
  type IStrokeAlign = 'inside' | 'outside' | 'center';
74
- type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral';
82
+ type IStrokeCap = 'none' | 'round' | 'square';
75
83
  type IStrokeJoin = 'bevel' | 'round' | 'miter';
84
+ type IArrowType = IPathDataArrow | 'none' | 'angle' | 'angle-side' | 'arrow' | 'triangle' | 'triangle-flip' | 'circle' | 'circle-line' | 'square' | 'square-line' | 'diamond' | 'diamond-line' | 'mark';
85
+ interface IPathDataArrowMap {
86
+ [name: string]: IPathDataArrow;
87
+ }
88
+ interface IPathDataArrow {
89
+ connect?: IPathDataArrowOffset;
90
+ offset?: IPathDataArrowOffset;
91
+ path: IPathCommandData;
92
+ }
93
+ interface IPathDataArrowOffset {
94
+ x?: number;
95
+ bevelJoin?: number;
96
+ roundJoin?: number;
97
+ }
76
98
  type ITextAlign = 'left' | 'center' | 'right' | 'justify';
77
99
  type IVerticalAlign = 'top' | 'middle' | 'bottom';
78
100
  type ITextCase = 'upper' | 'lower' | 'title' | 'none' | 'small-caps';
@@ -80,6 +102,7 @@ type IFontWeight = IFontWeightNumer | IFontWeightString;
80
102
  type IFontWeightNumer = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
81
103
  type IFontWeightString = 'thin' | 'extra-light' | 'light' | 'normal' | 'medium' | 'semi-bold' | 'bold' | 'extra-bold' | 'black';
82
104
  type ITextDecoration = 'none' | 'under' | 'delete';
105
+ type ITextWrap = 'normal' | 'none' | 'break';
83
106
  interface IVectorPath {
84
107
  rule?: IWindingRule;
85
108
  data: string | IPathCommandData;
@@ -114,6 +137,7 @@ interface ILeafPaint {
114
137
  image?: ILeaferImage;
115
138
  loadId?: number;
116
139
  patternId?: string;
140
+ patternTask?: ITaskItem;
117
141
  data?: ILeafPaintPatternData;
118
142
  }
119
143
  interface ILeafPaintPatternData {
@@ -124,6 +148,7 @@ interface ILeafPaintPatternData {
124
148
  opacity?: number;
125
149
  transform?: IMatrixData;
126
150
  mode?: IImagePaintMode;
151
+ repeat?: 'repeat' | 'repeat-x' | 'repeat-y';
127
152
  }
128
153
  type ILeafFill = ILeafPaint;
129
154
  interface ILeafStrokePaint extends ILeafPaint {
@@ -145,22 +170,22 @@ interface ILeafShadowEffect {
145
170
  }
146
171
 
147
172
  interface ICornerRadiusAttrData {
148
- cornerRadius: number | number[] | ICornerRadiusString;
149
- cornerSmoothing: number;
173
+ cornerRadius: INumber | INumber[] | ICornerRadiusString;
174
+ cornerSmoothing: INumber;
150
175
  }
151
176
  interface ICornerRadiusInputData {
152
- cornerRadius?: number | number[] | ICornerRadiusString;
153
- cornerSmoothing?: number;
177
+ cornerRadius?: INumber | INumber[] | ICornerRadiusString;
178
+ cornerSmoothing?: INumber;
154
179
  }
155
180
  interface ICornerRadiusComputedData {
156
181
  cornerRadius?: number;
157
182
  cornerSmoothing?: number;
158
183
  }
159
184
  interface IFillAttrData {
160
- fill: IPaint | IPaint[] | IPaintString;
185
+ fill: IFill;
161
186
  }
162
187
  interface IFillInputData {
163
- fill?: IPaint | IPaint[] | IPaintString;
188
+ fill?: IFill;
164
189
  }
165
190
  interface IFillComputedData {
166
191
  fill?: IColorString | ILeafPaint[];
@@ -170,64 +195,75 @@ interface IBorderComputedData {
170
195
  borderRadius?: number | number[];
171
196
  }
172
197
  interface IStrokeAttrData {
173
- stroke: IPaint | IPaint[] | IPaintString;
198
+ stroke: IStroke;
174
199
  strokeAlign: IStrokeAlign;
175
- strokeWidth: number | number[] | IStrokeWidthString;
200
+ strokeWidth: INumber | INumber[] | IStrokeWidthString;
201
+ strokeWidthFixed: IBoolean;
176
202
  strokeCap: IStrokeCap;
177
203
  strokeJoin: IStrokeJoin;
178
- dashPattern: number[] | IDashPatternString;
179
- dashOffset: number;
180
- miterLimit: number;
204
+ dashPattern: INumber[] | IDashPatternString;
205
+ dashOffset: INumber;
206
+ miterLimit: INumber;
207
+ startArrow: IArrowType;
208
+ endArrow: IArrowType;
181
209
  }
182
210
  interface IStrokeInputData {
183
- stroke?: IPaint | IPaint[] | IPaintString;
211
+ stroke?: IStroke;
184
212
  strokeAlign?: IStrokeAlign;
185
- strokeWidth?: number | number[] | IStrokeWidthString;
213
+ strokeWidth?: INumber | INumber[] | IStrokeWidthString;
214
+ strokeWidthFixed?: IBoolean;
186
215
  strokeCap?: IStrokeCap;
187
216
  strokeJoin?: IStrokeJoin;
188
- dashPattern?: number[] | IDashPatternString;
189
- dashOffset?: number;
190
- miterLimit?: number;
217
+ dashPattern?: INumber[] | IDashPatternString;
218
+ dashOffset?: INumber;
219
+ miterLimit?: INumber;
220
+ startArrow?: IArrowType;
221
+ endArrow?: IArrowType;
191
222
  }
192
223
  interface IStrokeComputedData {
193
224
  stroke?: IColorString | ILeafStrokePaint[];
194
225
  strokeAlign?: IStrokeAlign;
195
226
  strokeWidth?: number;
196
227
  strokeWidths?: number[];
228
+ strokeWidthFixed?: boolean;
197
229
  strokeCap?: IStrokeCap;
198
230
  strokeJoin?: IStrokeJoin;
199
231
  dashPattern?: number[];
200
232
  dashOffset?: number;
201
233
  miterLimit?: number;
234
+ startArrow?: IArrowType;
235
+ endArrow?: IArrowType;
202
236
  }
203
237
  interface ITextStyleAttrData {
204
- fontFamily: string;
205
- fontSize: number;
238
+ fontFamily: IString;
239
+ fontSize: INumber;
206
240
  fontWeight: IFontWeight;
207
- italic: boolean;
241
+ italic: IBoolean;
208
242
  textCase: ITextCase;
209
243
  textDecoration: ITextDecoration;
210
- letterSpacing: number | IUnitData;
211
- lineHeight: number | IUnitData;
212
- paraIndent: number;
213
- paraSpacing: number;
244
+ letterSpacing: INumber | IUnitData;
245
+ lineHeight: INumber | IUnitData;
246
+ paraIndent: INumber;
247
+ paraSpacing: INumber;
214
248
  textAlign: ITextAlign;
215
249
  verticalAlign: IVerticalAlign;
250
+ textWrap: ITextWrap;
216
251
  textOverflow: IOverflow | string;
217
252
  }
218
253
  interface ITextStyleInputData {
219
- fontFamily?: string;
220
- fontSize?: number;
254
+ fontFamily?: IString;
255
+ fontSize?: INumber;
221
256
  fontWeight?: IFontWeight;
222
- italic?: boolean;
257
+ italic?: IBoolean;
223
258
  textCase?: ITextCase;
224
259
  textDecoration?: ITextDecoration;
225
- letterSpacing?: number | IUnitData;
226
- lineHeight?: number | IUnitData;
227
- paraIndent?: number;
228
- paraSpacing?: number;
260
+ letterSpacing?: INumber | IUnitData;
261
+ lineHeight?: INumber | IUnitData;
262
+ paraIndent?: INumber;
263
+ paraSpacing?: INumber;
229
264
  textAlign?: ITextAlign;
230
265
  verticalAlign?: IVerticalAlign;
266
+ textWrap?: ITextWrap;
231
267
  textOverflow?: IOverflow | string;
232
268
  }
233
269
  interface ITextStyleComputedData {
@@ -243,21 +279,22 @@ interface ITextStyleComputedData {
243
279
  paraSpacing?: number;
244
280
  textAlign?: ITextAlign;
245
281
  verticalAlign?: IVerticalAlign;
246
- textOverflow?: IOverflow;
282
+ textWrap?: ITextWrap;
283
+ textOverflow?: IOverflow | string;
247
284
  }
248
285
  interface IEffectAttrData {
249
286
  shadow: IShadowEffect | IShadowEffect[] | IShadowString;
250
287
  innerShadow: IShadowEffect | IShadowEffect[] | IShadowString;
251
- blur: number | IBlurEffect;
252
- backgroundBlur: number | IBlurEffect;
253
- grayscale: number | IGrayscaleEffect;
288
+ blur: INumber | IBlurEffect;
289
+ backgroundBlur: INumber | IBlurEffect;
290
+ grayscale: INumber | IGrayscaleEffect;
254
291
  }
255
292
  interface IEffectInputData {
256
293
  shadow?: IShadowEffect | IShadowEffect[] | IShadowString;
257
294
  innerShadow?: IShadowEffect | IShadowEffect[] | IShadowString;
258
- blur?: number | IBlurEffect;
259
- backgroundBlur?: number | IBlurEffect;
260
- grayscale?: number | IGrayscaleEffect;
295
+ blur?: INumber | IBlurEffect;
296
+ backgroundBlur?: INumber | IBlurEffect;
297
+ grayscale?: INumber | IGrayscaleEffect;
261
298
  }
262
299
  interface IEffectComputedData {
263
300
  shadow?: ILeafShadowEffect[];
@@ -267,18 +304,74 @@ interface IEffectComputedData {
267
304
  grayscale?: number;
268
305
  }
269
306
 
270
- interface IExportOptions {
271
- quality?: number;
272
- blob?: boolean;
273
- }
274
- interface IExportResult {
275
- data: IBlob | string | boolean;
276
- }
277
- interface IExportResultFunction {
278
- (data: IExportResult): void;
279
- }
280
- interface IExportModule {
281
- export?(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
307
+ interface IEditorBase extends IGroup$1, ISelectorProxy {
308
+ config: IEditorConfig;
309
+ hoverTarget: IUI$1;
310
+ target: IUI$1 | IUI$1[];
311
+ readonly list: IUI$1[];
312
+ readonly hasTarget: boolean;
313
+ readonly multiple: boolean;
314
+ readonly single: boolean;
315
+ readonly dragging: boolean;
316
+ element: IUI$1;
317
+ buttons: IGroup$1;
318
+ selector: IGroup$1;
319
+ editBox: IGroup$1;
320
+ editTool: IObject;
321
+ hasItem(item: IUI$1): boolean;
322
+ shiftItem(item: IUI$1): void;
323
+ addItem(item: IUI$1): void;
324
+ removeItem(item: IUI$1): void;
325
+ update(): void;
326
+ updateEditTool(): void;
327
+ getEditSize(ui: ILeaf): IEditSize;
328
+ onMove(e: IDragEvent): void;
329
+ onScale(e: IDragEvent): void;
330
+ onRotate(e: IDragEvent | IRotateEvent): void;
331
+ onSkew(e: IDragEvent): void;
332
+ group(group?: IGroup$1 | IGroupInputData$1): IGroup$1;
333
+ ungroup(): IUI$1[];
334
+ lock(): void;
335
+ unlock(): void;
336
+ toTop(): void;
337
+ toBottom(): void;
338
+ }
339
+ interface IEditorConfig {
340
+ editSize?: 'auto' | IEditSize;
341
+ dualEvent?: boolean;
342
+ keyEvent?: boolean;
343
+ stroke?: IStroke$1;
344
+ strokeWidth?: number;
345
+ pointFill?: IFill$1;
346
+ pointSize?: number;
347
+ pointRadius?: number;
348
+ point?: IBoxInputData$1 | IBoxInputData$1[];
349
+ middlePoint?: IBoxInputData$1 | IBoxInputData$1[];
350
+ rotatePoint?: IBoxInputData$1;
351
+ rect?: IBoxInputData$1;
352
+ area?: IRectInputData$1;
353
+ buttonsDirection?: 'top' | 'right' | 'bottom' | 'left';
354
+ buttonsFixed?: boolean;
355
+ buttonsMargin?: number;
356
+ hideOnMove?: boolean;
357
+ hideOnSmall?: boolean | number;
358
+ moveCursor?: ICursorType;
359
+ resizeCursor?: IImageCursor;
360
+ rotateCursor?: IImageCursor;
361
+ skewCursor?: IImageCursor;
362
+ around?: IAround;
363
+ lockRatio?: boolean | 'corner';
364
+ lockMove?: boolean | 'x' | 'y';
365
+ rotateGap?: number;
366
+ selector?: boolean;
367
+ hover?: boolean;
368
+ select?: 'press' | 'tap';
369
+ boxSelect?: boolean;
370
+ continuousSelect?: boolean;
371
+ moveable?: boolean;
372
+ rotateable?: boolean;
373
+ resizeable?: boolean;
374
+ skewable?: boolean;
282
375
  }
283
376
 
284
377
  interface ILine extends IUI {
@@ -287,13 +380,24 @@ interface ILine extends IUI {
287
380
  points: number[];
288
381
  curve: boolean | number;
289
382
  }
290
- interface ILineData extends IUIData {
291
- }
292
- interface ILineInputData extends IUIBaseInputData {
383
+ interface ILineAttrData {
293
384
  toPoint?: IPointData;
294
385
  points?: number[];
295
386
  curve?: boolean | number;
296
387
  }
388
+ interface ILineData extends ILineAttrData, IUIData {
389
+ }
390
+ interface ILineInputData extends ILineAttrData, IUIBaseInputData {
391
+ }
392
+ interface IArrow extends ILine {
393
+ __: IArrowData;
394
+ }
395
+ interface IArrowAttrData {
396
+ }
397
+ interface IArrowData extends IArrowAttrData, ILineData {
398
+ }
399
+ interface IArrowInputData extends IArrowAttrData, ILineInputData {
400
+ }
297
401
  interface IRect extends IUI {
298
402
  __: IRectData;
299
403
  }
@@ -346,16 +450,10 @@ interface IStarInputData extends IStarAttrData, IUIBaseInputData {
346
450
  }
347
451
  interface IPath extends IUI {
348
452
  __: IPathData;
349
- path: IPathCommandData | IPathString;
350
- windingRule: IWindingRule;
351
453
  }
352
454
  interface IPathData extends IUIData {
353
- path?: IPathCommandData;
354
- windingRule?: IWindingRule;
355
455
  }
356
456
  interface IPathInputData extends IUIBaseInputData {
357
- path?: IPathCommandData | IPathString;
358
- windingRule?: IWindingRule;
359
457
  }
360
458
  interface IPen extends IGroup, IPathCreator {
361
459
  __: IPenData;
@@ -363,7 +461,6 @@ interface IPen extends IGroup, IPathCreator {
363
461
  pathStyle: IPathInputData;
364
462
  path: IPathCommandData;
365
463
  paint(): void;
366
- clear(): void;
367
464
  }
368
465
  interface IPenData extends IGroupData {
369
466
  }
@@ -380,6 +477,9 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {
380
477
  __baseLine?: number;
381
478
  __lineHeight?: number;
382
479
  __letterSpacing?: number;
480
+ __padding?: number[];
481
+ __clipText?: boolean;
482
+ __textBoxBounds?: IBoundsData;
383
483
  }
384
484
  interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {
385
485
  }
@@ -391,9 +491,12 @@ interface ITextRowData {
391
491
  text?: string;
392
492
  data?: ITextCharData[];
393
493
  words?: ITextWordData[];
494
+ startCharSize?: number;
495
+ endCharSize?: number;
394
496
  paraStart?: boolean;
395
497
  paraEnd?: boolean;
396
498
  isOverflow?: boolean;
499
+ textMode?: boolean;
397
500
  }
398
501
  interface ITextWordData {
399
502
  x?: number;
@@ -428,29 +531,32 @@ interface IImageAttrData {
428
531
  url?: string;
429
532
  }
430
533
  interface IImageData extends IImageAttrData, IRectData {
534
+ __setImageFill(value: string): void;
431
535
  }
432
536
  interface IImageInputData extends IImageAttrData, IUIBaseInputData {
433
537
  }
434
538
  interface ICanvas extends IRect {
435
539
  __: ICanvasData;
436
- pixelRatio: number;
437
540
  smooth: boolean;
541
+ contextSettings: ICanvasContext2DSettings;
438
542
  canvas: ILeaferCanvas;
439
543
  __updateSize(): void;
440
544
  }
441
545
  interface ICanvasAttrData {
442
- pixelRatio?: number;
443
546
  smooth?: boolean;
547
+ contextSettings?: ICanvasContext2DSettings;
444
548
  }
445
549
  interface ICanvasData extends ICanvasAttrData, IRectData {
446
550
  }
447
551
  interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData {
448
552
  }
449
553
  interface ILeaferData extends IGroupData {
450
- pixelRatio?: number;
451
554
  }
452
555
  interface ILeaferInputData extends IGroupInputData {
453
- pixelRatio?: number;
556
+ }
557
+ interface IAppData extends ILeaferData {
558
+ }
559
+ interface IAppInputData extends ILeaferInputData {
454
560
  }
455
561
  interface IFrame extends IBox {
456
562
  __: IFrameData;
@@ -474,60 +580,128 @@ interface IBoxInputData extends IGroupInputData {
474
580
  interface IGroup extends IUI {
475
581
  __: IGroupData;
476
582
  children: IUI[];
477
- mask?: IUI;
583
+ pick(hitPoint: IPointData, options?: IPickOptions): IPickResult;
478
584
  add(child: IUI, index?: number): void;
479
585
  addAt(child: IUI, index: number): void;
480
586
  addAfter(child: IUI, after: IUI): void;
481
587
  addBefore(child: IUI, before: IUI): void;
588
+ addMany(...children: ILeaf$1[]): void;
482
589
  remove(child?: IUI): void;
483
590
  removeAll(): void;
591
+ clear(): void;
484
592
  }
485
593
  interface IGroupData extends IUIData {
486
594
  }
487
595
  interface IGroupInputData extends IUIBaseInputData {
488
596
  }
489
- interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf {
597
+ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf$1 {
490
598
  __: IUIData;
599
+ readonly app: ILeafer;
600
+ leafer?: ILeafer;
491
601
  parent?: IGroup;
602
+ zoomLayer?: IGroup;
603
+ readonly isFrame?: boolean;
604
+ proxyData: IUIInputData;
605
+ __proxyData?: IUIInputData;
606
+ normalStyle: IUIInputData;
607
+ hoverStyle: IUIInputData;
608
+ pressStyle: IUIInputData;
609
+ focusStyle: IUIInputData;
610
+ selectedStyle: IUIInputData;
611
+ disabledStyle: IUIInputData;
612
+ editorStyle: IEditorConfig;
613
+ children?: IUI[];
614
+ reset(data?: IUIInputData): void;
492
615
  set(data: IUIInputData): void;
493
616
  toJSON(): IUIInputData;
494
- getPath(curve?: boolean): IPathCommandData;
495
- getPathString(curve?: boolean): IPathString;
617
+ get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
618
+ createProxyData(): IUIInputData;
619
+ find(condition: number | string | IFindUIMethod, options?: any): IUI[];
620
+ findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
621
+ getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
622
+ getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
496
623
  __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
624
+ __drawPathByBox(drawer: IPathDrawer): void;
497
625
  __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;
498
- export(filename: string, options?: IExportOptions | number): Promise<IBlob | string | boolean>;
626
+ export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
499
627
  clone(): IUI;
500
628
  }
629
+ interface IFindUIMethod {
630
+ (leaf: IUI, options?: any): IAnswer;
631
+ }
501
632
  interface IUIData extends IUIComputedData, ILeafData {
502
633
  padding?: number | number[];
503
- locked?: boolean;
634
+ normalStyle?: IUIInputData;
635
+ hoverStyle?: IUIInputData;
636
+ pressStyle?: IUIInputData;
637
+ focusStyle?: IUIInputData;
638
+ selectedStyle?: IUIInputData;
639
+ disabledStyle?: IUIInputData;
640
+ editorStyle?: IEditorConfig;
504
641
  __isFills?: boolean;
505
642
  __isStrokes?: boolean;
643
+ readonly __strokeWidth: number;
644
+ __pixelFill?: boolean;
645
+ __pixelStroke?: boolean;
646
+ __isHitPixel?: boolean;
647
+ __opacityFill?: boolean;
648
+ __opacityStroke?: boolean;
506
649
  __drawAfterFill?: boolean;
507
650
  __isOverflow?: boolean;
508
651
  __blendLayer?: boolean;
509
- __isTranslucentFill?: boolean;
510
- __isTranslucentStroke?: boolean;
511
- __useEffect?: boolean;
512
- path?: IPathCommandData;
513
- windingRule?: IWindingRule;
514
- __pathForRender?: IPathCommandData;
515
- __path2DForRender?: IPath2D;
652
+ readonly __autoWidth: boolean;
653
+ readonly __autoHeight: boolean;
654
+ readonly __autoSide: boolean;
655
+ readonly __autoSize: boolean;
516
656
  __boxStroke?: boolean;
517
657
  __font?: string;
518
658
  __textDrawData?: ITextDrawData;
659
+ __needComputePaint: boolean;
660
+ __computePaint(): void;
519
661
  }
520
662
  interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
521
663
  padding?: number | number[];
522
- locked?: boolean;
523
664
  }
524
665
  interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
525
666
  padding?: number | number[];
526
- locked?: boolean;
527
- children?: IUIBaseInputData[];
667
+ normalStyle?: IUIInputData;
668
+ hoverStyle?: IUIInputData;
669
+ pressStyle?: IUIInputData;
670
+ focusStyle?: IUIInputData;
671
+ selectedStyle?: IUIInputData;
672
+ disabledStyle?: IUIInputData;
673
+ editorStyle?: IEditorConfig;
674
+ children?: IUIInputData[];
528
675
  }
529
676
  type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box';
530
- interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject {
677
+ interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject$1 {
678
+ children?: IUIInputData[];
679
+ }
680
+
681
+ interface ILeafer extends IGroup, ILeaferAttrData, IControl {
682
+ readonly isApp: boolean;
683
+ readonly app: ILeafer;
684
+ parent?: IApp;
685
+ zoomLayer: IGroup;
686
+ editor: IEditorBase;
687
+ ground?: ILeafer;
688
+ tree?: ILeafer;
689
+ sky?: ILeafer;
690
+ userConfig?: ILeaferConfig;
691
+ onInit(): void;
692
+ initType(type: ILeaferType): void;
693
+ destroy(sync?: boolean): void;
694
+ }
695
+
696
+ interface IApp extends ILeafer {
697
+ children: ILeafer[];
698
+ realCanvas: boolean;
699
+ }
700
+ interface IAppConfig extends ILeaferConfig {
701
+ ground?: ILeaferConfig;
702
+ tree?: ILeaferConfig;
703
+ sky?: ILeaferConfig;
704
+ editor?: IEditorConfig;
531
705
  }
532
706
 
533
707
  type IUIRenderModule = IUIRender & ThisType<IUI>;
@@ -556,12 +730,31 @@ interface IUIBounds extends ILeafBounds {
556
730
 
557
731
  type IUIHitModule = ILeafHit & ThisType<IUI>;
558
732
 
733
+ interface IPathArrowModule {
734
+ list: IPathDataArrowMap;
735
+ addArrows(ui: IUI, changeRenderPath?: boolean): void;
736
+ }
737
+
559
738
  interface ITextConvertModule {
560
- getDrawData?(content: string, style: ITextData): ITextDrawData;
739
+ getDrawData(content: string, style: ITextData): ITextDrawData;
561
740
  }
562
741
 
563
742
  interface IColorConvertModule {
564
- string?(color: IColor, opacity?: number): string;
743
+ string(color: IColor, opacity?: number): string;
744
+ }
745
+
746
+ interface IExportModule {
747
+ running?: boolean;
748
+ export(leaf: ILeaf$1, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
749
+ }
750
+
751
+ interface IStateModule {
752
+ isHover(leaf: ILeaf$1): boolean;
753
+ isPress(leaf: ILeaf$1): boolean;
754
+ isFocus(leaf: ILeaf$1): boolean;
755
+ isDrag(leaf: ILeaf$1): boolean;
756
+ setStyle(leaf: ILeaf$1, stateType: IStateStyleType, value: boolean): void;
757
+ updateEventStyle(leaf: ILeaf$1, eventType: string): void;
565
758
  }
566
759
 
567
760
  interface ICachedShape extends ICachedLeaf {
@@ -572,24 +765,37 @@ interface ICachedShape extends ICachedLeaf {
572
765
  }
573
766
 
574
767
  interface IPaintModule {
575
- compute?(ui: IUI, attrName: 'fill' | 'stroke'): void;
576
- fill?(ui: IUI, canvas: ILeaferCanvas, fill: string): void;
577
- fills?(ui: IUI, canvas: ILeaferCanvas, fills: ILeafPaint[]): void;
578
- fillText?(ui: IUI, canvas: ILeaferCanvas): void;
579
- stroke?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void;
580
- strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void;
581
- strokeText?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void;
582
- strokesText?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void;
583
- drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void;
584
- shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape;
585
- recycleImage?(data: IUIData, attrName: string): IBooleanMap;
768
+ compute(attrName: IPaintAttr, ui: IUI): void;
769
+ fill(fill: string, ui: IUI, canvas: ILeaferCanvas): void;
770
+ fills(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
771
+ fillText(ui: IUI, canvas: ILeaferCanvas): void;
772
+ stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void;
773
+ strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
774
+ strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void;
775
+ drawTextStroke(ui: IUI, canvas: ILeaferCanvas): void;
776
+ shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape;
777
+ }
778
+ interface IPaintImageModule {
779
+ image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
780
+ checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean;
781
+ createPattern(ui: IUI, paint: ILeafPaint, pixelRatio: number): boolean;
782
+ recycleImage(attrName: IPaintAttr, data: IUIData): IBooleanMap;
783
+ createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
784
+ fillOrFitMode(data: ILeafPaintPatternData, mode: IImagePaintMode, box: IBoundsData, width: number, height: number, rotation: number): void;
785
+ clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
786
+ repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
787
+ }
788
+ interface IPaintGradientModule {
789
+ linearGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
790
+ radialGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
791
+ conicGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
586
792
  }
587
793
 
588
794
  interface IEffectModule {
589
- shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
590
- innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
591
- blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, options: IRenderOptions): void;
592
- backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void;
795
+ shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
796
+ innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
797
+ blur(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas): void;
798
+ backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
593
799
  }
594
800
 
595
- export type { IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, ICornerRadiusString, IDashPatternString, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IColorString as IStringColor, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
801
+ export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };