declare module "@univerjs/core/facade" {
  import { CFNumberOperator, CFTimePeriodOperator, CFValueType, IIconSetType } from "@univerjs/sheets-conditional-formatting";

  interface IFSheetsConditionalFormattingEnumMixin {
      /**
       * Conditional formatting number operator
       */
      ConditionFormatNumberOperatorEnum: typeof CFNumberOperator;
      /**
       * Conditional formatting time period operator
       */
      ConditionFormatTimePeriodOperatorEnum: typeof CFTimePeriodOperator;
      /**
       * Conditional formatting icon set type
       */
      ConditionFormatIconSetTypeEnum: typeof IIconSetType;
      /**
       * Conditional formatting value type
       */
      ConditionFormatValueTypeEnum: typeof CFValueType;
  }
}

declare module "@univerjs/sheets-conditional-formatting" {
  import type { IRange } from "@univerjs/core";

  // @ts-ignore: optional external type dependency may be absent in generated workspaces.
  import type { IStyleBase } from "@univerjs/core";

  enum CFTextOperator {
      beginsWith = "beginsWith",
      endsWith = "endsWith",
      containsText = "containsText",
      notContainsText = "notContainsText",
      equal = "equal",
      notEqual = "notEqual",
      containsBlanks = "containsBlanks",
      notContainsBlanks = "notContainsBlanks",
      containsErrors = "containsErrors",
      notContainsErrors = "notContainsErrors"
  }

  enum CFTimePeriodOperator {
      today = "today",
      yesterday = "yesterday",
      tomorrow = "tomorrow",
      last7Days = "last7Days",
      thisMonth = "thisMonth",
      lastMonth = "lastMonth",
      nextMonth = "nextMonth",
      thisWeek = "thisWeek",
      lastWeek = "lastWeek",
      nextWeek = "nextWeek"
  }

  enum CFNumberOperator {
      greaterThan = "greaterThan",
      greaterThanOrEqual = "greaterThanOrEqual",
      lessThan = "lessThan",
      lessThanOrEqual = "lessThanOrEqual",
      notBetween = "notBetween",
      between = "between",
      equal = "equal",
      notEqual = "notEqual"
  }

  enum CFRuleType {
      highlightCell = "highlightCell",
      dataBar = "dataBar",
      colorScale = "colorScale",
      iconSet = "iconSet"
  }

  enum CFSubRuleType {
      uniqueValues = "uniqueValues",
      duplicateValues = "duplicateValues",
      rank = "rank",
      text = "text",
      timePeriod = "timePeriod",
      number = "number",
      average = "average",
      formula = "formula"
  }

  enum CFValueType {
      num = "num",
      min = "min",
      max = "max",
      percent = "percent",
      percentile = "percentile",
      formula = "formula"
  }

  enum IIconSetType {
      threeArrows = "3Arrows",
      threeArrowsGray = "3ArrowsGray",
      fourArrows = "4Arrows",
      fourArrowsGray = "4ArrowsGray",
      fiveArrows = "5Arrows",
      fiveArrowsGray = "5ArrowsGray",
      threeTriangles = "3Triangles",
      threeTrafficLights1 = "3TrafficLights1",
      threeSigns = "3Signs",
      threeTrafficLights2 = "3TrafficLights2",
      fourRedToBlack = "4RedToBlack",
      fourTrafficLights = "4TrafficLights",
      threeSymbols = "3Symbols",
      threeSymbols2 = "3Symbols2",
      threeFlags = "3Flags",
      fourRating = "4Rating",
      fiveRating = "5Rating",
      fiveQuarters = "5Quarters",
      fiveFelling = "_5Felling",
      fiveBoxes = "5Boxes",
      threeStars = "3Stars",
      empty = "EMPTY_ICON_TYPE"
  }

  interface IBaseCfRule {
      type: string;
  }

  interface IHighlightCell extends IBaseCfRule {
      style: IStyleBase;
      type: CFRuleType.highlightCell;
      subType: CFSubRuleType;
  }

