declare module "@univerjs/core/facade" {
  import type { FDataValidationBuilder, IFUniverSheetsDataValidationMixin, ISheetsDataValidationEventParamConfig } from "@univerjs/sheets-data-validation/facade";

  interface IFSheetsDataValidationEventNameMixin {
      /**
       * Event fired when a rule is added, deleted, or modified
       * @see {@link ISheetDataValidationChangedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.SheetDataValidationChanged, (params) => {
       *   const { origin, worksheet, workbook, changeType, oldRule, rule } = params;
       *   console.log(params);
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly SheetDataValidationChanged: 'SheetDataValidationChanged';
      /**
       * Event fired when a cell validator status is changed
       * @see {@link ISheetDataValidatorStatusChangedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.SheetDataValidatorStatusChanged, (params) => {
       *   const { worksheet, workbook, row, column, status, rule } = params;
       *   console.log(params);
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly SheetDataValidatorStatusChanged: 'SheetDataValidatorStatusChanged';
      /**
       * Event fired before a rule is added
       * @see {@link IBeforeSheetDataValidationAddEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationAdd, (params) => {
       *   const { worksheet, workbook, rule } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule addition operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationAdd: 'BeforeSheetDataValidationAdd';
      /**
       * Event fired before a rule is deleted
       * @see {@link IBeforeSheetDataValidationDeleteEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationDelete, (params) => {
       *   const { worksheet, workbook, ruleId, rule } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule deletion operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationDelete: 'BeforeSheetDataValidationDelete';
      /**
       * Event fired before all rules are deleted
       * @see {@link IBeforeSheetDataValidationDeleteAllEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationDeleteAll, (params) => {
       *   const { worksheet, workbook, rules } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule deletion operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationDeleteAll: 'BeforeSheetDataValidationDeleteAll';
      /**
       * Event fired before the criteria of a rule are updated
       * @see {@link IBeforeSheetDataValidationCriteriaUpdateEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationCriteriaUpdate, (params) => {
       *   const { worksheet, workbook, ruleId, rule, newCriteria } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule criteria update operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationCriteriaUpdate: 'BeforeSheetDataValidationCriteriaUpdate';
      /**
       * Event fired before the range of a rule is updated
       * @see {@link IBeforeSheetDataValidationRangeUpdateEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationRangeUpdate, (params) => {
       *   const { worksheet, workbook, ruleId, rule, newRanges } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule range update operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationRangeUpdate: 'BeforeSheetDataValidationRangeUpdate';
      /**
       * Event fired before the options of a rule are updated
       * @see {@link IBeforeSheetDataValidationOptionsUpdateEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetDataValidationOptionsUpdate, (params) => {
       *   const { worksheet, workbook, ruleId, rule, newOptions } = params;
       *   console.log(params);
       *
       *   // Cancel the data validation rule options update operation
       *   params.cancel = true;
       * });
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeSheetDataValidationOptionsUpdate: 'BeforeSheetDataValidationOptionsUpdate';
  }
}

declare module "@univerjs/data-validation" {
  import type { IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleOptions } from "@univerjs/core";

  type DataValidationChangeType = 'update' | 'add' | 'remove';

  type DataValidationChangeSource = 'command' | 'patched';

  interface IRuleChange {
      rule: IDataValidationRule;
      type: DataValidationChangeType;
      unitId: string;
      subUnitId: string;
      source: DataValidationChangeSource;
      updatePayload?: IUpdateRulePayload;
      oldRule?: IDataValidationRule;
  }

  enum UpdateRuleType {
      SETTING = 0,
      RANGE = 1,
      OPTIONS = 2,
      ALL = 3
  }

  interface IUpdateRuleRangePayload {
      type: UpdateRuleType.RANGE;
      payload: any[];
  }

  interface IUpdateRuleSettingPayload {
      type: UpdateRuleType.SETTING;
      payload: IDataValidationRuleBase;
  }

  interface IUpdateRuleOptionsPayload {
      type: UpdateRuleType.OPTIONS;
      payload: Partial<IDataValidationRuleOptions>;
  }

  interface IUpdateRuleAllPayload {
      type: UpdateRuleType.ALL;
      payload: Omit<IDataValidationRule, 'uid'>;
  }

  type IUpdateRulePayload = IUpdateRuleRangePayload | IUpdateRuleSettingPayload | IUpdateRuleOptionsPayload | IUpdateRuleAllPayload;
}

declare module "@univerjs/sheets-data-validation/facade" {
  import type { DataValidationOperator, DataValidationStatus, DataValidationType, IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleOptions, IRange, ISheetDataValidationRule, Nullable, ObjectMatrix } from "@univerjs/core";

  import type { IEventBase } from "@univerjs/core/facade";

  import type { DataValidationChangeType, IRuleChange } from "@univerjs/data-validation";

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

  /**
   * Builder for data validation rules. use {@link FUniver} `univerAPI.newDataValidation()` to create a new builder.
   * @example
   * ```typescript
   * // Set the data validation for cell A1 to require a value from B1:B10
   * const fWorkbook = univerAPI.getActiveWorkbook();
   * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
   * if (!fWorksheet) return;
   * const fRange = fWorksheet.getRange('B1:B2');
   * fRange.setValues([
   *   ['Yes'],
   *   ['No']
   * ]);
   *
   * const rule = univerAPI.newDataValidation()
   *   .requireValueInRange(fRange)
   *   .setOptions({
   *     allowBlank: false,
   *     showErrorMessage: true,
   *     error: 'Please enter a value from the list'
   *   })
   *   .build();
   * const cell = fWorksheet.getRange('A1');
   * cell.setDataValidation(rule);
   * ```
   * @hideconstructor
   */
  class FDataValidationBuilder {
      /**
       * Builds an FDataValidation instance based on the _rule property of the current class
       * @returns {FDataValidation} A new instance of the FDataValidation class
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number between 1 and 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      build(): FDataValidation;
      /**
       * Creates a duplicate of the current DataValidationBuilder object
       * @returns {FDataValidationBuilder} A new instance of the DataValidationBuilder class
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number between 1 and 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const builder = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   });
       * fRange.setDataValidation(builder.build());
       *
       * // Copy the builder applied to the new range F1:G10
       * const newRange = fWorksheet.getRange('F1:G10');
       * const copyBuilder = builder.copy();
       * newRange.setDataValidation(copyBuilder.build());
       * ```
       */
      copy(): FDataValidationBuilder;
      /**
       * Determines whether invalid data is allowed
       * @returns {boolean} True if invalid data is allowed, False otherwise
       * @example
       * ```typescript
       * const builder = univerAPI.newDataValidation().requireNumberBetween(1, 10);
       * console.log(builder.getAllowInvalid());
       * ```
       */
      getAllowInvalid(): boolean;
      /**
       * Gets the data validation type of the rule
       * @returns {DataValidationType | string} The data validation type
       * @example
       * ```typescript
       * const builder = univerAPI.newDataValidation();
       * console.log(builder.getCriteriaType()); // custom
       *
       * builder.requireNumberBetween(1, 10);
       * console.log(builder.getCriteriaType()); // decimal
       *
       * builder.requireValueInList(['Yes', 'No']);
       * console.log(builder.getCriteriaType()); // list
       * ```
       */
      getCriteriaType(): DataValidationType | string;
      /**
       * Gets the values used for criteria evaluation
       * @returns {[string | undefined, string | undefined, string | undefined]} An array containing the operator, formula1, and formula2 values
       * @example
       * ```typescript
       * const builder = univerAPI.newDataValidation().requireNumberBetween(1, 10);
       * const [operator, formula1, formula2] = builder.getCriteriaValues();
       * console.log(operator, formula1, formula2); // between 1 10
       *
       * builder.requireValueInList(['Yes', 'No']);
       * console.log(builder.getCriteriaValues()); // undefined Yes,No undefined
       * ```
       */
      getCriteriaValues(): [
          string | undefined,
          string | undefined,
          string | undefined
      ];
      /**
       * Gets the help text information, which is used to provide users with guidance and support
       * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value
       * @example
       * ```typescript
       * const builder = univerAPI.newDataValidation().setOptions({
       *   showErrorMessage: true,
       *   error: 'Please enter a valid value'
       * });
       * console.log(builder.getHelpText()); // 'Please enter a valid value'
       * ```
       */
      getHelpText(): string | undefined;
      /**
       * Sets the data validation rule to require that the input is a boolean value; this value is rendered as a checkbox.
       * @param {string} [checkedValue] - The value assigned to a checked box.
       * @param {string} [uncheckedValue] - The value assigned to an unchecked box.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set the data validation for cell A1:A10 to require a checkbox with default 1 and 0 values
       * const fRange = fWorksheet.getRange('A1:A10');
       * const rule = univerAPI.newDataValidation()
       *   .requireCheckbox()
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Set the data validation for cell B1:B10 to require a checkbox with 'Yes' and 'No' values
       * const fRange2 = fWorksheet.getRange('B1:B10');
       * const rule2 = univerAPI.newDataValidation()
       *   .requireCheckbox('Yes', 'No')
       *   .build();
       * fRange2.setDataValidation(rule2);
       * ```
       */
      requireCheckbox(checkedValue?: string, uncheckedValue?: string): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be after a specific date.
       * @param {Date} date - The latest unacceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date after 2025-01-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateAfter(new Date('2025-01-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['invalid', 'invalid', 'invalid', 'valid']]
       * ```
       */
      requireDateAfter(date: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be before a specific date.
       * @param {Date} date - The earliest unacceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date before 2025-01-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateBefore(new Date('2025-01-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['valid', 'valid', 'invalid', 'invalid']]
       * ```
       */
      requireDateBefore(date: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be within a specific date range.
       * @param {Date} start - The earliest acceptable date.
       * @param {Date} end - The latest acceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date between 2024-06-01 and 2025-06-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateBetween(new Date('2024-06-01'), new Date('2025-06-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['invalid', 'valid', 'valid', 'invalid']]
       * ```
       */
      requireDateBetween(start: Date, end: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be equal to a specific date.
       * @param {Date} date - The sole acceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date equal to 2025-01-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateEqualTo(new Date('2025-01-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the cell A2
       * const status = await fWorksheet.getRange('A2').getValidatorStatus();
       * console.log(status?.[0]?.[0]); // 'valid'
       *
       * // Get the validation status of the cell B2
       * const status2 = await fWorksheet.getRange('B2').getValidatorStatus();
       * console.log(status2?.[0]?.[0]); // 'invalid'
       * ```
       */
      requireDateEqualTo(date: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be not within a specific date range.
       * @param {Date} start - The earliest unacceptable date.
       * @param {Date} end - The latest unacceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date not between 2024-06-01 and 2025-06-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateNotBetween(new Date('2024-06-01'), new Date('2025-06-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['valid', 'invalid', 'invalid', 'valid']]
       * ```
       */
      requireDateNotBetween(start: Date, end: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be on or after a specific date.
       * @param {Date} date - The earliest acceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date on or after 2025-01-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateOnOrAfter(new Date('2025-01-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['invalid', 'invalid', 'valid', 'valid']]
       * ```
       */
      requireDateOnOrAfter(date: Date): FDataValidationBuilder;
      /**
       * Set the data validation type to DATE and configure the validation rules to be on or before a specific date.
       * @param {Date} date - The latest acceptable date.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some date values in the range A1:B2
       * const fRange = fWorksheet.getRange('A1:B2');
       * fRange.setValues([
       *   ['2024-01-01', '2024-12-31'],
       *   ['2025-01-01', '2025-12-31']
       * ]);
       *
       * // Create a data validation rule that requires a date on or before 2025-01-01
       * const rule = univerAPI.newDataValidation()
       *   .requireDateOnOrBefore(new Date('2025-01-01'))
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['valid', 'valid', 'valid', 'invalid']]
       * ```
       */
      requireDateOnOrBefore(date: Date): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require that the given formula evaluates to `true`.
       * @param {string} formula - The formula string that needs to be satisfied, formula result should be TRUE or FALSE, and references range will relative offset.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some values in the range A1:B2 and C1:D2
       * const cell = fWorksheet.getRange('A1:B2');
       * cell.setValues([
       *   [4, 3],
       *   [2, 1]
       * ]);
       * const fRange = fWorksheet.getRange('C1:D2');
       * fRange.setValues([
       *   [1, 2],
       *   [3, 4]
       * ]);
       *
       * // Create a data validation rule that requires the formula '=A1>2' to be satisfied
       * const rule = univerAPI.newDataValidation()
       *   .requireFormulaSatisfied('=A1>2')
       *   .setOptions({
       *     showErrorMessage: true,
       *     error: 'Please enter a value equal to A1'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validation status of the range
       * const status = await fRange.getValidatorStatus();
       * console.log(status); // [['valid', 'valid', 'invalid', 'invalid']]
       * ```
       */
      requireFormulaSatisfied(formula: string): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number that falls between, or is either of, two specified numbers.
       * @param {number} start - The lowest acceptable value.
       * @param {number} end - The highest acceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number between 1 and 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberBetween(start: number, end: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number equal to the given value.
       * @param {number} num - The sole acceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number equal to 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number equal to 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number greater than the given value.
       * @param {number} num - The highest unacceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number greater than 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberGreaterThan(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number greater than 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberGreaterThan(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number greater than or equal to the given value.
       * @param {number} num - The lowest acceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number greater than 10 or equal to 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberGreaterThanOrEqualTo(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number greater than 10 or equal to 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberGreaterThanOrEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number less than the given value.
       * @param {number} num - The lowest unacceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number less than 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberLessThan(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number less than 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberLessThan(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number less than or equal to the given value.
       * @param {number} num - The highest acceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number less than 10 or equal to 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberLessThanOrEqualTo(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number less than 10 or equal to 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberLessThanOrEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number that does not fall between, and is neither of, two specified numbers.
       * @param {number} start - The lowest unacceptable value.
       * @param {number} end - The highest unacceptable value.
       * @param {boolean} [isInteger] - Optional parameter, indicating whether the number to be verified is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number not between 1 and 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberNotBetween(1, 10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number not between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberNotBetween(start: number, end: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets the data validation rule to require a number not equal to the given value.
       * @param {number} num - The sole unacceptable value.
       * @param {boolean} [isInteger] - Indicates whether the required number is an integer.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number not equal to 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberNotEqualTo(10)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a number not equal to 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireNumberNotEqualTo(num: number, isInteger?: boolean): FDataValidationBuilder;
      /**
       * Sets a data validation rule that requires the user to enter a value from a list of specific values.
       * The list can be displayed in a dropdown, and the user can choose multiple values according to the settings.
       * @param {string[]} values - An array of acceptable values.
       * @param {boolean} [multiple] - Optional parameter indicating whether the user can select multiple values.
       * @param {boolean} [showDropdown] - Optional parameter indicating whether to display the list in a dropdown.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires the user to enter a value from the list ['Yes', 'No'] for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a value from the list'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      requireValueInList(values: string[], multiple?: boolean, showDropdown?: boolean): FDataValidationBuilder;
      /**
       * Sets a data validation rule that requires the user to enter a value within a specific range.
       * The range is defined by an FRange object, which contains the unit ID, sheet name, and cell range.
       * @param {FRange} range - An FRange object representing the range of values that the user can enter.
       * @param {boolean} [multiple] - Optional parameter indicating whether the user can select multiple values.
       * @param {boolean} [showDropdown] - Optional parameter indicating whether to display the list in a dropdown.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set the values in the range B1:B2
       * const fRange = fWorksheet.getRange('B1:B2');
       * fRange.setValues([
       *   ['Yes'],
       *   ['No']
       * ]);
       *
       * // Create a new data validation rule that requires the user to enter a value from the range B1:B2 for the range A1:A10
       * const rule = univerAPI.newDataValidation()
       *   .requireValueInRange(fRange)
       *   .setOptions({
       *     allowBlank: false,
       *     showErrorMessage: true,
       *     error: 'Please enter a value from the list'
       *   })
       *   .build();
       * const cell = fWorksheet.getRange('A1');
       * cell.setDataValidation(rule);
       * ```
       */
      requireValueInRange(range: FRange, multiple?: boolean, showDropdown?: boolean): FDataValidationBuilder;
      /**
       * Sets whether to allow invalid data and configures the error style.
       * If invalid data is not allowed, the error style will be set to STOP, indicating that data entry must stop upon encountering an error.
       * If invalid data is allowed, the error style will be set to WARNING, indicating that a warning will be displayed when invalid data is entered, but data entry can continue.
       * @param {boolean} allowInvalidData - Whether to allow invalid data.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set the data validation for cell A1:B2 to allow invalid data, so A1:B2 will display a warning when invalid data is entered
       * const fRange = fWorksheet.getRange('A1:B2');
       * const rule = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setAllowInvalid(true)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Set the data validation for cell C1:D2 to not allow invalid data, so C1:D2 will stop data entry when invalid data is entered
       * const fRange2 = fWorksheet.getRange('C1:D2');
       * const rule2 = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setAllowInvalid(false)
       *   .build();
       * fRange2.setDataValidation(rule2);
       * ```
       */
      setAllowInvalid(allowInvalidData: boolean): FDataValidationBuilder;
      /**
       * Sets whether to allow blank values.
       * @param {boolean} allowBlank - Whether to allow blank values.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * // Assume current sheet is empty data
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set the data validation for cell A1:B2 to allow blank values
       * const fRange = fWorksheet.getRange('A1:B2');
       * const rule = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setAllowBlank(true)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Set the data validation for cell C1:D2 to not allow blank values
       * const fRange2 = fWorksheet.getRange('C1:D2');
       * const rule2 = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setAllowBlank(false)
       *   .build();
       * fRange2.setDataValidation(rule2);
       * ```
       */
      setAllowBlank(allowBlank: boolean): FDataValidationBuilder;
      /**
       * Sets the options for the data validation rule.
       * @param {Partial<IDataValidationRuleOptions>} options - The options to set for the data validation rule.
       * @returns {FDataValidationBuilder} The current instance for method chaining.
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires the user to enter a value from the list ['Yes', 'No'] for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireValueInList(['Yes', 'No'])
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a value from the list'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      setOptions(options: Partial<IDataValidationRuleOptions>): this;
  }

  /**
   * @hideconstructor
   */
  class FDataValidation {
      rule: IDataValidationRule;
      /**
       * Gets whether invalid data is allowed based on the error style value
       * @returns {boolean} true if invalid data is allowed, false otherwise
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * rules.forEach((rule) => {
       *   console.log(rule, rule.getAllowInvalid());
       * });
       * ```
       */
      getAllowInvalid(): boolean;
      /**
       * Gets the data validation type of the rule
       * @returns {DataValidationType | string} The data validation type
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * rules.forEach((rule) => {
       *   console.log(rule, rule.getCriteriaType());
       * });
       * ```
       */
      getCriteriaType(): DataValidationType | string;
      /**
       * Gets the values used for criteria evaluation
       * @returns {[string | undefined, string | undefined, string | undefined]} An array containing the operator, formula1, and formula2 values
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * rules.forEach((rule) => {
       *   console.log(rule);
       *   const criteriaValues = rule.getCriteriaValues();
       *   const [operator, formula1, formula2] = criteriaValues;
       *   console.log(operator, formula1, formula2);
       * });
       * ```
       */
      getCriteriaValues(): [
          string | undefined,
          string | undefined,
          string | undefined
      ];
      /**
       * Gets the help text information, which is used to provide users with guidance and support
       * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * console.log(fRange.getDataValidation().getHelpText()); // 'Please enter a number between 1 and 10'
       * ```
       */
      getHelpText(): string | undefined;
      /**
       * Creates a new instance of FDataValidationBuilder using the current rule object
       * @returns {FDataValidationBuilder} A new FDataValidationBuilder instance with the same rule configuration
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * const builder = fRange.getDataValidation().copy();
       * const newRule = builder
       *   .requireNumberBetween(1, 5)
       *   .setOptions({
       *     error: 'Please enter a number between 1 and 5'
       *   })
       *   .build();
       * fRange.setDataValidation(newRule);
       * ```
       */
      copy(): FDataValidationBuilder;
      /**
       * Gets whether the data validation rule is applied to the worksheet
       * @returns {boolean} true if the rule is applied, false otherwise
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * rules.forEach((rule) => {
       *   console.log(rule, rule.getApplied());
       * });
       *
       * const fRange = fWorksheet.getRange('A1:B10');
       * console.log(fRange.getDataValidation()?.getApplied());
       * ```
       */
      getApplied(): boolean;
      /**
       * Gets the ranges to which the data validation rule is applied
       * @returns {FRange[]} An array of FRange objects representing the ranges to which the data validation rule is applied
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * rules.forEach((rule) => {
       *   console.log(rule);
       *   const ranges = rule.getRanges();
       *   ranges.forEach((range) => {
       *     console.log(range.getA1Notation());
       *   });
       * });
       * ```
       */
      getRanges(): FRange[];
      /**
       * Gets the unit ID of the worksheet
       * @returns {string | undefined} The unit ID of the worksheet
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:B10');
       * console.log(fRange.getDataValidation().getUnitId());
       * ```
       */
      getUnitId(): string | undefined;
      /**
       * Gets the sheet ID of the worksheet
       * @returns {string | undefined} The sheet ID of the worksheet
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:B10');
       * console.log(fRange.getDataValidation().getSheetId());
       * ```
       */
      getSheetId(): string | undefined;
      /**
       * Set Criteria for the data validation rule
       * @param {DataValidationType} type - The type of data validation criteria
       * @param {[DataValidationOperator, string, string]} values - An array containing the operator, formula1, and formula2 values
       * @param {boolean} [allowBlank] - Whether to allow blank values
       * @returns {FDataValidation} The current instance for method chaining
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Change the rule criteria to require a number between 1 and 10
       * fRange.getDataValidation().setCriteria(
       *   univerAPI.Enum.DataValidationType.DECIMAL,
       *   [univerAPI.Enum.DataValidationOperator.BETWEEN, '1', '10']
       * );
       * ```
       */
      setCriteria(type: DataValidationType, values: [
          DataValidationOperator,
          string,
          string
      ], allowBlank?: boolean): FDataValidation;
      /**
       * Set the options for the data validation rule
       * @param {Partial<IDataValidationRuleOptions>} options - The options to set for the data validation rule
       * @returns {FDataValidation} The current instance for method chaining
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Supplement the rule with additional options
       * fRange.getDataValidation().setOptions({
       *   allowBlank: true,
       *   showErrorMessage: true,
       *   error: 'Please enter a valid value'
       * });
       * ```
       */
      setOptions(options: Partial<IDataValidationRuleOptions>): FDataValidation;
      /**
       * Set the ranges to the data validation rule
       * @param {FRange[]} ranges - New ranges array
       * @returns {FDataValidation} The current instance for method chaining
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Change the range to C1:D10
       * const newRuleRange = fWorksheet.getRange('C1:D10');
       * fRange.getDataValidation().setRanges([newRuleRange]);
       * ```
       */
      setRanges(ranges: FRange[]): FDataValidation;
      /**
       * Delete the data validation rule from the worksheet
       * @returns {boolean} true if the rule is deleted successfully, false otherwise
       * @example
       * ```typescript
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Delete the data validation rule
       * fRange.getDataValidation().delete();
       * ```
       */
      delete(): boolean;
  }

  /**
   * Event interface triggered when a data validation rule is changed
   * @interface ISheetDataValidationChangedEventParams
   * @augments {IEventBase}
   */
  interface ISheetDataValidationChangedEventParams extends IEventBase {
      /** The source of the rule change */
      origin: IRuleChange;
      /** The worksheet containing the validation rule */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Type of change made to the validation rule */
      changeType: DataValidationChangeType;
      /** The previous validation rule, if it exists */
      oldRule?: IDataValidationRule;
      /** The new or modified validation rule */
      rule: FDataValidation;
  }

  /**
   * Event interface triggered when a data validation status changes
   * @interface ISheetDataValidatorStatusChangedEventParams
   * @augments {IEventBase}
   */
  interface ISheetDataValidatorStatusChangedEventParams extends IEventBase {
      /** The worksheet containing the validation */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Row index of the validated cell */
      row: number;
      /** Column index of the validated cell */
      column: number;
      /** Current validation status */
      status: DataValidationStatus;
      /** The validation rule that was checked */
      rule: FDataValidation;
  }

  /**
   * Event interface triggered before adding a new data validation rule
   * @interface IBeforeSheetDataValidationAddEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationAddEventParams extends IEventBase {
      /** The worksheet to add the validation to */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** The validation rule to be added */
      rule: ISheetDataValidationRule;
  }

  /**
   * Event interface triggered before deleting a data validation rule
   * @interface IBeforeSheetDataValidationDeleteEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationDeleteEventParams extends IEventBase {
      /** The worksheet containing the validation */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Unique identifier of the rule to be deleted */
      ruleId: string;
      /** The validation rule to be deleted */
      rule: FDataValidation;
  }

  /**
   * Event interface triggered before updating a data validation rule's criteria
   * @interface IBeforeSheetDataValidationCriteriaUpdateEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationCriteriaUpdateEventParams extends IEventBase {
      /** The worksheet containing the validation */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Unique identifier of the rule to be updated */
      ruleId: string;
      /** The current validation rule */
      rule: FDataValidation;
      /** The new criteria to be applied */
      newCriteria: IDataValidationRuleBase;
  }

  /**
   * Event interface triggered before updating a data validation rule's ranges
   * @interface IBeforeSheetDataValidationRangeUpdateEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationRangeUpdateEventParams extends IEventBase {
      /** The worksheet containing the validation */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Unique identifier of the rule to be updated */
      ruleId: string;
      /** The current validation rule */
      rule: FDataValidation;
      /** The new ranges to be applied */
      newRanges: IRange[];
  }

  /**
   * Event interface triggered before updating a data validation rule's options
   * @interface IBeforeSheetDataValidationOptionsUpdateEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationOptionsUpdateEventParams extends IEventBase {
      /** The worksheet containing the validation */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Unique identifier of the rule to be updated */
      ruleId: string;
      /** The current validation rule */
      rule: FDataValidation;
      /** The new options to be applied */
      newOptions: IDataValidationRuleOptions;
  }

  /**
   * Event interface triggered before deleting all data validation rules
   * @interface IBeforeSheetDataValidationDeleteAllEventParams
   * @augments {IEventBase}
   */
  interface IBeforeSheetDataValidationDeleteAllEventParams extends IEventBase {
      /** The worksheet containing the validations */
      worksheet: FWorksheet;
      /** The workbook instance */
      workbook: FWorkbook;
      /** Array of all validation rules to be deleted */
      rules: FDataValidation[];
  }

  interface IDataValidationEventParamConfig {
      SheetDataValidationChanged: ISheetDataValidationChangedEventParams;
      SheetDataValidatorStatusChanged: ISheetDataValidatorStatusChangedEventParams;
      BeforeSheetDataValidationAdd: IBeforeSheetDataValidationAddEventParams;
      BeforeSheetDataValidationDelete: IBeforeSheetDataValidationDeleteEventParams;
      BeforeSheetDataValidationDeleteAll: IBeforeSheetDataValidationDeleteAllEventParams;
      BeforeSheetDataValidationCriteriaUpdate: IBeforeSheetDataValidationCriteriaUpdateEventParams;
      BeforeSheetDataValidationRangeUpdate: IBeforeSheetDataValidationRangeUpdateEventParams;
      BeforeSheetDataValidationOptionsUpdate: IBeforeSheetDataValidationOptionsUpdateEventParams;
  }

  class FSheetsDataValidationEventNameMixin {
      get SheetDataValidationChanged(): 'SheetDataValidationChanged';
      get SheetDataValidatorStatusChanged(): 'SheetDataValidatorStatusChanged';
      get BeforeSheetDataValidationAdd(): 'BeforeSheetDataValidationAdd';
      get BeforeSheetDataValidationDelete(): 'BeforeSheetDataValidationDelete';
      get BeforeSheetDataValidationDeleteAll(): 'BeforeSheetDataValidationDeleteAll';
      get BeforeSheetDataValidationCriteriaUpdate(): 'BeforeSheetDataValidationCriteriaUpdate';
      get BeforeSheetDataValidationRangeUpdate(): 'BeforeSheetDataValidationRangeUpdate';
      get BeforeSheetDataValidationOptionsUpdate(): 'BeforeSheetDataValidationOptionsUpdate';
  }

  interface ISheetsDataValidationEventParamConfig {
      SheetDataValidationChanged: ISheetDataValidationChangedEventParams;
      SheetDataValidatorStatusChanged: ISheetDataValidatorStatusChangedEventParams;
      BeforeSheetDataValidationAdd: IBeforeSheetDataValidationAddEventParams;
      BeforeSheetDataValidationDelete: IBeforeSheetDataValidationDeleteEventParams;
      BeforeSheetDataValidationDeleteAll: IBeforeSheetDataValidationDeleteAllEventParams;
      BeforeSheetDataValidationCriteriaUpdate: IBeforeSheetDataValidationCriteriaUpdateEventParams;
      BeforeSheetDataValidationRangeUpdate: IBeforeSheetDataValidationRangeUpdateEventParams;
      BeforeSheetDataValidationOptionsUpdate: IBeforeSheetDataValidationOptionsUpdateEventParams;
  }

  interface IFRangeSheetsDataValidationMixin {
      /**
       * Set a data validation rule to current range. if rule is null, clear data validation rule.
       * @param {Nullable<FDataValidation>} rule data validation rule, build by `FUniver.newDataValidation`
       * @returns current range
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a data validation rule that requires a number between 1 and 10 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      setDataValidation(rule: Nullable<FDataValidation>): FRange;
      /**
       * Get first data validation rule in current range.
       * @returns {Nullable<FDataValidation>} data validation rule
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange.setDataValidation(rule);
       * console.log(fRange.getDataValidation().getCriteriaValues());
       *
       * // Change the rule criteria to require a number between 1 and 10
       * fRange.getDataValidation().setCriteria(
       *   univerAPI.Enum.DataValidationType.DECIMAL,
       *   [univerAPI.Enum.DataValidationOperator.BETWEEN, '1', '10']
       * );
       *
       * // Print the new rule criteria values
       * console.log(fRange.getDataValidation().getCriteriaValues());
       * ```
       */
      getDataValidation(): Nullable<FDataValidation>;
      /**
       * Get all data validation rules in current range.
       * @returns {FDataValidation[]} all data validation rules
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a data validation rule that requires a number equal to 20 for the range A1:B10
       * const fRange1 = fWorksheet.getRange('A1:B10');
       * const rule1 = univerAPI.newDataValidation()
       *   .requireNumberEqualTo(20)
       *   .build();
       * fRange1.setDataValidation(rule1);
       *
       * // Create a data validation rule that requires a number between 1 and 10 for the range C1:D10
       * const fRange2 = fWorksheet.getRange('C1:D10');
       * const rule2 = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .build();
       * fRange2.setDataValidation(rule2);
       *
       * // Get all data validation rules in the range A1:D10
       * const range = fWorksheet.getRange('A1:D10');
       * const rules = range.getDataValidations();
       * console.log(rules.length); // 2
       * ```
       */
      getDataValidations(): FDataValidation[];
      /**
       * Get data validation validator status for current range.
       * @returns {Promise<DataValidationStatus[][]>} matrix of validator status
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Set some values in the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * fRange.setValues([
       *   [1, 2],
       *   [3, 4],
       *   [5, 6],
       *   [7, 8],
       *   [9, 10],
       *   [11, 12],
       *   [13, 14],
       *   [15, 16],
       *   [17, 18],
       *   [19, 20]
       * ]);
       *
       * // Create a data validation rule that requires a number between 1 and 10 for the range A1:B10
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .build();
       * fRange.setDataValidation(rule);
       *
       * // Get the validator status for the cell B2
       * const status = await fWorksheet.getRange('B2').getValidatorStatus();
       * console.log(status?.[0]?.[0]); // 'valid'
       *
       * // Get the validator status for the cell B10
       * const status2 = await fWorksheet.getRange('B10').getValidatorStatus();
       * console.log(status2?.[0]?.[0]); // 'invalid'
       * ```
       */
      getValidatorStatus(): Promise<DataValidationStatus[][]>;
      /**
       * Get data validation errors for a specific range in current worksheet.
       * @returns A promise that resolves to an array of validation errors in the specified range.
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const fRange = fWorksheet.getRange('A1:B10');
       * const errors = await fRange.getDataValidationErrorAsync();
       *
       * console.log(errors);
       * ```
       */
      getDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }

  class FRangeSheetsDataValidationMixin {
      setDataValidation(rule: Nullable<FDataValidation>): FRange;
      getDataValidation(): Nullable<FDataValidation>;
      getDataValidations(): FDataValidation[];
      getValidatorStatus(): Promise<DataValidationStatus[][]>;
      getDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }

  interface IFUniverSheetsDataValidationMixin {
      /**
       * Creates a new instance of FDataValidationBuilder
       * @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a new data validation rule that requires a number between 1 and 10 fot the range A1:B10
       * const fRange = fWorksheet.getRange('A1:B10');
       * const rule = univerAPI.newDataValidation()
       *   .requireNumberBetween(1, 10)
       *   .setOptions({
       *     allowBlank: true,
       *     showErrorMessage: true,
       *     error: 'Please enter a number between 1 and 10'
       *   })
       *   .build();
       * fRange.setDataValidation(rule);
       * ```
       */
      newDataValidation(): FDataValidationBuilder;
  }

  class FUniverSheetsDataValidationMixin {
      newDataValidation(): FDataValidationBuilder;
  }

  interface IDataValidationError {
      sheetName: string;
      /** The row of the cell that triggered the error */
      row: number;
      column: number;
      /** The ID of the rule that triggered the error */
      ruleId: string;
      /** The input value that triggered the error */
      inputValue: string | number | boolean | null;
      /** The rule content snapshot (optional, to avoid tracing back to the rule after modification) */
      rule?: IDataValidationRule;
  }

  interface IFWorkbookSheetsDataValidationMixin {
      /**
       * Get data validation validator status for current workbook.
       * @returns A promise that resolves to a matrix of validator status.
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const status = await fWorkbook.getValidatorStatus();
       * console.log(status);
       * ```
       */
      getValidatorStatus(): Promise<Record<string, ObjectMatrix<Nullable<DataValidationStatus>>>>;
      /**
       * Get all data validation errors for current workbook.
       * @returns A promise that resolves to an array of validation errors.
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const errors = await fWorkbook.getAllDataValidationError();
       * console.log(errors);
       * ```
       */
      getAllDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }

  class FWorkbookSheetsDataValidationMixin {
      getValidatorStatus(): Promise<Record<string, ObjectMatrix<Nullable<DataValidationStatus>>>>;
      getAllDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }

  interface IFWorksheetDataValidationMixin {
      /**
       * Get all data validation rules in current sheet.
       * @returns {FDataValidation[]} All data validation rules
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * console.log(rules);
       * ```
       */
      getDataValidations(): FDataValidation[];
      /**
       * Get data validation validator status for current sheet.
       * @returns {Promise<ObjectMatrix<Nullable<DataValidationStatus>>>} matrix of validator status
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const status = await fWorksheet.getValidatorStatusAsync();
       * console.log(status);
       * ```
       */
      getValidatorStatusAsync(): Promise<ObjectMatrix<Nullable<DataValidationStatus>>>;
      /**
       * get data validation rule by rule id
       * @param ruleId - the rule id
       * @returns {Nullable<FDataValidation>} data validation rule
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const rules = fWorksheet.getDataValidations();
       * console.log(fWorksheet.getDataValidation(rules[0]?.rule.uid));
       * ```
       */
      getDataValidation(ruleId: string): Nullable<FDataValidation>;
      /**
       * Get all data validation errors for current worksheet.
       * @returns A promise that resolves to an array of validation errors.
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const errors = await fWorksheet.getAllDataValidationError();
       * console.log(errors);
       * ```
       */
      getAllDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }

  class FWorksheetDataValidationMixin {
      getDataValidations(): FDataValidation[];
      getValidatorStatusAsync(): Promise<ObjectMatrix<Nullable<DataValidationStatus>>>;
      getDataValidation(ruleId: string): Nullable<FDataValidation>;
      getAllDataValidationErrorAsync(): Promise<IDataValidationError[]>;
  }
}

declare module "@univerjs/core/facade" {
  import type { FDataValidationBuilder, IFUniverSheetsDataValidationMixin, ISheetsDataValidationEventParamConfig } from "@univerjs/sheets-data-validation/facade";

  interface FEventName extends IFSheetsDataValidationEventNameMixin {
  }

  interface IEventParamConfig extends ISheetsDataValidationEventParamConfig {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFRangeSheetsDataValidationMixin, IFWorkbookSheetsDataValidationMixin, IFWorksheetDataValidationMixin } from "@univerjs/sheets-data-validation/facade";

  interface FRange extends IFRangeSheetsDataValidationMixin {
  }
}

declare module "@univerjs/core/facade" {
  import type { FDataValidationBuilder, IFUniverSheetsDataValidationMixin, ISheetsDataValidationEventParamConfig } from "@univerjs/sheets-data-validation/facade";

  namespace FUniver {
  }

  interface FUniver extends IFUniverSheetsDataValidationMixin {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFRangeSheetsDataValidationMixin, IFWorkbookSheetsDataValidationMixin, IFWorksheetDataValidationMixin } from "@univerjs/sheets-data-validation/facade";

  interface FWorkbook extends IFWorkbookSheetsDataValidationMixin {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFRangeSheetsDataValidationMixin, IFWorkbookSheetsDataValidationMixin, IFWorksheetDataValidationMixin } from "@univerjs/sheets-data-validation/facade";

  interface FWorksheet extends IFWorksheetDataValidationMixin {
  }
}
