@univerjs/sheets-data-validation 0.5.4 → 0.5.5-nightly.202501201336

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.
@@ -1,248 +1,352 @@
1
- import { IDataValidationRule, IDataValidationRuleOptions, DataValidationOperator, DataValidationType } from '@univerjs/core';
1
+ import { IDataValidationRule, IDataValidationRuleOptions, DataValidationType } from '@univerjs/core';
2
2
  import { FRange } from '@univerjs/sheets/facade';
3
3
  import { FDataValidation } from './f-data-validation';
4
4
  /**
5
5
  * Builder for data validation rules.
6
- *
7
- * Set the data validation for cell A1 to require a value from B1:B10.
8
- * var rule = FUniver.newDataValidation().requireValueInRange(range).build();
9
- * cell.setDataValidation(rule);
6
+ * @example
7
+ * ```typescript
8
+ * // Set the data validation for cell A1 to require a value from B1:B10
9
+ * const range = FRange.create('Sheet1', 'B1:B10');
10
+ * const rule = FUniver.newDataValidation().requireValueInRange(range).build();
11
+ * cell.setDataValidation(rule);
12
+ * ```
10
13
  */
11
14
  export declare class FDataValidationBuilder {
12
15
  private _rule;
13
16
  constructor(rule?: IDataValidationRule);
14
17
  /**
15
18
  * Builds an FDataValidation instance based on the _rule property of the current class
16
- *
17
19
  * @returns {FDataValidation} A new instance of the FDataValidation class
20
+ * @example
21
+ * ```typescript
22
+ * const builder = univerAPI.newDataValidation();
23
+ * const validation = builder.requireNumberBetween(1, 10).build();
24
+ * ```
18
25
  */
19
26
  build(): FDataValidation;
20
27
  /**
21
28
  * Creates a duplicate of the current DataValidationBuilder object
22
- *
23
- * @return {FDataValidationBuilder} A new instance of the DataValidationBuilder class
29
+ * @returns {FDataValidationBuilder} A new instance of the DataValidationBuilder class
30
+ * @example
31
+ * ```typescript
32
+ * const builder = univerAPI.newDataValidation();
33
+ * const copy = builder.requireNumberBetween(1, 10).copy();
34
+ * ```
24
35
  */
25
36
  copy(): FDataValidationBuilder;
26
37
  /**
27
38
  * Determines whether invalid data is allowed
28
- *
29
39
  * @returns {boolean} True if invalid data is allowed, False otherwise
40
+ * @example
41
+ * ```typescript
42
+ * const builder = univerAPI.newDataValidation();
43
+ * const allowsInvalid = builder.getAllowInvalid();
44
+ * ```
30
45
  */
31
46
  getAllowInvalid(): boolean;
32
47
  /**
33
48
  * Gets the data validation type of the rule
34
- *
35
- * @returns {DataValidationType} The data validation type
49
+ * @returns {DataValidationType | string} The data validation type
50
+ * @example
51
+ * ```typescript
52
+ * const builder = univerAPI.newDataValidation();
53
+ * const type = builder.getCriteriaType();
54
+ * ```
36
55
  */
37
56
  getCriteriaType(): DataValidationType | string;
38
57
  /**
39
58
  * Gets the values used for criteria evaluation
40
- *
41
- * @returns {[string, string, string]} An array containing the operator, formula1, and formula2 values
59
+ * @returns {[string | undefined, string | undefined, string | undefined]} An array containing the operator, formula1, and formula2 values
60
+ * @example
61
+ * ```typescript
62
+ * const builder = univerAPI.newDataValidation();
63
+ * const [operator, formula1, formula2] = builder.getCriteriaValues();
64
+ * ```
42
65
  */
43
66
  getCriteriaValues(): [string | undefined, string | undefined, string | undefined];
44
67
  /**
45
68
  * Gets the help text information, which is used to provide users with guidance and support
46
- *
47
- * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value.
69
+ * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value
70
+ * @example
71
+ * ```typescript
72
+ * const builder = univerAPI.newDataValidation();
73
+ * const helpText = builder.getHelpText();
74
+ * ```
48
75
  */
49
76
  getHelpText(): string | undefined;
50
77
  /**
51
78
  * Sets the data validation type to CHECKBOX and sets the checked and unchecked values
52
- *
53
- * @param checkedValue The value when the checkbox is checked (Optional)
54
- * @param uncheckedValue The value when the checkbox is unchecked (Optional)
55
- * @returns The current instance of the FDataValidationBuilder class to allow for method chaining
79
+ * @param {string} [checkedValue] - The value when the checkbox is checked
80
+ * @param {string} [uncheckedValue] - The value when the checkbox is unchecked
81
+ * @returns {FDataValidationBuilder} The current instance for method chaining
82
+ * @example
83
+ * ```typescript
84
+ * const builder = univerAPI.newDataValidation();
85
+ * const rule = builder.requireCheckbox('Yes', 'No').build();
86
+ * ```
56
87
  */
57
88
  requireCheckbox(checkedValue?: string, uncheckedValue?: string): FDataValidationBuilder;
58
89
  /**
59
90
  * Set the data validation type to DATE and configure the validation rules to be after a specific date
60
- *
61
- * @param date The date to compare against. The formatted date string will be set as formula1
62
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
91
+ * @param {Date} date - The date to compare against
92
+ * @returns {FDataValidationBuilder} The current instance for method chaining
93
+ * @example
94
+ * ```typescript
95
+ * const builder = univerAPI.newDataValidation();
96
+ * const rule = builder.requireDateAfter(new Date('2024-01-01')).build();
97
+ * ```
63
98
  */
64
99
  requireDateAfter(date: Date): FDataValidationBuilder;
65
100
  /**
66
101
  * Set the data validation type to DATE and configure the validation rules to be before a specific date
67
- *
68
- * @param date The date to compare against. The formatted date string will be set as formula1
69
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
102
+ * @param {Date} date - The date to compare against
103
+ * @returns {FDataValidationBuilder} The current instance for method chaining
104
+ * @example
105
+ * ```typescript
106
+ * const builder = univerAPI.newDataValidation();
107
+ * const rule = builder.requireDateBefore(new Date('2024-12-31')).build();
108
+ * ```
70
109
  */
71
110
  requireDateBefore(date: Date): FDataValidationBuilder;
72
111
  /**
73
112
  * Set the data validation type to DATE and configure the validation rules to be within a specific date range
74
- *
75
- * @param start The starting date of the range. The formatted date string will be set as formula1
76
- * @param end The ending date of the range. The formatted date string will be set as formula2
77
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
113
+ * @param {Date} start - The starting date of the range
114
+ * @param {Date} end - The ending date of the range
115
+ * @returns {FDataValidationBuilder} The current instance for method chaining
116
+ * @example
117
+ * ```typescript
118
+ * const builder = univerAPI.newDataValidation();
119
+ * const rule = builder
120
+ * .requireDateBetween(new Date('2024-01-01'), new Date('2024-12-31'))
121
+ * .build();
122
+ * ```
78
123
  */
79
124
  requireDateBetween(start: Date, end: Date): FDataValidationBuilder;
80
125
  /**
81
126
  * Set the data validation type to DATE and configure the validation rules to be equal to a specific date
82
- *
83
- * @param date The date to compare against. The formatted date string will be set as formula1
84
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
127
+ * @param {Date} date - The date to compare against
128
+ * @returns {FDataValidationBuilder} The current instance for method chaining
129
+ * @example
130
+ * ```typescript
131
+ * const builder = univerAPI.newDataValidation();
132
+ * const rule = builder.requireDateEqualTo(new Date('2024-01-01')).build();
133
+ * ```
85
134
  */
86
135
  requireDateEqualTo(date: Date): FDataValidationBuilder;
87
136
  /**
88
137
  * Set the data validation type to DATE and configure the validation rules to be not within a specific date range
89
- *
90
- * @param start The starting date of the date range
91
- * @param end The ending date of the date range
92
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
138
+ * @param {Date} start - The starting date of the date range
139
+ * @param {Date} end - The ending date of the date range
140
+ * @returns {FDataValidationBuilder} The current instance for method chaining
141
+ * @example
142
+ * ```typescript
143
+ * const builder = univerAPI.newDataValidation();
144
+ * const rule = builder
145
+ * .requireDateNotBetween(new Date('2024-01-01'), new Date('2024-12-31'))
146
+ * .build();
147
+ * ```
93
148
  */
94
149
  requireDateNotBetween(start: Date, end: Date): FDataValidationBuilder;
95
150
  /**
96
151
  * Set the data validation type to DATE and configure the validation rules to be on or after a specific date
97
- *
98
- * @param date The date to compare against. The formatted date string will be set as formula1
99
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
152
+ * @param {Date} date - The date to compare against
153
+ * @returns {FDataValidationBuilder} The current instance for method chaining
154
+ * @example
155
+ * ```typescript
156
+ * const builder = univerAPI.newDataValidation();
157
+ * const rule = builder.requireDateOnOrAfter(new Date('2024-01-01')).build();
158
+ * ```
100
159
  */
101
160
  requireDateOnOrAfter(date: Date): FDataValidationBuilder;
102
161
  /**
103
162
  * Set the data validation type to DATE and configure the validation rules to be on or before a specific date
104
- *
105
- * @param date The date to compare against. The formatted date string will be set as formula1
106
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
163
+ * @param {Date} date - The date to compare against
164
+ * @returns {FDataValidationBuilder} The current instance for method chaining
165
+ * @example
166
+ * ```typescript
167
+ * const builder = univerAPI.newDataValidation();
168
+ * const rule = builder.requireDateOnOrBefore(new Date('2024-12-31')).build();
169
+ * ```
107
170
  */
108
171
  requireDateOnOrBefore(date: Date): FDataValidationBuilder;
109
172
  /**
110
- * Requires that a custom formula be satisfied.
111
- * Sets the data validation type to CUSTOM and configures the validation rule based on the provided formula string.
112
- *
113
- * @param formula The formula string that needs to be satisfied.
114
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
173
+ * Requires that a custom formula be satisfied
174
+ * @param {string} formula - The formula string that needs to be satisfied
175
+ * @returns {FDataValidationBuilder} The current instance for method chaining
176
+ * @example
177
+ * ```typescript
178
+ * const builder = univerAPI.newDataValidation();
179
+ * const rule = builder.requireFormulaSatisfied('=A1>0').build();
180
+ * ```
115
181
  */
116
182
  requireFormulaSatisfied(formula: string): FDataValidationBuilder;
117
183
  /**
118
- * Requires the user to enter a number within a specific range, which can be integer or decimal.
119
- * Sets the data validation type based on the isInteger parameter and configures the validation rules for the specified number range.
120
- *
121
- * @param start The starting value of the number range.
122
- * @param end The ending value of the number range.
123
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or decimal.
124
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
184
+ * Requires the user to enter a number within a specific range, which can be integer or decimal
185
+ * @param {number} start - The starting value of the number range
186
+ * @param {number} end - The ending value of the number range
187
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
188
+ * @returns {FDataValidationBuilder} The current instance for method chaining
189
+ * @example
190
+ * ```typescript
191
+ * const builder = univerAPI.newDataValidation();
192
+ * const rule = builder.requireNumberBetween(1, 10).build();
193
+ * ```
125
194
  */
126
195
  requireNumberBetween(start: number, end: number, isInteger?: boolean): FDataValidationBuilder;
127
196
  /**
128
- * Requires the user to enter a number that is equal to a specific value, which can be an integer or a decimal.
129
- * Sets the data validation type based on the isInteger parameter and configures the validation rules for the specified number.
130
- *
131
- * @param num The number to which the entered number should be equal.
132
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or a decimal.
133
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
197
+ * Requires the user to enter a number that is equal to a specific value, which can be an integer or a decimal
198
+ * @param {number} num - The number to which the entered number should be equal
199
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
200
+ * @returns {FDataValidationBuilder} The current instance for method chaining
201
+ * @example
202
+ * ```typescript
203
+ * const builder = univerAPI.newDataValidation();
204
+ * const rule = builder.requireNumberEqualTo(10).build();
205
+ * ```
134
206
  */
135
207
  requireNumberEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
136
208
  /**
137
- * Requires the user to enter a number that is greater than a specific value, which can be an integer or a decimal.
138
- * Sets the data validation type based on the isInteger parameter and configures the validation rules for the specified number.
139
- *
140
- * @param num The number to which the entered number should be greater.
141
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or a decimal.
142
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
209
+ * Requires the user to enter a number that is greater than a specific value, which can be an integer or a decimal
210
+ * @param {number} num - The number to which the entered number should be greater
211
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
212
+ * @returns {FDataValidationBuilder} The current instance for method chaining
213
+ * @example
214
+ * ```typescript
215
+ * const builder = univerAPI.newDataValidation();
216
+ * const rule = builder.requireNumberGreaterThan(10).build();
217
+ * ```
143
218
  */
144
219
  requireNumberGreaterThan(num: number, isInteger?: boolean): FDataValidationBuilder;
145
220
  /**
146
- * Requires the user to enter a number that is greater than or equal to a specific value, which can be an integer or a decimal.
147
- * Sets the data validation type based on the isInteger parameter and configures the validation rules for the specified number.
148
- *
149
- * @param num The number to which the entered number should be greater than or equal.
150
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or a decimal.
151
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
221
+ * Requires the user to enter a number that is greater than or equal to a specific value, which can be an integer or a decimal
222
+ * @param {number} num - The number to which the entered number should be greater than or equal
223
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
224
+ * @returns {FDataValidationBuilder} The current instance for method chaining
225
+ * @example
226
+ * ```typescript
227
+ * const builder = univerAPI.newDataValidation();
228
+ * const rule = builder.requireNumberGreaterThanOrEqualTo(10).build();
229
+ * ```
152
230
  */
153
231
  requireNumberGreaterThanOrEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
154
232
  /**
155
- * Requires the user to enter a number that is less than a specific value, which can be an integer or a decimal.
156
- * Sets the data validation type based on the isInteger parameter and configures the validation rules for the specified number.
157
- *
158
- * @param num The number to which the entered number should be less.
159
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or a decimal.
160
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
233
+ * Requires the user to enter a number that is less than a specific value, which can be an integer or a decimal
234
+ * @param {number} num - The number to which the entered number should be less
235
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
236
+ * @returns {FDataValidationBuilder} The current instance for method chaining
237
+ * @example
238
+ * ```typescript
239
+ * const builder = univerAPI.newDataValidation();
240
+ * const rule = builder.requireNumberLessThan(10).build();
241
+ * ```
161
242
  */
162
243
  requireNumberLessThan(num: number, isInteger?: boolean): FDataValidationBuilder;
163
244
  /**
164
245
  * Sets the data validation rule to require a number less than or equal to a specified value
165
246
  * The specified value can be an integer or a decimal
166
- *
167
- * @param num The number to which the entered number should be less than or equal
168
- * @param isInteger Indicates whether the required number is an integer
169
- * @return The current instance of the DataValidationBuilder class, allowing for method chaining
247
+ * @param {number} num - The number to which the entered number should be less than or equal
248
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
249
+ * @returns {FDataValidationBuilder} The current instance for method chaining
250
+ * @example
251
+ * ```typescript
252
+ * const builder = univerAPI.newDataValidation();
253
+ * const rule = builder.requireNumberLessThanOrEqualTo(10).build();
254
+ * ```
170
255
  */
171
256
  requireNumberLessThanOrEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
172
257
  /**
173
258
  * Sets a data validation rule that requires the user to enter a number outside a specified range
174
259
  * The specified range includes all integers and decimals
175
- *
176
- * @param start The starting point of the specified range
177
- * @param end The end point of the specified range
178
- * @param isInteger Optional parameter, indicating whether the number to be verified is an integer. Default value is false
179
- * @return An instance of the FDataValidationBuilder class, allowing for method chaining
260
+ * @param {number} start - The starting point of the specified range
261
+ * @param {number} end - The end point of the specified range
262
+ * @param {boolean} [isInteger] - Optional parameter, indicating whether the number to be verified is an integer
263
+ * @returns {FDataValidationBuilder} The current instance for method chaining
264
+ * @example
265
+ * ```typescript
266
+ * const builder = univerAPI.newDataValidation();
267
+ * const rule = builder.requireNumberNotBetween(1, 10).build();
268
+ * ```
180
269
  */
181
270
  requireNumberNotBetween(start: number, end: number, isInteger?: boolean): FDataValidationBuilder;
182
271
  /**
183
272
  * Creates a data validation rule that requires the user to enter a number that is not equal to a specific value
184
273
  * The specific value can be an integer or a decimal
185
- *
186
- * @param num The number to which the entered number should not be equal
187
- * @param isInteger Indicates whether the required number is an integer. Default is undefined, meaning it can be an integer or a decimal
188
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining
274
+ * @param {number} num - The number to which the entered number should not be equal
275
+ * @param {boolean} [isInteger] - Indicates whether the required number is an integer
276
+ * @returns {FDataValidationBuilder} The current instance for method chaining
277
+ * @example
278
+ * ```typescript
279
+ * const builder = univerAPI.newDataValidation();
280
+ * const rule = builder.requireNumberNotEqualTo(10).build();
281
+ * ```
189
282
  */
190
283
  requireNumberNotEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
191
284
  /**
192
- * Sets a data validation rule that requires the user to enter a value from a list of specific values.
193
- * The list can be displayed in a dropdown, and the user can choose multiple values according to the settings.
194
- *
195
- * @param values An array containing the specific values that the user can enter.
196
- * @param multiple Optional parameter indicating whether the user can select multiple values. Default is false, meaning only one value can be selected.
197
- * @param showDropdown Optional parameter indicating whether to display the list in a dropdown. Default is true, meaning the list will be displayed as a dropdown.
198
- * @return An instance of the FDataValidationBuilder class, allowing for method chaining.
285
+ * Sets a data validation rule that requires the user to enter a value from a list of specific values
286
+ * The list can be displayed in a dropdown, and the user can choose multiple values according to the settings
287
+ * @param {string[]} values - An array containing the specific values that the user can enter
288
+ * @param {boolean} [multiple] - Optional parameter indicating whether the user can select multiple values
289
+ * @param {boolean} [showDropdown] - Optional parameter indicating whether to display the list in a dropdown
290
+ * @returns {FDataValidationBuilder} The current instance for method chaining
291
+ * @example
292
+ * ```typescript
293
+ * const builder = univerAPI.newDataValidation();
294
+ * const rule = builder.requireValueInList(['Yes', 'No']).build();
295
+ * ```
199
296
  */
200
297
  requireValueInList(values: string[], multiple?: boolean, showDropdown?: boolean): FDataValidationBuilder;
201
298
  /**
202
- * Sets a data validation rule that requires the user to enter a value within a specific range.
203
- * The range is defined by an FRange object, which contains the unit ID, sheet name, and cell range.
204
- *
205
- * @param range An FRange object representing the range of values that the user can enter.
206
- * @param multiple Optional parameter indicating whether the user can select multiple values. Default is false, meaning only one value can be selected.
207
- * @param showDropdown Optional parameter indicating whether to display the list in a dropdown. Default is true, meaning the list will be displayed as a dropdown.
208
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
299
+ * Sets a data validation rule that requires the user to enter a value within a specific range
300
+ * The range is defined by an FRange object, which contains the unit ID, sheet name, and cell range
301
+ * @param {FRange} range - An FRange object representing the range of values that the user can enter
302
+ * @param {boolean} [multiple] - Optional parameter indicating whether the user can select multiple values
303
+ * @param {boolean} [showDropdown] - Optional parameter indicating whether to display the list in a dropdown
304
+ * @returns {FDataValidationBuilder} The current instance for method chaining
305
+ * @example
306
+ * ```typescript
307
+ * const builder = univerAPI.newDataValidation();
308
+ * const range = FRange.create('Sheet1', 'B1:B10');
309
+ * const rule = builder.requireValueInRange(range).build();
310
+ * ```
209
311
  */
210
312
  requireValueInRange(range: FRange, multiple?: boolean, showDropdown?: boolean): FDataValidationBuilder;
211
313
  /**
212
- * Sets whether to allow invalid data and configures the error style for data validation.
213
- * If invalid data is not allowed, the error style will be set to STOP, indicating that data entry must stop upon encountering an error.
214
- * If invalid data is allowed, the error style will be set to WARNING, indicating that a warning will be displayed when invalid data is entered, but data entry can continue.
215
- *
216
- * @param allowInvalidData A boolean value indicating whether to allow invalid data.
217
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
314
+ * Sets whether to allow invalid data and configures the error style
315
+ * If invalid data is not allowed, the error style will be set to STOP, indicating that data entry must stop upon encountering an error
316
+ * If invalid data is allowed, the error style will be set to WARNING, indicating that a warning will be displayed when invalid data is entered, but data entry can continue
317
+ * @param {boolean} allowInvalidData - Whether to allow invalid data
318
+ * @returns {FDataValidationBuilder} The current instance for method chaining
319
+ * @example
320
+ * ```typescript
321
+ * const builder = univerAPI.newDataValidation();
322
+ * const rule = builder.setAllowInvalid(true).build();
323
+ * ```
218
324
  */
219
325
  setAllowInvalid(allowInvalidData: boolean): FDataValidationBuilder;
220
326
  /**
221
- * Sets the help text and enables the display of error messages for data validation.
222
- * This method allows you to set a custom help text that will be displayed when the user enters invalid data.
223
- *
224
- * @param helpText The text to display as help information.
225
- * @return The current instance of the FDataValidationBuilder class to allow for method chaining.
327
+ * Sets whether to allow blank values
328
+ * @param {boolean} allowBlank - Whether to allow blank values
329
+ * @returns {FDataValidationBuilder} The current instance for method chaining
330
+ * @example
331
+ * ```typescript
332
+ * const builder = univerAPI.newDataValidation();
333
+ * const rule = builder.setAllowBlank(true).build();
334
+ * ```
226
335
  */
227
- setHelpText(helpText: string): FDataValidationBuilder;
228
- /**
229
- * Sets the criteria values for data validation.
230
- * This method is used to configure the validation rules based on specific criteria values.
231
- *
232
- * @param type The type of data validation.
233
- * @param values An array containing the criteria values.
234
- * The array should have three elements: [operator, formula1, formula2].
235
- * operator is a DataValidationOperator enum value, formula1 is the first formula, and formula2 is the second formula.
236
- * @return The current instance of the FDataValidationBuilder class, allowing for method chaining.
237
- */
238
- withCriteriaValues(type: DataValidationType | string, values: [DataValidationOperator, string, string]): this;
239
336
  setAllowBlank(allowBlank: boolean): FDataValidationBuilder;
240
337
  /**
241
- * Sets the options for the data validation rule.
242
- * For details of options, please refer to https://univer.ai/typedoc/@univerjs/core/interfaces/IDataValidationRuleOptions
243
- *
244
- * @param options The options to set for the data validation rule.
245
- * @returns The current instance of the FDataValidationBuilder class to allow for method chaining.
338
+ * Sets the options for the data validation rule
339
+ * @param {Partial<IDataValidationRuleOptions>} options - The options to set for the data validation rule
340
+ * @returns {FDataValidationBuilder} The current instance for method chaining
341
+ * @example
342
+ * ```typescript
343
+ * const builder = univerAPI.newDataValidation();
344
+ * const rule = builder.setOptions({
345
+ * allowBlank: true,
346
+ * showErrorMessage: true,
347
+ * error: 'Please enter a valid value'
348
+ * }).build();
349
+ * ```
246
350
  */
247
351
  setOptions(options: Partial<IDataValidationRuleOptions>): this;
248
352
  }