@univerjs-pro/engine-shape 1.0.0-alpha.3 → 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/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -1
- package/lib/types/config/config.d.ts +5 -0
- package/lib/types/facade/f-connector-shape.d.ts +257 -0
- package/lib/types/facade/f-enum.d.ts +246 -0
- package/lib/types/facade/f-shape-text.d.ts +281 -0
- package/lib/types/facade/f-shape.d.ts +625 -0
- package/lib/types/facade/index.d.ts +6 -0
- package/lib/types/index.d.ts +15 -3
- package/lib/types/models/shape-model.d.ts +1 -1
- package/lib/types/plugin.d.ts +13 -0
- package/lib/types/services/connector-shape-host-adapter.d.ts +40 -0
- package/lib/types/services/connector-shape-host-adapter.service.d.ts +55 -0
- package/lib/types/services/shape-host-adapter.service.d.ts +103 -0
- package/lib/types/shape-type.d.ts +72 -19
- package/lib/types/utils/connector.util.d.ts +15 -0
- package/lib/types/utils/shape-shadow.util.d.ts +8 -0
- package/lib/types/utils/shape-text-behavior.util.d.ts +10 -2
- package/lib/types/utils/shape-text-converter.d.ts +14 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +15 -2
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { IConnectorArrow, IConnectorEndpoint, IShapeData, IShapePoint, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { FShape } from './f-shape';
|
|
3
|
+
/**
|
|
4
|
+
* A live, host-neutral facade handle for a Connector Shape.
|
|
5
|
+
*
|
|
6
|
+
* @example Sheet
|
|
7
|
+
* ```ts
|
|
8
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
9
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
10
|
+
* const fConnectorShape = fWorksheet.insertShape({
|
|
11
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
12
|
+
* transform: { left: 80, top: 80, width: 240, height: 120 },
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Doc
|
|
17
|
+
* ```ts
|
|
18
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
19
|
+
* const fConnectorShape = fDocument.insertShape({
|
|
20
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
21
|
+
* textRange: { startOffset: 0, endOffset: 0, collapsed: true },
|
|
22
|
+
* wrappingStyle: univerAPI.Enum.DocsShapeWrappingStyle.WRAP_SQUARE,
|
|
23
|
+
* transform: { left: 80, top: 80, width: 240, height: 120 },
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Slide
|
|
28
|
+
* ```ts
|
|
29
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
30
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
31
|
+
* const fConnectorShape = fSlide.insertShape({
|
|
32
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
33
|
+
* transform: { left: 80, top: 80, width: 240, height: 120 },
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example Board
|
|
38
|
+
* ```ts
|
|
39
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
40
|
+
* const fConnectorShape = fBoard.insertShape({
|
|
41
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
42
|
+
* transform: { left: 80, top: 80, width: 240, height: 120 },
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
49
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
50
|
+
* const sourceShape = fWorksheet.insertShape({
|
|
51
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.RoundRect,
|
|
52
|
+
* transform: { left: 80, top: 80, width: 180, height: 100 },
|
|
53
|
+
* });
|
|
54
|
+
* const targetShape = fWorksheet.insertShape({
|
|
55
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Ellipse,
|
|
56
|
+
* transform: { left: 420, top: 200, width: 180, height: 100 },
|
|
57
|
+
* });
|
|
58
|
+
* const fConnectorShape = fWorksheet.insertShape({
|
|
59
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.BentConnector3,
|
|
60
|
+
* transform: { left: 240, top: 130, width: 240, height: 120 },
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* const startSite = sourceShape.getConnectionSites()[0];
|
|
64
|
+
* const targetSites = targetShape.getConnectionSites();
|
|
65
|
+
* const endSite = targetSites[2] ?? targetSites[0];
|
|
66
|
+
*
|
|
67
|
+
* fConnectorShape
|
|
68
|
+
* .bindStart(sourceShape.getId(), startSite.index)
|
|
69
|
+
* .bindEnd(targetShape.getId(), endSite.index)
|
|
70
|
+
* .setEndArrow(univerAPI.Enum.ShapeArrowTypeEnum.Arrow);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare class FConnectorShape extends FShape {
|
|
74
|
+
/**
|
|
75
|
+
* Whether this Shape is a Connector preset type.
|
|
76
|
+
* @returns {boolean} Whether this Shape is a Connector preset type.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* console.log(fShape.isConnectorShape());
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
isConnectorShape(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the resolved start endpoint, including its optional Shape binding.
|
|
85
|
+
* @returns {IConnectorEndpoint | null} The resolved start endpoint, or `null` when the Connector does not exist.
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* console.log(fConnectorShape.getStartEndpoint());
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
getStartEndpoint(): IConnectorEndpoint | null;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the resolved end endpoint, including its optional Shape binding.
|
|
94
|
+
* @returns {IConnectorEndpoint | null} The resolved end endpoint, or `null` when the Connector does not exist.
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* console.log(fConnectorShape.getEndEndpoint());
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
getEndEndpoint(): IConnectorEndpoint | null;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the resolved Connector route in the host's document coordinates.
|
|
103
|
+
* @returns {IShapePoint[] | null} The resolved Connector route points, or `null` when the Connector does not exist.
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* console.log(fConnectorShape.getRoutePoints());
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
getRoutePoints(): IShapePoint[] | null;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the configured start arrowhead, or `null` when none is configured.
|
|
112
|
+
* @returns {IConnectorArrow | null} The start arrowhead, or `null` when none is configured.
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* console.log(fConnectorShape.getStartArrow());
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
getStartArrow(): IConnectorArrow | null;
|
|
119
|
+
/**
|
|
120
|
+
* Returns the configured end arrowhead, or `null` when none is configured.
|
|
121
|
+
* @returns {IConnectorArrow | null} The end arrowhead, or `null` when none is configured.
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* console.log(fConnectorShape.getEndArrow());
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
getEndArrow(): IConnectorArrow | null;
|
|
128
|
+
/**
|
|
129
|
+
* Changes this Connector to another Connector Shape preset.
|
|
130
|
+
* @param {ShapeTypeEnum} shapeType The new Connector Shape type.
|
|
131
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* fConnectorShape.setShapeType(univerAPI.Enum.ShapeTypeEnum.BentConnector3);
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
setShapeType(shapeType: ShapeTypeEnum): this;
|
|
138
|
+
/**
|
|
139
|
+
* Replaces this Connector's Shape data without allowing a basic Shape type.
|
|
140
|
+
* @param {IShapeData} shapeData The new Shape data.
|
|
141
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* fConnectorShape.setShapeData({
|
|
145
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
146
|
+
* stroke: { color: '#2563eb', width: 2 },
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
setShapeData(shapeData: IShapeData): this;
|
|
151
|
+
/**
|
|
152
|
+
* Binds the start endpoint to a target Shape connection site.
|
|
153
|
+
* @param {string} targetShapeId The target Shape's stable identifier.
|
|
154
|
+
* @param {number} connectionSiteIndex The target Shape's connection site index.
|
|
155
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const source = sourceShape.getConnectionSites()[0];
|
|
159
|
+
* if (source) fConnectorShape.bindStart(sourceShape.getId(), source.index);
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
bindStart(targetShapeId: string, connectionSiteIndex: number): this;
|
|
163
|
+
/**
|
|
164
|
+
* Binds the end endpoint to a target Shape connection site.
|
|
165
|
+
* @param {string} targetShapeId The target Shape's stable identifier.
|
|
166
|
+
* @param {number} connectionSiteIndex The target Shape's connection site index.
|
|
167
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* const target = targetShape.getConnectionSites()[0];
|
|
171
|
+
* if (target) fConnectorShape.bindEnd(targetShape.getId(), target.index);
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
bindEnd(targetShapeId: string, connectionSiteIndex: number): this;
|
|
175
|
+
/**
|
|
176
|
+
* Unbinds the start endpoint while preserving its current visual position.
|
|
177
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* fConnectorShape.unbindStart();
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
unbindStart(): this;
|
|
184
|
+
/**
|
|
185
|
+
* Unbinds the end endpoint while preserving its current visual position.
|
|
186
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* fConnectorShape.unbindEnd();
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
unbindEnd(): this;
|
|
193
|
+
/**
|
|
194
|
+
* Sets a free start point.
|
|
195
|
+
* Calling this method removes any existing start binding while preserving the end binding.
|
|
196
|
+
* @param {IShapePoint} point The new start point in the host's document coordinates.
|
|
197
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* fConnectorShape.setStartPoint({ x: 80, y: 120 });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
setStartPoint(point: IShapePoint): this;
|
|
204
|
+
/**
|
|
205
|
+
* Sets a free end point.
|
|
206
|
+
* Calling this method removes any existing end binding while preserving the start binding.
|
|
207
|
+
* @param {IShapePoint} point The new end point in the host's document coordinates.
|
|
208
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* fConnectorShape.setEndPoint({ x: 360, y: 240 });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
setEndPoint(point: IShapePoint): this;
|
|
215
|
+
/**
|
|
216
|
+
* Replaces the intermediate Connector route points while preserving both endpoint bindings.
|
|
217
|
+
* @param {IShapePoint[]} points The new Connector route points in the host's document coordinates.
|
|
218
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* fConnectorShape.setRoutePoints([{ x: 180, y: 120 }, { x: 180, y: 240 }]);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
setRoutePoints(points: IShapePoint[]): this;
|
|
225
|
+
/**
|
|
226
|
+
* Sets the start arrowhead type and optional size.
|
|
227
|
+
* @param {ShapeArrowTypeEnum} type The new start arrowhead type.
|
|
228
|
+
* @param {ShapeArrowSizeEnum} [size] The optional new start arrowhead size.
|
|
229
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
230
|
+
* @example
|
|
231
|
+
* ```ts
|
|
232
|
+
* fConnectorShape.setStartArrow(
|
|
233
|
+
* univerAPI.Enum.ShapeArrowTypeEnum.OvalArrow,
|
|
234
|
+
* univerAPI.Enum.ShapeArrowSizeEnum.Medium
|
|
235
|
+
* );
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
setStartArrow(type: ShapeArrowTypeEnum, size?: ShapeArrowSizeEnum): this;
|
|
239
|
+
/**
|
|
240
|
+
* Sets the end arrowhead type and optional size.
|
|
241
|
+
* @param {ShapeArrowTypeEnum} type The new end arrowhead type.
|
|
242
|
+
* @param {ShapeArrowSizeEnum} [size] The optional new end arrowhead size.
|
|
243
|
+
* @returns {FConnectorShape} This Connector Shape facade for chaining.
|
|
244
|
+
* @example
|
|
245
|
+
* ```ts
|
|
246
|
+
* fConnectorShape.setEndArrow(
|
|
247
|
+
* univerAPI.Enum.ShapeArrowTypeEnum.Arrow,
|
|
248
|
+
* univerAPI.Enum.ShapeArrowSizeEnum.Large
|
|
249
|
+
* );
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
setEndArrow(type: ShapeArrowTypeEnum, size?: ShapeArrowSizeEnum): this;
|
|
253
|
+
private _getConnectorAdapter;
|
|
254
|
+
private _getConnectorSnapshot;
|
|
255
|
+
private _bind;
|
|
256
|
+
private _mutateConnector;
|
|
257
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapeTextAutoFitType, ShapeTextDirection, ShapeTextWrapType, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
/** Shape facade enums exposed through `univerAPI.Enum`. */
|
|
3
|
+
export interface IFShapeEnumMixin {
|
|
4
|
+
/**
|
|
5
|
+
* Built-in Shape and Connector preset types.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
9
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
10
|
+
* const fShape = fWorksheet.insertShape({
|
|
11
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.RoundRect,
|
|
12
|
+
* transform: { left: 80, top: 80, width: 200, height: 120 },
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
ShapeTypeEnum: typeof ShapeTypeEnum;
|
|
17
|
+
/**
|
|
18
|
+
* Shape fill types such as no fill, solid, gradient, and picture.
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
22
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
23
|
+
* const fShape = fWorksheet.insertShape({
|
|
24
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect,
|
|
25
|
+
* shapeData: {
|
|
26
|
+
* fill: {
|
|
27
|
+
* fillType: univerAPI.Enum.ShapeFillEnum.SolidFill,
|
|
28
|
+
* color: '#2563eb'
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
ShapeFillEnum: typeof ShapeFillEnum;
|
|
35
|
+
/**
|
|
36
|
+
* Gradient geometries accepted by Shape fill APIs.
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
40
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
41
|
+
* const fShape = fWorksheet.insertShape({
|
|
42
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
43
|
+
* });
|
|
44
|
+
* fShape.setGradientFill(
|
|
45
|
+
* univerAPI.Enum.ShapeGradientTypeEnum.Linear,
|
|
46
|
+
* [
|
|
47
|
+
* { position: 0, color: '#2563eb' },
|
|
48
|
+
* { position: 1, color: '#a855f7' },
|
|
49
|
+
* ]
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
ShapeGradientTypeEnum: typeof ShapeGradientTypeEnum;
|
|
54
|
+
/**
|
|
55
|
+
* Image fill layout modes for stretching or tiling an image inside a Shape.
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
59
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
60
|
+
* const fShape = fWorksheet.insertShape({ shapeType: univerAPI.Enum.ShapeTypeEnum.Rect });
|
|
61
|
+
* fShape.setImageFill(
|
|
62
|
+
* 'https://github.com/dream-num.png',
|
|
63
|
+
* univerAPI.Enum.ShapeImageSourceTypeEnum.URL,
|
|
64
|
+
* {
|
|
65
|
+
* imageFillMode: univerAPI.Enum.ShapeImageFillModeEnum.Stretch,
|
|
66
|
+
* }
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
ShapeImageFillModeEnum: typeof ImageFillModeEnum;
|
|
71
|
+
/**
|
|
72
|
+
* Image source types accepted by Shape image fill APIs.
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
76
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
77
|
+
* const fShape = fWorksheet.insertShape({
|
|
78
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
79
|
+
* });
|
|
80
|
+
* fShape.setImageFill(
|
|
81
|
+
* 'https://github.com/dream-num.png',
|
|
82
|
+
* univerAPI.Enum.ShapeImageSourceTypeEnum.URL
|
|
83
|
+
* );
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
ShapeImageSourceTypeEnum: typeof ImageSourceTypeEnum;
|
|
87
|
+
/**
|
|
88
|
+
* Shape stroke fill types such as no line, solid line, and gradient line.
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
92
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
93
|
+
* const fShape = fWorksheet.insertShape({
|
|
94
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
95
|
+
* });
|
|
96
|
+
* fShape.setStrokeLineType(univerAPI.Enum.ShapeLineTypeEnum.SolidLine);
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
ShapeLineTypeEnum: typeof ShapeLineTypeEnum;
|
|
100
|
+
/**
|
|
101
|
+
* Dash patterns accepted by Shape stroke APIs.
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
105
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
106
|
+
* const fShape = fWorksheet.insertShape({
|
|
107
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
108
|
+
* });
|
|
109
|
+
* fShape.setStrokeLineDashType(univerAPI.Enum.ShapeLineDashEnum.DashDot);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
ShapeLineDashEnum: typeof ShapeLineDashEnum;
|
|
113
|
+
/**
|
|
114
|
+
* Line cap styles accepted by Shape stroke APIs.
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
118
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
119
|
+
* const fShape = fWorksheet.insertShape({
|
|
120
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
121
|
+
* });
|
|
122
|
+
* fShape.setStrokeLineCapType(univerAPI.Enum.ShapeLineCapEnum.Round);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
ShapeLineCapEnum: typeof ShapeLineCapEnum;
|
|
126
|
+
/**
|
|
127
|
+
* Line join styles accepted by Shape stroke APIs.
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
131
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
132
|
+
* const fShape = fWorksheet.insertShape({
|
|
133
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
134
|
+
* });
|
|
135
|
+
* fShape.setStrokeLineJoinType(univerAPI.Enum.ShapeLineJoinEnum.Bevel);
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
ShapeLineJoinEnum: typeof ShapeLineJoinEnum;
|
|
139
|
+
/**
|
|
140
|
+
* Formula operators used by custom Shape geometry guides.
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
144
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
145
|
+
* const fShape = fWorksheet.insertShape({
|
|
146
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
147
|
+
* });
|
|
148
|
+
* fShape.setCustomGeometry({
|
|
149
|
+
* adjustValues: {
|
|
150
|
+
* inset: [univerAPI.Enum.ShapeOperatorEnum.Val, 12000],
|
|
151
|
+
* },
|
|
152
|
+
* pathLst: [{
|
|
153
|
+
* dataArray: [
|
|
154
|
+
* { command: 'M', points: ['inset', 'inset'] },
|
|
155
|
+
* { command: 'L', points: ['r', 'inset'] },
|
|
156
|
+
* { command: 'L', points: ['r', 'b'] },
|
|
157
|
+
* { command: 'L', points: ['inset', 'b'] },
|
|
158
|
+
* { command: 'z', points: [] },
|
|
159
|
+
* ],
|
|
160
|
+
* }],
|
|
161
|
+
* });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
ShapeOperatorEnum: typeof ShapeOperatorEnum;
|
|
165
|
+
/**
|
|
166
|
+
* Connector arrowhead types.
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
170
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
171
|
+
* const fConnectorShape = fWorksheet.insertShape({
|
|
172
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
173
|
+
* });
|
|
174
|
+
* fConnectorShape.setEndArrow(univerAPI.Enum.ShapeArrowTypeEnum.Arrow);
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
ShapeArrowTypeEnum: typeof ShapeArrowTypeEnum;
|
|
178
|
+
/**
|
|
179
|
+
* Connector arrowhead sizes.
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
183
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
184
|
+
* const fConnectorShape = fWorksheet.insertShape({
|
|
185
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
186
|
+
* });
|
|
187
|
+
* fConnectorShape.setEndArrow(
|
|
188
|
+
* univerAPI.Enum.ShapeArrowTypeEnum.Arrow,
|
|
189
|
+
* univerAPI.Enum.ShapeArrowSizeEnum.Large
|
|
190
|
+
* );
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
ShapeArrowSizeEnum: typeof ShapeArrowSizeEnum;
|
|
194
|
+
/**
|
|
195
|
+
* Automatic fitting strategies for Shape text.
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
199
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
200
|
+
* const fShape = fWorksheet.insertShape({
|
|
201
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
202
|
+
* });
|
|
203
|
+
* fShape.getText().setText('Quarterly review');
|
|
204
|
+
* fShape.getText().setTextBoxOptions({
|
|
205
|
+
* autoFitType: univerAPI.Enum.ShapeTextAutoFitType.NormAutoFit,
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
ShapeTextAutoFitType: typeof ShapeTextAutoFitType;
|
|
210
|
+
/**
|
|
211
|
+
* Writing directions for Shape text.
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
215
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
216
|
+
* const fShape = fWorksheet.insertShape({
|
|
217
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
218
|
+
* });
|
|
219
|
+
* fShape.getText().setText('Vertical text');
|
|
220
|
+
* fShape.getText().setTextBoxOptions({
|
|
221
|
+
* textDirection: univerAPI.Enum.ShapeTextDirection.Vert,
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
ShapeTextDirection: typeof ShapeTextDirection;
|
|
226
|
+
/**
|
|
227
|
+
* Wrapping modes for Shape text.
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
231
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
232
|
+
* const fShape = fWorksheet.insertShape({
|
|
233
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect
|
|
234
|
+
* });
|
|
235
|
+
* fShape.getText().setText('Wrapped Shape text');
|
|
236
|
+
* fShape.getText().setTextBoxOptions({
|
|
237
|
+
* textWrap: univerAPI.Enum.ShapeTextWrapType.Square,
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
ShapeTextWrapType: typeof ShapeTextWrapType;
|
|
242
|
+
}
|
|
243
|
+
declare module '@univerjs/core/facade' {
|
|
244
|
+
interface FEnum extends IFShapeEnumMixin {
|
|
245
|
+
}
|
|
246
|
+
}
|