declare module "@univerjs/core/facade" {
  import type { IBeforeOverGridImageChangeEventParams, IBeforeOverGridImageInsertEventParams, IBeforeOverGridImageRemoveEventParams, IBeforeOverGridImageSelectEventParams, IFSheetsDrawingEnumMixin, IOverGridImageChangedEventParams, IOverGridImageInsertedEventParams, IOverGridImageRemovedEventParams, IOverGridImageSelectedEventParams } from "@univerjs/sheets-drawing/facade";

  interface IFSheetsDrawingEventNameMixin {
      /**
       * Triggered before float dom insertion.
       * @see {@link IBeforeFloatDomAddParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeFloatDomAdd, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       *   // Cancel the insertion operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeFloatDomAdd: 'BeforeFloatDomAdd';
      /**
       * Triggered after float dom insertion.
       * @see {@link IFloatDomAddedParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.FloatDomAdded, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly FloatDomAdded: 'FloatDomAdded';
      /**
       * Triggered before float dom update.
       * @see {@link IBeforeFloatDomUpdateParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeFloatDomUpdate, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       *   // Cancel the update operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeFloatDomUpdate: 'BeforeFloatDomUpdate';
      /**
       * Triggered after float dom update.
       * @see {@link IFloatDomUpdatedParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.FloatDomUpdated, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly FloatDomUpdated: 'FloatDomUpdated';
      /**
       * Triggered before float dom deletion.
       * @see {@link IBeforeFloatDomDeleteParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeFloatDomDelete, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       *   // Cancel the deletion operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeFloatDomDelete: 'BeforeFloatDomDelete';
      /**
       * Triggered after float dom deletion.
       * @see {@link IFloatDomDeletedParam}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.FloatDomDeleted, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, drawings } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly FloatDomDeleted: 'FloatDomDeleted';
      /**
       * Triggered before floating image insertion.
       * @see {@link IBeforeOverGridImageInsertEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageInsert, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, insertImageParams } = params;
       *   // Cancel the insertion operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeOverGridImageInsert: 'BeforeOverGridImageInsert';
      /**
       * Triggered after floating image insertion.
       * @see {@link IOverGridImageInsertedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.OverGridImageInserted, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, images } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly OverGridImageInserted: 'OverGridImageInserted';
      /**
       * Triggered before floating image removal.
       * @see {@link IBeforeOverGridImageRemoveEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageRemove, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, images } = params;
       *   // Cancel the removal operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeOverGridImageRemove: 'BeforeOverGridImageRemove';
      /**
       * Triggered after floating image removal.
       * @see {@link IOverGridImageRemovedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.OverGridImageRemoved, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, removeImageParams } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly OverGridImageRemoved: 'OverGridImageRemoved';
      /**
       * Triggered before floating image change.
       * @see {@link IBeforeOverGridImageChangeEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageChange, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, images } = params;
       *   // Cancel the image change
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeOverGridImageChange: 'BeforeOverGridImageChange';
      /**
       * Triggered after floating image change.
       * @see {@link IOverGridImageChangedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.OverGridImageChanged, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, images } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly OverGridImageChanged: 'OverGridImageChanged';
      /**
       * Triggered before floating image selection.
       * @see {@link IBeforeOverGridImageSelectEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageSelect, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, selectedImages, oldSelectedImages } = params;
       *   // cancel the selection operation
       *   params.cancel = true;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly BeforeOverGridImageSelect: 'BeforeOverGridImageSelect';
      /**
       * Triggered after floating image selection.
       * @see {@link IOverGridImageSelectedEventParams}
       * @example
       * ```ts
       * const disposable = univerAPI.addEvent(univerAPI.Event.OverGridImageSelected, (params) => {
       *   console.log(params);
       *   // do something
       *   const { workbook, selectedImages } = params;
       * })
       *
       * // Remove the event listener, use `disposable.dispose()`
       * ```
       */
      readonly OverGridImageSelected: 'OverGridImageSelected';
  }

