@leafer-ui/interface 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 +2 -2
- package/src/ICommonAttr.ts +61 -47
- package/src/IUI.ts +112 -58
- package/src/app/ILeafer.ts +5 -1
- package/src/editor/IEditor.ts +94 -18
- package/src/index.ts +10 -5
- package/src/module/IColorConvert.ts +1 -1
- package/src/module/IEffect.ts +5 -5
- package/src/module/IExport.ts +2 -15
- package/src/module/IPaint.ts +32 -13
- package/src/module/IPathArrow.ts +8 -0
- package/src/module/IState.ts +11 -0
- package/src/module/ITextConvert.ts +1 -1
- package/src/type/IType.ts +32 -11
- package/types/index.d.ts +345 -200
package/src/editor/IEditor.ts
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
import { IGroup, IUI, IRectInputData, ISelectorProxy, IEditSize, ICursorType,
|
|
1
|
+
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAlign, IUnitPointData, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IBoundsData, IKeyEvent, IUIInputData, IZoomEvent, IColorString } from '@leafer-ui/interface'
|
|
2
2
|
|
|
3
3
|
export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
4
4
|
config: IEditorConfig
|
|
5
|
+
readonly mergeConfig: IEditorConfig // 实际使用,合并了选中元素上的editConfig
|
|
5
6
|
|
|
6
|
-
hoverTarget
|
|
7
|
-
target
|
|
7
|
+
hoverTarget?: IUI
|
|
8
|
+
target?: IUI | IUI[]
|
|
8
9
|
|
|
9
10
|
readonly list: IUI[]
|
|
11
|
+
leafList: ILeafList
|
|
12
|
+
openedGroupList: ILeafList
|
|
13
|
+
|
|
14
|
+
readonly editing: boolean
|
|
15
|
+
innerEditing: boolean
|
|
16
|
+
readonly groupOpening: boolean
|
|
10
17
|
|
|
11
|
-
readonly hasTarget: boolean
|
|
12
18
|
readonly multiple: boolean
|
|
13
19
|
readonly single: boolean
|
|
14
20
|
|
|
15
21
|
readonly dragging: boolean
|
|
16
22
|
|
|
17
|
-
element
|
|
23
|
+
element?: IUI
|
|
18
24
|
buttons: IGroup
|
|
19
25
|
|
|
20
26
|
selector: IGroup
|
|
21
|
-
editBox:
|
|
22
|
-
editTool
|
|
27
|
+
editBox: IEditBoxBase
|
|
28
|
+
editTool?: IObject
|
|
29
|
+
innerEditor?: IObject
|
|
30
|
+
|
|
31
|
+
select(target: IUI | IUI[]): void
|
|
32
|
+
cancel(): void
|
|
23
33
|
|
|
24
34
|
hasItem(item: IUI): boolean
|
|
25
35
|
shiftItem(item: IUI): void
|
|
@@ -27,17 +37,23 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
27
37
|
removeItem(item: IUI): void
|
|
28
38
|
|
|
29
39
|
update(): void
|
|
40
|
+
updateEditBox(): void
|
|
30
41
|
updateEditTool(): void
|
|
31
42
|
|
|
32
43
|
getEditSize(ui: ILeaf): IEditSize
|
|
33
44
|
|
|
34
45
|
onMove(e: IDragEvent): void
|
|
35
|
-
onScale(e: IDragEvent): void
|
|
46
|
+
onScale(e: IDragEvent | IZoomEvent): void
|
|
36
47
|
onRotate(e: IDragEvent | IRotateEvent): void
|
|
37
48
|
onSkew(e: IDragEvent): void
|
|
38
49
|
|
|
39
|
-
group():
|
|
40
|
-
ungroup():
|
|
50
|
+
group(group?: IGroup | IGroupInputData): IGroup
|
|
51
|
+
ungroup(): IUI[]
|
|
52
|
+
openGroup(group: IGroup): void
|
|
53
|
+
closeGroup(group: IGroup): void
|
|
54
|
+
|
|
55
|
+
openInnerEditor(target?: IUI): void
|
|
56
|
+
closeInnerEditor(): void
|
|
41
57
|
|
|
42
58
|
lock(): void
|
|
43
59
|
unlock(): void
|
|
@@ -47,7 +63,9 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
47
63
|
}
|
|
48
64
|
|
|
49
65
|
export interface IEditorConfig {
|
|
50
|
-
editSize?:
|
|
66
|
+
editSize?: IEditSize
|
|
67
|
+
dualEvent?: boolean
|
|
68
|
+
keyEvent?: boolean
|
|
51
69
|
|
|
52
70
|
stroke?: IStroke
|
|
53
71
|
strokeWidth?: number
|
|
@@ -62,26 +80,84 @@ export interface IEditorConfig {
|
|
|
62
80
|
|
|
63
81
|
rect?: IBoxInputData
|
|
64
82
|
area?: IRectInputData
|
|
83
|
+
mask?: IColorString
|
|
65
84
|
|
|
66
85
|
buttonsDirection?: 'top' | 'right' | 'bottom' | 'left'
|
|
67
86
|
buttonsFixed?: boolean
|
|
68
87
|
buttonsMargin?: number
|
|
69
88
|
|
|
70
89
|
hideOnMove?: boolean
|
|
90
|
+
hideOnSmall?: boolean | number
|
|
71
91
|
|
|
72
92
|
moveCursor?: ICursorType
|
|
73
|
-
resizeCursor?:
|
|
74
|
-
rotateCursor?:
|
|
93
|
+
resizeCursor?: IImageCursor
|
|
94
|
+
rotateCursor?: IImageCursor
|
|
95
|
+
skewCursor?: IImageCursor
|
|
75
96
|
|
|
76
|
-
around?:
|
|
77
|
-
lockRatio?: boolean
|
|
97
|
+
around?: IAlign | IUnitPointData
|
|
98
|
+
lockRatio?: boolean | 'corner'
|
|
78
99
|
rotateGap?: number
|
|
79
100
|
|
|
80
101
|
selector?: boolean
|
|
81
102
|
hover?: boolean
|
|
103
|
+
hoverStyle?: IUIInputData
|
|
104
|
+
select?: 'press' | 'tap'
|
|
82
105
|
boxSelect?: boolean
|
|
106
|
+
continuousSelect?: boolean // 点击可以连续选择
|
|
107
|
+
openInner?: 'double' | 'long' // 双击/长按打开内部
|
|
83
108
|
|
|
84
|
-
|
|
85
|
-
|
|
109
|
+
moveable?: boolean
|
|
110
|
+
rotateable?: boolean | 'rotate'
|
|
111
|
+
resizeable?: boolean | 'zoom'
|
|
86
112
|
skewable?: boolean
|
|
87
|
-
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface IEditPoint extends IBox {
|
|
116
|
+
direction: number
|
|
117
|
+
pointType: IEditPointType
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type IEditPointType = 'rotate' | 'resize'
|
|
121
|
+
|
|
122
|
+
export interface IEditBoxBase extends IGroup {
|
|
123
|
+
editor: IEditorBase
|
|
124
|
+
dragging: boolean
|
|
125
|
+
moving: boolean
|
|
126
|
+
|
|
127
|
+
view: IGroup // 放置默认编辑工具控制点
|
|
128
|
+
|
|
129
|
+
circle: IEditPoint
|
|
130
|
+
rect: IRect
|
|
131
|
+
|
|
132
|
+
buttons: IGroup
|
|
133
|
+
|
|
134
|
+
resizePoints: IEditPoint[]
|
|
135
|
+
rotatePoints: IEditPoint[]
|
|
136
|
+
resizeLines: IEditPoint[]
|
|
137
|
+
|
|
138
|
+
readonly flipped: boolean
|
|
139
|
+
readonly flippedX: boolean
|
|
140
|
+
readonly flippedY: boolean
|
|
141
|
+
readonly flippedOne: boolean
|
|
142
|
+
|
|
143
|
+
enterPoint: IEditPoint
|
|
144
|
+
|
|
145
|
+
getPointStyle(userStyle?: IBoxInputData): IBoxInputData
|
|
146
|
+
getPointsStyle(): IBoxInputData[]
|
|
147
|
+
getMiddlePointsStyle(): IBoxInputData[]
|
|
148
|
+
|
|
149
|
+
load(): void
|
|
150
|
+
update(bounds: IBoundsData): void
|
|
151
|
+
unload(): void
|
|
152
|
+
|
|
153
|
+
onArrow(e: IKeyEvent): void
|
|
154
|
+
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface IEditorConfigFunction {
|
|
158
|
+
(ui: any): IEditorConfig
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface IEditToolFunction {
|
|
162
|
+
(ui: any): string
|
|
163
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { ILeafer } from './app/ILeafer'
|
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
ILine, ILineInputData, ILineData,
|
|
8
|
+
IArrow, IArrowInputData, IArrowData,
|
|
8
9
|
IRect, IRectInputData, IRectData,
|
|
9
10
|
IEllipse, IEllipseInputData, IEllipseData,
|
|
10
11
|
IPolygon, IPolygonInputData, IPolygonData,
|
|
@@ -15,27 +16,31 @@ export {
|
|
|
15
16
|
IImage, IImageInputData, IImageData,
|
|
16
17
|
ICanvas, ICanvasInputData, ICanvasData,
|
|
17
18
|
IFrame, IFrameInputData, IFrameData,
|
|
19
|
+
IFlow, IFlowInputData, IFlowData,
|
|
18
20
|
IBox, IBoxInputData, IBoxData,
|
|
19
21
|
IGroup, IGroupInputData, IGroupData,
|
|
20
22
|
ILeaferInputData, ILeaferData,
|
|
21
23
|
IAppInputData, IAppData,
|
|
22
24
|
IUI, IUIBaseInputData, IUIData, IFindUIMethod,
|
|
23
|
-
IUITag, IUIInputData
|
|
25
|
+
IUITag, IUIInputData, IUIJSONData
|
|
24
26
|
} from './IUI'
|
|
25
27
|
|
|
26
|
-
export {
|
|
28
|
+
export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IPaintAttr, IStrokeAlign, IStrokeJoin, IStrokeCap, IArrowType, IPathDataArrow, IPathDataArrowMap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap, IRepeat } from './type/IType'
|
|
27
29
|
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString } from './type/IStringType'
|
|
28
30
|
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
|
|
31
|
+
export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'
|
|
29
32
|
|
|
30
33
|
export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender'
|
|
31
34
|
export { IUIBoundsModule } from './module/IUIBounds'
|
|
32
35
|
export { IUIHitModule } from './module/IUIHit'
|
|
36
|
+
export { IPathArrowModule } from './module/IPathArrow'
|
|
33
37
|
export { ITextConvertModule } from './module/ITextConvert'
|
|
34
38
|
export { IColorConvertModule } from './module/IColorConvert'
|
|
35
|
-
export { IExportModule
|
|
39
|
+
export { IExportModule } from './module/IExport'
|
|
40
|
+
export { IStateModule } from './module/IState'
|
|
36
41
|
|
|
37
|
-
export { IPaintModule } from './module/IPaint'
|
|
42
|
+
export { IPaintModule, IPaintImageModule, IPaintGradientModule } from './module/IPaint'
|
|
38
43
|
export { IEffectModule } from './module/IEffect'
|
|
39
44
|
export { ICachedShape } from './ICachedShape'
|
|
40
45
|
|
|
41
|
-
export { IEditorBase, IEditorConfig } from './editor/IEditor'
|
|
46
|
+
export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'
|
package/src/module/IEffect.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ILeaferCanvas
|
|
1
|
+
import { ILeaferCanvas } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { IUI } from '../IUI'
|
|
4
4
|
import { ICachedShape } from '../ICachedShape'
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export interface IEffectModule {
|
|
8
|
-
shadow
|
|
9
|
-
innerShadow
|
|
10
|
-
blur
|
|
11
|
-
backgroundBlur
|
|
8
|
+
shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void
|
|
9
|
+
innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void
|
|
10
|
+
blur(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas): void
|
|
11
|
+
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void
|
|
12
12
|
}
|
package/src/module/IExport.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import { ILeaf, IExportFileType,
|
|
2
|
-
|
|
3
|
-
export interface IExportOptions {
|
|
4
|
-
quality?: number
|
|
5
|
-
blob?: boolean
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IExportResult {
|
|
9
|
-
data: IBlob | string | boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IExportResultFunction {
|
|
13
|
-
(data: IExportResult): void
|
|
14
|
-
}
|
|
1
|
+
import { ILeaf, IExportFileType, IExportOptions, IExportResult } from '@leafer/interface'
|
|
15
2
|
|
|
16
3
|
|
|
17
4
|
export interface IExportModule {
|
|
18
5
|
running?: boolean
|
|
19
|
-
export
|
|
6
|
+
export(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>
|
|
20
7
|
}
|
package/src/module/IPaint.ts
CHANGED
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import { ILeaferCanvas, IRenderOptions, IBooleanMap } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAround, IPointData, IMatrixData } from '@leafer/interface'
|
|
2
2
|
|
|
3
|
-
import { ILeafPaint } from '../type/IComputedType'
|
|
3
|
+
import { ILeafPaint, ILeafPaintPatternData } from '../type/IComputedType'
|
|
4
4
|
import { IUI, IUIData } from '../IUI'
|
|
5
5
|
import { ICachedShape } from '../ICachedShape'
|
|
6
|
+
import { IGradientPaint, IImagePaint, IPaintAttr } from '../type/IType'
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
export interface IPaintModule {
|
|
8
|
-
compute
|
|
10
|
+
compute(attrName: IPaintAttr, ui: IUI): void
|
|
11
|
+
|
|
12
|
+
fill(fill: string, ui: IUI, canvas: ILeaferCanvas,): void
|
|
13
|
+
fills(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
fills?(fills: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
|
|
15
|
+
fillText(ui: IUI, canvas: ILeaferCanvas): void
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void
|
|
18
|
+
strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
strokeText(stroke: string | ILeafPaint[], ui: IUI, canvas: ILeaferCanvas): void
|
|
21
|
+
drawTextStroke(ui: IUI, canvas: ILeaferCanvas): void
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
shape(ui: IUI, current: ILeaferCanvas, renderOptions: IRenderOptions): ICachedShape
|
|
24
|
+
}
|
|
20
25
|
|
|
21
|
-
drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
export interface IPaintImageModule {
|
|
28
|
+
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint
|
|
29
|
+
checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean
|
|
30
|
+
createPattern(ui: IUI, paint: ILeafPaint, pixelRatio: number): boolean
|
|
31
|
+
recycleImage(attrName: IPaintAttr, data: IUIData): IBooleanMap
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void
|
|
34
|
+
getPatternData(paint: IImagePaint, box: IBoundsData, image: ILeaferImage): ILeafPaintPatternData
|
|
35
|
+
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
|
|
36
|
+
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
|
|
37
|
+
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround): void
|
|
26
38
|
}
|
|
39
|
+
|
|
40
|
+
export interface IPaintGradientModule {
|
|
41
|
+
linearGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint
|
|
42
|
+
radialGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint
|
|
43
|
+
conicGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint
|
|
44
|
+
getTransform(box: IBoundsData, from: IPointData, to: IPointData, stretch: number, rotate90: boolean): IMatrixData
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILeaf, IStateStyleType } from '@leafer/interface'
|
|
2
|
+
|
|
3
|
+
export interface IStateModule {
|
|
4
|
+
isHover(leaf: ILeaf): boolean
|
|
5
|
+
isPress(leaf: ILeaf): boolean
|
|
6
|
+
isFocus(leaf: ILeaf): boolean
|
|
7
|
+
isDrag(leaf: ILeaf): boolean
|
|
8
|
+
|
|
9
|
+
setStyle(leaf: ILeaf, stateType: IStateStyleType, value: boolean): void
|
|
10
|
+
updateEventStyle(leaf: ILeaf, eventType: string): void
|
|
11
|
+
}
|
package/src/type/IType.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType } from '@leafer/interface'
|
|
1
|
+
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData, IFourNumber, IAlign, IUnitPointData } from '@leafer/interface'
|
|
2
2
|
import { IColorString, IPaintString } from './IStringType'
|
|
3
3
|
|
|
4
|
-
export interface IUnitData {
|
|
5
|
-
type: 'percent' | 'px'
|
|
6
|
-
value: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
4
|
export type IPaint = ISolidPaint | IGradientPaint | IImagePaint
|
|
10
5
|
|
|
11
6
|
export type IFill = IPaint | IPaint[] | IPaintString
|
|
12
7
|
|
|
13
8
|
export type IStroke = IPaint | IPaint[] | IPaintString
|
|
14
9
|
|
|
10
|
+
export type IPaintAttr = 'fill' | 'stroke'
|
|
11
|
+
|
|
15
12
|
export interface IPaintBase {
|
|
16
13
|
type: IPaintType
|
|
17
14
|
blendMode?: IBlendMode
|
|
@@ -50,10 +47,10 @@ export interface IRGBA extends IRGB {
|
|
|
50
47
|
// ---
|
|
51
48
|
export interface IGradientPaint extends IPaintBase {
|
|
52
49
|
type: IGradientType
|
|
53
|
-
from?:
|
|
54
|
-
to?:
|
|
50
|
+
from?: IAlign | IUnitPointData
|
|
51
|
+
to?: IAlign | IUnitPointData
|
|
55
52
|
stretch?: number
|
|
56
|
-
stops: IColorStop[]
|
|
53
|
+
stops: IColorStop[] | IColorString[]
|
|
57
54
|
}
|
|
58
55
|
export interface IColorStop {
|
|
59
56
|
offset: number
|
|
@@ -69,7 +66,12 @@ export interface IImagePaint extends IPaintBase {
|
|
|
69
66
|
|
|
70
67
|
filters?: IImageFilters
|
|
71
68
|
|
|
69
|
+
padding?: IFourNumber
|
|
70
|
+
|
|
71
|
+
align?: IAlign
|
|
72
72
|
offset?: IPointData
|
|
73
|
+
|
|
74
|
+
size?: number | ISizeData
|
|
73
75
|
scale?: number | IPointData
|
|
74
76
|
rotation?: number
|
|
75
77
|
|
|
@@ -84,14 +86,33 @@ export interface IImageFilters {
|
|
|
84
86
|
highlights?: number // 高光
|
|
85
87
|
shadows?: number // 阴影
|
|
86
88
|
}
|
|
87
|
-
export type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat'
|
|
89
|
+
export type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'strench' | 'clip' | 'repeat'
|
|
88
90
|
export type IRepeat = boolean | 'x' | 'y'
|
|
89
91
|
|
|
90
92
|
// 描边
|
|
91
93
|
export type IStrokeAlign = 'inside' | 'outside' | 'center'
|
|
92
|
-
export type IStrokeCap = 'none' | 'round' | 'square'
|
|
94
|
+
export type IStrokeCap = 'none' | 'round' | 'square'
|
|
93
95
|
export type IStrokeJoin = 'bevel' | 'round' | 'miter'
|
|
94
96
|
|
|
97
|
+
// 箭头
|
|
98
|
+
export type IArrowType = IPathDataArrow | 'none' | 'angle' | 'angle-side' | 'arrow' | 'triangle' | 'triangle-flip' | 'circle' | 'circle-line' | 'square' | 'square-line' | 'diamond' | 'diamond-line' | 'mark'
|
|
99
|
+
|
|
100
|
+
export interface IPathDataArrowMap {
|
|
101
|
+
[name: string]: IPathDataArrow
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface IPathDataArrow {
|
|
105
|
+
connect?: IPathDataArrowOffset // 箭头与线条的连接点位置
|
|
106
|
+
offset?: IPathDataArrowOffset // 箭头偏移距离,与末端对齐
|
|
107
|
+
path: IPathCommandData
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface IPathDataArrowOffset {
|
|
111
|
+
x?: number // 偏移距离(x轴)
|
|
112
|
+
bevelJoin?: number // strokeJoin 为 bevel 时增加的偏移距离(x轴)
|
|
113
|
+
roundJoin?: number // strokeJoin 为 round 时增加的偏移距离(x轴)
|
|
114
|
+
}
|
|
115
|
+
|
|
95
116
|
// 文本
|
|
96
117
|
export type ITextAlign = 'left' | 'center' | 'right' | 'justify'
|
|
97
118
|
export type IVerticalAlign = 'top' | 'middle' | 'bottom'
|