@univerjs-pro/sheets-shape 1.0.0 → 1.0.2
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 -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/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
- package/lib/types/controllers/config.schema.d.ts +0 -5
- package/lib/types/facade/f-connector-shape.d.ts +0 -189
- package/lib/types/facade/f-enum.d.ts +0 -203
- package/lib/types/model/shape-manager.d.ts +0 -32
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import type { ICxnShapeData, IShapeRelationItem, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
-
import type { Injector } from '@univerjs/core';
|
|
3
|
-
import type { IShapeBuilderInfo } from './f-shape';
|
|
4
|
-
import { FShape } from './f-shape';
|
|
5
|
-
/**
|
|
6
|
-
* The connector shape builder. It extends `FShape` and adds connector-specific properties
|
|
7
|
-
* such as start/end arrow types and sizes. Use `fWorksheet.newConnector()` to create a new connector builder.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
12
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
13
|
-
* if (!fWorksheet) return;
|
|
14
|
-
*
|
|
15
|
-
* // Create a straight connector with arrows
|
|
16
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
17
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
18
|
-
* .setPosition(1, 1, 0, 0)
|
|
19
|
-
* .setWidth(200)
|
|
20
|
-
* .setHeight(100)
|
|
21
|
-
* .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
22
|
-
* .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
23
|
-
* .setStrokeColor('#000000')
|
|
24
|
-
* .setStrokeWidth(2)
|
|
25
|
-
* .build();
|
|
26
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare class FConnectorShape extends FShape {
|
|
30
|
-
/**
|
|
31
|
-
* @property {ICxnShapeData} shapeData The connector shape data containing line styles, arrow settings, and connection info.
|
|
32
|
-
*/
|
|
33
|
-
shapeData: ICxnShapeData;
|
|
34
|
-
constructor(unitId: string, subUnitId: string, drawingId: string, injector: Injector);
|
|
35
|
-
setShapeType(shapeType: ShapeTypeEnum): this;
|
|
36
|
-
/**
|
|
37
|
-
* Sets the start arrow type of the connector line.
|
|
38
|
-
* @param {ShapeArrowTypeEnum} arrowType The arrow type for the start point. Which can be found from `univerAPI.Enum.ShapeArrowTypeEnum`.
|
|
39
|
-
* @returns {FConnectorShape} this builder, for chaining.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
44
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
45
|
-
* if (!fWorksheet) return;
|
|
46
|
-
*
|
|
47
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
48
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
49
|
-
* .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
50
|
-
* .setPosition(1, 1, 0, 0)
|
|
51
|
-
* .build();
|
|
52
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
setStartArrowType(arrowType: ShapeArrowTypeEnum): this;
|
|
56
|
-
/**
|
|
57
|
-
* Sets the end arrow type of the connector line.
|
|
58
|
-
* @param {ShapeArrowTypeEnum} arrowType The arrow type for the end point. Which can be found from `univerAPI.Enum.ShapeArrowTypeEnum`.
|
|
59
|
-
* @returns {FConnectorShape} this builder, for chaining.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```ts
|
|
63
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
64
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
65
|
-
* if (!fWorksheet) return;
|
|
66
|
-
*
|
|
67
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
68
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
69
|
-
* .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.StealthArrow)
|
|
70
|
-
* .setPosition(1, 1, 0, 0)
|
|
71
|
-
* .build();
|
|
72
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
setEndArrowType(arrowType: ShapeArrowTypeEnum): this;
|
|
76
|
-
/**
|
|
77
|
-
* Sets the start arrow size of the connector line.
|
|
78
|
-
* @param {ShapeArrowSizeEnum} arrowSize The arrow size for the start point.
|
|
79
|
-
* @returns {FConnectorShape} this builder, for chaining.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```ts
|
|
83
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
84
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
85
|
-
* if (!fWorksheet) return;
|
|
86
|
-
*
|
|
87
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
88
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
89
|
-
* .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.OvalArrow)
|
|
90
|
-
* .setStartArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Large)
|
|
91
|
-
* .setPosition(1, 1, 0, 0)
|
|
92
|
-
* .setWidth(200)
|
|
93
|
-
* .build();
|
|
94
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
setStartArrowSize(arrowSize: ShapeArrowSizeEnum): this;
|
|
98
|
-
/**
|
|
99
|
-
* Sets the end arrow size of the connector line.
|
|
100
|
-
* @param {ShapeArrowSizeEnum} arrowSize The arrow size for the end point.
|
|
101
|
-
* @returns {FConnectorShape} this builder, for chaining.
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```ts
|
|
105
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
106
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
107
|
-
* if (!fWorksheet) return;
|
|
108
|
-
*
|
|
109
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
110
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
111
|
-
* .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
112
|
-
* .setEndArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Large)
|
|
113
|
-
* .setStrokeWidth(3)
|
|
114
|
-
* .setPosition(1, 1, 0, 0)
|
|
115
|
-
* .build();
|
|
116
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
setEndArrowSize(arrowSize: ShapeArrowSizeEnum): this;
|
|
120
|
-
/**
|
|
121
|
-
* Builds the connector shape builder info. This method does not automatically draw the connector on top of the spreadsheet.
|
|
122
|
-
* A new connector must be inserted via `fWorksheet.insertShape(shapeInfo)`.
|
|
123
|
-
* @returns {IShapeBuilderInfo} The shape builder info containing all the accumulated properties.
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```ts
|
|
127
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
128
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
129
|
-
* if (!fWorksheet) return;
|
|
130
|
-
*
|
|
131
|
-
* const connectorInfo = fWorksheet.newConnector()
|
|
132
|
-
* .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
|
|
133
|
-
* .setPosition(1, 1, 0, 0)
|
|
134
|
-
* .setWidth(200)
|
|
135
|
-
* .setHeight(100)
|
|
136
|
-
* .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
137
|
-
* .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
|
|
138
|
-
* .setStrokeColor('#000000')
|
|
139
|
-
* .setStrokeWidth(2)
|
|
140
|
-
* .build();
|
|
141
|
-
* await fWorksheet.insertShape(connectorInfo);
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
|
-
build(): IShapeBuilderInfo;
|
|
145
|
-
/**
|
|
146
|
-
* Returns the end connection info for this connector shape.
|
|
147
|
-
* If this connector's end point is connected to a basic shape, returns the target shape id and connection site index.
|
|
148
|
-
* @returns {IShapeRelationItem | null} The end connection info, or `null` if not connected.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```ts
|
|
152
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
153
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
154
|
-
* if (!fWorksheet) return;
|
|
155
|
-
* const shapes = fWorksheet.getShapes();
|
|
156
|
-
* const connector = shapes.find((s) => s.isLineShape());
|
|
157
|
-
*
|
|
158
|
-
* if (connector) {
|
|
159
|
-
* const endInfo = connector.getEndConnectInfo();
|
|
160
|
-
* if (endInfo) {
|
|
161
|
-
* console.log(`End connected to shape ${endInfo.shapeId} at site ${endInfo.cxnIndex}`);
|
|
162
|
-
* }
|
|
163
|
-
* }
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
166
|
-
getEndConnectInfo(): IShapeRelationItem | null;
|
|
167
|
-
/**
|
|
168
|
-
* Returns the start connection info for this connector shape.
|
|
169
|
-
* If this connector's start point is connected to a basic shape, returns the target shape id and connection site index.
|
|
170
|
-
* @returns {IShapeRelationItem | null} The start connection info, or `null` if not connected.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```ts
|
|
174
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
175
|
-
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
176
|
-
* if (!fWorksheet) return;
|
|
177
|
-
* const shapes = fWorksheet.getShapes();
|
|
178
|
-
* const connector = shapes.find((s) => s.isLineShape());
|
|
179
|
-
*
|
|
180
|
-
* if (connector) {
|
|
181
|
-
* const startInfo = connector.getStartConnectInfo();
|
|
182
|
-
* if (startInfo) {
|
|
183
|
-
* console.log(`Start connected to shape ${startInfo.shapeId} at site ${startInfo.cxnIndex}`);
|
|
184
|
-
* }
|
|
185
|
-
* }
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
getStartConnectInfo(): IShapeRelationItem | null;
|
|
189
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IShapeData, IShapeJSONData, IShapeRelation, IShapeRelationItem, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
-
import { ShapeModel } from '@univerjs-pro/engine-shape';
|
|
3
|
-
import { Disposable } from '@univerjs/core';
|
|
4
|
-
export type IShapeRelationItemWithLineId = IShapeRelationItem & {
|
|
5
|
-
lineShapeId: string;
|
|
6
|
-
isFrom: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare class SheetShapeModelManager extends Disposable {
|
|
9
|
-
_shapes: Map<string, ShapeModel>;
|
|
10
|
-
_linesIds: Set<string>;
|
|
11
|
-
_groupIds: Set<string>;
|
|
12
|
-
constructor();
|
|
13
|
-
addShape(shapeType: ShapeTypeEnum, id: string, shapeData?: IShapeData): ShapeModel;
|
|
14
|
-
/**
|
|
15
|
-
* Get all shape relations associated with a basic shape
|
|
16
|
-
* @param {string} id The basic shape ID
|
|
17
|
-
* @returns {IShapeRelationItemWithLineId[]} List of shape relation items associated with the basic shape
|
|
18
|
-
*/
|
|
19
|
-
getBasicShapeRelation(id: string): IShapeRelationItemWithLineId[];
|
|
20
|
-
/**
|
|
21
|
-
* Get the line shape relation info
|
|
22
|
-
* @param lineShapeId The line shape ID
|
|
23
|
-
* @returns {IShapeRelationItem | undefined} The shape relation info for the given line shape ID
|
|
24
|
-
*/
|
|
25
|
-
getLineShapeRelation(lineShapeId: string): IShapeRelation | undefined;
|
|
26
|
-
getShapeType(id: string): ShapeTypeEnum | undefined;
|
|
27
|
-
hasShape(id: string): boolean;
|
|
28
|
-
removeShape(id: string): void;
|
|
29
|
-
toJSON(): IShapeJSONData[];
|
|
30
|
-
fromJSON(data: IShapeJSONData[]): void;
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|