  interface ISheetsDrawingEventParamConfig {
      BeforeOverGridImageChange: IBeforeOverGridImageChangeEventParams;
      OverGridImageChanged: IOverGridImageChangedEventParams;
      BeforeOverGridImageInsert: IBeforeOverGridImageInsertEventParams;
      OverGridImageInserted: IOverGridImageInsertedEventParams;
      BeforeOverGridImageRemove: IBeforeOverGridImageRemoveEventParams;
      OverGridImageRemoved: IOverGridImageRemovedEventParams;
      BeforeOverGridImageSelect: IBeforeOverGridImageSelectEventParams;
      OverGridImageSelected: IOverGridImageSelectedEventParams;
  }
}

declare module "@univerjs/sheets-drawing" {
  import type { IRotationSkewFlipTransform, Serializable } from "@univerjs/core";

  import type { IImageData } from "@univerjs/drawing";

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

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

  enum SheetDrawingAnchorType {
      /**
       * Only the position of the drawing follows the cell changes. When rows or columns are inserted or deleted, the position of the drawing changes, but the size remains the same.
       */
      Position = "0",
      /**
       * The size and position of the drawing follow the cell changes. When rows or columns are inserted or deleted, the size and position of the drawing change accordingly.
       */
      Both = "1",
      /**
       * The size and position of the drawing do not follow the cell changes. When rows or columns are inserted or deleted, the position and size of the drawing remain unchanged.
       */
      None = "2"
  }

  interface ISheetDrawingPosition extends IRotationSkewFlipTransform, ISheetOverGridPosition {
  }

  interface ISheetDrawingBase {
      sheetTransform: ISheetDrawingPosition;
      /**
       * this property is used to store the excel drawing axis alignment position, which is not always the same as the sheetTransform.
       */
      axisAlignSheetTransform: ISheetDrawingPosition;
      anchorType?: SheetDrawingAnchorType;
  }

  interface ISheetImage extends IImageData, ISheetDrawingBase {
  }

  /**
   * test type
   */
  interface ISheetShape extends IDrawingParam, ISheetDrawingBase {
  }

  interface IFloatDomData extends IDrawingParam {
      componentKey: string;
      data?: Serializable;
      allowTransform?: boolean;
      /**
       * this property is used to store the excel drawing axis alignment position, which is not always the same as the sheetTransform.
       */
      axisAlignSheetTransform: ISheetDrawingPosition;
  }

  interface ISheetFloatDom extends IFloatDomData, ISheetDrawingBase {
  }

  type ISheetDrawing = ISheetImage | ISheetShape | ISheetFloatDom;
}

declare module "@univerjs/sheets-drawing/facade" {
  import { DrawingTypeEnum, ImageSourceType } from "@univerjs/core";

  import { SheetDrawingAnchorType } from "@univerjs/sheets-drawing";

  import type { IDrawingSearch, IRotationSkewFlipTransform, ISize } from "@univerjs/core";

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

  import type { ICellOverGridPosition } from "@univerjs/sheets";

  import type { ISheetDrawing, ISheetImage } from "@univerjs/sheets-drawing";

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

  interface IFSheetsDrawingEnumMixin {
      /** Please refer to {@link DrawingTypeEnum}. */
      DrawingType: typeof DrawingTypeEnum;
      /** Please refer to {@link ImageSourceType}. */
      ImageSourceType: Omit<typeof ImageSourceType, 'UUID'>;
      /** Please refer to {@link SheetDrawingAnchorType}. */
      SheetDrawingAnchorType: typeof SheetDrawingAnchorType;
  }

  class FSheetsDrawingEnumMixin {
      get DrawingType(): typeof DrawingTypeEnum;
      get ImageSourceType(): Omit<typeof ImageSourceType, 'UUID'>;
      get SheetDrawingAnchorType(): typeof SheetDrawingAnchorType;
  }

