@leafer-ui/display 1.0.0-rc.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/Box.ts +59 -39
- package/src/Canvas.ts +17 -18
- package/src/Ellipse.ts +3 -3
- package/src/Frame.ts +8 -5
- package/src/Group.ts +24 -31
- package/src/Image.ts +5 -25
- package/src/Leafer.ts +447 -0
- package/src/Line.ts +19 -30
- package/src/Path.ts +4 -21
- package/src/Pen.ts +18 -8
- package/src/Polygon.ts +3 -6
- package/src/Rect.ts +2 -6
- package/src/Star.ts +2 -2
- package/src/Text.ts +34 -29
- package/src/UI.ts +266 -92
- package/src/index.ts +1 -0
- package/types/index.d.ts +254 -119
package/types/index.d.ts
CHANGED
|
@@ -1,112 +1,251 @@
|
|
|
1
|
-
import { IString, INumber, IBoolean,
|
|
2
|
-
import { Leaf } from '@leafer/core';
|
|
3
|
-
import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode,
|
|
1
|
+
import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IPathCommandData, IPathString, IWindingRule, IFlowType, IFourNumber, IGap, IPointGap, IFlowAlign, IFlowAxisAlign, IFlowWrap, IFlowBoxType, IAutoSize, IAutoBoxData, IConstraint, IRangeSize, IAxis, IBoundsData, IHitType, ICursorType, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, IExportFileType, IJSONOptions, IPickOptions, IPickResult, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, IZoomType, IClientPointData, IRenderOptions, ILeaferImage, ICanvasContext2DSettings, ICanvasContext2D, IUnitData } from '@leafer/interface';
|
|
2
|
+
import { Leaf, LeafList } from '@leafer/core';
|
|
3
|
+
import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowType, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IEditorConfig, IFindUIMethod, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupData, IGroupInputData, IUIJSONData, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBox, IBoxData, IOverflow, IBoxInputData, IFrame, IFrameData, IFrameInputData, IRect, IRectData, IRectInputData, IEllipse, IEllipseData, IEllipseInputData, IPolygon, IPolygonData, IPolygonInputData, IStar, IStarData, IStarInputData, ILine, ILineData, ILineInputData, IImage, IImageData, IImageInputData, ICanvas, ICanvasData, ICanvasInputData, IText, ITextData, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, ITextWrap, ITextDrawData, ITextInputData, IPath, IPathData, IPathInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPenInputData } from '@leafer-ui/interface';
|
|
4
4
|
|
|
5
5
|
declare class UI extends Leaf implements IUI {
|
|
6
6
|
__: IUIData;
|
|
7
|
-
proxyData
|
|
7
|
+
proxyData?: IUIInputData;
|
|
8
8
|
__proxyData?: IUIInputData;
|
|
9
9
|
get app(): ILeafer;
|
|
10
10
|
leafer?: ILeafer;
|
|
11
11
|
parent?: IGroup;
|
|
12
|
-
|
|
12
|
+
zoomLayer: IGroup;
|
|
13
|
+
get isFrame(): boolean;
|
|
13
14
|
children?: IUI[];
|
|
14
|
-
id
|
|
15
|
-
name
|
|
16
|
-
className
|
|
17
|
-
blendMode
|
|
18
|
-
opacity
|
|
19
|
-
visible
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
locked
|
|
23
|
-
zIndex
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
15
|
+
id?: IString;
|
|
16
|
+
name?: IString;
|
|
17
|
+
className?: IString;
|
|
18
|
+
blendMode?: IBlendMode;
|
|
19
|
+
opacity?: INumber;
|
|
20
|
+
visible?: IBoolean | 0;
|
|
21
|
+
selected?: IBoolean;
|
|
22
|
+
disabled?: IBoolean;
|
|
23
|
+
locked?: IBoolean;
|
|
24
|
+
zIndex?: INumber;
|
|
25
|
+
mask?: IBoolean | IMaskType;
|
|
26
|
+
eraser?: IBoolean | IEraserType;
|
|
27
|
+
x?: INumber;
|
|
28
|
+
y?: INumber;
|
|
29
|
+
width?: INumber;
|
|
30
|
+
height?: INumber;
|
|
31
|
+
scaleX?: INumber;
|
|
32
|
+
scaleY?: INumber;
|
|
33
|
+
rotation?: INumber;
|
|
34
|
+
skewX?: INumber;
|
|
35
|
+
skewY?: INumber;
|
|
36
|
+
offsetX?: INumber;
|
|
37
|
+
offsetY?: INumber;
|
|
38
|
+
scrollX?: INumber;
|
|
39
|
+
scrollY?: INumber;
|
|
40
|
+
origin?: IAlign | IUnitPointData;
|
|
41
|
+
around?: IAlign | IUnitPointData;
|
|
42
|
+
lazy?: IBoolean;
|
|
43
|
+
pixelRatio?: INumber;
|
|
44
|
+
path?: IPathCommandData | IPathString;
|
|
45
|
+
windingRule?: IWindingRule;
|
|
46
|
+
closed?: boolean;
|
|
47
|
+
flow?: IFlowType;
|
|
48
|
+
padding?: IFourNumber;
|
|
49
|
+
gap?: IGap | IPointGap;
|
|
50
|
+
flowAlign?: IFlowAlign | IFlowAxisAlign;
|
|
51
|
+
flowWrap?: IFlowWrap;
|
|
52
|
+
itemBox?: IFlowBoxType;
|
|
53
|
+
inFlow?: IBoolean;
|
|
54
|
+
autoWidth?: IAutoSize;
|
|
55
|
+
autoHeight?: IAutoSize;
|
|
56
|
+
lockRatio?: IBoolean;
|
|
57
|
+
autoBox?: IAutoBoxData | IConstraint;
|
|
58
|
+
widthRange?: IRangeSize;
|
|
59
|
+
heightRange?: IRangeSize;
|
|
60
|
+
draggable?: IBoolean | IAxis;
|
|
61
|
+
dragBounds?: IBoundsData | 'parent';
|
|
62
|
+
editable?: IBoolean;
|
|
63
|
+
hittable?: IBoolean;
|
|
64
|
+
hitFill?: IHitType;
|
|
65
|
+
hitStroke?: IHitType;
|
|
66
|
+
hitBox?: IBoolean;
|
|
67
|
+
hitChildren?: IBoolean;
|
|
68
|
+
hitSelf?: IBoolean;
|
|
69
|
+
hitRadius?: INumber;
|
|
70
|
+
cursor?: ICursorType | ICursorType[];
|
|
71
|
+
fill?: IFill;
|
|
72
|
+
stroke?: IStroke;
|
|
73
|
+
strokeAlign?: IStrokeAlign;
|
|
74
|
+
strokeWidth?: IFourNumber | IStrokeWidthString;
|
|
75
|
+
strokeWidthFixed?: IBoolean;
|
|
76
|
+
strokeCap?: IStrokeCap;
|
|
77
|
+
strokeJoin?: IStrokeJoin;
|
|
78
|
+
dashPattern?: INumber[] | IDashPatternString;
|
|
79
|
+
dashOffset?: INumber;
|
|
80
|
+
miterLimit?: INumber;
|
|
81
|
+
startArrow?: IArrowType;
|
|
82
|
+
endArrow?: IArrowType;
|
|
83
|
+
cornerRadius?: IFourNumber | ICornerRadiusString;
|
|
84
|
+
cornerSmoothing?: INumber;
|
|
85
|
+
shadow?: IShadowEffect | IShadowEffect[] | IShadowString;
|
|
86
|
+
innerShadow?: IShadowEffect | IShadowEffect[] | IShadowString;
|
|
87
|
+
blur?: INumber | IBlurEffect;
|
|
88
|
+
backgroundBlur?: INumber | IBlurEffect;
|
|
89
|
+
grayscale?: INumber | IGrayscaleEffect;
|
|
90
|
+
normalStyle?: IUIInputData;
|
|
91
|
+
hoverStyle?: IUIInputData;
|
|
92
|
+
pressStyle?: IUIInputData;
|
|
93
|
+
focusStyle?: IUIInputData;
|
|
94
|
+
selectedStyle?: IUIInputData;
|
|
95
|
+
disabledStyle?: IUIInputData;
|
|
96
|
+
data: IObject;
|
|
61
97
|
set scale(value: INumber | IPointData);
|
|
62
98
|
get scale(): INumber | IPointData;
|
|
99
|
+
get pen(): IPathCreator;
|
|
100
|
+
get editConfig(): IEditorConfig;
|
|
101
|
+
get editOuter(): string;
|
|
102
|
+
get editInner(): string;
|
|
63
103
|
constructor(data?: IUIInputData);
|
|
64
104
|
reset(_data?: IUIInputData): void;
|
|
65
105
|
set(data: IUIInputData): void;
|
|
66
|
-
get(): IUIInputData;
|
|
106
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
67
107
|
createProxyData(): IUIInputData;
|
|
68
|
-
find(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
find(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI[];
|
|
109
|
+
findTag(tag: string | string[]): IUI[];
|
|
110
|
+
findOne(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI | undefined;
|
|
111
|
+
findId(id: number | string): IUI | undefined;
|
|
112
|
+
getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
|
|
113
|
+
getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
|
|
114
|
+
load(): void;
|
|
72
115
|
__onUpdateSize(): void;
|
|
73
116
|
__updateRenderPath(): void;
|
|
74
117
|
__drawRenderPath(canvas: ILeaferCanvas): void;
|
|
75
118
|
__drawPath(canvas: ILeaferCanvas): void;
|
|
76
|
-
__drawPathByData(
|
|
119
|
+
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
|
|
77
120
|
__drawPathByBox(drawer: IPathDrawer): void;
|
|
78
121
|
export(filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
|
|
79
122
|
clone(): IUI;
|
|
80
123
|
static one(data: IUIInputData, x?: number, y?: number, width?: number, height?: number): IUI;
|
|
124
|
+
static registerUI(): void;
|
|
125
|
+
static registerData(data: IUIData): void;
|
|
126
|
+
static setEditConfig(_config: IEditorConfig | IEditorConfigFunction): void;
|
|
127
|
+
static setEditOuter(_toolName: string | IEditToolFunction): void;
|
|
128
|
+
static setEditInner(_editorName: string | IEditToolFunction): void;
|
|
81
129
|
destroy(): void;
|
|
82
130
|
}
|
|
83
131
|
|
|
84
132
|
declare class Group extends UI implements IGroup {
|
|
85
133
|
get __tag(): string;
|
|
134
|
+
get isBranch(): boolean;
|
|
86
135
|
__: IGroupData;
|
|
87
136
|
children: IUI[];
|
|
88
|
-
set mask(child: IUI);
|
|
89
|
-
get mask(): IUI;
|
|
90
137
|
constructor(data?: IGroupInputData);
|
|
138
|
+
reset(data?: IGroupInputData): void;
|
|
91
139
|
__setBranch(): void;
|
|
92
140
|
set(data: IUIInputData): void;
|
|
93
|
-
toJSON():
|
|
94
|
-
|
|
141
|
+
toJSON(options?: IJSONOptions): IUIJSONData;
|
|
142
|
+
pick(_hitPoint: IPointData, _options?: IPickOptions): IPickResult;
|
|
95
143
|
addAt(child: IUI, index: number): void;
|
|
96
144
|
addAfter(child: IUI, after: IUI): void;
|
|
97
|
-
addBefore(child:
|
|
145
|
+
addBefore(child: IUI, before: IUI): void;
|
|
98
146
|
add(_child: IUI, _index?: number): void;
|
|
99
147
|
addMany(..._children: IUI[]): void;
|
|
100
148
|
remove(_child?: IUI, _destroy?: boolean): void;
|
|
101
149
|
removeAll(_destroy?: boolean): void;
|
|
150
|
+
clear(): void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare class Leafer extends Group implements ILeafer {
|
|
154
|
+
static list: LeafList;
|
|
155
|
+
get __tag(): string;
|
|
156
|
+
__: ILeaferData;
|
|
157
|
+
pixelRatio?: INumber;
|
|
158
|
+
get isApp(): boolean;
|
|
159
|
+
get app(): ILeafer;
|
|
160
|
+
get isLeafer(): boolean;
|
|
161
|
+
parent?: IApp;
|
|
162
|
+
running: boolean;
|
|
163
|
+
created: boolean;
|
|
164
|
+
ready: boolean;
|
|
165
|
+
viewReady: boolean;
|
|
166
|
+
viewCompleted: boolean;
|
|
167
|
+
get imageReady(): boolean;
|
|
168
|
+
get layoutLocked(): boolean;
|
|
169
|
+
transforming: boolean;
|
|
170
|
+
view: unknown;
|
|
171
|
+
canvas: ILeaferCanvas;
|
|
172
|
+
renderer: IRenderer;
|
|
173
|
+
watcher: IWatcher;
|
|
174
|
+
layouter: ILayouter;
|
|
175
|
+
selector?: ISelector;
|
|
176
|
+
interaction?: IInteraction;
|
|
177
|
+
canvasManager: ICanvasManager;
|
|
178
|
+
hitCanvasManager?: IHitCanvasManager;
|
|
179
|
+
editor: IEditorBase;
|
|
180
|
+
userConfig: ILeaferConfig;
|
|
181
|
+
config: ILeaferConfig;
|
|
182
|
+
autoLayout?: IAutoBounds;
|
|
183
|
+
lazyBounds: IBounds;
|
|
184
|
+
get FPS(): number;
|
|
185
|
+
get cursorPoint(): IPointData;
|
|
186
|
+
get clientBounds(): IBoundsData;
|
|
187
|
+
leafs: number;
|
|
188
|
+
__eventIds: IEventListenerId[];
|
|
189
|
+
protected __startTimer: ITimer;
|
|
190
|
+
protected __controllers: IControl[];
|
|
191
|
+
protected __initWait: IFunction[];
|
|
192
|
+
protected __readyWait: IFunction[];
|
|
193
|
+
protected __viewReadyWait: IFunction[];
|
|
194
|
+
protected __viewCompletedWait: IFunction[];
|
|
195
|
+
__nextRenderWait: IFunction[];
|
|
196
|
+
constructor(userConfig?: ILeaferConfig, data?: ILeaferInputData);
|
|
197
|
+
init(userConfig?: ILeaferConfig, parentApp?: IApp): void;
|
|
198
|
+
onInit(): void;
|
|
199
|
+
initType(_type: ILeaferType): void;
|
|
200
|
+
set(data: IUIInputData): void;
|
|
201
|
+
start(): void;
|
|
202
|
+
stop(): void;
|
|
203
|
+
unlockLayout(): void;
|
|
204
|
+
lockLayout(): void;
|
|
205
|
+
resize(size: IScreenSizeData): void;
|
|
206
|
+
forceRender(bounds?: IBoundsData): void;
|
|
207
|
+
updateCursor(cursor?: ICursorType): void;
|
|
208
|
+
updateLazyBounds(): void;
|
|
209
|
+
protected __doResize(size: IScreenSizeData): void;
|
|
210
|
+
protected __onResize(event: IResizeEvent): void;
|
|
211
|
+
protected __setApp(): void;
|
|
212
|
+
protected __bindApp(app: IApp): void;
|
|
213
|
+
__setLeafer(leafer: ILeafer): void;
|
|
214
|
+
protected __checkAutoLayout(config: ILeaferConfig): void;
|
|
215
|
+
__setAttr(attrName: string, newValue: IValue): boolean;
|
|
216
|
+
__getAttr(attrName: string): IValue;
|
|
217
|
+
protected __changeCanvasSize(attrName: string, newValue: number): void;
|
|
218
|
+
protected __changeFill(newValue: string): void;
|
|
219
|
+
protected __onCreated(): void;
|
|
220
|
+
protected __onReady(): void;
|
|
221
|
+
protected __onViewReady(): void;
|
|
222
|
+
protected __onNextRender(): void;
|
|
223
|
+
protected __checkViewCompleted(emit?: boolean): void;
|
|
224
|
+
protected __onWatchData(): void;
|
|
225
|
+
waitInit(item: IFunction, bind?: IObject): void;
|
|
226
|
+
waitReady(item: IFunction, bind?: IObject): void;
|
|
227
|
+
waitViewReady(item: IFunction, bind?: IObject): void;
|
|
228
|
+
waitViewCompleted(item: IFunction, bind?: IObject): void;
|
|
229
|
+
nextRender(item: IFunction, bind?: IObject, off?: 'off'): void;
|
|
230
|
+
zoom(_zoomType: IZoomType, _padding?: IFourNumber, _fixedScale?: boolean): IBoundsData;
|
|
231
|
+
getValidMove(moveX: number, moveY: number): IPointData;
|
|
232
|
+
getValidScale(changeScale: number): number;
|
|
233
|
+
getWorldPointByClient(clientPoint: IClientPointData, updateClient?: boolean): IPointData;
|
|
234
|
+
protected __checkUpdateLayout(): void;
|
|
235
|
+
protected emitLeafer(type: string): void;
|
|
236
|
+
protected __listenEvents(): void;
|
|
237
|
+
protected __removeListenEvents(): void;
|
|
238
|
+
destroy(sync?: boolean): void;
|
|
102
239
|
}
|
|
103
240
|
|
|
104
241
|
declare class Box extends Group implements IBox {
|
|
105
242
|
get __tag(): string;
|
|
243
|
+
get isBranchLeaf(): boolean;
|
|
106
244
|
__: IBoxData;
|
|
107
|
-
|
|
245
|
+
resizeChildren?: IBoolean;
|
|
246
|
+
overflow?: IOverflow;
|
|
247
|
+
isOverflow: boolean;
|
|
108
248
|
constructor(data?: IBoxInputData);
|
|
109
|
-
__scaleResize(scaleX: number, scaleY: number): void;
|
|
110
249
|
__updateStrokeSpread(): number;
|
|
111
250
|
__updateRectRenderSpread(): number;
|
|
112
251
|
__updateRenderSpread(): number;
|
|
@@ -117,7 +256,6 @@ declare class Box extends Group implements IBox {
|
|
|
117
256
|
__updateRectRenderBounds(): void;
|
|
118
257
|
__updateRectChange(): void;
|
|
119
258
|
__updateChange(): void;
|
|
120
|
-
__drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void;
|
|
121
259
|
__renderRect(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|
|
122
260
|
__renderGroup(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|
|
123
261
|
__render(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
@@ -126,8 +264,10 @@ declare class Box extends Group implements IBox {
|
|
|
126
264
|
|
|
127
265
|
declare class Frame extends Box implements IFrame {
|
|
128
266
|
get __tag(): string;
|
|
267
|
+
get isFrame(): boolean;
|
|
129
268
|
__: IFrameData;
|
|
130
|
-
|
|
269
|
+
fill?: IFill;
|
|
270
|
+
overflow?: IOverflow;
|
|
131
271
|
constructor(data?: IFrameInputData);
|
|
132
272
|
}
|
|
133
273
|
|
|
@@ -135,15 +275,14 @@ declare class Rect extends UI implements IRect {
|
|
|
135
275
|
get __tag(): string;
|
|
136
276
|
__: IRectData;
|
|
137
277
|
constructor(data?: IRectInputData);
|
|
138
|
-
__drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void;
|
|
139
278
|
}
|
|
140
279
|
|
|
141
280
|
declare class Ellipse extends UI implements IEllipse {
|
|
142
281
|
get __tag(): string;
|
|
143
282
|
__: IEllipseData;
|
|
144
|
-
innerRadius
|
|
145
|
-
startAngle
|
|
146
|
-
endAngle
|
|
283
|
+
innerRadius?: INumber;
|
|
284
|
+
startAngle?: INumber;
|
|
285
|
+
endAngle?: INumber;
|
|
147
286
|
constructor(data?: IEllipseInputData);
|
|
148
287
|
__updatePath(): void;
|
|
149
288
|
}
|
|
@@ -151,21 +290,20 @@ declare class Ellipse extends UI implements IEllipse {
|
|
|
151
290
|
declare class Polygon extends UI implements IPolygon {
|
|
152
291
|
get __tag(): string;
|
|
153
292
|
__: IPolygonData;
|
|
154
|
-
sides
|
|
155
|
-
points
|
|
156
|
-
curve
|
|
293
|
+
sides?: INumber;
|
|
294
|
+
points?: number[];
|
|
295
|
+
curve?: boolean | number;
|
|
157
296
|
constructor(data?: IPolygonInputData);
|
|
158
297
|
__updatePath(): void;
|
|
159
298
|
__updateRenderPath(): void;
|
|
160
299
|
__updateBoxBounds(): void;
|
|
161
|
-
__scaleResize(_scaleX: number, _scaleY: number): void;
|
|
162
300
|
}
|
|
163
301
|
|
|
164
302
|
declare class Star extends UI implements IStar {
|
|
165
303
|
get __tag(): string;
|
|
166
304
|
__: IStarData;
|
|
167
|
-
corners
|
|
168
|
-
innerRadius
|
|
305
|
+
corners?: INumber;
|
|
306
|
+
innerRadius?: INumber;
|
|
169
307
|
constructor(data?: IStarInputData);
|
|
170
308
|
__updatePath(): void;
|
|
171
309
|
}
|
|
@@ -173,17 +311,17 @@ declare class Star extends UI implements IStar {
|
|
|
173
311
|
declare class Line extends UI implements ILine {
|
|
174
312
|
get __tag(): string;
|
|
175
313
|
__: ILineData;
|
|
176
|
-
strokeAlign
|
|
177
|
-
height
|
|
178
|
-
points
|
|
179
|
-
curve
|
|
314
|
+
strokeAlign?: IStrokeAlign;
|
|
315
|
+
height?: INumber;
|
|
316
|
+
points?: number[];
|
|
317
|
+
curve?: boolean | number;
|
|
318
|
+
closed?: boolean;
|
|
180
319
|
get toPoint(): IPointData;
|
|
181
320
|
set toPoint(value: IPointData);
|
|
182
321
|
constructor(data?: ILineInputData);
|
|
183
322
|
__updatePath(): void;
|
|
184
323
|
__updateRenderPath(): void;
|
|
185
324
|
__updateBoxBounds(): void;
|
|
186
|
-
__scaleResize(scaleX: number, scaleY: number): void;
|
|
187
325
|
}
|
|
188
326
|
|
|
189
327
|
declare class Image extends Rect implements IImage {
|
|
@@ -191,22 +329,21 @@ declare class Image extends Rect implements IImage {
|
|
|
191
329
|
__: IImageData;
|
|
192
330
|
url: IString;
|
|
193
331
|
get ready(): boolean;
|
|
194
|
-
image
|
|
332
|
+
image?: ILeaferImage;
|
|
195
333
|
constructor(data?: IImageInputData);
|
|
196
|
-
__updateBoxBounds(): void;
|
|
197
334
|
destroy(): void;
|
|
198
335
|
}
|
|
199
336
|
|
|
200
337
|
declare class Canvas extends Rect implements ICanvas {
|
|
201
338
|
get __tag(): string;
|
|
202
339
|
__: ICanvasData;
|
|
203
|
-
width
|
|
204
|
-
height
|
|
205
|
-
pixelRatio
|
|
206
|
-
smooth
|
|
207
|
-
|
|
208
|
-
canvas
|
|
209
|
-
context
|
|
340
|
+
width?: INumber;
|
|
341
|
+
height?: INumber;
|
|
342
|
+
pixelRatio?: INumber;
|
|
343
|
+
smooth?: boolean;
|
|
344
|
+
contextSettings?: ICanvasContext2DSettings;
|
|
345
|
+
canvas?: ILeaferCanvas;
|
|
346
|
+
context?: ICanvasContext2D;
|
|
210
347
|
constructor(data?: ICanvasInputData);
|
|
211
348
|
draw(ui: IUI, offset?: IPointData, scale?: number | IPointData, rotation?: number): void;
|
|
212
349
|
paint(): void;
|
|
@@ -218,27 +355,28 @@ declare class Canvas extends Rect implements ICanvas {
|
|
|
218
355
|
declare class Text extends UI implements IText {
|
|
219
356
|
get __tag(): string;
|
|
220
357
|
__: ITextData;
|
|
221
|
-
width
|
|
222
|
-
height
|
|
223
|
-
|
|
224
|
-
fill
|
|
225
|
-
strokeAlign
|
|
226
|
-
hitFill
|
|
227
|
-
text
|
|
228
|
-
fontFamily
|
|
229
|
-
fontSize
|
|
230
|
-
fontWeight
|
|
231
|
-
italic
|
|
232
|
-
textCase
|
|
233
|
-
textDecoration
|
|
234
|
-
letterSpacing
|
|
235
|
-
lineHeight
|
|
236
|
-
paraIndent
|
|
237
|
-
paraSpacing
|
|
238
|
-
textAlign
|
|
239
|
-
verticalAlign
|
|
240
|
-
textWrap
|
|
241
|
-
textOverflow
|
|
358
|
+
width?: INumber;
|
|
359
|
+
height?: INumber;
|
|
360
|
+
resizeFontSize?: IBoolean;
|
|
361
|
+
fill?: IFill;
|
|
362
|
+
strokeAlign?: IStrokeAlign;
|
|
363
|
+
hitFill?: IHitType$1;
|
|
364
|
+
text?: IString;
|
|
365
|
+
fontFamily?: IString;
|
|
366
|
+
fontSize?: INumber;
|
|
367
|
+
fontWeight?: IFontWeight;
|
|
368
|
+
italic?: IBoolean;
|
|
369
|
+
textCase?: ITextCase;
|
|
370
|
+
textDecoration?: ITextDecoration;
|
|
371
|
+
letterSpacing?: INumber | IUnitData;
|
|
372
|
+
lineHeight?: INumber | IUnitData;
|
|
373
|
+
paraIndent?: INumber;
|
|
374
|
+
paraSpacing?: INumber;
|
|
375
|
+
textAlign?: ITextAlign;
|
|
376
|
+
verticalAlign?: IVerticalAlign;
|
|
377
|
+
textWrap?: ITextWrap;
|
|
378
|
+
textOverflow?: IOverflow | string;
|
|
379
|
+
get editInner(): string;
|
|
242
380
|
get textDrawData(): ITextDrawData;
|
|
243
381
|
constructor(data?: ITextInputData);
|
|
244
382
|
__drawHitPath(canvas: ILeaferCanvas): void;
|
|
@@ -253,12 +391,8 @@ declare class Text extends UI implements IText {
|
|
|
253
391
|
declare class Path extends UI implements IPath {
|
|
254
392
|
get __tag(): string;
|
|
255
393
|
__: IPathData;
|
|
256
|
-
|
|
257
|
-
windingRule: IWindingRule;
|
|
258
|
-
strokeAlign: IStrokeAlign;
|
|
394
|
+
strokeAlign?: IStrokeAlign;
|
|
259
395
|
constructor(data?: IPathInputData);
|
|
260
|
-
__scaleResize(scaleX: number, scaleY: number): void;
|
|
261
|
-
__updateBoxBounds(): void;
|
|
262
396
|
}
|
|
263
397
|
|
|
264
398
|
declare class Pen extends Group implements IPen {
|
|
@@ -267,6 +401,7 @@ declare class Pen extends Group implements IPen {
|
|
|
267
401
|
pathElement: IPath;
|
|
268
402
|
pathStyle: IPathInputData;
|
|
269
403
|
path: IPathCommandData$1;
|
|
404
|
+
__path: IPathCommandData$1;
|
|
270
405
|
constructor(data?: IPenInputData);
|
|
271
406
|
setStyle(data: IPathInputData): Pen;
|
|
272
407
|
beginPath(): Pen;
|
|
@@ -283,8 +418,8 @@ declare class Pen extends Group implements IPen {
|
|
|
283
418
|
drawEllipse(_x: number, _y: number, _radiusX: number, _radiusY: number, _rotation?: number, _startAngle?: number, _endAngle?: number, _anticlockwise?: boolean): Pen;
|
|
284
419
|
drawArc(_x: number, _y: number, _radius: number, _startAngle?: number, _endAngle?: number, _anticlockwise?: boolean): Pen;
|
|
285
420
|
drawPoints(_points: number[], _curve?: boolean | number, _close?: boolean): Pen;
|
|
421
|
+
clearPath(): Pen;
|
|
286
422
|
paint(): void;
|
|
287
|
-
clear(): void;
|
|
288
423
|
}
|
|
289
424
|
|
|
290
|
-
export { Box, Canvas, Ellipse, Frame, Group, Image, Line, Path, Pen, Polygon, Rect, Star, Text, UI };
|
|
425
|
+
export { Box, Canvas, Ellipse, Frame, Group, Image, Leafer, Line, Path, Pen, Polygon, Rect, Star, Text, UI };
|