@cool-office/sheets-conditional-formatting 0.0.0-stage → 1.2.0

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.
Files changed (151) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +49 -2
  3. package/lib/cjs/facade.js +2237 -0
  4. package/lib/cjs/index.js +3211 -0
  5. package/lib/cjs/locale/ar-SA.js +10 -0
  6. package/lib/cjs/locale/ca-ES.js +10 -0
  7. package/lib/cjs/locale/de-DE.js +10 -0
  8. package/lib/cjs/locale/en-US.js +25 -0
  9. package/lib/cjs/locale/es-ES.js +10 -0
  10. package/lib/cjs/locale/fa-IR.js +10 -0
  11. package/lib/cjs/locale/fr-FR.js +10 -0
  12. package/lib/cjs/locale/id-ID.js +10 -0
  13. package/lib/cjs/locale/it-IT.js +10 -0
  14. package/lib/cjs/locale/ja-JP.js +10 -0
  15. package/lib/cjs/locale/ko-KR.js +10 -0
  16. package/lib/cjs/locale/pl-PL.js +10 -0
  17. package/lib/cjs/locale/pt-BR.js +10 -0
  18. package/lib/cjs/locale/ru-RU.js +10 -0
  19. package/lib/cjs/locale/sk-SK.js +10 -0
  20. package/lib/cjs/locale/vi-VN.js +10 -0
  21. package/lib/cjs/locale/zh-CN.js +10 -0
  22. package/lib/cjs/locale/zh-HK.js +10 -0
  23. package/lib/cjs/locale/zh-TW.js +10 -0
  24. package/lib/es/facade.js +2236 -0
  25. package/lib/es/index.js +3116 -0
  26. package/lib/es/locale/ar-SA.js +10 -0
  27. package/lib/es/locale/ca-ES.js +10 -0
  28. package/lib/es/locale/de-DE.js +10 -0
  29. package/lib/es/locale/en-US.js +25 -0
  30. package/lib/es/locale/es-ES.js +10 -0
  31. package/lib/es/locale/fa-IR.js +10 -0
  32. package/lib/es/locale/fr-FR.js +10 -0
  33. package/lib/es/locale/id-ID.js +10 -0
  34. package/lib/es/locale/it-IT.js +10 -0
  35. package/lib/es/locale/ja-JP.js +10 -0
  36. package/lib/es/locale/ko-KR.js +10 -0
  37. package/lib/es/locale/pl-PL.js +10 -0
  38. package/lib/es/locale/pt-BR.js +10 -0
  39. package/lib/es/locale/ru-RU.js +10 -0
  40. package/lib/es/locale/sk-SK.js +10 -0
  41. package/lib/es/locale/vi-VN.js +10 -0
  42. package/lib/es/locale/zh-CN.js +10 -0
  43. package/lib/es/locale/zh-HK.js +10 -0
  44. package/lib/es/locale/zh-TW.js +10 -0
  45. package/lib/facade.js +2236 -0
  46. package/lib/index.js +3116 -0
  47. package/lib/locale/ar-SA.js +10 -0
  48. package/lib/locale/ca-ES.js +10 -0
  49. package/lib/locale/de-DE.js +10 -0
  50. package/lib/locale/en-US.js +25 -0
  51. package/lib/locale/es-ES.js +10 -0
  52. package/lib/locale/fa-IR.js +10 -0
  53. package/lib/locale/fr-FR.js +10 -0
  54. package/lib/locale/id-ID.js +10 -0
  55. package/lib/locale/it-IT.js +10 -0
  56. package/lib/locale/ja-JP.js +10 -0
  57. package/lib/locale/ko-KR.js +10 -0
  58. package/lib/locale/pl-PL.js +10 -0
  59. package/lib/locale/pt-BR.js +10 -0
  60. package/lib/locale/ru-RU.js +10 -0
  61. package/lib/locale/sk-SK.js +10 -0
  62. package/lib/locale/vi-VN.js +10 -0
  63. package/lib/locale/zh-CN.js +10 -0
  64. package/lib/locale/zh-HK.js +10 -0
  65. package/lib/locale/zh-TW.js +10 -0
  66. package/lib/types/assets/icon-map.d.ts +79 -0
  67. package/lib/types/base/const.d.ts +80 -0
  68. package/lib/types/commands/commands/add-cf.command.d.ts +24 -0
  69. package/lib/types/commands/commands/clear-range-cf.command.d.ts +24 -0
  70. package/lib/types/commands/commands/clear-worksheet-cf.command.d.ts +21 -0
  71. package/lib/types/commands/commands/delete-cf.command.d.ts +22 -0
  72. package/lib/types/commands/commands/move-cf.command.d.ts +24 -0
  73. package/lib/types/commands/commands/set-cf.command.d.ts +24 -0
  74. package/lib/types/commands/mutations/add-conditional-rule.mutation.d.ts +28 -0
  75. package/lib/types/commands/mutations/delete-conditional-rule.mutation.d.ts +23 -0
  76. package/lib/types/commands/mutations/formula-mark-dirty.mutation.d.ts +24 -0
  77. package/lib/types/commands/mutations/move-conditional-rule.mutation.d.ts +28 -0
  78. package/lib/types/commands/mutations/set-conditional-rule.mutation.d.ts +28 -0
  79. package/lib/types/config/config.d.ts +20 -0
  80. package/lib/types/facade/f-conditional-formatting-builder.d.ts +1709 -0
  81. package/lib/types/facade/f-enum.d.ts +48 -0
  82. package/lib/types/facade/f-range.d.ts +99 -0
  83. package/lib/types/facade/f-worksheet.d.ts +180 -0
  84. package/lib/types/facade/index.d.ts +21 -0
  85. package/lib/types/index.d.ts +55 -0
  86. package/lib/types/locale/ar-SA.d.ts +18 -0
  87. package/lib/types/locale/ca-ES.d.ts +18 -0
  88. package/lib/types/locale/de-DE.d.ts +18 -0
  89. package/lib/types/locale/en-US.d.ts +26 -0
  90. package/lib/types/locale/es-ES.d.ts +18 -0
  91. package/lib/types/locale/fa-IR.d.ts +18 -0
  92. package/lib/types/locale/fr-FR.d.ts +18 -0
  93. package/lib/types/locale/id-ID.d.ts +18 -0
  94. package/lib/types/locale/it-IT.d.ts +18 -0
  95. package/lib/types/locale/ja-JP.d.ts +18 -0
  96. package/lib/types/locale/ko-KR.d.ts +18 -0
  97. package/lib/types/locale/pl-PL.d.ts +18 -0
  98. package/lib/types/locale/pt-BR.d.ts +18 -0
  99. package/lib/types/locale/ru-RU.d.ts +18 -0
  100. package/lib/types/locale/sk-SK.d.ts +18 -0
  101. package/lib/types/locale/types.d.ts +18 -0
  102. package/lib/types/locale/vi-VN.d.ts +18 -0
  103. package/lib/types/locale/zh-CN.d.ts +18 -0
  104. package/lib/types/locale/zh-HK.d.ts +18 -0
  105. package/lib/types/locale/zh-TW.d.ts +18 -0
  106. package/lib/types/models/calculate-unit-v2/base-calculate-unit.d.ts +68 -0
  107. package/lib/types/models/calculate-unit-v2/color-scale-calculate-unit.d.ts +27 -0
  108. package/lib/types/models/calculate-unit-v2/data-bar-calculate-unit.d.ts +33 -0
  109. package/lib/types/models/calculate-unit-v2/highlight-cell-calculate-unit.d.ts +28 -0
  110. package/lib/types/models/calculate-unit-v2/icon-set-calculate-unit.d.ts +34 -0
  111. package/lib/types/models/calculate-unit-v2/utils.d.ts +46 -0
  112. package/lib/types/models/conditional-formatting-range-index-model.d.ts +32 -0
  113. package/lib/types/models/conditional-formatting-rule-model.d.ts +45 -0
  114. package/lib/types/models/conditional-formatting-view-model.d.ts +78 -0
  115. package/lib/types/models/icon-map.d.ts +48 -0
  116. package/lib/types/models/type.d.ts +106 -0
  117. package/lib/types/plugin.d.ts +29 -0
  118. package/lib/types/render/data-bar.render.d.ts +35 -0
  119. package/lib/types/render/icon.render.d.ts +37 -0
  120. package/lib/types/render/type.d.ts +38 -0
  121. package/lib/types/services/conditional-formatting-formula.service.d.ts +73 -0
  122. package/lib/types/services/conditional-formatting-range-transform.service.d.ts +27 -0
  123. package/lib/types/services/conditional-formatting-style-composer.service.d.ts +35 -0
  124. package/lib/types/services/conditional-formatting.service.d.ts +41 -0
  125. package/lib/types/utils/anchor.d.ts +34 -0
  126. package/lib/types/utils/create-cf-id.d.ts +16 -0
  127. package/lib/types/utils/range.d.ts +18 -0
  128. package/lib/types/utils/remove-undefined-attr.d.ts +16 -0
  129. package/lib/types/utils/type.d.ts +18 -0
  130. package/lib/umd/facade.js +1 -0
  131. package/lib/umd/index.js +1 -0
  132. package/lib/umd/locale/ar-SA.js +1 -0
  133. package/lib/umd/locale/ca-ES.js +1 -0
  134. package/lib/umd/locale/de-DE.js +1 -0
  135. package/lib/umd/locale/en-US.js +1 -0
  136. package/lib/umd/locale/es-ES.js +1 -0
  137. package/lib/umd/locale/fa-IR.js +1 -0
  138. package/lib/umd/locale/fr-FR.js +1 -0
  139. package/lib/umd/locale/id-ID.js +1 -0
  140. package/lib/umd/locale/it-IT.js +1 -0
  141. package/lib/umd/locale/ja-JP.js +1 -0
  142. package/lib/umd/locale/ko-KR.js +1 -0
  143. package/lib/umd/locale/pl-PL.js +1 -0
  144. package/lib/umd/locale/pt-BR.js +1 -0
  145. package/lib/umd/locale/ru-RU.js +1 -0
  146. package/lib/umd/locale/sk-SK.js +1 -0
  147. package/lib/umd/locale/vi-VN.js +1 -0
  148. package/lib/umd/locale/zh-CN.js +1 -0
  149. package/lib/umd/locale/zh-HK.js +1 -0
  150. package/lib/umd/locale/zh-TW.js +1 -0
  151. package/package.json +90 -3