  class FSheetsDrawingEventNameMixin {
      get BeforeFloatDomAdd(): 'BeforeFloatDomAdd';
      get FloatDomAdded(): 'FloatDomAdded';
      get BeforeFloatDomUpdate(): 'BeforeFloatDomUpdate';
      get FloatDomUpdated(): 'FloatDomUpdated';
      get BeforeFloatDomDelete(): 'BeforeFloatDomDelete';
      get FloatDomDeleted(): 'FloatDomDeleted';
      get BeforeOverGridImageChange(): 'BeforeOverGridImageChange';
      get OverGridImageChanged(): 'OverGridImageChanged';
      get BeforeOverGridImageInsert(): 'BeforeOverGridImageInsert';
      get OverGridImageInserted(): 'OverGridImageInserted';
      get BeforeOverGridImageRemove(): 'BeforeOverGridImageRemove';
      get OverGridImageRemoved(): 'OverGridImageRemoved';
      get BeforeOverGridImageSelect(): 'BeforeOverGridImageSelect';
      get OverGridImageSelected(): 'OverGridImageSelected';
  }

  interface IBeforeOverGridImageChangeParamObject {
      /**
       * Parameters of the image to be updated. {@link ISheetImage}
       */
      changeParam: Partial<ISheetImage>;
      /**
       * Instance of the image to be updated. {@link FOverGridImage}
       */
      image: FOverGridImage;
  }

  interface IBeforeOverGridImageChangeEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Collection of parameters of the images to be updated, there may be multiple images to be updated. {@link IBeforeOverGridImageChangeParamObject}
       */
      images: IBeforeOverGridImageChangeParamObject[];
  }

  interface IOverGridImageChangedEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Instances of the images after the update. {@link FOverGridImage}
       */
      images: FOverGridImage[];
  }

  interface IBeforeOverGridImageInsertEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Collection of parameters of the images to be inserted. {@link ISheetImage}
       */
      insertImageParams: ISheetImage[];
  }

  interface IOverGridImageInsertedEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Collection of instances of the images after insertion. {@link FOverGridImage}
       */
      images: FOverGridImage[];
  }

  interface IBeforeOverGridImageRemoveEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Collection of instances of the images to be removed. {@link FOverGridImage}
       */
      images: FOverGridImage[];
  }

  interface IOverGridImageRemovedEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * Collection of parameters of the images after removal. {@link ISheetImage}
       */
      removeImageParams: IDrawingSearch[];
  }

  interface IBeforeOverGridImageSelectEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * The images before selection. {@link FOverGridImage}
       */
      oldSelectedImages: FOverGridImage[];
      selectedImages: FOverGridImage[];
  }

  interface IOverGridImageSelectedEventParams extends IEventBase {
      /**
       * The workbook instance currently being operated on. {@link FWorkbook}
       */
      workbook: FWorkbook;
      /**
       * The selected images. {@link FOverGridImage}
       */
      selectedImages: FOverGridImage[];
  }

  interface IFOverGridImage extends Omit<ISheetImage, 'sheetTransform' | 'transform'>, ICellOverGridPosition, IRotationSkewFlipTransform, Required<ISize> {
  }

  /**
   * @hideconstructor
   */
  class FOverGridImageBuilder {
      /**
       * Set the initial image configuration for the image builder.
       * @param {ISheetImage} image - The image configuration
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set initial image configuration.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setImage({
       *     drawingId: '123456',
       *     drawingType: univerAPI.Enum.DrawingType.DRAWING_IMAGE,
       *     imageSourceType: univerAPI.Enum.ImageSourceType.BASE64,
       *     source: 'https://avatars.githubusercontent.com/u/61444807?s=48&v=4',
       *     unitId: fWorkbook.getId(),
       *     subUnitId: fWorksheet.getSheetId(),
       *   })
       *   .setColumn(5)
       *   .setRow(5)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setImage(image: ISheetImage): FOverGridImageBuilder;
      /**
       * Set the source of the image.
       * @param {string} source - The source of the image
       * @param {ImageSourceType} [sourceType] - The source type of the image, default is URL
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setSource(source: string): FOverGridImageBuilder;
      setSource(source: string, sourceType?: ImageSourceType): FOverGridImageBuilder;
      /**
       * Get the source of the image
       * @returns {string} The source of the image
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.toBuilder().getSource());
       * });
       * ```
       */
      getSource(): string;
      /**
       * Get the source type of the image
       * @returns {ImageSourceType} The source type of the image
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.toBuilder().getSourceType());
       * });
       * ```
       */
      getSourceType(): ImageSourceType;
      /**
       * Set the horizontal position of the image
       * @param {number} column - The column index of the image start position, start at 0
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setColumn(column: number): FOverGridImageBuilder;
      /**
       * Set the vertical position of the image
       * @param {number} row - The row index of the image start position, start at 0
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setRow(row: number): FOverGridImageBuilder;
      /**
       * Set the horizontal offset of the image
       * @param {number} offset - The column offset of the image start position, pixel unit
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell and horizontal offset is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setColumnOffset(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setColumnOffset(offset: number): FOverGridImageBuilder;
      /**
       * Set the vertical offset of the image
       * @param {number} offset - The row offset of the image start position, pixel unit
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell and vertical offset is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setRowOffset(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setRowOffset(offset: number): FOverGridImageBuilder;
      /**
       * Set the width of the image
       * @param {number} width - The width of the image, pixel unit
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, width is 120px and height is 50px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setWidth(120)
       *   .setHeight(50)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setWidth(width: number): FOverGridImageBuilder;
      /**
       * Set the height of the image
       * @param {number} height - The height of the image, pixel unit
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, width is 120px and height is 50px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setWidth(120)
       *   .setHeight(50)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setHeight(height: number): FOverGridImageBuilder;
      /**
       * Set the anchor type of the image, whether the position and size change with the cell
       * @param {SheetDrawingAnchorType} anchorType - The anchor type of the image
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // image1 position is start from A6 cell, anchor type is Position.
       * // Only the position of the drawing follows the cell changes. When rows or columns are inserted or deleted, the position of the drawing changes, but the size remains the same.
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(0)
       *   .setRow(5)
       *   .setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Position)
       *   .buildAsync();
       *
       * // image2 position is start from C6 cell, anchor type is Both.
       * // The size and position of the drawing follow the cell changes. When rows or columns are inserted or deleted, the size and position of the drawing change accordingly.
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(2)
       *   .setRow(5)
       *   .setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Both)
       *   .buildAsync();
       *
       * // image3 position is start from E6 cell, anchor type is None.
       * // The size and position of the drawing do not follow the cell changes. When rows or columns are inserted or deleted, the position and size of the drawing remain unchanged.
       * const image3 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(4)
       *   .setRow(5)
       *   .setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.None)
       *   .buildAsync();
       *
       * // insert images into the sheet
       * fWorksheet.insertImages([image1, image2, image3]);
       *
       * // after 2 seconds, set the row height of the 5th row to 100px and insert a row before the 5th row.
       * // then observe the position and size changes of the images.
       * setTimeout(() => {
       *   fWorksheet.setRowHeight(5, 100).insertRowBefore(5);
       * }, 2000);
       * ```
       */
      setAnchorType(anchorType: SheetDrawingAnchorType): FOverGridImageBuilder;
      /**
       * Set the cropping region of the image by defining the top edges, thereby displaying the specific part of the image you want.
       * @param {number} top - The number of pixels to crop from the top of the image
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, top crop is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setCropTop(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setCropTop(top: number): FOverGridImageBuilder;
      /**
       * Set the cropping region of the image by defining the left edges, thereby displaying the specific part of the image you want.
       * @param {number} left - The number of pixels to crop from the left side of the image
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, left crop is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setCropLeft(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setCropLeft(left: number): FOverGridImageBuilder;
      /**
       * Set the cropping region of the image by defining the bottom edges, thereby displaying the specific part of the image you want.
       * @param {number} bottom - The number of pixels to crop from the bottom of the image
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, bottom crop is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setCropBottom(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setCropBottom(bottom: number): FOverGridImageBuilder;
      /**
       * Set the cropping region of the image by defining the right edges, thereby displaying the specific part of the image you want.
       * @param {number} right - The number of pixels to crop from the right side of the image
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, right crop is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setCropRight(10)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setCropRight(right: number): FOverGridImageBuilder;
      /**
       * Set the rotation angle of the image
       * @param {number} angle - Degree of rotation of the image, for example, 90, 180, 270, etc.
       * @returns {FOverGridImageBuilder} The `FOverGridImageBuilder` for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, rotate 90 degrees.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setRotate(90)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      setRotate(angle: number): FOverGridImageBuilder;
      setUnitId(unitId: string): FOverGridImageBuilder;
      setSubUnitId(subUnitId: string): FOverGridImageBuilder;
      buildAsync(): Promise<ISheetImage>;
  }

  /**
   * @hideconstructor
   */
  class FOverGridImage {
      /**
       * Get the id of the image
       * @returns {string} The id of the image
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.getId());
       * });
       * ```
       */
      getId(): string;
      /**
       * Get the drawing type of the image
       * @returns {DrawingTypeEnum} The drawing type of the image
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.getType());
       * });
       * ```
       */
      getType(): DrawingTypeEnum;
      /**
       * Remove the image from the sheet
       * @returns {boolean} true if the image is removed successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.remove();
       * console.log(result);
       * ```
       */
      remove(): boolean;
      /**
       * Convert the image to a FOverGridImageBuilder
       * @returns {FOverGridImageBuilder} The builder FOverGridImageBuilder
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.toBuilder().getSource());
       * });
       * ```
       */
      toBuilder(): FOverGridImageBuilder;
      /**
       * Set the source of the image
       * @param {string} source - The source of the image
       * @returns {boolean} true if the source is set successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4');
       * console.log(result);
       * ```
       */
      setSource(source: string): boolean;
      /**
       * Set the source of the image, change image display.
       * @param {string} source - The source of the image
       * @param {ImageSourceType} [sourceType] - The source type of the image, default is URL
       * @returns {boolean} true if the source is set successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL);
       * console.log(result);
       * ```
       */
      setSource(source: string, sourceType?: ImageSourceType): boolean;
      /**
       * Set the position of the image
       * @param {number} row - The row index of the image start position
       * @param {number} column - The column index of the image start position
       * @returns {boolean} true if the position is set successfully, otherwise false
       * @example
       * ```ts
       * // set the position of the image, the start position is F6 cell.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setPositionAsync(5, 5);
       * console.log(result);
       * ```
       */
      setPositionAsync(row: number, column: number): Promise<boolean>;
      /**
       * @param {number} row - The row index of the image start position
       * @param {number} column - The column index of the image start position
       * @param {number} rowOffset - The row offset of the image start position, pixel unit
       * @param {number} columnOffset - The column offset of the image start position, pixel unit
       * @returns {boolean} true if the position is set successfully, otherwise false
       * @example
       * ```ts
       * // set the position of the image, the start position is F6 cell, and the offset is 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setPositionAsync(5, 5, 10, 10);
       * console.log(result);
       * ```
       */
      setPositionAsync(row: number, column: number, rowOffset?: number, columnOffset?: number): Promise<boolean>;
      /**
       * Set the size of the image
       * @param {number} width - The width of the image, pixel unit
       * @param {number} height - The height of the image, pixel unit
       * @returns {boolean} true if the size is set successfully, otherwise false
       * @example
       * ```ts
       * // set the image width 120px and height 50px
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setSizeAsync(120, 50);
       * console.log(result);
       * ```
       */
      setSizeAsync(width: number, height: number): Promise<boolean>;
      /**
       * Set the cropping region of the image by defining the top, bottom, left, and right edges, thereby displaying the specific part of the image you want.
       * @param {number} top - The number of pixels to crop from the top of the image
       * @param {number} left - The number of pixels to crop from the left side of the image
       * @param {number} bottom - The number of pixels to crop from the bottom of the image
       * @param {number} right - The number of pixels to crop from the right side of the image
       * @returns {boolean} true if the crop is set successfully, otherwise false
       * @example
       * ```ts
       * // set the crop of the image, top 10px, left 10px, bottom 10px, right 10px.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setCrop(10, 10, 10, 10);
       * console.log(result);
       * ```
       */
      setCrop(top?: number, left?: number, bottom?: number, right?: number): boolean;
      /**
       * Set the rotation angle of the image
       * @param {number} angle - Degree of rotation of the image, for example, 90, 180, 270, etc.
       * @returns {boolean} true if the rotation is set successfully, otherwise false
       * @example
       * ```ts
       * // set 90 degrees rotation of the image
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setRotate(90);
       * console.log(result);
       * ```
       */
      setRotate(angle: number): boolean;
      /**
       * Move the image layer forward by one level
       * @returns {boolean} true if the image is moved forward successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setForward();
       * console.log(result);
       * ```
       */
      setForward(): boolean;
      /**
       * Move the image layer backward by one level
       * @returns {boolean} true if the image is moved backward successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setBackward();
       * console.log(result);
       * ```
       */
      setBackward(): boolean;
      /**
       * Move the image layer to the bottom layer
       * @returns {boolean} true if the image is moved to the bottom layer successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setBack();
       * console.log(result);
       * ```
       */
      setBack(): boolean;
      /**
       * Move the image layer to the top layer
       * @returns {boolean} true if the image is moved to the top layer successfully, otherwise false
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       * const result = image?.setFront();
       * console.log(result);
       * ```
       */
      setFront(): boolean;
  }

  class FUniverSheetsDrawingMixin {
  }

  interface IFWorksheetDrawingMixin {
      /**
       * Insert an image to the sheet
       * @param {string} url - The image url
       * @returns true if the image is inserted successfully
       * @example
       * ```ts
       * // Insert an image to the sheet, default position is A1
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const result = await fWorksheet.insertImage('https://avatars.githubusercontent.com/u/61444807?s=48&v=4');
       * console.log(result);
       * ```
       */
      insertImage(url: string): Promise<boolean>;
      /**
       * @param {string} url - The image url
       * @param {number} column - The column index to insert the image
       * @param {number} row - The row index to insert the image
       * @returns True if the image is inserted successfully
       * @example
       * ```ts
       * // Insert an image to the sheet, position is F6
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const result = await fWorksheet.insertImage('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', 5, 5);
       * console.log(result);
       * ```
       */
      insertImage(url: string, column: number, row: number): Promise<boolean>;
      /**
       * @param {string} url - The image url
       * @param {number} column - The column index to insert the image
       * @param {number} row - The row index to insert the image
       * @param {number} offsetX - The column offset, pixel unit
       * @param {number} offsetY - The row offset, pixel unit
       * @returns True if the image is inserted successfully
       * @example
       * ```ts
       * // Insert an image to the sheet, position is F6, offset is 10px
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const result = await fWorksheet.insertImage('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', 5, 5, 10, 10);
       * console.log(result);
       * ```
       */
      insertImage(url: string, column: number, row: number, offsetX: number, offsetY: number): Promise<boolean>;
      insertImage(url: IFBlobSource): Promise<boolean>;
      insertImage(url: IFBlobSource, column: number, row: number): Promise<boolean>;
      insertImage(url: IFBlobSource, column: number, row: number, offsetX: number, offsetY: number): Promise<boolean>;
      insertImage(url: IFBlobSource | string, column: number, row: number, offsetX: number, offsetY: number): Promise<boolean>;
      /**
       * Insert images to the sheet
       * @param {ISheetImage[]} sheetImages - The images to insert
       * @returns {FWorksheet} The FWorksheet instance for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, width is 500px, height is 300px
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setWidth(500)
       *   .setHeight(300)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       *
       * // update the image width to 100px and height to 50px
       * setTimeout(async () => {
       *   const imageBuilder = fWorksheet.getImageById(image.drawingId).toBuilder();
       *   const newImage = await imageBuilder.setWidth(100).setHeight(50).buildAsync();
       *   fWorksheet.updateImages([newImage]);
       * }, 4000);
       * ```
       */
      insertImages(sheetImages: ISheetImage[]): FWorksheet;
      /**
       * Get all images of the sheet.
       * @returns {FOverGridImage[]} The FOverGridImage instances
       * @example
       * ```ts
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getImages();
       * images.forEach((image) => {
       *   console.log(image, image.getId());
       * });
       * ```
       */
      getImages(): FOverGridImage[];
      /**
       * Get image by drawing id
       * @param {string} id - The drawing id of the image
       * @returns {FOverGridImage | null} The FOverGridImage instance
       * @example
       * ```ts
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImageById('xxxx');
       * console.log(image);
       * ```
       */
      getImageById(id: string): FOverGridImage | null;
      /**
       * Delete images from the sheet
       * @param {FOverGridImage[]} sheetImages - The images to delete
       * @returns {FWorksheet} The FWorksheet instance for chaining
       * @example
       * ```ts
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = fWorksheet.getImages()[0];
       *
       * // Delete the first image of the sheet
       * fWorksheet.deleteImages([image]);
       * ```
       */
      deleteImages(sheetImages: FOverGridImage[]): FWorksheet;
      /**
       * Update images to the sheet
       * @param {ISheetImage[]} sheetImages - The images to update
       * @returns {FWorksheet} The FWorksheet instance for chaining
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, width is 500px, height is 300px
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setWidth(500)
       *   .setHeight(300)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       *
       * // update the image width to 100px and height to 50px after 4 seconds
       * setTimeout(async () => {
       *   const imageBuilder = fWorksheet.getImageById(image.drawingId).toBuilder();
       *   const newImage = await imageBuilder.setWidth(100).setHeight(50).buildAsync();
       *   fWorksheet.updateImages([newImage]);
       * }, 4000);
       * ```
       */
      updateImages(sheetImages: ISheetImage[]): FWorksheet;
      /**
       * Get the current selected images.
       * @returns {FOverGridImage[]} The FOverGridImage instances
       * @example
       * ```ts
       * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const images = fWorksheet.getActiveImages();
       * images.forEach((image) => {
       *   console.log(image, image.getId());
       * });
       * ```
       */
      getActiveImages(): FOverGridImage[];
      /**
       * Create a new over grid image builder.
       * @returns {FOverGridImageBuilder} The FOverGridImageBuilder instance
       * @example
       * ```ts
       * // create a new image builder and set image source.
       * // then build `ISheetImage` and insert it into the sheet, position is start from F6 cell, width is 500px, height is 300px
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const image = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(5)
       *   .setRow(5)
       *   .setWidth(500)
       *   .setHeight(300)
       *   .buildAsync();
       * fWorksheet.insertImages([image]);
       * ```
       */
      newOverGridImage(): FOverGridImageBuilder;
      /**
       * Group drawings on the current sheet.
       * @param {string[]} drawingIds - The drawing ids to group. At least two drawings are required.
       * @param {string} [groupId] - Optional group drawing id. If omitted, a new id will be generated.
       * @returns {string | null} The group id if the operation succeeds, otherwise null.
       * @example
       * ```ts
       * // Group two over-grid images on the active sheet.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getActiveSheet();
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(1)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(3)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * fWorksheet.insertImages([image1, image2]);
       * const groupId = fWorksheet.groupDrawings([image1.drawingId, image2.drawingId]);
       * console.log(groupId);
       * ```
       */
      groupDrawings(drawingIds: string[], groupId?: string): string | null;
      /**
       * Ungroup drawing groups on the current sheet.
       * @param {string[]} groupIds - The group drawing ids to ungroup.
       * @returns {boolean} true if the operation succeeds, otherwise false.
       * @example
       * ```ts
       * // Group two images, then ungroup the generated group.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getActiveSheet();
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(1)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(3)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * fWorksheet.insertImages([image1, image2]);
       * const groupId = fWorksheet.groupDrawings([image1.drawingId, image2.drawingId]);
       * if (groupId) {
       *   const result = fWorksheet.ungroupDrawings([groupId]);
       *   console.log(result);
       * }
       * ```
       */
      ungroupDrawings(groupIds: string[]): boolean;
      /**
       * Get children of a drawing group on the current sheet.
       * @param {string} groupId - The group drawing id.
       * @param {boolean} [recursive] - Whether to return all descendants.
       * @returns {ISheetDrawing[]} The child drawings.
       * @example
       * ```ts
       * // Get the direct children of a drawing group.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getActiveSheet();
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(1)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(3)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * fWorksheet.insertImages([image1, image2]);
       * const groupId = fWorksheet.groupDrawings([image1.drawingId, image2.drawingId]);
       * if (groupId) {
       *   const children = fWorksheet.getDrawingGroupChildren(groupId);
       *   console.log(children.map((drawing) => drawing.drawingId));
       * }
       * ```
       */
      getDrawingGroupChildren(groupId: string, recursive?: boolean): ISheetDrawing[];
      /**
       * Get the parent group of a drawing on the current sheet.
       * @param {string} drawingId - The child drawing id.
       * @returns {ISheetDrawing | null} The parent group drawing, or null if the drawing is not grouped.
       * @example
       * ```ts
       * // Get the parent group of a drawing.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getActiveSheet();
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(1)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(3)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * fWorksheet.insertImages([image1, image2]);
       * fWorksheet.groupDrawings([image1.drawingId, image2.drawingId]);
       * const parentGroup = fWorksheet.getDrawingParentGroup(image1.drawingId);
       * console.log(parentGroup?.drawingId);
       * ```
       */
      getDrawingParentGroup(drawingId: string): ISheetDrawing | null;
      /**
       * Returns whether a drawing is inside a group on the current sheet.
       * @param {string} drawingId - The drawing id.
       * @returns {boolean} true if the drawing has a parent group.
       * @example
       * ```ts
       * // Check whether a drawing is inside a group.
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getActiveSheet();
       * const image1 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(1)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * const image2 = await fWorksheet.newOverGridImage()
       *   .setSource('https://avatars.githubusercontent.com/u/61444807?s=48&v=4', univerAPI.Enum.ImageSourceType.URL)
       *   .setColumn(3)
       *   .setRow(1)
       *   .setWidth(100)
       *   .setHeight(100)
       *   .buildAsync();
       * fWorksheet.insertImages([image1, image2]);
       * fWorksheet.groupDrawings([image1.drawingId, image2.drawingId]);
       * const isGrouped = fWorksheet.isDrawingGrouped(image1.drawingId);
       * console.log(isGrouped);
       * ```
       */
      isDrawingGrouped(drawingId: string): boolean;
  }

  class FWorksheetDrawingMixin {
      insertImage(url: IFBlobSource | string, column?: number, row?: number, offsetX?: number, offsetY?: number): Promise<boolean>;
      insertImages(sheetImages: ISheetImage[]): FWorksheet;
      deleteImages(sheetImages: FOverGridImage[]): FWorksheet;
      getImages(): FOverGridImage[];
      getImageById(id: string): FOverGridImage | null;
      getActiveImages(): FOverGridImage[];
      updateImages(sheetImages: ISheetImage[]): FWorksheet;
      newOverGridImage(): FOverGridImageBuilder;
      groupDrawings(drawingIds: string[], groupId?: string): string | null;
      ungroupDrawings(groupIds: string[]): boolean;
      getDrawingGroupChildren(groupId: string, recursive?: boolean): ISheetDrawing[];
      getDrawingParentGroup(drawingId: string): ISheetDrawing | null;
      isDrawingGrouped(drawingId: string): boolean;
  }
}