  interface IValueConfig {
      type: CFValueType;
      value?: number | string;
  }

  interface IUniqueValuesHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.uniqueValues;
  }

  interface IDuplicateValuesHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.duplicateValues;
  }

  interface IRankHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.rank;
      isBottom: boolean;
      isPercent: boolean;
      value: number;
  }

  interface ITextHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.text;
      operator: CFTextOperator;
      value?: string;
  }

  interface ITimePeriodHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.timePeriod;
      operator: CFTimePeriodOperator;
  }

  interface IFormulaHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.formula;
      value: string;
  }

  type INumberHighlightCell = ({
      subType: CFSubRuleType.number;
      operator: CFNumberOperator.between | CFNumberOperator.notBetween;
      value: [
          number,
          number
      ];
  } & IHighlightCell) | ({
      subType: CFSubRuleType.number;
      operator: CFNumberOperator.equal | CFNumberOperator.notEqual | CFNumberOperator.greaterThan | CFNumberOperator.greaterThanOrEqual | CFNumberOperator.lessThanOrEqual | CFNumberOperator.lessThan;
      value?: number;
  } & IHighlightCell);

  interface IAverageHighlightCell extends IHighlightCell {
      subType: CFSubRuleType.average;
      operator: CFNumberOperator.greaterThan | CFNumberOperator.greaterThanOrEqual | CFNumberOperator.lessThan | CFNumberOperator.lessThanOrEqual | CFNumberOperator.equal | CFNumberOperator.notEqual;
  }

  interface IDataBar extends IBaseCfRule {
      type: CFRuleType.dataBar;
      isShowValue: boolean;
      config: {
          min: IValueConfig;
          max: IValueConfig;
          isGradient: boolean;
          positiveColor: string;
          nativeColor: string;
      };
  }

  interface IColorScale extends IBaseCfRule {
      type: CFRuleType.colorScale;
      config: {
          index: number;
          color: string;
          value: IValueConfig;
      }[];
  }

  interface IIconSet extends IBaseCfRule {
      type: CFRuleType.iconSet;
      isShowValue: boolean;
      config: {
          operator: CFNumberOperator;
          value: IValueConfig;
          iconType: IIconSetType;
          iconId: string;
      }[];
  }

  type IConditionalFormattingRuleConfig = IColorScale | IDataBar | IUniqueValuesHighlightCell | IDuplicateValuesHighlightCell | IRankHighlightCell | ITextHighlightCell | ITimePeriodHighlightCell | INumberHighlightCell | IAverageHighlightCell | IFormulaHighlightCell | IIconSet;

  interface IConditionFormattingRule<C = IConditionalFormattingRuleConfig> {
      ranges: IRange[];
      cfId: string;
      stopIfTrue: boolean;
      rule: C;
  }

  interface IAnchor {
      id: string;
      type: 'before' | 'after' | 'self';
  }
}

declare module "@univerjs/sheets-conditional-formatting/facade" {
  import type { IRange } from "@univerjs/core";

  import type { CFTimePeriodOperator, IAnchor, IAverageHighlightCell, IColorScale, IConditionFormattingRule, IIconSet, IValueConfig } from "@univerjs/sheets-conditional-formatting";

  import type { FRange, FWorksheet } from "@univerjs/sheets/facade";

