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