declare module "@univerjs/core/facade" {
  import type { IBeforeOverGridImageChangeEventParams, IBeforeOverGridImageInsertEventParams, IBeforeOverGridImageRemoveEventParams, IBeforeOverGridImageSelectEventParams, IFSheetsDrawingEnumMixin, IOverGridImageChangedEventParams, IOverGridImageInsertedEventParams, IOverGridImageRemovedEventParams, IOverGridImageSelectedEventParams } from "@univerjs/sheets-drawing/facade";

  interface FEnum extends IFSheetsDrawingEnumMixin {
  }
}

declare module "@univerjs/core/facade" {
  import type { IBeforeOverGridImageChangeEventParams, IBeforeOverGridImageInsertEventParams, IBeforeOverGridImageRemoveEventParams, IBeforeOverGridImageSelectEventParams, IFSheetsDrawingEnumMixin, IOverGridImageChangedEventParams, IOverGridImageInsertedEventParams, IOverGridImageRemovedEventParams, IOverGridImageSelectedEventParams } from "@univerjs/sheets-drawing/facade";

  interface FEventName extends IFSheetsDrawingEventNameMixin {
  }

  interface IEventParamConfig extends ISheetsDrawingEventParamConfig {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFWorksheetDrawingMixin } from "@univerjs/sheets-drawing/facade";

  interface FWorksheet extends IFWorksheetDrawingMixin {
  }
}