  /**
   * @ignore
   * @hideconstructor
   */
  class ConditionalFormatRuleBaseBuilder {
      /**
       * Constructs a conditional format rule from the settings applied to the builder.
       * @returns {IConditionFormattingRule} The conditional format rule.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      build(): IConditionFormattingRule;
      /**
       * Deep clone a current builder.
       * @returns {ConditionalFormatRuleBaseBuilder} A new builder with the same settings as the original.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(builder.build());
       *
       * // Copy the rule and change the background color to green for the range A1:B2.
       * const newRange = fWorksheet.getRange('A1:B2');
       * const newBuilder = builder.copy()
       *   .setBackground('#00FF00')
       *   .setRanges([newRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(newBuilder.build());
       * ```
       */
      copy(): ConditionalFormatRuleBaseBuilder;
      /**
       * Gets the scope of the current conditional format.
       * @returns {IRange[]} The ranges to which the conditional format applies.
       */
      getRanges(): IRange[];
      /**
       * Get the icon set mapping dictionary.
       * @returns {Record<string, string[]>} The icon set mapping dictionary.
       */
      getIconMap(): Record<string, string[]>;
      /**
       * Create a conditional format ID.
       * @returns {string} The conditional format ID.
       */
      createCfId(): string;
      /**
       * Sets the scope for conditional formatting.
       * @param {IRange[]} ranges - The ranges to which the conditional format applies.
       * @returns {ConditionalFormatRuleBaseBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setRanges(ranges: IRange[]): this;
  }

  /**
   * @hideconstructor
   */
  class ConditionalFormatHighlightRuleBuilder extends ConditionalFormatRuleBaseBuilder {
      /**
       * Deep clone a current builder.
       * @returns {ConditionalFormatHighlightRuleBuilder} A new builder with the same settings as the original.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(builder.build());
       *
       * // Copy the rule and change the background color to green for the range A1:B2.
       * const newRange = fWorksheet.getRange('A1:B2');
       * const newBuilder = builder.copy()
       *   .setBackground('#00FF00')
       *   .setRanges([newRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(newBuilder.build());
       * ```
       */
      copy(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set average rule.
       * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setAverage(operator: IAverageHighlightCell['operator']): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set unique values rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setUniqueValues()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setUniqueValues(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set duplicate values rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setDuplicateValues()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setDuplicateValues(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set rank rule.
       * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
       * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
       * @param {boolean} config.isPercent - Whether to use a percentage rank.
       * @param {number} config.value - The rank value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setRank({ isBottom: true, isPercent: true, value: 10 })
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setRank(config: {
          isBottom: boolean;
          isPercent: boolean;
          value: number;
      }): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the background color for the conditional format rule's format.
       * @param {string} [color] - The background color to set. If not provided, the background color is removed.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setBackground(color?: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text bolding for the conditional format rule's format.
       * @param {boolean} isBold - Whether to bold the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setBold(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setBold(isBold: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the font color for the conditional format rule's format.
       * @param {string} [color] - The font color to set. If not provided, the font color is removed.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setFontColor('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setFontColor(color?: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text italics for the conditional format rule's format.
       * @param {boolean} isItalic - Whether to italicize the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setItalic(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setItalic(isItalic: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text strikethrough for the conditional format rule's format.
       * @param {boolean} isStrikethrough - Whether is strikethrough the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setStrikethrough(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setStrikethrough(isStrikethrough: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text underlining for the conditional format rule's format.
       * @param {boolean} isUnderline - Whether to underline the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setUnderline(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setUnderline(isUnderline: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when the cell is empty.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenCellEmpty(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when the cell is not empty.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setFontColor('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenCellNotEmpty(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a time period is met.
       * @param {CFTimePeriodOperator} date - The time period to check for.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenDate(date: CFTimePeriodOperator): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
       * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenFormulaSatisfied('=A1>10')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenFormulaSatisfied(formulaString: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
       * @param {number} start - The lowest acceptable value.
       * @param {number} end - The highest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberBetween(10, 20)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is equal to the given value.
       * @param {number} value - The sole acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is greater than the given value.
       * @param {number} value - The highest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberGreaterThan(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberGreaterThan(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
       * @param {number} value - The lowest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberGreaterThanOrEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberGreaterThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional conditional format rule to trigger when a number less than the given value.
       * @param {number} value - The lowest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberLessThan(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberLessThan(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number less than or equal to the given value.
       * @param {number} value - The highest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberLessThanOrEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberLessThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
       * @param {number} start - The lowest unacceptable value.
       * @param {number} end - The highest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberNotBetween(10, 20)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberNotBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is not equal to the given value.
       * @param {number} value - The sole unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberNotEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberNotEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input contains the given value.
       * @param {string} text - The value that the input must contain.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextContains('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextContains(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input does not contain the given value.
       * @param {string} text - The value that the input must not contain.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextDoesNotContain('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextDoesNotContain(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input ends with the given value.
       * @param {string} text - Text to compare against the end of the string.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextEndsWith('.ai')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextEndsWith(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input is equal to the given value.
       * @param {string} text - The sole acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextEqualTo('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextEqualTo(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input starts with the given value.
       * @param {string} text - Text to compare against the beginning of the string.
       * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextStartsWith('https://')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextStartsWith(text: string): ConditionalFormatHighlightRuleBuilder;
  }

  class ConditionalFormatDataBarRuleBuilder extends ConditionalFormatRuleBaseBuilder {
      /**
       * Deep clone a current builder.
       * @returns {ConditionalFormatDataBarRuleBuilder} A new instance of the builder with the same settings as the original.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
       * // positive values are green and negative values are red.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule()
       *   .setDataBar({
       *     min: { type: 'num', value: -100 },
       *     max: { type: 'num', value: 100 },
       *     positiveColor: '#00FF00',
       *     nativeColor: '#FF0000',
       *     isShowValue: true
       *   })
       *   .setRanges([fRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(builder.build());
       *
       * // Copy the rule and apply it to a new range.
       * const newRange = fWorksheet.getRange('F1:F10');
       * const newBuilder = builder.copy()
       *   .setRanges([newRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(newBuilder.build());
       * ```
       */
      copy(): ConditionalFormatDataBarRuleBuilder;
      /**
       * Set data bar rule.
       * @param {{
       *         min: IValueConfig;
       *         max: IValueConfig;
       *         isGradient?: boolean;
       *         positiveColor: string;
       *         nativeColor: string;
       *         isShowValue?: boolean;
       *     }} config - The data bar rule settings.
       * @param {IValueConfig} config.min - The minimum value for the data bar.
       * @param {IValueConfig} config.max - The maximum value for the data bar.
       * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
       * @param {string} config.positiveColor - The color for positive values.
       * @param {string} config.nativeColor - The color for negative values.
       * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
       * @returns {ConditionalFormatDataBarRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
       * // positive values are green and negative values are red.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setDataBar({
       *     min: { type: 'num', value: -100 },
       *     max: { type: 'num', value: 100 },
       *     positiveColor: '#00FF00',
       *     nativeColor: '#FF0000',
       *     isShowValue: true
       *   })
       *  .setRanges([fRange.getRange()])
       * .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setDataBar(config: {
          min: IValueConfig;
          max: IValueConfig;
          isGradient?: boolean;
          positiveColor: string;
          nativeColor: string;
          isShowValue?: boolean;
      }): ConditionalFormatDataBarRuleBuilder;
  }

  class ConditionalFormatColorScaleRuleBuilder extends ConditionalFormatRuleBaseBuilder {
      /**
       * Deep clone a current builder.
       * @returns {ConditionalFormatColorScaleRuleBuilder} A new instance of the builder with the same settings as the original.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
       * // The color scale is green for 0, yellow for 50, and red for 100.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule()
       *   .setColorScale([
       *     { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
       *     { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
       *     { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
       *   ])
       *   .setRanges([fRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(builder.build());
       *
       * // Copy the rule and apply it to a new range.
       * const newRange = fWorksheet.getRange('F1:F10');
       * const newBuilder = builder.copy()
       *   .setRanges([newRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(newBuilder.build());
       * ```
       */
      copy(): ConditionalFormatColorScaleRuleBuilder;
      /**
       * Set color scale rule.
       * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
       * @param {number} config.index - The index of the color scale configuration.
       * @param {string} config.color - The color corresponding to the index of the color scale configuration.
       * @param {IValueConfig} config.value - The condition value corresponding to the index of the color scale configuration.
       * @returns {ConditionalFormatColorScaleRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
       * // The color scale is green for 0, yellow for 50, and red for 100.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setColorScale([
       *     { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
       *     { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
       *     { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
       *   ])
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setColorScale(config: IColorScale['config']): ConditionalFormatColorScaleRuleBuilder;
  }

  class ConditionalFormatIconSetRuleBuilder extends ConditionalFormatRuleBaseBuilder {
      /**
       * Deep clone a current builder.
       * @returns {ConditionalFormatIconSetRuleBuilder} A new instance of the builder with the same settings as the original.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
       * // The first arrow is green for values greater than 20.
       * // The second arrow is yellow for values greater than 10.
       * // The third arrow is red for values less than or equal to 10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule()
       *   .setIconSet({
       *     iconConfigs: [
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '0',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 20
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '1',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '2',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       }
       *     ],
       *     isShowValue: true,
       *   })
       *   .setRanges([fRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(builder.build());
       *
       * // Copy the rule and apply it to a new range.
       * const newRange = fWorksheet.getRange('F1:F10');
       * const newBuilder = builder.copy()
       *   .setRanges([newRange.getRange()]);
       * fWorksheet.addConditionalFormattingRule(newBuilder.build());
       * ```
       */
      copy(): ConditionalFormatIconSetRuleBuilder;
      /**
       * Set up icon set conditional formatting rule.
       * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
       * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
       * @param {boolean} config.isShowValue - Whether to show the value in the cell.
       * @returns {ConditionalFormatIconSetRuleBuilder} This builder for chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
       * // The first arrow is green for values greater than 20.
       * // The second arrow is yellow for values greater than 10.
       * // The third arrow is red for values less than or equal to 10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule();
       * console.log(builder.getIconMap()); // icons key-value map
       * const rule = builder.setIconSet({
       *     iconConfigs: [
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '0',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 20
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '1',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '2',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       }
       *     ],
       *     isShowValue: true,
       *   })
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setIconSet(config: {
          iconConfigs: IIconSet['config'];
          isShowValue: boolean;
      }): ConditionalFormatIconSetRuleBuilder;
  }

  /**
   * @hideconstructor
   */
  class FConditionalFormattingBuilder {
      /**
       * Constructs a conditional format rule from the settings applied to the builder.
       * @returns {IConditionFormattingRule} The conditional format rule.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberGreaterThan(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      build(): IConditionFormattingRule;
      /**
       * Set average rule.
       * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setAverage(operator: IAverageHighlightCell['operator']): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set unique values rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setUniqueValues()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setUniqueValues(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set duplicate values rule.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setDuplicateValues()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setDuplicateValues(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Set rank rule.
       * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
       * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
       * @param {boolean} config.isPercent - Whether to use a percentage rank.
       * @param {number} config.value - The rank value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setRank({ isBottom: true, isPercent: true, value: 10 })
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setRank(config: {
          isBottom: boolean;
          isPercent: boolean;
          value: number;
      }): ConditionalFormatHighlightRuleBuilder;
      /**
       * Get the icon set mapping dictionary.
       * @returns {Record<string, string[]>} The icon set mapping dictionary.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * console.log(fWorksheet.newConditionalFormattingRule().getIconMap()); // icons key-value map
       * ```
       */
      getIconMap(): Record<string, string[]>;
      /**
       * Set up icon set conditional formatting rule.
       * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
       * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
       * @param {boolean} config.isShowValue - Whether to show the value in the cell.
       * @returns {ConditionalFormatIconSetRuleBuilder} The conditional format icon set rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
       * // The first arrow is green for values greater than 20.
       * // The second arrow is yellow for values greater than 10.
       * // The third arrow is red for values less than or equal to 10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const builder = fWorksheet.newConditionalFormattingRule();
       * console.log(builder.getIconMap()); // icons key-value map
       * const rule = builder.setIconSet({
       *     iconConfigs: [
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '0',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 20
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '1',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       },
       *       {
       *         iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
       *         iconId: '2',
       *         operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
       *         value: {
       *           type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
       *           value: 10
       *         }
       *       }
       *     ],
       *     isShowValue: true,
       *   })
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setIconSet(config: {
          iconConfigs: IIconSet['config'];
          isShowValue: boolean;
      }): ConditionalFormatIconSetRuleBuilder;
      /**
       * Set color scale rule.
       * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
       * @param {number} config.index - The index of the color scale.
       * @param {string} config.color - The color for the color scale.
       * @param {IValueConfig} config.value - The value for the color scale.
       * @returns {ConditionalFormatColorScaleRuleBuilder} The conditional format color scale rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
       * // The color scale is green for 0, yellow for 50, and red for 100.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setColorScale([
       *     { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
       *     { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
       *     { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
       *   ])
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setColorScale(config: IColorScale['config']): ConditionalFormatColorScaleRuleBuilder;
      /**
       * Set data bar rule.
       * @param {{
       *         min: IValueConfig;
       *         max: IValueConfig;
       *         isGradient?: boolean;
       *         positiveColor: string;
       *         nativeColor: string;
       *         isShowValue?: boolean;
       *     }} config - The data bar rule settings.
       * @param {IValueConfig} config.min - The minimum value for the data bar.
       * @param {IValueConfig} config.max - The maximum value for the data bar.
       * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
       * @param {string} config.positiveColor - The color for positive values.
       * @param {string} config.nativeColor - The color for negative values.
       * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
       * @returns {ConditionalFormatDataBarRuleBuilder} The conditional format data bar rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
       * // positive values are green and negative values are red.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .setDataBar({
       *     min: { type: 'num', value: -100 },
       *     max: { type: 'num', value: 100 },
       *     positiveColor: '#00FF00',
       *     nativeColor: '#FF0000',
       *     isShowValue: true
       *   })
       *  .setRanges([fRange.getRange()])
       * .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setDataBar(config: {
          min: IValueConfig;
          max: IValueConfig;
          isGradient?: boolean;
          positiveColor: string;
          nativeColor: string;
          isShowValue?: boolean;
      }): ConditionalFormatDataBarRuleBuilder;
      /**
       * Sets the background color for the conditional format rule's format.
       * @param {string} [color] - The background color to set. If not provided, the background color is removed.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setBackground(color?: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text bolding for the conditional format rule's format.
       * @param {boolean} isBold - Whether to bold the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setBold(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setBold(isBold: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the font color for the conditional format rule's format.
       * @param {string} [color] - The font color to set. If not provided, the font color is removed.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setFontColor('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setFontColor(color?: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text italics for the conditional format rule's format.
       * @param {boolean} isItalic - Whether to italicize the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setItalic(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setItalic(isItalic: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text strikethrough for the conditional format rule's format.
       * @param {boolean} isStrikethrough - Whether is strikethrough the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setStrikethrough(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setStrikethrough(isStrikethrough: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets text underlining for the conditional format rule's format.
       * @param {boolean} isUnderline - Whether to underline the text.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setUnderline(true)
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      setUnderline(isUnderline: boolean): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when the cell is empty.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellEmpty()
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenCellEmpty(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when the cell is not empty.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setFontColor('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenCellNotEmpty(): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a time period is met.
       * @param {CFTimePeriodOperator} date - The time period to check for.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenDate(date: CFTimePeriodOperator): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
       * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenFormulaSatisfied('=A1>10')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenFormulaSatisfied(formulaString: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
       * @param {number} start - The lowest acceptable value.
       * @param {number} end - The highest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberBetween(10, 20)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is equal to the given value.
       * @param {number} value - The sole acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is greater than the given value.
       * @param {number} value - The highest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberGreaterThan(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberGreaterThan(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
       * @param {number} value - The lowest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberGreaterThanOrEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberGreaterThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional conditional format rule to trigger when a number less than the given value.
       * @param {number} value - The lowest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberLessThan(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberLessThan(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number less than or equal to the given value.
       * @param {number} value - The highest acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberLessThanOrEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberLessThanOrEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
       * @param {number} start - The lowest unacceptable value.
       * @param {number} end - The highest unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberNotBetween(10, 20)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberNotBetween(start: number, end: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when a number is not equal to the given value.
       * @param {number} value - The sole unacceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenNumberNotEqualTo(10)
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenNumberNotEqualTo(value: number): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input contains the given value.
       * @param {string} text - The value that the input must contain.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextContains('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextContains(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input does not contain the given value.
       * @param {string} text - The value that the input must not contain.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextDoesNotContain('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextDoesNotContain(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input ends with the given value.
       * @param {string} text - Text to compare against the end of the string.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextEndsWith('.ai')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextEndsWith(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input is equal to the given value.
       * @param {string} text - The sole acceptable value.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextEqualTo('apple')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextEqualTo(text: string): ConditionalFormatHighlightRuleBuilder;
      /**
       * Sets the conditional format rule to trigger when that the input starts with the given value.
       * @param {string} text - Text to compare against the beginning of the string.
       * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
       * const fRange = fWorksheet.getRange('A1:D10');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenTextStartsWith('https://')
       *   .setBackground('#FF0000')
       *   .setRanges([fRange.getRange()])
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      whenTextStartsWith(text: string): ConditionalFormatHighlightRuleBuilder;
  }

  interface IFRangeSheetsConditionalFormattingMixin {
      /**
       * Gets all the conditional formatting for the current range.
       * @returns {IConditionFormattingRule[]} conditional formatting rules for the current range.
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
       * const fRange = fWorksheet.getRange('A1:T100');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setRanges([fRange.getRange()])
       *   .setItalic(true)
       *   .setBackground('red')
       *   .setFontColor('green')
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       *
       * // Get all the conditional formatting rules for the range F6:H8.
       * const targetRange = fWorksheet.getRange('F6:H8');
       * const rules = targetRange.getConditionalFormattingRules();
       * console.log(rules);
       * ```
       */
      getConditionalFormattingRules(): IConditionFormattingRule[];
      /**
       * Creates a constructor for conditional formatting
       * @returns {FConditionalFormattingBuilder} The conditional formatting builder
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
       * const fRange = fWorksheet.getRange('A1:T100');
       * const rule = fRange.createConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setItalic(true)
       *   .setBackground('red')
       *   .setFontColor('green')
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * console.log(fRange.getConditionalFormattingRules());
       * ```
       */
      createConditionalFormattingRule(): FConditionalFormattingBuilder;
      /**
       * Clear the conditional rules for the range.
       * @returns {FRange} Returns the current range instance for method chaining
       * @memberof IFRangeConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:T100');
       *
       * // Clear all conditional format rules for the range
       * fRange.clearConditionalFormatRules();
       * console.log(fRange.getConditionalFormattingRules()); // []
       * ```
       */
      clearConditionalFormatRules(): FRange;
  }

  interface IFWorksheetConditionalFormattingMixin {
      /**
       * Gets all the conditional formatting for the current sheet
       * @returns {IConditionFormattingRule[]} conditional formatting rules for the current sheet
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getConditionalFormattingRules();
       * console.log(rules);
       * ```
       */
      getConditionalFormattingRules(): IConditionFormattingRule[];
      /**
       * Creates a constructor for conditional formatting
       * @returns {FConditionalFormattingBuilder} The conditional formatting builder
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
       * const fRange = fWorksheet.getRange('A1:T100');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setRanges([fRange.getRange()])
       *   .setItalic(true)
       *   .setBackground('red')
       *   .setFontColor('green')
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      newConditionalFormattingRule(): FConditionalFormattingBuilder;
      /**
       * Add a new conditional format
       * @param {IConditionFormattingRule} rule - The conditional formatting rule to add
       * @returns {FWorksheet} Returns the current worksheet instance for method chaining
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
       * const fRange = fWorksheet.getRange('A1:T100');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setRanges([fRange.getRange()])
       *   .setItalic(true)
       *   .setBackground('red')
       *   .setFontColor('green')
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       * ```
       */
      addConditionalFormattingRule(rule: IConditionFormattingRule): FWorksheet;
      /**
       * Delete conditional format according to `cfId`
       * @param {string} cfId - The conditional formatting rule id to delete
       * @returns {FWorksheet} Returns the current worksheet instance for method chaining
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getConditionalFormattingRules();
       *
       * // Delete the first rule
       * fWorksheet.deleteConditionalFormattingRule(rules[0]?.cfId);
       * ```
       */
      deleteConditionalFormattingRule(cfId: string): FWorksheet;
      /**
       * Modify the priority of the conditional format
       * @param {string} cfId - The conditional formatting rule id to move
       * @param {string} toCfId Target rule
       * @param {IAnchor['type']} [type] After the default move to the destination rule, if type = before moves to the front, the default value is after
       * @returns {FWorksheet} Returns the current worksheet instance for method chaining
       * @memberof FWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getConditionalFormattingRules();
       *
       * // Move the third rule before the first rule
       * const rule = rules[2];
       * const targetRule = rules[0];
       * fWorksheet.moveConditionalFormattingRule(rule?.cfId, targetRule?.cfId, 'before');
       * ```
       */
      moveConditionalFormattingRule(cfId: string, toCfId: string, type?: IAnchor['type']): FWorksheet;
      /**
       * Set the conditional format according to `cfId`
       * @param {string} cfId - The conditional formatting rule id to set
       * @param {IConditionFormattingRule} rule - The conditional formatting rule to set
       * @returns {FWorksheet} Returns the current worksheet instance for method chaining
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
       * const fRange = fWorksheet.getRange('A1:T100');
       * const rule = fWorksheet.newConditionalFormattingRule()
       *   .whenCellNotEmpty()
       *   .setRanges([fRange.getRange()])
       *   .setItalic(true)
       *   .setBackground('red')
       *   .setFontColor('green')
       *   .build();
       * fWorksheet.addConditionalFormattingRule(rule);
       *
       * // Modify the first rule to apply to a new range
       * const rules = fWorksheet.getConditionalFormattingRules();
       * const newRuleRange = fWorksheet.getRange('A1:D10');
       * fWorksheet.setConditionalFormattingRule(rules[0]?.cfId, { ...rules[0], ranges: [newRuleRange.getRange()] });
       * ```
       */
      setConditionalFormattingRule(cfId: string, rule: IConditionFormattingRule): FWorksheet;
      /**
       * Removes all conditional format rules from the sheet.
       * @returns {FWorksheet} Returns the current worksheet instance for method chaining
       * @memberof IFWorksheetConditionalFormattingMixin
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * fWorksheet.clearConditionalFormatRules();
       * console.log(fWorksheet.getConditionalFormattingRules()); // []
       * ```
       */
      clearConditionalFormatRules(): FWorksheet;
  }
}

declare module "@univerjs/core/facade" {
  import { CFNumberOperator, CFTimePeriodOperator, CFValueType, IIconSetType } from "@univerjs/sheets-conditional-formatting";

  interface FEnum extends IFSheetsConditionalFormattingEnumMixin {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFRangeSheetsConditionalFormattingMixin, IFWorksheetConditionalFormattingMixin } from "@univerjs/sheets-conditional-formatting/facade";

  interface FRange extends IFRangeSheetsConditionalFormattingMixin {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFRangeSheetsConditionalFormattingMixin, IFWorksheetConditionalFormattingMixin } from "@univerjs/sheets-conditional-formatting/facade";

  interface FWorksheet extends IFWorksheetConditionalFormattingMixin {
  }
}
