@leafer-ui/display 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 +8 -8
- package/src/Box.ts +65 -30
- package/src/Canvas.ts +19 -20
- package/src/Ellipse.ts +9 -6
- package/src/Frame.ts +8 -5
- package/src/Group.ts +28 -22
- package/src/Image.ts +7 -27
- package/src/Leafer.ts +447 -0
- package/src/Line.ts +19 -16
- package/src/Path.ts +4 -19
- package/src/Pen.ts +18 -8
- package/src/Polygon.ts +12 -24
- package/src/Rect.ts +3 -11
- package/src/Star.ts +3 -3
- package/src/Text.ts +69 -38
- package/src/UI.ts +313 -84
- package/src/index.ts +1 -0
- package/types/index.d.ts +266 -113
package/types/index.d.ts
CHANGED
|
@@ -1,108 +1,261 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Leaf } from '@leafer/core';
|
|
3
|
-
import { IUI, IUIData, 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?: IUIInputData;
|
|
8
|
+
__proxyData?: IUIInputData;
|
|
9
|
+
get app(): ILeafer;
|
|
10
|
+
leafer?: ILeafer;
|
|
7
11
|
parent?: IGroup;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
12
|
+
zoomLayer: IGroup;
|
|
13
|
+
get isFrame(): boolean;
|
|
14
|
+
children?: IUI[];
|
|
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;
|
|
97
|
+
set scale(value: INumber | IPointData);
|
|
98
|
+
get scale(): INumber | IPointData;
|
|
99
|
+
get pen(): IPathCreator;
|
|
100
|
+
get editConfig(): IEditorConfig;
|
|
101
|
+
get editOuter(): string;
|
|
102
|
+
get editInner(): string;
|
|
103
|
+
constructor(data?: IUIInputData);
|
|
104
|
+
reset(_data?: IUIInputData): void;
|
|
55
105
|
set(data: IUIInputData): void;
|
|
56
|
-
get(): IUIInputData;
|
|
57
|
-
|
|
58
|
-
|
|
106
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
107
|
+
createProxyData(): IUIInputData;
|
|
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;
|
|
59
115
|
__onUpdateSize(): void;
|
|
60
116
|
__updateRenderPath(): void;
|
|
61
117
|
__drawRenderPath(canvas: ILeaferCanvas): void;
|
|
62
118
|
__drawPath(canvas: ILeaferCanvas): void;
|
|
63
|
-
__drawPathByData(
|
|
119
|
+
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
|
|
120
|
+
__drawPathByBox(drawer: IPathDrawer): void;
|
|
64
121
|
export(filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
|
|
65
122
|
clone(): IUI;
|
|
66
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;
|
|
67
129
|
destroy(): void;
|
|
68
130
|
}
|
|
69
131
|
|
|
70
132
|
declare class Group extends UI implements IGroup {
|
|
71
133
|
get __tag(): string;
|
|
134
|
+
get isBranch(): boolean;
|
|
72
135
|
__: IGroupData;
|
|
73
136
|
children: IUI[];
|
|
74
|
-
get resizeable(): boolean;
|
|
75
|
-
set mask(child: IUI);
|
|
76
|
-
get mask(): IUI;
|
|
77
137
|
constructor(data?: IGroupInputData);
|
|
138
|
+
reset(data?: IGroupInputData): void;
|
|
78
139
|
__setBranch(): void;
|
|
79
140
|
set(data: IUIInputData): void;
|
|
80
|
-
toJSON():
|
|
141
|
+
toJSON(options?: IJSONOptions): IUIJSONData;
|
|
142
|
+
pick(_hitPoint: IPointData, _options?: IPickOptions): IPickResult;
|
|
81
143
|
addAt(child: IUI, index: number): void;
|
|
82
144
|
addAfter(child: IUI, after: IUI): void;
|
|
83
|
-
addBefore(child:
|
|
145
|
+
addBefore(child: IUI, before: IUI): void;
|
|
84
146
|
add(_child: IUI, _index?: number): void;
|
|
85
147
|
addMany(..._children: IUI[]): void;
|
|
86
148
|
remove(_child?: IUI, _destroy?: boolean): void;
|
|
87
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;
|
|
88
239
|
}
|
|
89
240
|
|
|
90
241
|
declare class Box extends Group implements IBox {
|
|
91
242
|
get __tag(): string;
|
|
243
|
+
get isBranchLeaf(): boolean;
|
|
92
244
|
__: IBoxData;
|
|
93
|
-
|
|
94
|
-
|
|
245
|
+
resizeChildren?: IBoolean;
|
|
246
|
+
overflow?: IOverflow;
|
|
247
|
+
isOverflow: boolean;
|
|
95
248
|
constructor(data?: IBoxInputData);
|
|
96
249
|
__updateStrokeSpread(): number;
|
|
97
250
|
__updateRectRenderSpread(): number;
|
|
98
251
|
__updateRenderSpread(): number;
|
|
252
|
+
__updateRectBoxBounds(): void;
|
|
99
253
|
__updateBoxBounds(): void;
|
|
100
254
|
__updateStrokeBounds(): void;
|
|
101
255
|
__updateRenderBounds(): void;
|
|
102
256
|
__updateRectRenderBounds(): void;
|
|
103
257
|
__updateRectChange(): void;
|
|
104
258
|
__updateChange(): void;
|
|
105
|
-
__drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void;
|
|
106
259
|
__renderRect(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|
|
107
260
|
__renderGroup(_canvas: ILeaferCanvas, _options: IRenderOptions): void;
|
|
108
261
|
__render(canvas: ILeaferCanvas, options: IRenderOptions): void;
|
|
@@ -111,8 +264,10 @@ declare class Box extends Group implements IBox {
|
|
|
111
264
|
|
|
112
265
|
declare class Frame extends Box implements IFrame {
|
|
113
266
|
get __tag(): string;
|
|
267
|
+
get isFrame(): boolean;
|
|
114
268
|
__: IFrameData;
|
|
115
|
-
|
|
269
|
+
fill?: IFill;
|
|
270
|
+
overflow?: IOverflow;
|
|
116
271
|
constructor(data?: IFrameInputData);
|
|
117
272
|
}
|
|
118
273
|
|
|
@@ -120,15 +275,14 @@ declare class Rect extends UI implements IRect {
|
|
|
120
275
|
get __tag(): string;
|
|
121
276
|
__: IRectData;
|
|
122
277
|
constructor(data?: IRectInputData);
|
|
123
|
-
__drawPathByData(drawer: IPathDrawer, _data: IPathCommandData): void;
|
|
124
278
|
}
|
|
125
279
|
|
|
126
280
|
declare class Ellipse extends UI implements IEllipse {
|
|
127
281
|
get __tag(): string;
|
|
128
282
|
__: IEllipseData;
|
|
129
|
-
innerRadius
|
|
130
|
-
startAngle
|
|
131
|
-
endAngle
|
|
283
|
+
innerRadius?: INumber;
|
|
284
|
+
startAngle?: INumber;
|
|
285
|
+
endAngle?: INumber;
|
|
132
286
|
constructor(data?: IEllipseInputData);
|
|
133
287
|
__updatePath(): void;
|
|
134
288
|
}
|
|
@@ -136,10 +290,9 @@ declare class Ellipse extends UI implements IEllipse {
|
|
|
136
290
|
declare class Polygon extends UI implements IPolygon {
|
|
137
291
|
get __tag(): string;
|
|
138
292
|
__: IPolygonData;
|
|
139
|
-
sides
|
|
140
|
-
points
|
|
141
|
-
curve
|
|
142
|
-
get resizeable(): boolean;
|
|
293
|
+
sides?: INumber;
|
|
294
|
+
points?: number[];
|
|
295
|
+
curve?: boolean | number;
|
|
143
296
|
constructor(data?: IPolygonInputData);
|
|
144
297
|
__updatePath(): void;
|
|
145
298
|
__updateRenderPath(): void;
|
|
@@ -149,8 +302,8 @@ declare class Polygon extends UI implements IPolygon {
|
|
|
149
302
|
declare class Star extends UI implements IStar {
|
|
150
303
|
get __tag(): string;
|
|
151
304
|
__: IStarData;
|
|
152
|
-
corners
|
|
153
|
-
innerRadius
|
|
305
|
+
corners?: INumber;
|
|
306
|
+
innerRadius?: INumber;
|
|
154
307
|
constructor(data?: IStarInputData);
|
|
155
308
|
__updatePath(): void;
|
|
156
309
|
}
|
|
@@ -158,11 +311,11 @@ declare class Star extends UI implements IStar {
|
|
|
158
311
|
declare class Line extends UI implements ILine {
|
|
159
312
|
get __tag(): string;
|
|
160
313
|
__: ILineData;
|
|
161
|
-
strokeAlign
|
|
162
|
-
height
|
|
163
|
-
points
|
|
164
|
-
curve
|
|
165
|
-
|
|
314
|
+
strokeAlign?: IStrokeAlign;
|
|
315
|
+
height?: INumber;
|
|
316
|
+
points?: number[];
|
|
317
|
+
curve?: boolean | number;
|
|
318
|
+
closed?: boolean;
|
|
166
319
|
get toPoint(): IPointData;
|
|
167
320
|
set toPoint(value: IPointData);
|
|
168
321
|
constructor(data?: ILineInputData);
|
|
@@ -174,24 +327,23 @@ declare class Line extends UI implements ILine {
|
|
|
174
327
|
declare class Image extends Rect implements IImage {
|
|
175
328
|
get __tag(): string;
|
|
176
329
|
__: IImageData;
|
|
177
|
-
url:
|
|
330
|
+
url: IString;
|
|
178
331
|
get ready(): boolean;
|
|
179
|
-
image
|
|
332
|
+
image?: ILeaferImage;
|
|
180
333
|
constructor(data?: IImageInputData);
|
|
181
|
-
__updateBoxBounds(): void;
|
|
182
334
|
destroy(): void;
|
|
183
335
|
}
|
|
184
336
|
|
|
185
337
|
declare class Canvas extends Rect implements ICanvas {
|
|
186
338
|
get __tag(): string;
|
|
187
339
|
__: ICanvasData;
|
|
188
|
-
width
|
|
189
|
-
height
|
|
190
|
-
pixelRatio
|
|
191
|
-
smooth
|
|
192
|
-
|
|
193
|
-
canvas
|
|
194
|
-
context
|
|
340
|
+
width?: INumber;
|
|
341
|
+
height?: INumber;
|
|
342
|
+
pixelRatio?: INumber;
|
|
343
|
+
smooth?: boolean;
|
|
344
|
+
contextSettings?: ICanvasContext2DSettings;
|
|
345
|
+
canvas?: ILeaferCanvas;
|
|
346
|
+
context?: ICanvasContext2D;
|
|
195
347
|
constructor(data?: ICanvasInputData);
|
|
196
348
|
draw(ui: IUI, offset?: IPointData, scale?: number | IPointData, rotation?: number): void;
|
|
197
349
|
paint(): void;
|
|
@@ -203,24 +355,28 @@ declare class Canvas extends Rect implements ICanvas {
|
|
|
203
355
|
declare class Text extends UI implements IText {
|
|
204
356
|
get __tag(): string;
|
|
205
357
|
__: ITextData;
|
|
206
|
-
width
|
|
207
|
-
height
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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;
|
|
224
380
|
get textDrawData(): ITextDrawData;
|
|
225
381
|
constructor(data?: ITextInputData);
|
|
226
382
|
__drawHitPath(canvas: ILeaferCanvas): void;
|
|
@@ -235,12 +391,8 @@ declare class Text extends UI implements IText {
|
|
|
235
391
|
declare class Path extends UI implements IPath {
|
|
236
392
|
get __tag(): string;
|
|
237
393
|
__: IPathData;
|
|
238
|
-
|
|
239
|
-
windingRule: IWindingRule;
|
|
240
|
-
strokeAlign: IStrokeAlign;
|
|
241
|
-
get resizeable(): boolean;
|
|
394
|
+
strokeAlign?: IStrokeAlign;
|
|
242
395
|
constructor(data?: IPathInputData);
|
|
243
|
-
__updateBoxBounds(): void;
|
|
244
396
|
}
|
|
245
397
|
|
|
246
398
|
declare class Pen extends Group implements IPen {
|
|
@@ -249,6 +401,7 @@ declare class Pen extends Group implements IPen {
|
|
|
249
401
|
pathElement: IPath;
|
|
250
402
|
pathStyle: IPathInputData;
|
|
251
403
|
path: IPathCommandData$1;
|
|
404
|
+
__path: IPathCommandData$1;
|
|
252
405
|
constructor(data?: IPenInputData);
|
|
253
406
|
setStyle(data: IPathInputData): Pen;
|
|
254
407
|
beginPath(): Pen;
|
|
@@ -265,8 +418,8 @@ declare class Pen extends Group implements IPen {
|
|
|
265
418
|
drawEllipse(_x: number, _y: number, _radiusX: number, _radiusY: number, _rotation?: number, _startAngle?: number, _endAngle?: number, _anticlockwise?: boolean): Pen;
|
|
266
419
|
drawArc(_x: number, _y: number, _radius: number, _startAngle?: number, _endAngle?: number, _anticlockwise?: boolean): Pen;
|
|
267
420
|
drawPoints(_points: number[], _curve?: boolean | number, _close?: boolean): Pen;
|
|
421
|
+
clearPath(): Pen;
|
|
268
422
|
paint(): void;
|
|
269
|
-
clear(): void;
|
|
270
423
|
}
|
|
271
424
|
|
|
272
|
-
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 };
|