@univerjs/sheets 0.5.4 → 0.5.5-experimental.20250123-34738ff
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 +3 -3
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +2664 -1499
- package/lib/es/index.js +9211 -8683
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/types/basics/const/command-listener-const.d.ts +149 -13
- package/lib/types/commands/commands/remove-sheet.command.d.ts +1 -1
- package/lib/types/commands/commands/split-text-to-columns.command.d.ts +1 -1
- package/lib/types/commands/operations/selection.operation.d.ts +1 -0
- package/lib/types/commands/utils/selection-command-util.d.ts +1 -1
- package/lib/types/controllers/config.schema.d.ts +4 -0
- package/lib/types/facade/f-defined-name.d.ts +22 -16
- package/lib/types/facade/f-enum.d.ts +24 -0
- package/lib/types/facade/f-event.d.ts +474 -24
- package/lib/types/facade/f-permission.d.ts +141 -9
- package/lib/types/facade/f-range.d.ts +416 -98
- package/lib/types/facade/f-selection.d.ts +27 -1
- package/lib/types/facade/f-sheet-hooks.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +39 -3
- package/lib/types/facade/f-workbook.d.ts +57 -60
- package/lib/types/facade/f-worksheet.d.ts +654 -209
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/model/range-protection-rule.model.d.ts +1 -1
- package/lib/types/model/range-theme-util.d.ts +3 -3
- package/lib/types/services/permission/permission-point/const.d.ts +117 -4
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +1 -1
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +1 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts +1 -1
- package/lib/types/services/selections/selection-data-model.d.ts +7 -7
- package/lib/types/services/selections/selection.service.d.ts +4 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
- package/LICENSE +0 -176
- package/lib/types/basics/__tests__/cell-type.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/cell-value.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/expand.data.d.ts +0 -2
- package/lib/types/basics/__tests__/expand.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/rangeMerge.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/row-column-value.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/add-merge-command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/clear-selection.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/copy-worksheet.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -7
- package/lib/types/commands/commands/__tests__/delete-range.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/insert-range.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/insert-remove-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/move-range-commands.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/move-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/range-template-command.sepc.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-sheet.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-border.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-col-data.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-col-width.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-frozen.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-gridlines-command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-range-values.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-col-visible.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-data.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-height.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-style.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-tab-color.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-default-style.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-hide.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-name.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-order.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-show.command.spec.d.ts +0 -16
- package/lib/types/commands/mutations/__tests__/create-command-test-bed.d.ts +0 -8
- package/lib/types/commands/mutations/__tests__/move-rows-cols.mutation.spec.d.ts +0 -16
- package/lib/types/commands/mutations/__tests__/remove-row-col.mutation.spec.d.ts +0 -16
- package/lib/types/controllers/__tests__/util.d.ts +0 -13
- package/lib/types/facade/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/services/__tests__/move-active-cell.spec.d.ts +0 -16
- package/lib/types/services/__tests__/numfmt.service.test.d.ts +0 -16
- package/lib/types/services/__tests__/ref-range.setvice.spec.d.ts +0 -16
- package/lib/types/services/__tests__/util.d.ts +0 -14
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +0 -14
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +0 -13
- package/lib/types/services/ref-range/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/services/ref-range/__tests__/watch-range.spec.d.ts +0 -16
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +0 -13
- package/lib/types/services/sheet-interceptor/__tests__/sheet-interceptor.service.spec.d.ts +0 -16
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { CellValue, CustomData, ICellData, IDocumentData, IObjectMatrixPrimitiveType, IRange, IStyleData, Nullable, Workbook, Worksheet, FBaseInitialable, ICommandService, Injector, RichTextValue, WrapStrategy } from '@univerjs/core';
|
|
1
|
+
import { BorderStyleTypes, BorderType, CellValue, CustomData, ICellData, IDocumentData, IObjectMatrixPrimitiveType, IRange, IStyleData, Nullable, Workbook, Worksheet, FBaseInitialable, ICommandService, Injector, RichTextValue, TextStyleValue, WrapStrategy } from '@univerjs/core';
|
|
2
2
|
import { SplitDelimiterEnum } from '@univerjs/sheets';
|
|
3
3
|
import { FHorizontalAlignment, FVerticalAlignment } from './utils';
|
|
4
4
|
import { FormulaDataModel } from '@univerjs/engine-formula';
|
|
5
5
|
export type FontLine = 'none' | 'underline' | 'line-through';
|
|
6
6
|
export type FontStyle = 'normal' | 'italic';
|
|
7
7
|
export type FontWeight = 'normal' | 'bold';
|
|
8
|
+
/**
|
|
9
|
+
* Represents a range of cells in a sheet. You can call methods on this Facade API object
|
|
10
|
+
* to read contents or manipulate the range.
|
|
11
|
+
*
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
*/
|
|
8
14
|
export declare class FRange extends FBaseInitialable {
|
|
9
15
|
protected readonly _workbook: Workbook;
|
|
10
16
|
protected readonly _worksheet: Worksheet;
|
|
@@ -15,138 +21,284 @@ export declare class FRange extends FBaseInitialable {
|
|
|
15
21
|
constructor(_workbook: Workbook, _worksheet: Worksheet, _range: IRange, _injector: Injector, _commandService: ICommandService, _formulaDataModel: FormulaDataModel);
|
|
16
22
|
/**
|
|
17
23
|
* Get the unit ID of the current workbook
|
|
18
|
-
* @returns The unit ID of the workbook
|
|
24
|
+
* @returns {string} The unit ID of the workbook
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* univerAPI.getActiveWorkbook()
|
|
28
|
+
* .getActiveSheet()
|
|
29
|
+
* .getActiveRange()
|
|
30
|
+
* .getUnitId()
|
|
31
|
+
* ```
|
|
19
32
|
*/
|
|
20
33
|
getUnitId(): string;
|
|
21
34
|
/**
|
|
22
35
|
* Gets the name of the worksheet
|
|
23
|
-
* @returns The name of the worksheet
|
|
36
|
+
* @returns {string} The name of the worksheet
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* univerAPI.getActiveWorkbook()
|
|
40
|
+
* .getActiveSheet()
|
|
41
|
+
* .getActiveRange()
|
|
42
|
+
* .getSheetName()
|
|
43
|
+
* ```
|
|
24
44
|
*/
|
|
25
45
|
getSheetName(): string;
|
|
26
46
|
/**
|
|
27
47
|
* Gets the ID of the worksheet
|
|
28
|
-
* @returns The ID of the worksheet
|
|
48
|
+
* @returns {string} The ID of the worksheet
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* univerAPI.getActiveWorkbook()
|
|
52
|
+
* .getActiveSheet()
|
|
53
|
+
* .getActiveRange()
|
|
54
|
+
* .getSheetId()
|
|
55
|
+
* ```
|
|
29
56
|
*/
|
|
30
57
|
getSheetId(): string;
|
|
31
58
|
/**
|
|
32
59
|
* Gets the area where the statement is applied
|
|
33
|
-
* @returns The area where the statement is applied
|
|
60
|
+
* @returns {IRange} The area where the statement is applied
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* univerAPI.getActiveWorkbook()
|
|
64
|
+
* .getActiveSheet()
|
|
65
|
+
* .getActiveRange()
|
|
66
|
+
* .getRange()
|
|
67
|
+
* ```
|
|
34
68
|
*/
|
|
35
69
|
getRange(): IRange;
|
|
36
70
|
/**
|
|
37
71
|
* Gets the starting row number of the applied area
|
|
38
|
-
* @returns The starting row number of the area
|
|
72
|
+
* @returns {number} The starting row number of the area
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* univerAPI.getActiveWorkbook()
|
|
76
|
+
* .getActiveSheet()
|
|
77
|
+
* .getActiveRange()
|
|
78
|
+
* .getRow()
|
|
79
|
+
* ```
|
|
39
80
|
*/
|
|
40
81
|
getRow(): number;
|
|
41
82
|
/**
|
|
42
83
|
* Gets the starting column number of the applied area
|
|
43
|
-
* @returns The starting column number of the area
|
|
84
|
+
* @returns {number} The starting column number of the area
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* univerAPI.getActiveWorkbook()
|
|
88
|
+
* .getActiveSheet()
|
|
89
|
+
* .getActiveRange()
|
|
90
|
+
* .getColumn()
|
|
91
|
+
* ```
|
|
44
92
|
*/
|
|
45
93
|
getColumn(): number;
|
|
46
94
|
/**
|
|
47
95
|
* Gets the width of the applied area
|
|
48
|
-
* @returns The width of the area
|
|
96
|
+
* @returns {number} The width of the area
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* univerAPI.getActiveWorkbook()
|
|
100
|
+
* .getActiveSheet()
|
|
101
|
+
* .getActiveRange()
|
|
102
|
+
* .getWidth()
|
|
103
|
+
* ```
|
|
49
104
|
*/
|
|
50
105
|
getWidth(): number;
|
|
51
106
|
/**
|
|
52
107
|
* Gets the height of the applied area
|
|
53
|
-
* @returns The height of the area
|
|
108
|
+
* @returns {number} The height of the area
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* univerAPI.getActiveWorkbook()
|
|
112
|
+
* .getActiveSheet()
|
|
113
|
+
* .getActiveRange()
|
|
114
|
+
* .getHeight()
|
|
115
|
+
* ```
|
|
54
116
|
*/
|
|
55
117
|
getHeight(): number;
|
|
56
118
|
/**
|
|
57
119
|
* Return range whether this range is merged
|
|
58
|
-
* @returns if true is merged
|
|
120
|
+
* @returns {boolean} if true is merged
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* univerAPI.getActiveWorkbook()
|
|
124
|
+
* .getActiveSheet()
|
|
125
|
+
* .getActiveRange()
|
|
126
|
+
* .isMerged()
|
|
127
|
+
* ```
|
|
59
128
|
*/
|
|
60
129
|
isMerged(): boolean;
|
|
61
130
|
/**
|
|
62
131
|
* Return first cell style data in this range
|
|
63
132
|
* @returns {IStyleData | null} The cell style data
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* univerAPI.getActiveWorkbook()
|
|
136
|
+
* .getActiveSheet()
|
|
137
|
+
* .getActiveRange()
|
|
138
|
+
* .getCellStyleData()
|
|
139
|
+
* ```
|
|
64
140
|
*/
|
|
65
141
|
getCellStyleData(): IStyleData | null;
|
|
66
142
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @returns {
|
|
143
|
+
* Return first cell style in this range
|
|
144
|
+
* @returns {TextStyleValue | null} The cell style
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* univerAPI.getActiveWorkbook()
|
|
148
|
+
* .getActiveSheet()
|
|
149
|
+
* .getActiveRange()
|
|
150
|
+
* .getCellStyle()
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
getCellStyle(): TextStyleValue | null;
|
|
154
|
+
/**
|
|
155
|
+
* Returns the cell styles for the cells in the range.
|
|
156
|
+
* @returns {Array<Array<TextStyleValue | null>>} A two-dimensional array of cell styles.
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* univerAPI.getActiveWorkbook()
|
|
160
|
+
* .getActiveSheet()
|
|
161
|
+
* .getActiveRange()
|
|
162
|
+
* .getCellStyles()
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
getCellStyles(): Array<Array<TextStyleValue | null>>;
|
|
166
|
+
/**
|
|
167
|
+
* Return first cell value in this range
|
|
168
|
+
* @returns {CellValue | null} The cell value
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* univerAPI.getActiveWorkbook()
|
|
172
|
+
* .getActiveSheet()
|
|
173
|
+
* .getActiveRange()
|
|
174
|
+
* .getValue()
|
|
175
|
+
* ```
|
|
69
176
|
*/
|
|
70
177
|
getValue(): CellValue | null;
|
|
71
178
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @returns {
|
|
179
|
+
* Return first cell value in this range
|
|
180
|
+
* @param {boolean} includeRichText Should the returns of this func to include rich text
|
|
181
|
+
* @returns {CellValue | RichTextValue | null} The cell value
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* univerAPI.getActiveWorkbook()
|
|
185
|
+
* .getActiveSheet()
|
|
186
|
+
* .getActiveRange()
|
|
187
|
+
* .getValue(true)
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
getValue(includeRichText: true): Nullable<CellValue | RichTextValue>;
|
|
191
|
+
/**
|
|
192
|
+
* Returns the cell values for the cells in the range.
|
|
193
|
+
* @returns {Nullable<CellValue>[][]} A two-dimensional array of cell values.
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* // Get plain values
|
|
197
|
+
* const values = range.getValues();
|
|
198
|
+
* ```
|
|
75
199
|
*/
|
|
76
200
|
getValues(): Nullable<CellValue>[][];
|
|
201
|
+
/**
|
|
202
|
+
* Returns the cell values for the cells in the range.
|
|
203
|
+
* @param {boolean} includeRichText Should the returns of this func to include rich text
|
|
204
|
+
* @returns {Nullable<RichTextValue | CellValue>[][]} A two-dimensional array of cell values.
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* // Get values with rich text if available
|
|
208
|
+
* const richTextValues = univerAPI.getActiveWorkbook()
|
|
209
|
+
* .getActiveSheet()
|
|
210
|
+
* .getActiveRange()
|
|
211
|
+
* .getValues(true)
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
getValues(includeRichText: true): (Nullable<RichTextValue | CellValue>)[][];
|
|
77
215
|
/**
|
|
78
216
|
* Return first cell model data in this range
|
|
79
217
|
* @returns {ICellData | null} The cell model data
|
|
80
218
|
* @example
|
|
81
|
-
* ```
|
|
219
|
+
* ```ts
|
|
82
220
|
* univerAPI.getActiveWorkbook()
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
221
|
+
* .getActiveSheet()
|
|
222
|
+
* .getActiveRange()
|
|
223
|
+
* .getCellData()
|
|
86
224
|
* ```
|
|
87
225
|
*/
|
|
88
226
|
getCellData(): ICellData | null;
|
|
89
227
|
/**
|
|
90
|
-
*
|
|
228
|
+
* Alias for getCellDataGrid.
|
|
91
229
|
* @returns {Nullable<ICellData>[][]} A two-dimensional array of cell data.
|
|
92
230
|
* @example
|
|
93
|
-
* ```
|
|
231
|
+
* ```ts
|
|
94
232
|
* univerAPI.getActiveWorkbook()
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
233
|
+
* .getActiveSheet()
|
|
234
|
+
* .getActiveRange()
|
|
235
|
+
* .getCellDatas()
|
|
98
236
|
* ```
|
|
99
237
|
*/
|
|
100
238
|
getCellDatas(): Nullable<ICellData>[][];
|
|
101
239
|
/**
|
|
102
|
-
*
|
|
240
|
+
* Returns the cell data for the cells in the range.
|
|
241
|
+
* @returns {Nullable<ICellData>[][]} A two-dimensional array of cell data.
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* univerAPI.getActiveWorkbook()
|
|
245
|
+
* .getActiveSheet()
|
|
246
|
+
* .getActiveRange()
|
|
247
|
+
* .getCellDataGrid()
|
|
248
|
+
* ```
|
|
103
249
|
*/
|
|
104
250
|
getCellDataGrid(): Nullable<ICellData>[][];
|
|
105
251
|
/**
|
|
106
252
|
* Returns the rich text value for the cell at the start of this range.
|
|
107
253
|
* @returns {Nullable<RichTextValue>} The rich text value
|
|
254
|
+
* @internal
|
|
255
|
+
* @beta
|
|
108
256
|
* @example
|
|
109
|
-
* ```
|
|
257
|
+
* ```ts
|
|
110
258
|
* univerAPI.getActiveWorkbook()
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
259
|
+
* .getActiveSheet()
|
|
260
|
+
* .getActiveRange()
|
|
261
|
+
* .getRichTextValue()
|
|
114
262
|
* ```
|
|
115
263
|
*/
|
|
116
|
-
getRichTextValue
|
|
264
|
+
private getRichTextValue;
|
|
117
265
|
/**
|
|
118
266
|
* Returns the rich text value for the cells in the range.
|
|
119
267
|
* @returns {Nullable<RichTextValue>[][]} A two-dimensional array of RichTextValue objects.
|
|
268
|
+
* @internal
|
|
269
|
+
* @beta
|
|
120
270
|
* @example
|
|
121
|
-
* ```
|
|
271
|
+
* ```ts
|
|
122
272
|
* univerAPI.getActiveWorkbook()
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
273
|
+
* .getActiveSheet()
|
|
274
|
+
* .getActiveRange()
|
|
275
|
+
* .getRichTextValues()
|
|
126
276
|
* ```
|
|
127
277
|
*/
|
|
128
|
-
getRichTextValues
|
|
278
|
+
private getRichTextValues;
|
|
129
279
|
/**
|
|
130
280
|
* Returns the value and rich text value for the cell at the start of this range.
|
|
131
281
|
* @returns {Nullable<CellValue | RichTextValue>} The value and rich text value
|
|
282
|
+
* @internal
|
|
283
|
+
* @beta
|
|
132
284
|
* @example
|
|
133
|
-
* ```
|
|
285
|
+
* ```ts
|
|
134
286
|
* univerAPI.getActiveWorkbook()
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
287
|
+
* .getActiveSheet()
|
|
288
|
+
* .getActiveRange()
|
|
289
|
+
* .getValueAndRichTextValue()
|
|
138
290
|
* ```
|
|
139
291
|
*/
|
|
140
|
-
getValueAndRichTextValue
|
|
292
|
+
private getValueAndRichTextValue;
|
|
141
293
|
/**
|
|
142
294
|
* Returns the value and rich text value for the cells in the range.
|
|
143
295
|
* @returns {Nullable<CellValue | RichTextValue>[][]} A two-dimensional array of value and rich text value
|
|
144
296
|
* @example
|
|
145
|
-
* ```
|
|
297
|
+
* ```ts
|
|
146
298
|
* univerAPI.getActiveWorkbook()
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
299
|
+
* .getActiveSheet()
|
|
300
|
+
* .getActiveRange()
|
|
301
|
+
* .getValueAndRichTextValues()
|
|
150
302
|
* ```
|
|
151
303
|
*/
|
|
152
304
|
getValueAndRichTextValues(): Nullable<CellValue | RichTextValue>[][];
|
|
@@ -156,15 +308,59 @@ export declare class FRange extends FBaseInitialable {
|
|
|
156
308
|
* @example
|
|
157
309
|
* ```ts
|
|
158
310
|
* univerAPI.getActiveWorkbook()
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
311
|
+
* .getActiveSheet()
|
|
312
|
+
* .getActiveRange()
|
|
313
|
+
* .getFormulas()
|
|
162
314
|
* ```
|
|
163
315
|
*/
|
|
164
316
|
getFormulas(): string[][];
|
|
317
|
+
/**
|
|
318
|
+
* Returns true if the cell wrap is enabled
|
|
319
|
+
* @returns {boolean} True if the cell wrap is enabled
|
|
320
|
+
* @example
|
|
321
|
+
* ```ts
|
|
322
|
+
* univerAPI.getActiveWorkbook()
|
|
323
|
+
* .getActiveSheet()
|
|
324
|
+
* .getActiveRange()
|
|
325
|
+
* .getWrap()
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
165
328
|
getWrap(): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Returns the text wrapping strategy for the top left cell of the range.
|
|
331
|
+
* @returns {WrapStrategy} The text wrapping strategy
|
|
332
|
+
* @example
|
|
333
|
+
* ```ts
|
|
334
|
+
* univerAPI.getActiveWorkbook()
|
|
335
|
+
* .getActiveSheet()
|
|
336
|
+
* .getActiveRange()
|
|
337
|
+
* .getWrapStrategy()
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
166
340
|
getWrapStrategy(): WrapStrategy;
|
|
341
|
+
/**
|
|
342
|
+
* Returns the horizontal alignment for the top left cell of the range.
|
|
343
|
+
* @returns {string} The horizontal alignment
|
|
344
|
+
* @example
|
|
345
|
+
* ```ts
|
|
346
|
+
* univerAPI.getActiveWorkbook()
|
|
347
|
+
* .getActiveSheet()
|
|
348
|
+
* .getActiveRange()
|
|
349
|
+
* .getHorizontalAlignment()
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
167
352
|
getHorizontalAlignment(): string;
|
|
353
|
+
/**
|
|
354
|
+
* Returns the vertical alignment for the top left cell of the range.
|
|
355
|
+
* @returns {string} The vertical alignment
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* univerAPI.getActiveWorkbook()
|
|
359
|
+
* .getActiveSheet()
|
|
360
|
+
* .getActiveRange()
|
|
361
|
+
* .getVerticalAlignment()
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
168
364
|
getVerticalAlignment(): string;
|
|
169
365
|
/**
|
|
170
366
|
* Set custom meta data for first cell in current range.
|
|
@@ -172,9 +368,9 @@ export declare class FRange extends FBaseInitialable {
|
|
|
172
368
|
* @returns {FRange} This range, for chaining
|
|
173
369
|
* ```ts
|
|
174
370
|
* univerAPI.getActiveWorkbook()
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
371
|
+
* .getActiveSheet()
|
|
372
|
+
* .getActiveRange()
|
|
373
|
+
* .setCustomMetaData({ key: 'value' });
|
|
178
374
|
* ```
|
|
179
375
|
*/
|
|
180
376
|
setCustomMetaData(data: CustomData): FRange;
|
|
@@ -184,9 +380,9 @@ export declare class FRange extends FBaseInitialable {
|
|
|
184
380
|
* @returns {FRange} This range, for chaining
|
|
185
381
|
* ```ts
|
|
186
382
|
* univerAPI.getActiveWorkbook()
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
383
|
+
* .getActiveSheet()
|
|
384
|
+
* .getActiveRange()
|
|
385
|
+
* .setCustomMetaDatas([[{ key: 'value' }]]);
|
|
190
386
|
* ```
|
|
191
387
|
*/
|
|
192
388
|
setCustomMetaDatas(datas: CustomData[][]): FRange;
|
|
@@ -196,9 +392,9 @@ export declare class FRange extends FBaseInitialable {
|
|
|
196
392
|
* @example
|
|
197
393
|
* ```
|
|
198
394
|
* univerAPI.getActiveWorkbook()
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
395
|
+
* .getActiveSheet()
|
|
396
|
+
* .getActiveRange()
|
|
397
|
+
* .getCustomMetaData()
|
|
202
398
|
* ```
|
|
203
399
|
*/
|
|
204
400
|
getCustomMetaData(): CustomData | null;
|
|
@@ -208,46 +404,71 @@ export declare class FRange extends FBaseInitialable {
|
|
|
208
404
|
* @example
|
|
209
405
|
* ```
|
|
210
406
|
* univerAPI.getActiveWorkbook()
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
407
|
+
* .getActiveSheet()
|
|
408
|
+
* .getActiveRange()
|
|
409
|
+
* .getCustomMetaDatas()
|
|
214
410
|
* ```
|
|
215
411
|
*/
|
|
216
412
|
getCustomMetaDatas(): Nullable<CustomData>[][];
|
|
217
413
|
/**
|
|
218
|
-
*
|
|
219
|
-
* @param
|
|
414
|
+
* Sets basic border properties for the current range.
|
|
415
|
+
* @param {BorderType} type The type of border to apply
|
|
416
|
+
* @param {BorderStyleTypes} style The border style
|
|
417
|
+
* @param {string} [color] Optional border color in CSS notation
|
|
418
|
+
* @returns {FRange} This range, for chaining
|
|
220
419
|
* @example
|
|
420
|
+
* ```ts
|
|
421
|
+
* univerAPI.getActiveWorkbook()
|
|
422
|
+
* .getActiveSheet()
|
|
423
|
+
* .getActiveRange()
|
|
424
|
+
* .setBorder(BorderType.ALL, BorderStyleType.THIN, '#ff0000');
|
|
221
425
|
* ```
|
|
426
|
+
*/
|
|
427
|
+
setBorder(type: BorderType, style: BorderStyleTypes, color?: string): FRange;
|
|
428
|
+
/**
|
|
429
|
+
* Set background color for current range.
|
|
430
|
+
* @param {string} color The background color
|
|
431
|
+
* @returns {FRange} This range, for chaining
|
|
432
|
+
* @example
|
|
433
|
+
* ```ts
|
|
222
434
|
* univerAPI.getActiveWorkbook()
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
435
|
+
* .getActiveSheet()
|
|
436
|
+
* .getActiveRange()
|
|
437
|
+
* .setBackgroundColor('red')
|
|
226
438
|
* ```
|
|
227
439
|
*/
|
|
228
440
|
setBackgroundColor(color: string): FRange;
|
|
229
441
|
/**
|
|
230
442
|
* Set background color for current range.
|
|
443
|
+
* @param {string} color The background color
|
|
444
|
+
* @returns {FRange} This range, for chaining
|
|
231
445
|
* @example
|
|
232
446
|
* ```typescript
|
|
233
447
|
* univerAPI.getActiveWorkbook().getActiveSheet().getActiveRange().setBackground('red')
|
|
234
448
|
* ```
|
|
235
|
-
* @param color {string}
|
|
236
449
|
*/
|
|
237
450
|
setBackground(color: string): FRange;
|
|
238
451
|
/**
|
|
239
452
|
* Set new value for current cell, first cell in this range.
|
|
240
453
|
* @param {CellValue | ICellData} value The value can be a number, string, boolean, or standard cell format. If it begins with `=`, it is interpreted as a formula. The value is tiled to all cells in the range.
|
|
454
|
+
* @returns {FRange} This range, for chaining
|
|
455
|
+
* ```ts
|
|
456
|
+
* univerAPI.getActiveWorkbook()
|
|
457
|
+
* .getActiveSheet()
|
|
458
|
+
* .getActiveRange()
|
|
459
|
+
* .setValue(1);
|
|
460
|
+
* ```
|
|
241
461
|
*/
|
|
242
462
|
setValue(value: CellValue | ICellData): FRange;
|
|
243
463
|
/**
|
|
244
464
|
* Set new value for current cell, first cell in this range.
|
|
245
465
|
* @param {CellValue | ICellData} value The value can be a number, string, boolean, or standard cell format. If it begins with `=`, it is interpreted as a formula. The value is tiled to all cells in the range.
|
|
466
|
+
* @returns {FRange} This range, for chaining
|
|
246
467
|
* ```ts
|
|
247
468
|
* univerAPI.getActiveWorkbook()
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
469
|
+
* .getActiveSheet()
|
|
470
|
+
* .getActiveRange()
|
|
471
|
+
* .setValueForCell(1);
|
|
251
472
|
* ```
|
|
252
473
|
*/
|
|
253
474
|
setValueForCell(value: CellValue | ICellData): FRange;
|
|
@@ -258,9 +479,9 @@ export declare class FRange extends FBaseInitialable {
|
|
|
258
479
|
* @example
|
|
259
480
|
* ```
|
|
260
481
|
* univerAPI.getActiveWorkbook()
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
482
|
+
* .getActiveSheet()
|
|
483
|
+
* .getActiveRange()
|
|
484
|
+
* .setRichTextValueForCell(new RichTextValue().insertText('Hello'));
|
|
264
485
|
* ```
|
|
265
486
|
*/
|
|
266
487
|
setRichTextValueForCell(value: RichTextValue | IDocumentData): FRange;
|
|
@@ -271,83 +492,180 @@ export declare class FRange extends FBaseInitialable {
|
|
|
271
492
|
* @example
|
|
272
493
|
* ```ts
|
|
273
494
|
* univerAPI
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
495
|
+
* .getActiveWorkbook()
|
|
496
|
+
* .getActiveSheet()
|
|
497
|
+
* .getActiveRange()
|
|
498
|
+
* .setRichTextValues([[new RichTextValue().insertText('Hello')]]);
|
|
278
499
|
* ```
|
|
279
500
|
*/
|
|
280
501
|
setRichTextValues(values: (RichTextValue | IDocumentData)[][]): FRange;
|
|
281
502
|
/**
|
|
282
503
|
* Set the cell wrap of the given range.
|
|
283
504
|
* Cells with wrap enabled (the default) resize to display their full content. Cells with wrap disabled display as much as possible in the cell without resizing or running to multiple lines.
|
|
284
|
-
* @param isWrapEnabled
|
|
505
|
+
* @param {boolean} isWrapEnabled Whether to enable wrap
|
|
506
|
+
* @returns {FRange} this range, for chaining
|
|
507
|
+
* @example
|
|
508
|
+
* ```ts
|
|
509
|
+
* univerAPI.getActiveWorkbook()
|
|
510
|
+
* .getActiveSheet()
|
|
511
|
+
* .getActiveRange()
|
|
512
|
+
* .setWrap(true);
|
|
513
|
+
* ```
|
|
285
514
|
*/
|
|
286
515
|
setWrap(isWrapEnabled: boolean): FRange;
|
|
287
516
|
/**
|
|
288
517
|
* Sets the text wrapping strategy for the cells in the range.
|
|
289
|
-
* @param strategy
|
|
518
|
+
* @param {WrapStrategy} strategy The text wrapping strategy
|
|
519
|
+
* @returns {FRange} this range, for chaining
|
|
520
|
+
* @example
|
|
521
|
+
* ```ts
|
|
522
|
+
* univerAPI.getActiveWorkbook()
|
|
523
|
+
* .getActiveSheet()
|
|
524
|
+
* .getActiveRange()
|
|
525
|
+
* .setWrapStrategy(WrapStrategy.WRAP);
|
|
526
|
+
* ```
|
|
290
527
|
*/
|
|
291
528
|
setWrapStrategy(strategy: WrapStrategy): FRange;
|
|
292
529
|
/**
|
|
293
530
|
* Set the vertical (top to bottom) alignment for the given range (top/middle/bottom).
|
|
294
|
-
* @param alignment
|
|
531
|
+
* @param {"top" | "middle" | "bottom"} alignment The vertical alignment
|
|
532
|
+
* @returns {FRange} this range, for chaining
|
|
533
|
+
* @example
|
|
534
|
+
* ```ts
|
|
535
|
+
* univerAPI.getActiveWorkbook()
|
|
536
|
+
* .getActiveSheet()
|
|
537
|
+
* .getActiveRange()
|
|
538
|
+
* .setVerticalAlignment('top');
|
|
539
|
+
* ```
|
|
295
540
|
*/
|
|
296
541
|
setVerticalAlignment(alignment: FVerticalAlignment): FRange;
|
|
297
542
|
/**
|
|
298
543
|
* Set the horizontal (left to right) alignment for the given range (left/center/right).
|
|
299
|
-
* @param alignment
|
|
544
|
+
* @param {"left" | "center" | "normal"} alignment The horizontal alignment
|
|
545
|
+
* @returns {FRange} this range, for chaining
|
|
546
|
+
* @example
|
|
547
|
+
* ```ts
|
|
548
|
+
* univerAPI.getActiveWorkbook()
|
|
549
|
+
* .getActiveSheet()
|
|
550
|
+
* .getActiveRange()
|
|
551
|
+
* .setHorizontalAlignment('left');
|
|
552
|
+
* ```
|
|
300
553
|
*/
|
|
301
554
|
setHorizontalAlignment(alignment: FHorizontalAlignment): FRange;
|
|
302
555
|
/**
|
|
303
556
|
* Sets a different value for each cell in the range. The value can be a two-dimensional array or a standard range matrix (must match the dimensions of this range), consisting of numbers, strings, Boolean values or Composed of standard cell formats. If a value begins with `=`, it is interpreted as a formula.
|
|
304
|
-
* @param value
|
|
557
|
+
* @param {CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>} value The value can be a two-dimensional array or a standard range matrix (must match the dimensions of this range), consisting of numbers, strings, Boolean values or Composed of standard cell formats.
|
|
558
|
+
* @returns {FRange} This range, for chaining
|
|
559
|
+
* @example
|
|
560
|
+
* ```ts
|
|
561
|
+
* univerAPI.getActiveWorkbook()
|
|
562
|
+
* .getActiveSheet()
|
|
563
|
+
* .getActiveRange()
|
|
564
|
+
* .setValues([[1, 2], [3, 4]]);
|
|
565
|
+
* ```
|
|
305
566
|
*/
|
|
306
567
|
setValues(value: CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>): FRange;
|
|
307
568
|
/**
|
|
308
569
|
* Sets the font weight for the given range (normal/bold),
|
|
309
|
-
* @param fontWeight The font weight, either 'normal' or 'bold'; a null value resets the font weight.
|
|
570
|
+
* @param {FontWeight|null} fontWeight The font weight, either 'normal' or 'bold'; a null value resets the font weight.
|
|
571
|
+
* @returns {FRange} This range, for chaining
|
|
572
|
+
* @example
|
|
573
|
+
* ```ts
|
|
574
|
+
* univerAPI.getActiveWorkbook()
|
|
575
|
+
* .getActiveSheet()
|
|
576
|
+
* .getActiveRange()
|
|
577
|
+
* .setFontWeight('bold');
|
|
578
|
+
* ```
|
|
310
579
|
*/
|
|
311
580
|
setFontWeight(fontWeight: FontWeight | null): this;
|
|
312
581
|
/**
|
|
313
582
|
* Sets the font style for the given range ('italic' or 'normal').
|
|
314
|
-
* @param fontStyle The font style, either 'italic' or 'normal'; a null value resets the font style.
|
|
583
|
+
* @param {FontStyle|null} fontStyle The font style, either 'italic' or 'normal'; a null value resets the font style.
|
|
584
|
+
* @returns {FRange} This range, for chaining
|
|
585
|
+
* @example
|
|
586
|
+
* ```ts
|
|
587
|
+
* univerAPI.getActiveWorkbook()
|
|
588
|
+
* .getActiveSheet()
|
|
589
|
+
* .getActiveRange()
|
|
590
|
+
* .setFontStyle('italic');
|
|
591
|
+
* ```
|
|
315
592
|
*/
|
|
316
593
|
setFontStyle(fontStyle: FontStyle | null): this;
|
|
317
594
|
/**
|
|
318
595
|
* Sets the font line style of the given range ('underline', 'line-through', or 'none').
|
|
319
|
-
* @param fontLine The font line style, either 'underline', 'line-through', or 'none'; a null value resets the font line style.
|
|
596
|
+
* @param {FontLine|null} fontLine The font line style, either 'underline', 'line-through', or 'none'; a null value resets the font line style.
|
|
597
|
+
* @returns {FRange} This range, for chaining
|
|
598
|
+
* @example
|
|
599
|
+
* ```ts
|
|
600
|
+
* univerAPI.getActiveWorkbook()
|
|
601
|
+
* .getActiveSheet()
|
|
602
|
+
* .getActiveRange()
|
|
603
|
+
* .setFontLine('underline');
|
|
604
|
+
* ```
|
|
320
605
|
*/
|
|
321
606
|
setFontLine(fontLine: FontLine | null): this;
|
|
322
607
|
/**
|
|
323
608
|
* Sets the font underline style of the given ITextDecoration
|
|
324
|
-
* @param value
|
|
609
|
+
* @param {ITextDecoration|null} value The font underline style of the given ITextDecoration; a null value resets the font underline style
|
|
610
|
+
* @returns {void}
|
|
611
|
+
* @example
|
|
612
|
+
* ```ts
|
|
613
|
+
* univerAPI.getActiveWorkbook()
|
|
614
|
+
* .getActiveSheet()
|
|
615
|
+
* .getActiveRange()
|
|
616
|
+
* .setFontLine('underline');
|
|
617
|
+
* ```
|
|
325
618
|
*/
|
|
326
619
|
private _setFontUnderline;
|
|
327
620
|
/**
|
|
328
621
|
* Sets the font strikethrough style of the given ITextDecoration
|
|
329
|
-
* @param value
|
|
622
|
+
* @param {ITextDecoration|null} value The font strikethrough style of the given ITextDecoration; a null value resets the font strikethrough style
|
|
623
|
+
* @returns {void}
|
|
330
624
|
*/
|
|
331
625
|
private _setFontStrikethrough;
|
|
332
626
|
/**
|
|
333
627
|
* Sets the font family, such as "Arial" or "Helvetica".
|
|
334
|
-
* @param fontFamily The font family to set; a null value resets the font family.
|
|
628
|
+
* @param {string|null} fontFamily The font family to set; a null value resets the font family.
|
|
629
|
+
* @returns {FRange} This range, for chaining
|
|
630
|
+
* @example
|
|
631
|
+
* ```ts
|
|
632
|
+
* univerAPI.getActiveWorkbook()
|
|
633
|
+
* .getActiveSheet()
|
|
634
|
+
* .getActiveRange()
|
|
635
|
+
* .setFontFamily('Arial');
|
|
636
|
+
* ```
|
|
335
637
|
*/
|
|
336
638
|
setFontFamily(fontFamily: string | null): this;
|
|
337
639
|
/**
|
|
338
640
|
* Sets the font size, with the size being the point size to use.
|
|
339
|
-
* @param size A font size in point size. A null value resets the font size.
|
|
641
|
+
* @param {number|null} size A font size in point size. A null value resets the font size.
|
|
642
|
+
* @returns {FRange} This range, for chaining
|
|
643
|
+
* @example
|
|
644
|
+
* ```ts
|
|
645
|
+
* univerAPI.getActiveWorkbook()
|
|
646
|
+
* .getActiveSheet()
|
|
647
|
+
* .getActiveRange()
|
|
648
|
+
* .setFontSize(12);
|
|
649
|
+
* ```
|
|
340
650
|
*/
|
|
341
651
|
setFontSize(size: number | null): this;
|
|
342
652
|
/**
|
|
343
653
|
* Sets the font color in CSS notation (such as '#ffffff' or 'white').
|
|
344
|
-
* @param color The font color in CSS notation (such as '#ffffff' or 'white'); a null value resets the color.
|
|
654
|
+
* @param {string|null} color The font color in CSS notation (such as '#ffffff' or 'white'); a null value resets the color.
|
|
655
|
+
* @returns {FRange} This range, for chaining
|
|
656
|
+
* @example
|
|
657
|
+
* ```ts
|
|
658
|
+
* univerAPI.getActiveWorkbook()
|
|
659
|
+
* .getActiveSheet()
|
|
660
|
+
* .getActiveRange()
|
|
661
|
+
* .setFontColor('#ff0000');
|
|
662
|
+
* ```
|
|
345
663
|
*/
|
|
346
664
|
setFontColor(color: string | null): this;
|
|
347
665
|
/**
|
|
348
666
|
* Merge cells in a range into one merged cell
|
|
349
|
-
* @param [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
350
|
-
* @returns This range, for chaining
|
|
667
|
+
* @param {boolean} [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
668
|
+
* @returns {FRange} This range, for chaining
|
|
351
669
|
* @example
|
|
352
670
|
* ```ts
|
|
353
671
|
* const workbook = univerAPI.getActiveWorkbook();
|
|
@@ -361,8 +679,8 @@ export declare class FRange extends FBaseInitialable {
|
|
|
361
679
|
merge(defaultMerge?: boolean): FRange;
|
|
362
680
|
/**
|
|
363
681
|
* Merges cells in a range horizontally.
|
|
364
|
-
* @param [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
365
|
-
* @returns This range, for chaining
|
|
682
|
+
* @param {boolean} [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
683
|
+
* @returns {FRange} This range, for chaining
|
|
366
684
|
* @example
|
|
367
685
|
* ```ts
|
|
368
686
|
* const workbook = univerAPI.getActiveWorkbook();
|
|
@@ -376,8 +694,8 @@ export declare class FRange extends FBaseInitialable {
|
|
|
376
694
|
mergeAcross(defaultMerge?: boolean): FRange;
|
|
377
695
|
/**
|
|
378
696
|
* Merges cells in a range vertically.
|
|
379
|
-
* @param [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
380
|
-
* @returns This range, for chaining
|
|
697
|
+
* @param {boolean} [defaultMerge] - If true, only the value in the upper left cell is retained.
|
|
698
|
+
* @returns {FRange} This range, for chaining
|
|
381
699
|
* @example
|
|
382
700
|
* ```ts
|
|
383
701
|
* const workbook = univerAPI.getActiveWorkbook();
|
|
@@ -406,7 +724,7 @@ export declare class FRange extends FBaseInitialable {
|
|
|
406
724
|
isPartOfMerge(): boolean;
|
|
407
725
|
/**
|
|
408
726
|
* Break all horizontally- or vertically-merged cells contained within the range list into individual cells again.
|
|
409
|
-
* @returns This range, for chaining
|
|
727
|
+
* @returns {FRange} This range, for chaining
|
|
410
728
|
* @example
|
|
411
729
|
* ```ts
|
|
412
730
|
* const workbook = univerAPI.getActiveWorkbook();
|
|
@@ -424,7 +742,7 @@ export declare class FRange extends FBaseInitialable {
|
|
|
424
742
|
breakApart(): FRange;
|
|
425
743
|
/**
|
|
426
744
|
* Iterate cells in this range. Merged cells will be respected.
|
|
427
|
-
* @param callback the callback function to be called for each cell in the range
|
|
745
|
+
* @param {Function} callback the callback function to be called for each cell in the range
|
|
428
746
|
* @param {number} callback.row the row number of the cell
|
|
429
747
|
* @param {number} callback.col the column number of the cell
|
|
430
748
|
* @param {ICellData} callback.cell the cell data
|
|
@@ -433,14 +751,14 @@ export declare class FRange extends FBaseInitialable {
|
|
|
433
751
|
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
434
752
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
435
753
|
* fRange.forEach((row, col, cell) => {
|
|
436
|
-
*
|
|
754
|
+
* console.log(row, col, cell);
|
|
437
755
|
* });
|
|
438
756
|
* ```
|
|
439
757
|
*/
|
|
440
758
|
forEach(callback: (row: number, col: number, cell: ICellData) => void): void;
|
|
441
759
|
/**
|
|
442
760
|
* Returns a string description of the range, in A1 notation.
|
|
443
|
-
* @param withSheet
|
|
761
|
+
* @param {boolean} [withSheet] - If true, the sheet name is included in the A1 notation.
|
|
444
762
|
* @returns {string} The A1 notation of the range.
|
|
445
763
|
* ```ts
|
|
446
764
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|