@univerjs-pro/sheets-shape 1.0.0-alpha.2 → 1.0.0-alpha.4
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/README.md +7 -2
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/adapters/sheet-shape-host.adapter.d.ts +21 -0
- package/lib/types/commands/command/add-shape.command.d.ts +7 -0
- package/lib/types/commands/command/set-shape-drawing-data.command.d.ts +7 -0
- package/lib/types/controllers/sheets-shape.controller.d.ts +4 -1
- package/lib/types/facade/f-shape.d.ts +12 -690
- package/lib/types/facade/f-worksheet.d.ts +44 -209
- package/lib/types/facade/index.d.ts +2 -12
- package/lib/types/index.d.ts +2 -8
- package/lib/types/plugin.d.ts +2 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +10 -9
- package/lib/types/facade/f-connector-shape.d.ts +0 -189
- package/lib/types/facade/f-enum.d.ts +0 -203
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
-
/**
|
|
3
|
-
* @ignore
|
|
4
|
-
*/
|
|
5
|
-
export interface IFSheetsShapeEnumMixin {
|
|
6
|
-
/**
|
|
7
|
-
* Represents the type of the shape. {@link ShapeTypeEnum}
|
|
8
|
-
* @description This enum defines almost all Excel supported shape types, including basic shapes, block arrows, flowchart shapes, callouts, stars and banners, symbols, and lines.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
13
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
14
|
-
* if (!fWorksheet) return;
|
|
15
|
-
*
|
|
16
|
-
* // Create a rectangle shape.
|
|
17
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
18
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Diamond)
|
|
19
|
-
* .setPosition(1, 1, 0, 0)
|
|
20
|
-
* .build();
|
|
21
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
ShapeTypeEnum: typeof ShapeTypeEnum;
|
|
25
|
-
/**
|
|
26
|
-
* Represents the fill type of the shape. {@link ShapeFillEnum}
|
|
27
|
-
* The possible values are: NoFill, SolidFil, GradientFill, PatternFill, PictureFill.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
32
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
33
|
-
* if (!fWorksheet) return;
|
|
34
|
-
*
|
|
35
|
-
* // Create a rectangle shape with solid fill.
|
|
36
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
37
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
38
|
-
* .setShapeSolidFill('#ff0000')
|
|
39
|
-
* .setPosition(1, 1, 0, 0)
|
|
40
|
-
* .build();
|
|
41
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
ShapeFillEnum: typeof ShapeFillEnum;
|
|
45
|
-
/**
|
|
46
|
-
* Represents the gradient type of the shape fill. {@link ShapeGradientTypeEnum}
|
|
47
|
-
* The possible values are: Linear, Radial, Angular, Diamond.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
52
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
53
|
-
* if (!fWorksheet) return;
|
|
54
|
-
*
|
|
55
|
-
* // Create a rectangle shape with linear gradient fill.
|
|
56
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
57
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
58
|
-
* .setShapeGradientFill(univerAPI.Enum.ShapeGradientTypeEnum.Linear, [{
|
|
59
|
-
* position: 0,
|
|
60
|
-
* color: '#ff0000'
|
|
61
|
-
* }, {
|
|
62
|
-
* position: 0.5,
|
|
63
|
-
* color: '#00ff00'
|
|
64
|
-
* }, {
|
|
65
|
-
* position: 1,
|
|
66
|
-
* color: '#0000ff'
|
|
67
|
-
* }], 90 )
|
|
68
|
-
* .setPosition(1, 1, 0, 0)
|
|
69
|
-
* .build();
|
|
70
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
ShapeGradientTypeEnum: typeof ShapeGradientTypeEnum;
|
|
74
|
-
/**
|
|
75
|
-
* Represents the line fill type of the shape stroke. {@link ShapeLineTypeEnum}
|
|
76
|
-
* The possible values are: NoLine, SolidLine, GradientLine.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```ts
|
|
80
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
81
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
82
|
-
* if (!fWorksheet) return;
|
|
83
|
-
*
|
|
84
|
-
* // Create a rectangle shape with solid line stroke type.
|
|
85
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
86
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
87
|
-
* .setStrokeLineType(univerAPI.Enum.ShapeLineTypeEnum.SolidLine)
|
|
88
|
-
* .setStrokeColor('#000000')
|
|
89
|
-
* .setPosition(1, 1, 0, 0)
|
|
90
|
-
* .build();
|
|
91
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
ShapeLineTypeEnum: typeof ShapeLineTypeEnum;
|
|
95
|
-
/**
|
|
96
|
-
* Represents the line dash type of the shape stroke. {@link ShapeLineDashEnum}
|
|
97
|
-
* The possible values are: Solid, RoundDot, SquareDot, Dash, DashDot, LongDash, LongDashDot, LongDashDotDot.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```ts
|
|
101
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
102
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
103
|
-
* if (!fWorksheet) return;
|
|
104
|
-
*
|
|
105
|
-
* // Create a rectangle shape with dashed stroke.
|
|
106
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
107
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
108
|
-
* .setStrokeLineDashType(univerAPI.Enum.ShapeLineDashEnum.Dash)
|
|
109
|
-
* .setPosition(1, 1, 0, 0)
|
|
110
|
-
* .build();
|
|
111
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
ShapeLineDashEnum: typeof ShapeLineDashEnum;
|
|
115
|
-
/**
|
|
116
|
-
* Represents the line cap type of the shape stroke. {@link ShapeLineCapEnum}
|
|
117
|
-
* The possible values are: Flat, Round, Square.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
122
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
123
|
-
* if (!fWorksheet) return;
|
|
124
|
-
*
|
|
125
|
-
* // Create a rectangle shape with round line cap.
|
|
126
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
127
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
128
|
-
* .setStrokeLineCapType(univerAPI.Enum.ShapeLineCapEnum.Round)
|
|
129
|
-
* .setPosition(1, 1, 0, 0)
|
|
130
|
-
* .build();
|
|
131
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
ShapeLineCapEnum: typeof ShapeLineCapEnum;
|
|
135
|
-
/**
|
|
136
|
-
* Represents the line join type of the shape stroke. {@link ShapeLineJoinEnum}
|
|
137
|
-
* The possible values are: Miter, Round, Bevel.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```ts
|
|
141
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
142
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
143
|
-
* if (!fWorksheet) return;
|
|
144
|
-
*
|
|
145
|
-
* // Create a rectangle shape with round line join.
|
|
146
|
-
* const shapeInfo = fWorksheet.newShape()
|
|
147
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
|
|
148
|
-
* .setStrokeLineJoinType(univerAPI.Enum.ShapeLineJoinEnum.Round)
|
|
149
|
-
* .setPosition(1, 1, 0, 0)
|
|
150
|
-
* .build();
|
|
151
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
ShapeLineJoinEnum: typeof ShapeLineJoinEnum;
|
|
155
|
-
/**
|
|
156
|
-
* Represents the arrow type of connector line shape. {@link ShapeArrowTypeEnum}
|
|
157
|
-
* The possible values are: None, Arrow, OpenArrow, DiamondArrow, StealthArrow, OvalArrow.
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
162
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
163
|
-
* if (!fWorksheet) return;
|
|
164
|
-
*
|
|
165
|
-
* // Create a line shape with arrow type.
|
|
166
|
-
* const shapeInfo = fWorksheet.newConnector()
|
|
167
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
168
|
-
* .setPosition(1, 1, 0, 0)
|
|
169
|
-
* .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
170
|
-
* .setStrokeWidth(3)
|
|
171
|
-
* .build();
|
|
172
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
ShapeArrowTypeEnum: typeof ShapeArrowTypeEnum;
|
|
176
|
-
/**
|
|
177
|
-
* Represents the arrow size of connector line shape. {@link ShapeArrowSizeEnum}
|
|
178
|
-
* The possible values are:Small, Medium, Large.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* ```ts
|
|
182
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
183
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
184
|
-
* if (!fWorksheet) return;
|
|
185
|
-
* // Create a line shape with arrow size.
|
|
186
|
-
* const shapeInfo = fWorksheet.newConnector()
|
|
187
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.BentConnector3)
|
|
188
|
-
* .setPosition(1, 1, 0, 0)
|
|
189
|
-
* .setStartArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Medium)
|
|
190
|
-
* .setStrokeWidth(3)
|
|
191
|
-
* .build();
|
|
192
|
-
* await fWorksheet.insertShape(shapeInfo);
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
ShapeArrowSizeEnum: typeof ShapeArrowSizeEnum;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* @ignore
|
|
199
|
-
*/
|
|
200
|
-
declare module '@univerjs/core/facade' {
|
|
201
|
-
interface FEnum extends IFSheetsShapeEnumMixin {
|
|
202
|
-
}
|
|
203
|
-
}
|