@@ -0,0 +1,1709 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IRange } from '@cool-office/core';
17
+ import type { CFTimePeriodOperator, IAverageHighlightCell, IColorScale, IConditionalFormattingRuleConfig, IConditionFormattingRule, IIconSet, IValueConfig } from '@cool-office/sheets-conditional-formatting';
18
+ import { CFRuleType } from '@cool-office/sheets-conditional-formatting';
19
+ /**
20
+ * @ignore
21
+ * @hideconstructor
22
+ */
23
+ declare class ConditionalFormatRuleBaseBuilder {
24
+ protected _rule: Partial<IConditionFormattingRule>;
25
+ protected get _ruleConfig(): IConditionalFormattingRuleConfig | null;
26
+ protected _getDefaultConfig(type?: CFRuleType): IConditionalFormattingRuleConfig;
27
+ constructor(initRule?: Partial<IConditionFormattingRule>);
28
+ protected _ensureAttr<T extends object>(obj: T, keys: string[]): T;
29
+ /**
30
+ * Constructs a conditional format rule from the settings applied to the builder.
31
+ * @returns {IConditionFormattingRule} The conditional format rule.
32
+ * @example
33
+ * ```typescript
34
+ * const fWorkbook = univerAPI.getActiveWorkbook();
35
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
36
+ * if (!fWorksheet) return;
37
+ *
38
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
39
+ * const fRange = fWorksheet.getRange('A1:D10');
40
+ * const rule = fWorksheet.newConditionalFormattingRule()
41
+ * .whenCellEmpty()
42
+ * .setBackground('#FF0000')
43
+ * .setRanges([fRange.getRange()])
44
+ * .build();
45
+ * fWorksheet.addConditionalFormattingRule(rule);
46
+ * ```
47
+ */
48
+ build(): IConditionFormattingRule;
49
+ /**
50
+ * Deep clone a current builder.
51
+ * @returns {ConditionalFormatRuleBaseBuilder} A new builder with the same settings as the original.
52
+ * @example
53
+ * ```typescript
54
+ * const fWorkbook = univerAPI.getActiveWorkbook();
55
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
56
+ * if (!fWorksheet) return;
57
+ *
58
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
59
+ * const fRange = fWorksheet.getRange('A1:D10');
60
+ * const builder = fWorksheet.newConditionalFormattingRule()
61
+ * .whenCellEmpty()
62
+ * .setBackground('#FF0000')
63
+ * .setRanges([fRange.getRange()]);
64
+ * fWorksheet.addConditionalFormattingRule(builder.build());
65
+ *
66
+ * // Copy the rule and change the background color to green for the range A1:B2.
67
+ * const newRange = fWorksheet.getRange('A1:B2');
68
+ * const newBuilder = builder.copy()
69
+ * .setBackground('#00FF00')
70
+ * .setRanges([newRange.getRange()]);
71
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
72
+ * ```
73
+ */
74
+ copy(): ConditionalFormatRuleBaseBuilder;
75
+ /**
76
+ * Gets the scope of the current conditional format.
77
+ * @returns {IRange[]} The ranges to which the conditional format applies.
78
+ */
79
+ getRanges(): IRange[];
80
+ /**
81
+ * Get the icon set mapping dictionary.
82
+ * @returns {Record<string, string[]>} The icon set mapping dictionary.
83
+ */
84
+ getIconMap(): Record<string, string[]>;
85
+ /**
86
+ * Create a conditional format ID.
87
+ * @returns {string} The conditional format ID.
88
+ */
89
+ createCfId(): string;
90
+ /**
91
+ * Sets the scope for conditional formatting.
92
+ * @param {IRange[]} ranges - The ranges to which the conditional format applies.
93
+ * @returns {ConditionalFormatRuleBaseBuilder} This builder for chaining.
94
+ * @example
95
+ * ```typescript
96
+ * const fWorkbook = univerAPI.getActiveWorkbook();
97
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
98
+ * if (!fWorksheet) return;
99
+ *
100
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
101
+ * const fRange = fWorksheet.getRange('A1:D10');
102
+ * const rule = fWorksheet.newConditionalFormattingRule()
103
+ * .whenCellEmpty()
104
+ * .setBackground('#FF0000')
105
+ * .setRanges([fRange.getRange()])
106
+ * .build();
107
+ * fWorksheet.addConditionalFormattingRule(rule);
108
+ * ```
109
+ */
110
+ setRanges(ranges: IRange[]): this;
111
+ }
112
+ /**
113
+ * @hideconstructor
114
+ */
115
+ declare class ConditionalFormatHighlightRuleBuilder extends ConditionalFormatRuleBaseBuilder {
116
+ constructor(initConfig?: Partial<IConditionFormattingRule>);
117
+ /**
118
+ * Deep clone a current builder.
119
+ * @returns {ConditionalFormatHighlightRuleBuilder} A new builder with the same settings as the original.
120
+ * @example
121
+ * ```typescript
122
+ * const fWorkbook = univerAPI.getActiveWorkbook();
123
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
124
+ * if (!fWorksheet) return;
125
+ *
126
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
127
+ * const fRange = fWorksheet.getRange('A1:D10');
128
+ * const builder = fWorksheet.newConditionalFormattingRule()
129
+ * .whenCellEmpty()
130
+ * .setBackground('#FF0000')
131
+ * .setRanges([fRange.getRange()]);
132
+ * fWorksheet.addConditionalFormattingRule(builder.build());
133
+ *
134
+ * // Copy the rule and change the background color to green for the range A1:B2.
135
+ * const newRange = fWorksheet.getRange('A1:B2');
136
+ * const newBuilder = builder.copy()
137
+ * .setBackground('#00FF00')
138
+ * .setRanges([newRange.getRange()]);
139
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
140
+ * ```
141
+ */
142
+ copy(): ConditionalFormatHighlightRuleBuilder;
143
+ /**
144
+ * Set average rule.
145
+ * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
146
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
147
+ * @example
148
+ * ```typescript
149
+ * const fWorkbook = univerAPI.getActiveWorkbook();
150
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
151
+ * if (!fWorksheet) return;
152
+ *
153
+ * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
154
+ * const fRange = fWorksheet.getRange('A1:D10');
155
+ * const rule = fWorksheet.newConditionalFormattingRule()
156
+ * .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
157
+ * .setBackground('#FF0000')
158
+ * .setRanges([fRange.getRange()])
159
+ * .build();
160
+ * fWorksheet.addConditionalFormattingRule(rule);
161
+ * ```
162
+ */
163
+ setAverage(operator: IAverageHighlightCell['operator']): ConditionalFormatHighlightRuleBuilder;
164
+ /**
165
+ * Set unique values rule.
166
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
167
+ * @example
168
+ * ```typescript
169
+ * const fWorkbook = univerAPI.getActiveWorkbook();
170
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
171
+ * if (!fWorksheet) return;
172
+ *
173
+ * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
174
+ * const fRange = fWorksheet.getRange('A1:D10');
175
+ * const rule = fWorksheet.newConditionalFormattingRule()
176
+ * .setUniqueValues()
177
+ * .setBackground('#FF0000')
178
+ * .setRanges([fRange.getRange()])
179
+ * .build();
180
+ * fWorksheet.addConditionalFormattingRule(rule);
181
+ * ```
182
+ */
183
+ setUniqueValues(): ConditionalFormatHighlightRuleBuilder;
184
+ /**
185
+ * Set duplicate values rule.
186
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
187
+ * @example
188
+ * ```typescript
189
+ * const fWorkbook = univerAPI.getActiveWorkbook();
190
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
191
+ * if (!fWorksheet) return;
192
+ *
193
+ * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
194
+ * const fRange = fWorksheet.getRange('A1:D10');
195
+ * const rule = fWorksheet.newConditionalFormattingRule()
196
+ * .setDuplicateValues()
197
+ * .setBackground('#FF0000')
198
+ * .setRanges([fRange.getRange()])
199
+ * .build();
200
+ * fWorksheet.addConditionalFormattingRule(rule);
201
+ * ```
202
+ */
203
+ setDuplicateValues(): ConditionalFormatHighlightRuleBuilder;
204
+ /**
205
+ * Set rank rule.
206
+ * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
207
+ * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
208
+ * @param {boolean} config.isPercent - Whether to use a percentage rank.
209
+ * @param {number} config.value - The rank value.
210
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
211
+ * @example
212
+ * ```typescript
213
+ * const fWorkbook = univerAPI.getActiveWorkbook();
214
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
215
+ * if (!fWorksheet) return;
216
+ *
217
+ * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
218
+ * const fRange = fWorksheet.getRange('A1:D10');
219
+ * const rule = fWorksheet.newConditionalFormattingRule()
220
+ * .setRank({ isBottom: true, isPercent: true, value: 10 })
221
+ * .setBackground('#FF0000')
222
+ * .setRanges([fRange.getRange()])
223
+ * .build();
224
+ * fWorksheet.addConditionalFormattingRule(rule);
225
+ * ```
226
+ */
227
+ setRank(config: {
228
+ isBottom: boolean;
229
+ isPercent: boolean;
230
+ value: number;
231
+ }): ConditionalFormatHighlightRuleBuilder;
232
+ /**
233
+ * Sets the background color for the conditional format rule's format.
234
+ * @param {string} [color] - The background color to set. If not provided, the background color is removed.
235
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
236
+ * @example
237
+ * ```typescript
238
+ * const fWorkbook = univerAPI.getActiveWorkbook();
239
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
240
+ * if (!fWorksheet) return;
241
+ *
242
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
243
+ * const fRange = fWorksheet.getRange('A1:D10');
244
+ * const rule = fWorksheet.newConditionalFormattingRule()
245
+ * .whenCellEmpty()
246
+ * .setBackground('#FF0000')
247
+ * .setRanges([fRange.getRange()])
248
+ * .build();
249
+ * fWorksheet.addConditionalFormattingRule(rule);
250
+ * ```
251
+ */
252
+ setBackground(color?: string): ConditionalFormatHighlightRuleBuilder;
253
+ /**
254
+ * Sets text bolding for the conditional format rule's format.
255
+ * @param {boolean} isBold - Whether to bold the text.
256
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
257
+ * @example
258
+ * ```typescript
259
+ * const fWorkbook = univerAPI.getActiveWorkbook();
260
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
261
+ * if (!fWorksheet) return;
262
+ *
263
+ * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
264
+ * const fRange = fWorksheet.getRange('A1:D10');
265
+ * const rule = fWorksheet.newConditionalFormattingRule()
266
+ * .whenCellNotEmpty()
267
+ * .setBold(true)
268
+ * .setRanges([fRange.getRange()])
269
+ * .build();
270
+ * fWorksheet.addConditionalFormattingRule(rule);
271
+ * ```
272
+ */
273
+ setBold(isBold: boolean): ConditionalFormatHighlightRuleBuilder;
274
+ /**
275
+ * Sets the font color for the conditional format rule's format.
276
+ * @param {string} [color] - The font color to set. If not provided, the font color is removed.
277
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
278
+ * @example
279
+ * ```typescript
280
+ * const fWorkbook = univerAPI.getActiveWorkbook();
281
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
282
+ * if (!fWorksheet) return;
283
+ *
284
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
285
+ * const fRange = fWorksheet.getRange('A1:D10');
286
+ * const rule = fWorksheet.newConditionalFormattingRule()
287
+ * .whenCellNotEmpty()
288
+ * .setFontColor('#FF0000')
289
+ * .setRanges([fRange.getRange()])
290
+ * .build();
291
+ * fWorksheet.addConditionalFormattingRule(rule);
292
+ * ```
293
+ */
294
+ setFontColor(color?: string): ConditionalFormatHighlightRuleBuilder;
295
+ /**
296
+ * Sets text italics for the conditional format rule's format.
297
+ * @param {boolean} isItalic - Whether to italicize the text.
298
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
299
+ * @example
300
+ * ```typescript
301
+ * const fWorkbook = univerAPI.getActiveWorkbook();
302
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
303
+ * if (!fWorksheet) return;
304
+ *
305
+ * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
306
+ * const fRange = fWorksheet.getRange('A1:D10');
307
+ * const rule = fWorksheet.newConditionalFormattingRule()
308
+ * .whenCellNotEmpty()
309
+ * .setItalic(true)
310
+ * .setRanges([fRange.getRange()])
311
+ * .build();
312
+ * fWorksheet.addConditionalFormattingRule(rule);
313
+ * ```
314
+ */
315
+ setItalic(isItalic: boolean): ConditionalFormatHighlightRuleBuilder;
316
+ /**
317
+ * Sets text strikethrough for the conditional format rule's format.
318
+ * @param {boolean} isStrikethrough - Whether is strikethrough the text.
319
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
320
+ * @example
321
+ * ```typescript
322
+ * const fWorkbook = univerAPI.getActiveWorkbook();
323
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
324
+ * if (!fWorksheet) return;
325
+ *
326
+ * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
327
+ * const fRange = fWorksheet.getRange('A1:D10');
328
+ * const rule = fWorksheet.newConditionalFormattingRule()
329
+ * .whenCellNotEmpty()
330
+ * .setStrikethrough(true)
331
+ * .setRanges([fRange.getRange()])
332
+ * .build();
333
+ * fWorksheet.addConditionalFormattingRule(rule);
334
+ * ```
335
+ */
336
+ setStrikethrough(isStrikethrough: boolean): ConditionalFormatHighlightRuleBuilder;
337
+ /**
338
+ * Sets text underlining for the conditional format rule's format.
339
+ * @param {boolean} isUnderline - Whether to underline the text.
340
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
341
+ * @example
342
+ * ```typescript
343
+ * const fWorkbook = univerAPI.getActiveWorkbook();
344
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
345
+ * if (!fWorksheet) return;
346
+ *
347
+ * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
348
+ * const fRange = fWorksheet.getRange('A1:D10');
349
+ * const rule = fWorksheet.newConditionalFormattingRule()
350
+ * .whenCellNotEmpty()
351
+ * .setUnderline(true)
352
+ * .setRanges([fRange.getRange()])
353
+ * .build();
354
+ * fWorksheet.addConditionalFormattingRule(rule);
355
+ * ```
356
+ */
357
+ setUnderline(isUnderline: boolean): ConditionalFormatHighlightRuleBuilder;
358
+ /**
359
+ * Sets the conditional format rule to trigger when the cell is empty.
360
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
361
+ * @example
362
+ * ```typescript
363
+ * const fWorkbook = univerAPI.getActiveWorkbook();
364
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
365
+ * if (!fWorksheet) return;
366
+ *
367
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
368
+ * const fRange = fWorksheet.getRange('A1:D10');
369
+ * const rule = fWorksheet.newConditionalFormattingRule()
370
+ * .whenCellEmpty()
371
+ * .setBackground('#FF0000')
372
+ * .setRanges([fRange.getRange()])
373
+ * .build();
374
+ * fWorksheet.addConditionalFormattingRule(rule);
375
+ * ```
376
+ */
377
+ whenCellEmpty(): ConditionalFormatHighlightRuleBuilder;
378
+ /**
379
+ * Sets the conditional format rule to trigger when the cell is not empty.
380
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
381
+ * @example
382
+ * ```typescript
383
+ * const fWorkbook = univerAPI.getActiveWorkbook();
384
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
385
+ * if (!fWorksheet) return;
386
+ *
387
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
388
+ * const fRange = fWorksheet.getRange('A1:D10');
389
+ * const rule = fWorksheet.newConditionalFormattingRule()
390
+ * .whenCellNotEmpty()
391
+ * .setFontColor('#FF0000')
392
+ * .setRanges([fRange.getRange()])
393
+ * .build();
394
+ * fWorksheet.addConditionalFormattingRule(rule);
395
+ * ```
396
+ */
397
+ whenCellNotEmpty(): ConditionalFormatHighlightRuleBuilder;
398
+ /**
399
+ * Sets the conditional format rule to trigger when a time period is met.
400
+ * @param {CFTimePeriodOperator} date - The time period to check for.
401
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
402
+ * @example
403
+ * ```typescript
404
+ * const fWorkbook = univerAPI.getActiveWorkbook();
405
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
406
+ * if (!fWorksheet) return;
407
+ *
408
+ * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
409
+ * const fRange = fWorksheet.getRange('A1:D10');
410
+ * const rule = fWorksheet.newConditionalFormattingRule()
411
+ * .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
412
+ * .setBackground('#FF0000')
413
+ * .setRanges([fRange.getRange()])
414
+ * .build();
415
+ * fWorksheet.addConditionalFormattingRule(rule);
416
+ * ```
417
+ */
418
+ whenDate(date: CFTimePeriodOperator): ConditionalFormatHighlightRuleBuilder;
419
+ /**
420
+ * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
421
+ * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
422
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
423
+ * @example
424
+ * ```typescript
425
+ * const fWorkbook = univerAPI.getActiveWorkbook();
426
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
427
+ * if (!fWorksheet) return;
428
+ *
429
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
430
+ * const fRange = fWorksheet.getRange('A1:D10');
431
+ * const rule = fWorksheet.newConditionalFormattingRule()
432
+ * .whenFormulaSatisfied('=A1>10')
433
+ * .setBackground('#FF0000')
434
+ * .setRanges([fRange.getRange()])
435
+ * .build();
436
+ * fWorksheet.addConditionalFormattingRule(rule);
437
+ * ```
438
+ */
439
+ whenFormulaSatisfied(formulaString: string): ConditionalFormatHighlightRuleBuilder;
440
+ /**
441
+ * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
442
+ * @param {number} start - The lowest acceptable value.
443
+ * @param {number} end - The highest acceptable value.
444
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
445
+ * @example
446
+ * ```typescript
447
+ * const fWorkbook = univerAPI.getActiveWorkbook();
448
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
449
+ * if (!fWorksheet) return;
450
+ *
451
+ * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
452
+ * const fRange = fWorksheet.getRange('A1:D10');
453
+ * const rule = fWorksheet.newConditionalFormattingRule()
454
+ * .whenNumberBetween(10, 20)
455
+ * .setBackground('#FF0000')
456
+ * .setRanges([fRange.getRange()])
457
+ * .build();
458
+ * fWorksheet.addConditionalFormattingRule(rule);
459
+ * ```
460
+ */
461
+ whenNumberBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
462
+ /**
463
+ * Sets the conditional format rule to trigger when a number is equal to the given value.
464
+ * @param {number} value - The sole acceptable value.
465
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
466
+ * @example
467
+ * ```typescript
468
+ * const fWorkbook = univerAPI.getActiveWorkbook();
469
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
470
+ * if (!fWorksheet) return;
471
+ *
472
+ * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
473
+ * const fRange = fWorksheet.getRange('A1:D10');
474
+ * const rule = fWorksheet.newConditionalFormattingRule()
475
+ * .whenNumberEqualTo(10)
476
+ * .setBackground('#FF0000')
477
+ * .setRanges([fRange.getRange()])
478
+ * .build();
479
+ * fWorksheet.addConditionalFormattingRule(rule);
480
+ * ```
481
+ */
482
+ whenNumberEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
483
+ /**
484
+ * Sets the conditional format rule to trigger when a number is greater than the given value.
485
+ * @param {number} value - The highest unacceptable value.
486
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
487
+ * @example
488
+ * ```typescript
489
+ * const fWorkbook = univerAPI.getActiveWorkbook();
490
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
491
+ * if (!fWorksheet) return;
492
+ *
493
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
494
+ * const fRange = fWorksheet.getRange('A1:D10');
495
+ * const rule = fWorksheet.newConditionalFormattingRule()
496
+ * .whenNumberGreaterThan(10)
497
+ * .setBackground('#FF0000')
498
+ * .setRanges([fRange.getRange()])
499
+ * .build();
500
+ * fWorksheet.addConditionalFormattingRule(rule);
501
+ * ```
502
+ */
503
+ whenNumberGreaterThan(value: number): ConditionalFormatHighlightRuleBuilder;
504
+ /**
505
+ * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
506
+ * @param {number} value - The lowest acceptable value.
507
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
508
+ * @example
509
+ * ```typescript
510
+ * const fWorkbook = univerAPI.getActiveWorkbook();
511
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
512
+ * if (!fWorksheet) return;
513
+ *
514
+ * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
515
+ * const fRange = fWorksheet.getRange('A1:D10');
516
+ * const rule = fWorksheet.newConditionalFormattingRule()
517
+ * .whenNumberGreaterThanOrEqualTo(10)
518
+ * .setBackground('#FF0000')
519
+ * .setRanges([fRange.getRange()])
520
+ * .build();
521
+ * fWorksheet.addConditionalFormattingRule(rule);
522
+ * ```
523
+ */
524
+ whenNumberGreaterThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
525
+ /**
526
+ * Sets the conditional conditional format rule to trigger when a number less than the given value.
527
+ * @param {number} value - The lowest unacceptable value.
528
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
529
+ * @example
530
+ * ```typescript
531
+ * const fWorkbook = univerAPI.getActiveWorkbook();
532
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
533
+ * if (!fWorksheet) return;
534
+ *
535
+ * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
536
+ * const fRange = fWorksheet.getRange('A1:D10');
537
+ * const rule = fWorksheet.newConditionalFormattingRule()
538
+ * .whenNumberLessThan(10)
539
+ * .setBackground('#FF0000')
540
+ * .setRanges([fRange.getRange()])
541
+ * .build();
542
+ * fWorksheet.addConditionalFormattingRule(rule);
543
+ * ```
544
+ */
545
+ whenNumberLessThan(value: number): ConditionalFormatHighlightRuleBuilder;
546
+ /**
547
+ * Sets the conditional format rule to trigger when a number less than or equal to the given value.
548
+ * @param {number} value - The highest acceptable value.
549
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
550
+ * @example
551
+ * ```typescript
552
+ * const fWorkbook = univerAPI.getActiveWorkbook();
553
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
554
+ * if (!fWorksheet) return;
555
+ *
556
+ * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
557
+ * const fRange = fWorksheet.getRange('A1:D10');
558
+ * const rule = fWorksheet.newConditionalFormattingRule()
559
+ * .whenNumberLessThanOrEqualTo(10)
560
+ * .setBackground('#FF0000')
561
+ * .setRanges([fRange.getRange()])
562
+ * .build();
563
+ * fWorksheet.addConditionalFormattingRule(rule);
564
+ * ```
565
+ */
566
+ whenNumberLessThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
567
+ /**
568
+ * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
569
+ * @param {number} start - The lowest unacceptable value.
570
+ * @param {number} end - The highest unacceptable value.
571
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
572
+ * @example
573
+ * ```typescript
574
+ * const fWorkbook = univerAPI.getActiveWorkbook();
575
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
576
+ * if (!fWorksheet) return;
577
+ *
578
+ * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
579
+ * const fRange = fWorksheet.getRange('A1:D10');
580
+ * const rule = fWorksheet.newConditionalFormattingRule()
581
+ * .whenNumberNotBetween(10, 20)
582
+ * .setBackground('#FF0000')
583
+ * .setRanges([fRange.getRange()])
584
+ * .build();
585
+ * fWorksheet.addConditionalFormattingRule(rule);
586
+ * ```
587
+ */
588
+ whenNumberNotBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
589
+ /**
590
+ * Sets the conditional format rule to trigger when a number is not equal to the given value.
591
+ * @param {number} value - The sole unacceptable value.
592
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
593
+ * @example
594
+ * ```typescript
595
+ * const fWorkbook = univerAPI.getActiveWorkbook();
596
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
597
+ * if (!fWorksheet) return;
598
+ *
599
+ * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
600
+ * const fRange = fWorksheet.getRange('A1:D10');
601
+ * const rule = fWorksheet.newConditionalFormattingRule()
602
+ * .whenNumberNotEqualTo(10)
603
+ * .setBackground('#FF0000')
604
+ * .setRanges([fRange.getRange()])
605
+ * .build();
606
+ * fWorksheet.addConditionalFormattingRule(rule);
607
+ * ```
608
+ */
609
+ whenNumberNotEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
610
+ /**
611
+ * Sets the conditional format rule to trigger when that the input contains the given value.
612
+ * @param {string} text - The value that the input must contain.
613
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
614
+ * @example
615
+ * ```typescript
616
+ * const fWorkbook = univerAPI.getActiveWorkbook();
617
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
618
+ * if (!fWorksheet) return;
619
+ *
620
+ * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
621
+ * const fRange = fWorksheet.getRange('A1:D10');
622
+ * const rule = fWorksheet.newConditionalFormattingRule()
623
+ * .whenTextContains('apple')
624
+ * .setBackground('#FF0000')
625
+ * .setRanges([fRange.getRange()])
626
+ * .build();
627
+ * fWorksheet.addConditionalFormattingRule(rule);
628
+ * ```
629
+ */
630
+ whenTextContains(text: string): ConditionalFormatHighlightRuleBuilder;
631
+ /**
632
+ * Sets the conditional format rule to trigger when that the input does not contain the given value.
633
+ * @param {string} text - The value that the input must not contain.
634
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
635
+ * @example
636
+ * ```typescript
637
+ * const fWorkbook = univerAPI.getActiveWorkbook();
638
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
639
+ * if (!fWorksheet) return;
640
+ *
641
+ * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
642
+ * const fRange = fWorksheet.getRange('A1:D10');
643
+ * const rule = fWorksheet.newConditionalFormattingRule()
644
+ * .whenTextDoesNotContain('apple')
645
+ * .setBackground('#FF0000')
646
+ * .setRanges([fRange.getRange()])
647
+ * .build();
648
+ * fWorksheet.addConditionalFormattingRule(rule);
649
+ * ```
650
+ */
651
+ whenTextDoesNotContain(text: string): ConditionalFormatHighlightRuleBuilder;
652
+ /**
653
+ * Sets the conditional format rule to trigger when that the input ends with the given value.
654
+ * @param {string} text - Text to compare against the end of the string.
655
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
656
+ * @example
657
+ * ```typescript
658
+ * const fWorkbook = univerAPI.getActiveWorkbook();
659
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
660
+ * if (!fWorksheet) return;
661
+ *
662
+ * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
663
+ * const fRange = fWorksheet.getRange('A1:D10');
664
+ * const rule = fWorksheet.newConditionalFormattingRule()
665
+ * .whenTextEndsWith('.ai')
666
+ * .setBackground('#FF0000')
667
+ * .setRanges([fRange.getRange()])
668
+ * .build();
669
+ * fWorksheet.addConditionalFormattingRule(rule);
670
+ * ```
671
+ */
672
+ whenTextEndsWith(text: string): ConditionalFormatHighlightRuleBuilder;
673
+ /**
674
+ * Sets the conditional format rule to trigger when that the input is equal to the given value.
675
+ * @param {string} text - The sole acceptable value.
676
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
677
+ * @example
678
+ * ```typescript
679
+ * const fWorkbook = univerAPI.getActiveWorkbook();
680
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
681
+ * if (!fWorksheet) return;
682
+ *
683
+ * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
684
+ * const fRange = fWorksheet.getRange('A1:D10');
685
+ * const rule = fWorksheet.newConditionalFormattingRule()
686
+ * .whenTextEqualTo('apple')
687
+ * .setBackground('#FF0000')
688
+ * .setRanges([fRange.getRange()])
689
+ * .build();
690
+ * fWorksheet.addConditionalFormattingRule(rule);
691
+ * ```
692
+ */
693
+ whenTextEqualTo(text: string): ConditionalFormatHighlightRuleBuilder;
694
+ /**
695
+ * Sets the conditional format rule to trigger when that the input starts with the given value.
696
+ * @param {string} text - Text to compare against the beginning of the string.
697
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
698
+ * @example
699
+ * ```typescript
700
+ * const fWorkbook = univerAPI.getActiveWorkbook();
701
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
702
+ * if (!fWorksheet) return;
703
+ *
704
+ * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
705
+ * const fRange = fWorksheet.getRange('A1:D10');
706
+ * const rule = fWorksheet.newConditionalFormattingRule()
707
+ * .whenTextStartsWith('https://')
708
+ * .setBackground('#FF0000')
709
+ * .setRanges([fRange.getRange()])
710
+ * .build();
711
+ * fWorksheet.addConditionalFormattingRule(rule);
712
+ * ```
713
+ */
714
+ whenTextStartsWith(text: string): ConditionalFormatHighlightRuleBuilder;
715
+ }
716
+ declare class ConditionalFormatDataBarRuleBuilder extends ConditionalFormatRuleBaseBuilder {
717
+ /**
718
+ * Deep clone a current builder.
719
+ * @returns {ConditionalFormatDataBarRuleBuilder} A new instance of the builder with the same settings as the original.
720
+ * @example
721
+ * ```typescript
722
+ * const fWorkbook = univerAPI.getActiveWorkbook();
723
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
724
+ * if (!fWorksheet) return;
725
+ *
726
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
727
+ * // positive values are green and negative values are red.
728
+ * const fRange = fWorksheet.getRange('A1:D10');
729
+ * const builder = fWorksheet.newConditionalFormattingRule()
730
+ * .setDataBar({
731
+ * min: { type: 'num', value: -100 },
732
+ * max: { type: 'num', value: 100 },
733
+ * positiveColor: '#00FF00',
734
+ * nativeColor: '#FF0000',
735
+ * isShowValue: true
736
+ * })
737
+ * .setRanges([fRange.getRange()]);
738
+ * fWorksheet.addConditionalFormattingRule(builder.build());
739
+ *
740
+ * // Copy the rule and apply it to a new range.
741
+ * const newRange = fWorksheet.getRange('F1:F10');
742
+ * const newBuilder = builder.copy()
743
+ * .setRanges([newRange.getRange()]);
744
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
745
+ * ```
746
+ */
747
+ copy(): ConditionalFormatDataBarRuleBuilder;
748
+ /**
749
+ * Set data bar rule.
750
+ * @param {object} config - The data bar rule settings.
751
+ * @param {IValueConfig} config.min - The minimum value for the data bar.
752
+ * @param {IValueConfig} config.max - The maximum value for the data bar.
753
+ * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
754
+ * @param {string} config.positiveColor - The color for positive values.
755
+ * @param {string} config.nativeColor - The color for negative values.
756
+ * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
757
+ * @returns {ConditionalFormatDataBarRuleBuilder} This builder for chaining.
758
+ * @example
759
+ * ```typescript
760
+ * const fWorkbook = univerAPI.getActiveWorkbook();
761
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
762
+ * if (!fWorksheet) return;
763
+ *
764
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
765
+ * // positive values are green and negative values are red.
766
+ * const fRange = fWorksheet.getRange('A1:D10');
767
+ * const rule = fWorksheet.newConditionalFormattingRule()
768
+ * .setDataBar({
769
+ * min: { type: 'num', value: -100 },
770
+ * max: { type: 'num', value: 100 },
771
+ * positiveColor: '#00FF00',
772
+ * nativeColor: '#FF0000',
773
+ * isShowValue: true
774
+ * })
775
+ * .setRanges([fRange.getRange()])
776
+ * .build();
777
+ * fWorksheet.addConditionalFormattingRule(rule);
778
+ * ```
779
+ */
780
+ setDataBar(config: {
781
+ min: IValueConfig;
782
+ max: IValueConfig;
783
+ isGradient?: boolean;
784
+ positiveColor: string;
785
+ nativeColor: string;
786
+ isShowValue?: boolean;
787
+ }): ConditionalFormatDataBarRuleBuilder;
788
+ }
789
+ declare class ConditionalFormatColorScaleRuleBuilder extends ConditionalFormatRuleBaseBuilder {
790
+ /**
791
+ * Deep clone a current builder.
792
+ * @returns {ConditionalFormatColorScaleRuleBuilder} A new instance of the builder with the same settings as the original.
793
+ * @example
794
+ * ```typescript
795
+ * const fWorkbook = univerAPI.getActiveWorkbook();
796
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
797
+ * if (!fWorksheet) return;
798
+ *
799
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
800
+ * // The color scale is green for 0, yellow for 50, and red for 100.
801
+ * const fRange = fWorksheet.getRange('A1:D10');
802
+ * const builder = fWorksheet.newConditionalFormattingRule()
803
+ * .setColorScale([
804
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
805
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
806
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
807
+ * ])
808
+ * .setRanges([fRange.getRange()]);
809
+ * fWorksheet.addConditionalFormattingRule(builder.build());
810
+ *
811
+ * // Copy the rule and apply it to a new range.
812
+ * const newRange = fWorksheet.getRange('F1:F10');
813
+ * const newBuilder = builder.copy()
814
+ * .setRanges([newRange.getRange()]);
815
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
816
+ * ```
817
+ */
818
+ copy(): ConditionalFormatColorScaleRuleBuilder;
819
+ /**
820
+ * Set color scale rule.
821
+ * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
822
+ * @param {number} config.index - The index of the color scale configuration.
823
+ * @param {string} config.color - The color corresponding to the index of the color scale configuration.
824
+ * @param {IValueConfig} config.value - The condition value corresponding to the index of the color scale configuration.
825
+ * @returns {ConditionalFormatColorScaleRuleBuilder} This builder for chaining.
826
+ * @example
827
+ * ```typescript
828
+ * const fWorkbook = univerAPI.getActiveWorkbook();
829
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
830
+ * if (!fWorksheet) return;
831
+ *
832
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
833
+ * // The color scale is green for 0, yellow for 50, and red for 100.
834
+ * const fRange = fWorksheet.getRange('A1:D10');
835
+ * const rule = fWorksheet.newConditionalFormattingRule()
836
+ * .setColorScale([
837
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
838
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
839
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
840
+ * ])
841
+ * .setRanges([fRange.getRange()])
842
+ * .build();
843
+ * fWorksheet.addConditionalFormattingRule(rule);
844
+ * ```
845
+ */
846
+ setColorScale(config: IColorScale['config']): ConditionalFormatColorScaleRuleBuilder;
847
+ }
848
+ declare class ConditionalFormatIconSetRuleBuilder extends ConditionalFormatRuleBaseBuilder {
849
+ /**
850
+ * Deep clone a current builder.
851
+ * @returns {ConditionalFormatIconSetRuleBuilder} A new instance of the builder with the same settings as the original.
852
+ * @example
853
+ * ```typescript
854
+ * const fWorkbook = univerAPI.getActiveWorkbook();
855
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
856
+ * if (!fWorksheet) return;
857
+ *
858
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
859
+ * // The first arrow is green for values greater than 20.
860
+ * // The second arrow is yellow for values greater than 10.
861
+ * // The third arrow is red for values less than or equal to 10.
862
+ * const fRange = fWorksheet.getRange('A1:D10');
863
+ * const builder = fWorksheet.newConditionalFormattingRule()
864
+ * .setIconSet({
865
+ * iconConfigs: [
866
+ * {
867
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
868
+ * iconId: '0',
869
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
870
+ * value: {
871
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
872
+ * value: 20
873
+ * }
874
+ * },
875
+ * {
876
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
877
+ * iconId: '1',
878
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
879
+ * value: {
880
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
881
+ * value: 10
882
+ * }
883
+ * },
884
+ * {
885
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
886
+ * iconId: '2',
887
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
888
+ * value: {
889
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
890
+ * value: 10
891
+ * }
892
+ * }
893
+ * ],
894
+ * isShowValue: true,
895
+ * })
896
+ * .setRanges([fRange.getRange()]);
897
+ * fWorksheet.addConditionalFormattingRule(builder.build());
898
+ *
899
+ * // Copy the rule and apply it to a new range.
900
+ * const newRange = fWorksheet.getRange('F1:F10');
901
+ * const newBuilder = builder.copy()
902
+ * .setRanges([newRange.getRange()]);
903
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
904
+ * ```
905
+ */
906
+ copy(): ConditionalFormatIconSetRuleBuilder;
907
+ /**
908
+ * Set up icon set conditional formatting rule.
909
+ * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
910
+ * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
911
+ * @param {boolean} config.isShowValue - Whether to show the value in the cell.
912
+ * @returns {ConditionalFormatIconSetRuleBuilder} This builder for chaining.
913
+ * @example
914
+ * ```typescript
915
+ * const fWorkbook = univerAPI.getActiveWorkbook();
916
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
917
+ * if (!fWorksheet) return;
918
+ *
919
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
920
+ * // The first arrow is green for values greater than 20.
921
+ * // The second arrow is yellow for values greater than 10.
922
+ * // The third arrow is red for values less than or equal to 10.
923
+ * const fRange = fWorksheet.getRange('A1:D10');
924
+ * const builder = fWorksheet.newConditionalFormattingRule();
925
+ * console.log(builder.getIconMap()); // icons key-value map
926
+ * const rule = builder.setIconSet({
927
+ * iconConfigs: [
928
+ * {
929
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
930
+ * iconId: '0',
931
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
932
+ * value: {
933
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
934
+ * value: 20
935
+ * }
936
+ * },
937
+ * {
938
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
939
+ * iconId: '1',
940
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
941
+ * value: {
942
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
943
+ * value: 10
944
+ * }
945
+ * },
946
+ * {
947
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
948
+ * iconId: '2',
949
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
950
+ * value: {
951
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
952
+ * value: 10
953
+ * }
954
+ * }
955
+ * ],
956
+ * isShowValue: true,
957
+ * })
958
+ * .setRanges([fRange.getRange()])
959
+ * .build();
960
+ * fWorksheet.addConditionalFormattingRule(rule);
961
+ * ```
962
+ */
963
+ setIconSet(config: {
964
+ iconConfigs: IIconSet['config'];
965
+ isShowValue: boolean;
966
+ }): ConditionalFormatIconSetRuleBuilder;
967
+ }
968
+ /**
969
+ * @hideconstructor
970
+ */
971
+ export declare class FConditionalFormattingBuilder {
972
+ private _initConfig;
973
+ constructor(_initConfig?: {
974
+ ranges?: IRange[];
975
+ });
976
+ /**
977
+ * Constructs a conditional format rule from the settings applied to the builder.
978
+ * @returns {IConditionFormattingRule} The conditional format rule.
979
+ * @example
980
+ * ```typescript
981
+ * const fWorkbook = univerAPI.getActiveWorkbook();
982
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
983
+ * if (!fWorksheet) return;
984
+ *
985
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
986
+ * const fRange = fWorksheet.getRange('A1:D10');
987
+ * const rule = fWorksheet.newConditionalFormattingRule()
988
+ * .whenNumberGreaterThan(10)
989
+ * .setBackground('#FF0000')
990
+ * .setRanges([fRange.getRange()])
991
+ * .build();
992
+ * fWorksheet.addConditionalFormattingRule(rule);
993
+ * ```
994
+ */
995
+ build(): IConditionFormattingRule;
996
+ /**
997
+ * Set average rule.
998
+ * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
999
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1000
+ * @example
1001
+ * ```typescript
1002
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1003
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1004
+ * if (!fWorksheet) return;
1005
+ *
1006
+ * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
1007
+ * const fRange = fWorksheet.getRange('A1:D10');
1008
+ * const rule = fWorksheet.newConditionalFormattingRule()
1009
+ * .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
1010
+ * .setBackground('#FF0000')
1011
+ * .setRanges([fRange.getRange()])
1012
+ * .build();
1013
+ * fWorksheet.addConditionalFormattingRule(rule);
1014
+ * ```
1015
+ */
1016
+ setAverage(operator: IAverageHighlightCell['operator']): ConditionalFormatHighlightRuleBuilder;
1017
+ /**
1018
+ * Set unique values rule.
1019
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1020
+ * @example
1021
+ * ```typescript
1022
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1023
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1024
+ * if (!fWorksheet) return;
1025
+ *
1026
+ * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
1027
+ * const fRange = fWorksheet.getRange('A1:D10');
1028
+ * const rule = fWorksheet.newConditionalFormattingRule()
1029
+ * .setUniqueValues()
1030
+ * .setBackground('#FF0000')
1031
+ * .setRanges([fRange.getRange()])
1032
+ * .build();
1033
+ * fWorksheet.addConditionalFormattingRule(rule);
1034
+ * ```
1035
+ */
1036
+ setUniqueValues(): ConditionalFormatHighlightRuleBuilder;
1037
+ /**
1038
+ * Set duplicate values rule.
1039
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1040
+ * @example
1041
+ * ```typescript
1042
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1043
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1044
+ * if (!fWorksheet) return;
1045
+ *
1046
+ * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
1047
+ * const fRange = fWorksheet.getRange('A1:D10');
1048
+ * const rule = fWorksheet.newConditionalFormattingRule()
1049
+ * .setDuplicateValues()
1050
+ * .setBackground('#FF0000')
1051
+ * .setRanges([fRange.getRange()])
1052
+ * .build();
1053
+ * fWorksheet.addConditionalFormattingRule(rule);
1054
+ * ```
1055
+ */
1056
+ setDuplicateValues(): ConditionalFormatHighlightRuleBuilder;
1057
+ /**
1058
+ * Set rank rule.
1059
+ * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
1060
+ * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
1061
+ * @param {boolean} config.isPercent - Whether to use a percentage rank.
1062
+ * @param {number} config.value - The rank value.
1063
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1064
+ * @example
1065
+ * ```typescript
1066
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1067
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1068
+ * if (!fWorksheet) return;
1069
+ *
1070
+ * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
1071
+ * const fRange = fWorksheet.getRange('A1:D10');
1072
+ * const rule = fWorksheet.newConditionalFormattingRule()
1073
+ * .setRank({ isBottom: true, isPercent: true, value: 10 })
1074
+ * .setBackground('#FF0000')
1075
+ * .setRanges([fRange.getRange()])
1076
+ * .build();
1077
+ * fWorksheet.addConditionalFormattingRule(rule);
1078
+ * ```
1079
+ */
1080
+ setRank(config: {
1081
+ isBottom: boolean;
1082
+ isPercent: boolean;
1083
+ value: number;
1084
+ }): ConditionalFormatHighlightRuleBuilder;
1085
+ /**
1086
+ * Get the icon set mapping dictionary.
1087
+ * @returns {Record<string, string[]>} The icon set mapping dictionary.
1088
+ * @example
1089
+ * ```typescript
1090
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1091
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1092
+ * if (!fWorksheet) return;
1093
+ * console.log(fWorksheet.newConditionalFormattingRule().getIconMap()); // icons key-value map
1094
+ * ```
1095
+ */
1096
+ getIconMap(): Record<string, string[]>;
1097
+ /**
1098
+ * Set up icon set conditional formatting rule.
1099
+ * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
1100
+ * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
1101
+ * @param {boolean} config.isShowValue - Whether to show the value in the cell.
1102
+ * @returns {ConditionalFormatIconSetRuleBuilder} The conditional format icon set rule builder.
1103
+ * @example
1104
+ * ```typescript
1105
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1106
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1107
+ * if (!fWorksheet) return;
1108
+ *
1109
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
1110
+ * // The first arrow is green for values greater than 20.
1111
+ * // The second arrow is yellow for values greater than 10.
1112
+ * // The third arrow is red for values less than or equal to 10.
1113
+ * const fRange = fWorksheet.getRange('A1:D10');
1114
+ * const builder = fWorksheet.newConditionalFormattingRule();
1115
+ * console.log(builder.getIconMap()); // icons key-value map
1116
+ * const rule = builder.setIconSet({
1117
+ * iconConfigs: [
1118
+ * {
1119
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1120
+ * iconId: '0',
1121
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1122
+ * value: {
1123
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1124
+ * value: 20
1125
+ * }
1126
+ * },
1127
+ * {
1128
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1129
+ * iconId: '1',
1130
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1131
+ * value: {
1132
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1133
+ * value: 10
1134
+ * }
1135
+ * },
1136
+ * {
1137
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1138
+ * iconId: '2',
1139
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1140
+ * value: {
1141
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1142
+ * value: 10
1143
+ * }
1144
+ * }
1145
+ * ],
1146
+ * isShowValue: true,
1147
+ * })
1148
+ * .setRanges([fRange.getRange()])
1149
+ * .build();
1150
+ * fWorksheet.addConditionalFormattingRule(rule);
1151
+ * ```
1152
+ */
1153
+ setIconSet(config: {
1154
+ iconConfigs: IIconSet['config'];
1155
+ isShowValue: boolean;
1156
+ }): ConditionalFormatIconSetRuleBuilder;
1157
+ /**
1158
+ * Set color scale rule.
1159
+ * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
1160
+ * @param {number} config.index - The index of the color scale.
1161
+ * @param {string} config.color - The color for the color scale.
1162
+ * @param {IValueConfig} config.value - The value for the color scale.
1163
+ * @returns {ConditionalFormatColorScaleRuleBuilder} The conditional format color scale rule builder.
1164
+ * @example
1165
+ * ```typescript
1166
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1167
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1168
+ * if (!fWorksheet) return;
1169
+ *
1170
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
1171
+ * // The color scale is green for 0, yellow for 50, and red for 100.
1172
+ * const fRange = fWorksheet.getRange('A1:D10');
1173
+ * const rule = fWorksheet.newConditionalFormattingRule()
1174
+ * .setColorScale([
1175
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
1176
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
1177
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
1178
+ * ])
1179
+ * .setRanges([fRange.getRange()])
1180
+ * .build();
1181
+ * fWorksheet.addConditionalFormattingRule(rule);
1182
+ * ```
1183
+ */
1184
+ setColorScale(config: IColorScale['config']): ConditionalFormatColorScaleRuleBuilder;
1185
+ /**
1186
+ * Set data bar rule.
1187
+ * @param {object} config - The data bar rule settings.
1188
+ * @param {IValueConfig} config.min - The minimum value for the data bar.
1189
+ * @param {IValueConfig} config.max - The maximum value for the data bar.
1190
+ * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
1191
+ * @param {string} config.positiveColor - The color for positive values.
1192
+ * @param {string} config.nativeColor - The color for negative values.
1193
+ * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
1194
+ * @returns {ConditionalFormatDataBarRuleBuilder} The conditional format data bar rule builder.
1195
+ * @example
1196
+ * ```typescript
1197
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1198
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1199
+ * if (!fWorksheet) return;
1200
+ *
1201
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
1202
+ * // positive values are green and negative values are red.
1203
+ * const fRange = fWorksheet.getRange('A1:D10');
1204
+ * const rule = fWorksheet.newConditionalFormattingRule()
1205
+ * .setDataBar({
1206
+ * min: { type: 'num', value: -100 },
1207
+ * max: { type: 'num', value: 100 },
1208
+ * positiveColor: '#00FF00',
1209
+ * nativeColor: '#FF0000',
1210
+ * isShowValue: true
1211
+ * })
1212
+ * .setRanges([fRange.getRange()])
1213
+ * .build();
1214
+ * fWorksheet.addConditionalFormattingRule(rule);
1215
+ * ```
1216
+ */
1217
+ setDataBar(config: {
1218
+ min: IValueConfig;
1219
+ max: IValueConfig;
1220
+ isGradient?: boolean;
1221
+ positiveColor: string;
1222
+ nativeColor: string;
1223
+ isShowValue?: boolean;
1224
+ }): ConditionalFormatDataBarRuleBuilder;
1225
+ /**
1226
+ * Sets the background color for the conditional format rule's format.
1227
+ * @param {string} [color] - The background color to set. If not provided, the background color is removed.
1228
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1229
+ * @example
1230
+ * ```typescript
1231
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1232
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1233
+ * if (!fWorksheet) return;
1234
+ *
1235
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
1236
+ * const fRange = fWorksheet.getRange('A1:D10');
1237
+ * const rule = fWorksheet.newConditionalFormattingRule()
1238
+ * .whenCellEmpty()
1239
+ * .setBackground('#FF0000')
1240
+ * .setRanges([fRange.getRange()])
1241
+ * .build();
1242
+ * fWorksheet.addConditionalFormattingRule(rule);
1243
+ * ```
1244
+ */
1245
+ setBackground(color?: string): ConditionalFormatHighlightRuleBuilder;
1246
+ /**
1247
+ * Sets text bolding for the conditional format rule's format.
1248
+ * @param {boolean} isBold - Whether to bold the text.
1249
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1250
+ * @example
1251
+ * ```typescript
1252
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1253
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1254
+ * if (!fWorksheet) return;
1255
+ *
1256
+ * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
1257
+ * const fRange = fWorksheet.getRange('A1:D10');
1258
+ * const rule = fWorksheet.newConditionalFormattingRule()
1259
+ * .whenCellNotEmpty()
1260
+ * .setBold(true)
1261
+ * .setRanges([fRange.getRange()])
1262
+ * .build();
1263
+ * fWorksheet.addConditionalFormattingRule(rule);
1264
+ * ```
1265
+ */
1266
+ setBold(isBold: boolean): ConditionalFormatHighlightRuleBuilder;
1267
+ /**
1268
+ * Sets the font color for the conditional format rule's format.
1269
+ * @param {string} [color] - The font color to set. If not provided, the font color is removed.
1270
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1271
+ * @example
1272
+ * ```typescript
1273
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1274
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1275
+ * if (!fWorksheet) return;
1276
+ *
1277
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
1278
+ * const fRange = fWorksheet.getRange('A1:D10');
1279
+ * const rule = fWorksheet.newConditionalFormattingRule()
1280
+ * .whenCellNotEmpty()
1281
+ * .setFontColor('#FF0000')
1282
+ * .setRanges([fRange.getRange()])
1283
+ * .build();
1284
+ * fWorksheet.addConditionalFormattingRule(rule);
1285
+ * ```
1286
+ */
1287
+ setFontColor(color?: string): ConditionalFormatHighlightRuleBuilder;
1288
+ /**
1289
+ * Sets text italics for the conditional format rule's format.
1290
+ * @param {boolean} isItalic - Whether to italicize the text.
1291
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1292
+ * @example
1293
+ * ```typescript
1294
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1295
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1296
+ * if (!fWorksheet) return;
1297
+ *
1298
+ * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
1299
+ * const fRange = fWorksheet.getRange('A1:D10');
1300
+ * const rule = fWorksheet.newConditionalFormattingRule()
1301
+ * .whenCellNotEmpty()
1302
+ * .setItalic(true)
1303
+ * .setRanges([fRange.getRange()])
1304
+ * .build();
1305
+ * fWorksheet.addConditionalFormattingRule(rule);
1306
+ * ```
1307
+ */
1308
+ setItalic(isItalic: boolean): ConditionalFormatHighlightRuleBuilder;
1309
+ /**
1310
+ * Sets text strikethrough for the conditional format rule's format.
1311
+ * @param {boolean} isStrikethrough - Whether is strikethrough the text.
1312
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1313
+ * @example
1314
+ * ```typescript
1315
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1316
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1317
+ * if (!fWorksheet) return;
1318
+ *
1319
+ * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
1320
+ * const fRange = fWorksheet.getRange('A1:D10');
1321
+ * const rule = fWorksheet.newConditionalFormattingRule()
1322
+ * .whenCellNotEmpty()
1323
+ * .setStrikethrough(true)
1324
+ * .setRanges([fRange.getRange()])
1325
+ * .build();
1326
+ * fWorksheet.addConditionalFormattingRule(rule);
1327
+ * ```
1328
+ */
1329
+ setStrikethrough(isStrikethrough: boolean): ConditionalFormatHighlightRuleBuilder;
1330
+ /**
1331
+ * Sets text underlining for the conditional format rule's format.
1332
+ * @param {boolean} isUnderline - Whether to underline the text.
1333
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1334
+ * @example
1335
+ * ```typescript
1336
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1337
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1338
+ * if (!fWorksheet) return;
1339
+ *
1340
+ * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
1341
+ * const fRange = fWorksheet.getRange('A1:D10');
1342
+ * const rule = fWorksheet.newConditionalFormattingRule()
1343
+ * .whenCellNotEmpty()
1344
+ * .setUnderline(true)
1345
+ * .setRanges([fRange.getRange()])
1346
+ * .build();
1347
+ * fWorksheet.addConditionalFormattingRule(rule);
1348
+ * ```
1349
+ */
1350
+ setUnderline(isUnderline: boolean): ConditionalFormatHighlightRuleBuilder;
1351
+ /**
1352
+ * Sets the conditional format rule to trigger when the cell is empty.
1353
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1354
+ * @example
1355
+ * ```typescript
1356
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1357
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1358
+ * if (!fWorksheet) return;
1359
+ *
1360
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
1361
+ * const fRange = fWorksheet.getRange('A1:D10');
1362
+ * const rule = fWorksheet.newConditionalFormattingRule()
1363
+ * .whenCellEmpty()
1364
+ * .setBackground('#FF0000')
1365
+ * .setRanges([fRange.getRange()])
1366
+ * .build();
1367
+ * fWorksheet.addConditionalFormattingRule(rule);
1368
+ * ```
1369
+ */
1370
+ whenCellEmpty(): ConditionalFormatHighlightRuleBuilder;
1371
+ /**
1372
+ * Sets the conditional format rule to trigger when the cell is not empty.
1373
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1374
+ * @example
1375
+ * ```typescript
1376
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1377
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1378
+ * if (!fWorksheet) return;
1379
+ *
1380
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
1381
+ * const fRange = fWorksheet.getRange('A1:D10');
1382
+ * const rule = fWorksheet.newConditionalFormattingRule()
1383
+ * .whenCellNotEmpty()
1384
+ * .setFontColor('#FF0000')
1385
+ * .setRanges([fRange.getRange()])
1386
+ * .build();
1387
+ * fWorksheet.addConditionalFormattingRule(rule);
1388
+ * ```
1389
+ */
1390
+ whenCellNotEmpty(): ConditionalFormatHighlightRuleBuilder;
1391
+ /**
1392
+ * Sets the conditional format rule to trigger when a time period is met.
1393
+ * @param {CFTimePeriodOperator} date - The time period to check for.
1394
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1395
+ * @example
1396
+ * ```typescript
1397
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1398
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1399
+ * if (!fWorksheet) return;
1400
+ *
1401
+ * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
1402
+ * const fRange = fWorksheet.getRange('A1:D10');
1403
+ * const rule = fWorksheet.newConditionalFormattingRule()
1404
+ * .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
1405
+ * .setBackground('#FF0000')
1406
+ * .setRanges([fRange.getRange()])
1407
+ * .build();
1408
+ * fWorksheet.addConditionalFormattingRule(rule);
1409
+ * ```
1410
+ */
1411
+ whenDate(date: CFTimePeriodOperator): ConditionalFormatHighlightRuleBuilder;
1412
+ /**
1413
+ * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
1414
+ * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
1415
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1416
+ * @example
1417
+ * ```typescript
1418
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1419
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1420
+ * if (!fWorksheet) return;
1421
+ *
1422
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
1423
+ * const fRange = fWorksheet.getRange('A1:D10');
1424
+ * const rule = fWorksheet.newConditionalFormattingRule()
1425
+ * .whenFormulaSatisfied('=A1>10')
1426
+ * .setBackground('#FF0000')
1427
+ * .setRanges([fRange.getRange()])
1428
+ * .build();
1429
+ * fWorksheet.addConditionalFormattingRule(rule);
1430
+ * ```
1431
+ */
1432
+ whenFormulaSatisfied(formulaString: string): ConditionalFormatHighlightRuleBuilder;
1433
+ /**
1434
+ * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
1435
+ * @param {number} start - The lowest acceptable value.
1436
+ * @param {number} end - The highest acceptable value.
1437
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1438
+ * @example
1439
+ * ```typescript
1440
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1441
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1442
+ * if (!fWorksheet) return;
1443
+ *
1444
+ * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
1445
+ * const fRange = fWorksheet.getRange('A1:D10');
1446
+ * const rule = fWorksheet.newConditionalFormattingRule()
1447
+ * .whenNumberBetween(10, 20)
1448
+ * .setBackground('#FF0000')
1449
+ * .setRanges([fRange.getRange()])
1450
+ * .build();
1451
+ * fWorksheet.addConditionalFormattingRule(rule);
1452
+ * ```
1453
+ */
1454
+ whenNumberBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
1455
+ /**
1456
+ * Sets the conditional format rule to trigger when a number is equal to the given value.
1457
+ * @param {number} value - The sole acceptable value.
1458
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1459
+ * @example
1460
+ * ```typescript
1461
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1462
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1463
+ * if (!fWorksheet) return;
1464
+ *
1465
+ * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
1466
+ * const fRange = fWorksheet.getRange('A1:D10');
1467
+ * const rule = fWorksheet.newConditionalFormattingRule()
1468
+ * .whenNumberEqualTo(10)
1469
+ * .setBackground('#FF0000')
1470
+ * .setRanges([fRange.getRange()])
1471
+ * .build();
1472
+ * fWorksheet.addConditionalFormattingRule(rule);
1473
+ * ```
1474
+ */
1475
+ whenNumberEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
1476
+ /**
1477
+ * Sets the conditional format rule to trigger when a number is greater than the given value.
1478
+ * @param {number} value - The highest unacceptable value.
1479
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1480
+ * @example
1481
+ * ```typescript
1482
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1483
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1484
+ * if (!fWorksheet) return;
1485
+ *
1486
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
1487
+ * const fRange = fWorksheet.getRange('A1:D10');
1488
+ * const rule = fWorksheet.newConditionalFormattingRule()
1489
+ * .whenNumberGreaterThan(10)
1490
+ * .setBackground('#FF0000')
1491
+ * .setRanges([fRange.getRange()])
1492
+ * .build();
1493
+ * fWorksheet.addConditionalFormattingRule(rule);
1494
+ * ```
1495
+ */
1496
+ whenNumberGreaterThan(value: number): ConditionalFormatHighlightRuleBuilder;
1497
+ /**
1498
+ * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
1499
+ * @param {number} value - The lowest acceptable value.
1500
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1501
+ * @example
1502
+ * ```typescript
1503
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1504
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1505
+ * if (!fWorksheet) return;
1506
+ *
1507
+ * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
1508
+ * const fRange = fWorksheet.getRange('A1:D10');
1509
+ * const rule = fWorksheet.newConditionalFormattingRule()
1510
+ * .whenNumberGreaterThanOrEqualTo(10)
1511
+ * .setBackground('#FF0000')
1512
+ * .setRanges([fRange.getRange()])
1513
+ * .build();
1514
+ * fWorksheet.addConditionalFormattingRule(rule);
1515
+ * ```
1516
+ */
1517
+ whenNumberGreaterThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
1518
+ /**
1519
+ * Sets the conditional conditional format rule to trigger when a number less than the given value.
1520
+ * @param {number} value - The lowest unacceptable value.
1521
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1522
+ * @example
1523
+ * ```typescript
1524
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1525
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1526
+ * if (!fWorksheet) return;
1527
+ *
1528
+ * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
1529
+ * const fRange = fWorksheet.getRange('A1:D10');
1530
+ * const rule = fWorksheet.newConditionalFormattingRule()
1531
+ * .whenNumberLessThan(10)
1532
+ * .setBackground('#FF0000')
1533
+ * .setRanges([fRange.getRange()])
1534
+ * .build();
1535
+ * fWorksheet.addConditionalFormattingRule(rule);
1536
+ * ```
1537
+ */
1538
+ whenNumberLessThan(value: number): ConditionalFormatHighlightRuleBuilder;
1539
+ /**
1540
+ * Sets the conditional format rule to trigger when a number less than or equal to the given value.
1541
+ * @param {number} value - The highest acceptable value.
1542
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1543
+ * @example
1544
+ * ```typescript
1545
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1546
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1547
+ * if (!fWorksheet) return;
1548
+ *
1549
+ * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
1550
+ * const fRange = fWorksheet.getRange('A1:D10');
1551
+ * const rule = fWorksheet.newConditionalFormattingRule()
1552
+ * .whenNumberLessThanOrEqualTo(10)
1553
+ * .setBackground('#FF0000')
1554
+ * .setRanges([fRange.getRange()])
1555
+ * .build();
1556
+ * fWorksheet.addConditionalFormattingRule(rule);
1557
+ * ```
1558
+ */
1559
+ whenNumberLessThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
1560
+ /**
1561
+ * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
1562
+ * @param {number} start - The lowest unacceptable value.
1563
+ * @param {number} end - The highest unacceptable value.
1564
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1565
+ * @example
1566
+ * ```typescript
1567
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1568
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1569
+ * if (!fWorksheet) return;
1570
+ *
1571
+ * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
1572
+ * const fRange = fWorksheet.getRange('A1:D10');
1573
+ * const rule = fWorksheet.newConditionalFormattingRule()
1574
+ * .whenNumberNotBetween(10, 20)
1575
+ * .setBackground('#FF0000')
1576
+ * .setRanges([fRange.getRange()])
1577
+ * .build();
1578
+ * fWorksheet.addConditionalFormattingRule(rule);
1579
+ * ```
1580
+ */
1581
+ whenNumberNotBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
1582
+ /**
1583
+ * Sets the conditional format rule to trigger when a number is not equal to the given value.
1584
+ * @param {number} value - The sole unacceptable value.
1585
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1586
+ * @example
1587
+ * ```typescript
1588
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1589
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1590
+ * if (!fWorksheet) return;
1591
+ *
1592
+ * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
1593
+ * const fRange = fWorksheet.getRange('A1:D10');
1594
+ * const rule = fWorksheet.newConditionalFormattingRule()
1595
+ * .whenNumberNotEqualTo(10)
1596
+ * .setBackground('#FF0000')
1597
+ * .setRanges([fRange.getRange()])
1598
+ * .build();
1599
+ * fWorksheet.addConditionalFormattingRule(rule);
1600
+ * ```
1601
+ */
1602
+ whenNumberNotEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
1603
+ /**
1604
+ * Sets the conditional format rule to trigger when that the input contains the given value.
1605
+ * @param {string} text - The value that the input must contain.
1606
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1607
+ * @example
1608
+ * ```typescript
1609
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1610
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1611
+ * if (!fWorksheet) return;
1612
+ *
1613
+ * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
1614
+ * const fRange = fWorksheet.getRange('A1:D10');
1615
+ * const rule = fWorksheet.newConditionalFormattingRule()
1616
+ * .whenTextContains('apple')
1617
+ * .setBackground('#FF0000')
1618
+ * .setRanges([fRange.getRange()])
1619
+ * .build();
1620
+ * fWorksheet.addConditionalFormattingRule(rule);
1621
+ * ```
1622
+ */
1623
+ whenTextContains(text: string): ConditionalFormatHighlightRuleBuilder;
1624
+ /**
1625
+ * Sets the conditional format rule to trigger when that the input does not contain the given value.
1626
+ * @param {string} text - The value that the input must not contain.
1627
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1628
+ * @example
1629
+ * ```typescript
1630
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1631
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1632
+ * if (!fWorksheet) return;
1633
+ *
1634
+ * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
1635
+ * const fRange = fWorksheet.getRange('A1:D10');
1636
+ * const rule = fWorksheet.newConditionalFormattingRule()
1637
+ * .whenTextDoesNotContain('apple')
1638
+ * .setBackground('#FF0000')
1639
+ * .setRanges([fRange.getRange()])
1640
+ * .build();
1641
+ * fWorksheet.addConditionalFormattingRule(rule);
1642
+ * ```
1643
+ */
1644
+ whenTextDoesNotContain(text: string): ConditionalFormatHighlightRuleBuilder;
1645
+ /**
1646
+ * Sets the conditional format rule to trigger when that the input ends with the given value.
1647
+ * @param {string} text - Text to compare against the end of the string.
1648
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1649
+ * @example
1650
+ * ```typescript
1651
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1652
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1653
+ * if (!fWorksheet) return;
1654
+ *
1655
+ * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
1656
+ * const fRange = fWorksheet.getRange('A1:D10');
1657
+ * const rule = fWorksheet.newConditionalFormattingRule()
1658
+ * .whenTextEndsWith('.ai')
1659
+ * .setBackground('#FF0000')
1660
+ * .setRanges([fRange.getRange()])
1661
+ * .build();
1662
+ * fWorksheet.addConditionalFormattingRule(rule);
1663
+ * ```
1664
+ */
1665
+ whenTextEndsWith(text: string): ConditionalFormatHighlightRuleBuilder;
1666
+ /**
1667
+ * Sets the conditional format rule to trigger when that the input is equal to the given value.
1668
+ * @param {string} text - The sole acceptable value.
1669
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1670
+ * @example
1671
+ * ```typescript
1672
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1673
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1674
+ * if (!fWorksheet) return;
1675
+ *
1676
+ * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
1677
+ * const fRange = fWorksheet.getRange('A1:D10');
1678
+ * const rule = fWorksheet.newConditionalFormattingRule()
1679
+ * .whenTextEqualTo('apple')
1680
+ * .setBackground('#FF0000')
1681
+ * .setRanges([fRange.getRange()])
1682
+ * .build();
1683
+ * fWorksheet.addConditionalFormattingRule(rule);
1684
+ * ```
1685
+ */
1686
+ whenTextEqualTo(text: string): ConditionalFormatHighlightRuleBuilder;
1687
+ /**
1688
+ * Sets the conditional format rule to trigger when that the input starts with the given value.
1689
+ * @param {string} text - Text to compare against the beginning of the string.
1690
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1691
+ * @example
1692
+ * ```typescript
1693
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1694
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1695
+ * if (!fWorksheet) return;
1696
+ *
1697
+ * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
1698
+ * const fRange = fWorksheet.getRange('A1:D10');
1699
+ * const rule = fWorksheet.newConditionalFormattingRule()
1700
+ * .whenTextStartsWith('https://')
1701
+ * .setBackground('#FF0000')
1702
+ * .setRanges([fRange.getRange()])
1703
+ * .build();
1704
+ * fWorksheet.addConditionalFormattingRule(rule);
1705
+ * ```
1706
+ */
1707
+ whenTextStartsWith(text: string): ConditionalFormatHighlightRuleBuilder;
1708
+ }
1709
+ export {};