declare module "@univerjs-pro/engine-shape" {
  /**
   * Shape fill type enum
   * Currently, PatternFill and PictureFill are not supported, but we define them for future use, if will be treat as Nofill currently.
   */
  enum ShapeFillEnum {
      NoFill = 1,
      SolidFill = 2,
      GradientFill = 3,
      PatternFill = 4,
      PictureFill = 5
  }

  enum ShapeGradientTypeEnum {
      Linear = 1,
      Radial = 2,
      Angular = 3,
      Diamond = 4
  }

  /**
   * Shape line type enum
   * This enum is used to define the line fill type (no line, solid, gradient)
   */
  enum ShapeLineTypeEnum {
      NoLine = 1,
      SolidLine = 2,
      GradientLine = 3
  }

  /**
   * Shape operator enum, it used to define the shape geometry
   */
  enum ShapeOperatorEnum {
      Val = "val",
      Pin = "pin",
      AddSub = "addSub",
      MulDiv = "mulDiv",
      AddDiv = "addDiv",
      Abs = "abs",
      Max = "max",
      Min = "min",
      IfElse = "ifelse",
      Sin = "sin",
      Cos = "cos",
      Tan = "tan",
      Atan2 = "at2",
      Mod = "mod",
      Sqrt = "sqrt",
      Cat2 = "cat2",
      Sat2 = "sat2"
  }

  /**
   * Shape type enum, it defines almost excel supported shape types
   */
  enum ShapeTypeEnum {
      None = "none",
      Rect = "rect",
      RoundRect = "roundRect",
      Ellipse = "ellipse",
      Diamond = "diamond",
      Triangle = "triangle",
      RightTriangle = "rtTriangle",
      Parallelogram = "parallelogram",
      Trapezoid = "trapezoid",
      Hexagon = "hexagon",// 这个跟Heptagon 不一样的点在于调节点
      Octagon = "octagon",
      Plus = "plus",
      Star5 = "star5",
      Star6 = "star6",
      Star7 = "star7",
      Star8 = "star8",
      Star10 = "star10",
      Star12 = "star12",
      Star16 = "star16",
      Star24 = "star24",
      Star32 = "star32",
      Round1Rect = "round1Rect",
      Round2SameRect = "round2SameRect",
      Round2DiagRect = "round2DiagRect",
      Snip1Rect = "snip1Rect",
      SnipRoundRect = "snipRoundRect",
      Snip2SameRect = "snip2SameRect",
      Snip2DiagRect = "snip2DiagRect",
      Plaque = "plaque",
      Frame = "frame",
      HalfFrame = "halfFrame",
      Corner = "corner",
      DiagStripe = "diagStripe",
      Chord = "chord",
      Arc = "arc",
      LeftCircularArrow = "leftCircularArrow",
      LeftRightCircularArrow = "leftRightCircularArrow",
      SwooshArrow = "swooshArrow",
      LeftRightRibbon = "leftRightRibbon",
      Heptagon = "heptagon",
      HomePlate = "homePlate",
      RightArrow = "rightArrow",
      LeftArrow = "leftArrow",
      UpArrow = "upArrow",
      DownArrow = "downArrow",
      LeftRightArrow = "leftRightArrow",
      UpDownArrow = "upDownArrow",
      QuadArrow = "quadArrow",
      LeftRightUpArrow = "leftRightUpArrow",
      BentArrow = "bentArrow",
      UturnArrow = "uturnArrow",
      LeftUpArrow = "leftUpArrow",
      BentUpArrow = "bentUpArrow",
      CurvedRightArrow = "curvedRightArrow",
      CurvedLeftArrow = "curvedLeftArrow",
      CurvedUpArrow = "curvedUpArrow",
      CurvedDownArrow = "curvedDownArrow",
      StripedRightArrow = "stripedRightArrow",
      NotchedRightArrow = "notchedRightArrow",
      Pentagon = "pentagon",
      Chevron = "chevron",
      RightArrowCallout = "rightArrowCallout",
      DownArrowCallout = "downArrowCallout",
      LeftArrowCallout = "leftArrowCallout",
      UpArrowCallout = "upArrowCallout",
      LeftRightArrowCallout = "leftRightArrowCallout",
      QuadArrowCallout = "quadArrowCallout",
      CircularArrow = "circularArrow",
      MathPlus = "mathPlus",
      MathMinus = "mathMinus",
      MathMultiply = "mathMultiply",
      MathDivide = "mathDivide",
      MathEqual = "mathEqual",
      MathNotEqual = "mathNotEqual",
      FlowchartProcess = "flowChartProcess",
      FlowchartAlternateProcess = "flowChartAlternateProcess",
      FlowchartDecision = "flowChartDecision",
      FlowChartInputOutput = "flowChartInputOutput",
      FlowchartPredefinedProcess = "flowChartPredefinedProcess",
      FlowchartInternalStorage = "flowChartInternalStorage",
      FlowchartDocument = "flowChartDocument",
      FlowchartMultiDocument = "flowChartMultidocument",
      FlowchartTerminator = "flowChartTerminator",
      FlowchartPreparation = "flowChartPreparation",
      FlowchartManualInput = "flowChartManualInput",
      FlowchartManualOperation = "flowChartManualOperation",
      FlowchartConnector = "flowChartConnector",
      FlowchartOffPageConnector = "flowChartOffpageConnector",
      FlowchartPunchedCard = "flowChartPunchedCard",
      FlowchartPunchedTape = "flowChartPunchedTape",
      FlowchartSummingJunction = "flowChartSummingJunction",
      FlowchartOr = "flowChartOr",
      FlowchartCollate = "flowChartCollate",
      FlowchartSort = "flowChartSort",
      FlowchartExtract = "flowChartExtract",
      FlowchartMerge = "flowChartMerge",
      FlowchartOnlineStorage = "flowChartOnlineStorage",
      FlowchartDelay = "flowChartDelay",
      FlowchartMagneticTape = "flowChartMagneticTape",
      FlowchartMagneticDisk = "flowChartMagneticDisk",
      FlowchartMagneticDrum = "flowChartMagneticDrum",
      FlowchartDisplay = "flowChartDisplay",
      WedgeRectCallout = "wedgeRectCallout",
      WedgeRoundRectCallout = "wedgeRoundRectCallout",
      WedgeEllipseCallout = "wedgeEllipseCallout",
      CloudCallout = "cloudCallout",
      BorderCallout1 = "borderCallout1",
      BorderCallout2 = "borderCallout2",
      BorderCallout3 = "borderCallout3",
      AccentCallout1 = "accentCallout1",
      AccentCallout2 = "accentCallout2",
      AccentCallout3 = "accentCallout3",
      Callout1 = "callout1",
      Callout2 = "callout2",
      Callout3 = "callout3",
      AccentBorderCallout1 = "accentBorderCallout1",
      AccentBorderCallout2 = "accentBorderCallout2",
      AccentBorderCallout3 = "accentBorderCallout3",
      Ribbon = "ribbon",
      Ribbon2 = "ribbon2",
      EllipseRibbon = "ellipseRibbon",
      EllipseRibbon2 = "ellipseRibbon2",
      VerticalScroll = "verticalScroll",
      HorizontalScroll = "horizontalScroll",
      Wave = "wave",
      DoubleWave = "doubleWave",
      Cube = "cube",
      Can = "can",
      LightningBolt = "lightningBolt",
      Heart = "heart",
      Sun = "sun",
      Moon = "moon",
      SmileyFace = "smileyFace",
      IrregularSeal1 = "irregularSeal1",
      IrregularSeal2 = "irregularSeal2",
      FoldedCorner = "foldedCorner",
      Bevel = "bevel",
      Donut = "donut",
      NoSmoking = "noSmoking",
      BlockArc = "blockArc",
      Teardrop = "teardrop",
      PieWedge = "pieWedge",
      Pie = "pie",
      Funnel = "funnel",
      Gear6 = "gear6",
      Gear9 = "gear9",
      Decagon = "decagon",
      Dodecagon = "dodecagon",
      CornerTabs = "cornerTabs",
      LeftBrace = "leftBrace",
      RightBrace = "rightBrace",
      LeftBracket = "leftBracket",
      RightBracket = "rightBracket",
      ActionButtonBackPrevious = "actionButtonBackPrevious",
      ActionButtonForwardNext = "actionButtonForwardNext",
      ActionButtonBeginning = "actionButtonBeginning",
      ActionButtonEnd = "actionButtonEnd",
      ActionButtonHome = "actionButtonHome",
      ActionButtonInformation = "actionButtonInformation",
      ActionButtonReturn = "actionButtonReturn",
      ActionButtonMovie = "actionButtonMovie",
      ActionButtonDocument = "actionButtonDocument",
      ActionButtonSound = "actionButtonSound",
      ActionButtonHelp = "actionButtonHelp",
      ActionButtonBlank = "actionButtonBlank",
      BracePair = "bracePair",
      BracketPair = "bracketPair",
      ChartPlus = "chartPlus",
      ChartStar = "chartStar",
      ChartX = "chartX",
      Cloud = "cloud",
      FlowChartOfflineStorage = "flowChartOfflineStorage",
      LineInv = "lineInv",
      NonIsoscelesTrapezoid = "nonIsoscelesTrapezoid",
      PlaqueTabs = "plaqueTabs",
      SquareTabs = "squareTabs",
      Star4 = "star4",
      UpDownArrowCallout = "upDownArrowCallout",
      Line = "line",
      StraightConnector1 = "straightConnector1",
      BentConnector2 = "bentConnector2",
      BentConnector3 = "bentConnector3",
      BentConnector4 = "bentConnector4",
      BentConnector5 = "bentConnector5",
      CurvedConnector2 = "curvedConnector2",
      CurvedConnector3 = "curvedConnector3",
      CurvedConnector4 = "curvedConnector4",
      CurvedConnector5 = "curvedConnector5"
  }

  /**
   * Shape line style enums
   * This enum is used define basic shape stroke style or line shape stroke style
   */
  enum ShapeLineDashEnum {
      Solid = 1,
      RoundDot = 2,
      SquareDot = 3,
      Dash = 4,
      DashDot = 5,
      LongDash = 6,
      LongDashDot = 7,
      LongDashDotDot = 8
  }

  /**
   * The line cap type of shape line style or basic shape line stroke style
   */
  enum ShapeLineCapEnum {
      Flat = 1,
      Round = 2,
      Square = 3
  }

  /**
   * The line join type of shape line style or basic shape line stroke style
   */
  enum ShapeLineJoinEnum {
      Miter = 1,
      Round = 2,
      Bevel = 3
  }

  /**
   * The arrow type of connector line shape
   */
  enum ShapeArrowTypeEnum {
      None = 0,
      Arrow = 1,
      OpenArrow = 2,
      DiamondArrow = 3,
      StealthArrow = 4,
      OvalArrow = 5
  }

  enum ShapeArrowSizeEnum {
      Small = 1,
      Medium = 2,
      Large = 3
  }

  /**
   * Shape sketch (hand-drawn) style enum.
   * Controls how strongly the stroke is perturbed to look like a hand-drawn line.
   *
   * - None      – regular vector stroke, no perturbation
   * - Curved    – very slight smooth waviness
   * - Freehand  – moderate irregular deformation
   * - HandDrawn – heavy rough deformation rendered in two overlapping passes
   */
  enum ShapeSketchTypeEnum {
      None = 1,
      Curved = 2,
      Freehand = 3,
      HandDrawn = 4
  }

  /**
   * The type of image data source
   */
  enum ImageSourceTypeEnum {
      /**
       * The image source is a URL, for example: https://avatars.githubusercontent.com/u/61444807?s=48&v=4
       */
      URL = "URL",
      /**
       * The image source is a UUID, this ID is generated by the Univer image hosting service. For specific generation rules, please refer to the Univer image hosting service API documentation.
       */
      UUID = "UUID",
      /**
       * The image source is BASE64, for example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB7ZJ...
       */
      BASE64 = "BASE64"
  }

  /**
   * The image fill mode when ShapeFillEnum is PictureFill
   */
  enum ImageFillModeEnum {
      Stretch = 1,
      /**
       * Tile: The image is repeated (tiled) to fill the shape's area.
       */
      Tile = 2
  }

  /**
   * GdContext 用来计算 OOXML Shape 的 Geometry Definitions (gd)
   * 包含：
   *  - 基本绘制尺寸（宽 w、高 h）
   *  - 固定点位（左 l、右 r、顶 t、底 b、中心等）
   *  - 调整值（adjust values）
   *  - 临时计算缓存
   *  - gd 公式系统需要的数学方法
   *
   * 所有值都按 Office 的规则：1000 = 1px 的 EMU 转换前坐标系。
   * 公式计算遵循 OOXML 的 ST_AdjCoordinate 体系。
   */
  interface IGdContextBase {
      /**
       * shape 的最终显示宽度（OOXML 使用的坐标值，非 CSS 像素）
       * 例如：Excel 中 w = 100000 表示宽度 100%。
       */
      w: number;
      /**
       * shape 的最终显示高度
       */
      h: number;
      /**
       * w / 2，OOXML 常用
       */
      wd2: number;
      /**
       * h / 2，常用
       */
      hd2: number;
      /**
       * 左侧（一般为 0）
       */
      l: number;
      /**
       * 顶部（一般为 0）
       */
      t: number;
      /**
       * 右侧 = w
       */
      r: number;
      /**
       * 底部 = h
       */
      b: number;
      /**
       * 垂直中心 = h / 2
       */
      vc: number;
      /**
       * 水平中心 = w / 2
       */
      hc: number;
      wd3: number;
      wd4: number;
      wd5: number;
      wd6: number;
      wd8: number;
      wd10: number;
      hd3: number;
      hd4: number;
      hd5: number;
      hd6: number;
      hd8: number;
      hd10: number;
      wd32: number;
      hd32: number;
      /**
       * circle division by 2 (180° in DrawingML angle unit)
       */
      cd2: number;
      /**
       * circle division by 4 (90° in DrawingML angle unit)
       */
      cd4: number;
      /**
       * circle division by 8 (45° in DrawingML angle unit)
       */
      cd8: number;
      /**
       * circle division by 16 (22.5° in DrawingML angle unit)
       */
      cd16: number;
      /**
       * shortest side of the shape (w and h)
       */
      ss: number;
      /**
       * longest side of the shape (w and h)
       */
      ls: number;
      ssd2: number;
      ssd4: number;
      ssd6: number;
      ssd8: number;
      ssd16: number;
      ssd32: number;
      lsd2: number;
      lsd4: number;
      lsd8: number;
      lsd16: number;
      lsd32: number;
  }

  interface IGdContext extends IGdContextBase {
      [key: string]: number | undefined;
      x0?: number;
      x1?: number;
      x2?: number;
      x3?: number;
      x4?: number;
      x5?: number;
      x6?: number;
      x7?: number;
      x8?: number;
      x9?: number;
      x10?: number;
      x11?: number;
      x12?: number;
      x13?: number;
      x14?: number;
      x15?: number;
      x16?: number;
      x17?: number;
      x18?: number;
      x23?: number;
      x24?: number;
      x25?: number;
      y1?: number;
      y2?: number;
      y3?: number;
      y4?: number;
      y5?: number;
      y6?: number;
      y7?: number;
      y8?: number;
      y9?: number;
      y10?: number;
      y11?: number;
      y12?: number;
      y13?: number;
      y14?: number;
      y15?: number;
      y16?: number;
      y17?: number;
      y18?: number;
      y24?: number;
      sx1?: number;
      sx2?: number;
      sx3?: number;
      sx4?: number;
      sx5?: number;
      sx6?: number;
      sx7?: number;
      sx8?: number;
      sx9?: number;
      sx10?: number;
      sx11?: number;
      sx12?: number;
      sx13?: number;
      sx14?: number;
      sx15?: number;
      sx16?: number;
      /**
       * g5–g8 are vertically symmetric guideline values used in many preset shapes.
       * They represent positions above/below the vertical center (vc) using offsets.
       *
       * g5：vc 上方 g3 距离
       * g6：vc 下方 g3 距离
       * g7：vc 上方 g4 距离
       * g8：vc 下方 g4 距离
       *
       * These are commonly used to build arcs, eyes, mouth curves, or rounded corners
       * in shapes such as smileyFace, cloud, heart, blockArrows.
       *
       * g5–g8用于构造图形的上下对称控制点，例如笑脸的眼睛位置、嘴巴曲线、
       * 或者箭头、云朵等的圆角结构。
       */
      g2?: number;
      g3?: number;
      g4?: number;
      g5?: number;
      g6?: number;
      g7?: number;
      g8?: number;
      g9?: number;
      g10?: number;
      g11?: number;
      g12?: number;
      g13?: number;
      g14?: number;
      g15?: number;
      g16?: number;
      g17?: number;
      g18?: number;
      g19?: number;
      g20?: number;
      g21?: number;
      g22?: number;
      g23?: number;
      g24?: number;
      g25?: number;
      g26?: number;
      sy1?: number;
      sy2?: number;
      sy3?: number;
      sy4?: number;
      sy5?: number;
      sy6?: number;
      sy7?: number;
      sy8?: number;
      sy9?: number;
      sy10?: number;
      sy11?: number;
      sy12?: number;
      sy13?: number;
      sy14?: number;
      sy15?: number;
      sy16?: number;
      dx?: number;
      dx1?: number;
      dx2?: number;
      dx3?: number;
      dx4?: number;
      dx5?: number;
      dx6?: number;
      dy?: number;
      dy1?: number;
      dy2?: number;
      dy3?: number;
      idx?: number;
      il?: number;
      ir?: number;
      idy?: number;
      it?: number;
      ib?: number;
      wR?: number;
      hR?: number;
      tx1?: number;
      tx2?: number;
      bx1?: number;
      bx2?: number;
      by1?: number;
      d?: number;
      tdx?: number;
      bdx?: number;
      ilx?: number;
      irx?: number;
      lx?: number;
      lx1: number;
      ly1: number;
      lx2: number;
      ly2: number;
      rx?: number;
      rx1: number;
      rx2: number;
      rx3: number;
      rx4: number;
      rx5: number;
      rx6: number;
      ry: number;
      ry1: number;
      ry2: number;
      ly?: number;
      ly3?: number;
      ly4?: number;
      ry3?: number;
      ry4?: number;
      a: number;
      a1: number;
      a2: number;
      a3?: number;
      ang1?: number;
      maxAdj1?: number;
      maxAdj2?: number;
      maxAdj3?: number;
      q1?: number;
      stAng: number;
      swAng: number;
      dxI: number;
      dyI: number;
      xE: number;
      yE: number;
      xD: number;
      yD: number;
      rw2: number;
      rh2: number;
      istAng: number;
      iswAng: number;
      xBp: number;
      yBp: number;
      xA: number;
      yA: number;
      xGp: number;
      yGp: number;
      xF: number;
      yF: number;
      rw1: number;
      rh1: number;
      stAng0: number;
      swAng0: number;
      xL: number;
      yL: number;
      xKp: number;
      yKp: number;
      st2: number;
      xC: number;
      yC: number;
      xJp: number;
      yJp: number;
      aI?: number;
      th?: number;
      aw2?: number;
      th2?: number;
      dh2?: number;
      ah?: number;
      bw?: number;
      bh?: number;
      bs?: number;
      maxAdj4?: number;
      a4?: number;
      bd?: number;
      bd3?: number;
      bd2?: number;
      q2?: number;
      q3?: number;
      minAdj5?: number;
      a5?: number;
      cx?: number;
      cx1?: number;
      cy1?: number;
      aw?: number;
      dh?: number;
      mswAng?: number;
      ix?: number;
      iy?: number;
      dang2?: number;
      swAng2?: number;
      swAng3?: number;
      stAng3?: number;
      q4?: number;
      q5?: number;
      q6?: number;
      q7?: number;
      q8?: number;
      q9?: number;
      q10?: number;
      q11?: number;
      q12?: number;
      q13?: number;
      q14?: number;
      mswAng2?: number;
      stAng2?: number;
      hf?: number;
      vf?: number;
      swd2?: number;
      shd2?: number;
      svc?: number;
      xB?: number;
      yB?: number;
      yG?: number;
      yI?: number;
      yH?: number;
      rad?: number;
      drx?: number;
      dry?: number;
      dlx?: number;
      dly?: number;
      yWave1?: number;
      yWave2?: number;
      yWave3?: number;
      yWave4?: number;
      yWave5?: number;
      yWave6?: number;
      xWave1?: number;
      xWave2?: number;
      xOff1?: number;
      xOff2?: number;
      xOff3?: number;
      yOff1?: number;
      xt?: number;
      yt?: number;
      xr?: number;
      yr?: number;
      xb?: number;
      yb?: number;
      xl?: number;
      yl?: number;
      u1?: number;
      u2?: number;
      v2?: number;
      xPos?: number;
      yPos?: number;
      stAng1?: number;
      cy3?: number;
      cx2?: number;
      rh?: number;
      cx5?: number;
      cy4?: number;
      cy6?: number;
      cx4?: number;
      cy7?: number;
      ch?: number;
      ch2?: number;
      ch4?: number;
      ox1?: number;
      oy1?: number;
      ox2?: number;
      oy2?: number;
      x19?: number;
      g18w?: number;
      swAng1?: number;
      swAng4?: number;
      swAng5?: number;
      iwd2?: number;
      ihd2?: number;
      dr?: number;
      g27?: number;
      g28?: number;
      g29?: number;
      g30?: number;
      g31?: number;
      g32?: number;
      g33?: number;
      g34?: number;
      g35?: number;
      g36?: number;
      g37?: number;
      g38?: number;
      g39?: number;
      g40?: number;
      g41?: number;
      g42?: number;
      g43?: number;
      g44?: number;
      g45?: number;
      g46?: number;
      g47?: number;
      g48?: number;
      rh3?: number;
      rw3?: number;
      da?: number;
      rw?: number;
      xA1?: number;
      yA1?: number;
      xB1?: number;
      yB1?: number;
      xC1?: number;
      yC1?: number;
      xD1?: number;
      yD1?: number;
      bD1?: number;
      yD2?: number;
      bD2?: number;
      yB3?: number;
      xA6?: number;
      yD3?: number;
      bD3?: number;
      xB4?: number;
      yC2?: number;
      xC4?: number;
      yB2?: number;
      xD4?: number;
      yA2?: number;
      bD4?: number;
      xB5?: number;
      xC5?: number;
      xD5?: number;
      bD5?: number;
      xE6?: number;
      xF6?: number;
      yC6?: number;
      xD6?: number;
      yD6?: number;
      bD6?: number;
      xB2?: number;
      xC2?: number;
      xD2?: number;
      xB3?: number;
      xC3?: number;
      xD3?: number;
      yB4?: number;
      yC4?: number;
      yD4?: number;
      yA4?: number;
      xB6?: number;
      yC3?: number;
      xC6?: number;
      yA3?: number;
      xB7?: number;
      xC7?: number;
      xD7?: number;
      bD7?: number;
      xB8?: number;
      xC8?: number;
      xD8?: number;
      bD8?: number;
      xE9?: number;
      yC9?: number;
      xF9?: number;
      xD9?: number;
      yD9?: number;
      bD9?: number;
      xP1?: number;
      yP1?: number;
      xP2?: number;
      yP2?: number;
      g0w?: number;
  }

  type IGdContextKey = keyof IGdContext;

  type ShapeOperatorValue = [
      ShapeOperatorEnum,
      ...Array<string | number>
  ];

  type PathCommandType = 'M' | 'L' | 'C' | 'Q' | 'A' | 'z';

  /** Individual path command with its parameters */
  interface IPathCommand {
      /** Command type */
      command: PathCommandType;
      /** Command points/parameters */
      points: Array<IGdContextKey | number>;
      center?: [
          IGdContextKey | number,
          IGdContextKey | number,
          boolean
      ];
      /** Start position of this command segment */
      start?: {
          x: number;
          y: number;
      };
      /** Calculated length of this path segment */
      pathLength?: number;
  }

  /** Single path definition for shape rendering */
  interface IShapePath {
      /** Virtual canvas width (default: shape width) - used for coordinate system scaling */
      w?: number;
      /** Virtual canvas height (default: shape height) - used for coordinate system scaling */
      h?: number;
      /** Fill mode */
      fill?: 'none' | 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess' | 'evenodd';
      /** Stroke mode */
      stroke?: boolean;
      /** Whether extrusion is allowed (3D) */
      extrusionOk?: boolean;
      /**
       * Path data - can be either:
       * 1. SVG path string (e.g., "M 0 0 L 100 100")
       * 2. Parsed data array for direct rendering
       */
      data?: string;
      /** Parsed path data array (alternative to data string) */
      dataArray?: IPathCommand[];
  }

  type ShapeTextDirection = 'horz' | 'vert' | 'vert270' | 'wordArtVert' | 'eaVert' | 'mongolianVert' | 'wordArtVertRtl';

  interface IShapeTextAlign {
      isHorizontal: boolean;
      textDirection?: ShapeTextDirection;
  }

  interface IShapeTextRectPadding {
      left: number;
      top: number;
      right: number;
      bottom: number;
  }

  interface IShapeText extends IShapeTextAlign {
      isRichText: false;
      text?: string;
      color?: string;
      fontFamily?: string;
      fontSize?: number;
      bold?: boolean;
      italic?: boolean;
      underline?: boolean;
  }

  interface ICustomShapeTextData extends IShapeTextAlign {
      dataModel?: unknown;
  }

  /**
   * This interface defines the shape data structure , and this part will save in json
   */
  interface IBasicShapeData {
      shapeType?: ShapeTypeEnum;
      isTextBox?: boolean;
      fill?: {
          color?: string;
          fillType?: ShapeFillEnum;
          opacity?: number;
          gradientType?: ShapeGradientTypeEnum;
          gradientAngle?: number;
          gradientStops?: Array<{
              position: number;
              color: string;
              opacity?: number;
          }>;
          /**
           * Image fill source, can be a URL or base64 data URI. When fillType is 'image', this specifies the image to use for filling the shape.
           */
          fillImageSource?: string;
          /**
           * Image source type for fillImageSource
           */
          fillImageSourceType?: ImageSourceTypeEnum;
          /**
           * Image fill mode, defines how the image is applied to the shape. The options include:Stretch & Tile.
           * Defaults to Stretch when not specified.
           */
          imageFillMode?: ImageFillModeEnum;
          /**
           * The stretch fill rect defines the portion of the shape's bounding box that the image should be stretched to fill. This is used when imageFillMode is set to Stretch. The values are typically in percentage (0-100%) of the shape's dimensions, allowing for flexible scaling of the fill image within the shape.
           */
          stretchFillRect?: {
              left: number;
              top: number;
              bottom: number;
              right: number;
          };
          /**
           * The crop rect of image, the unit of value is percentage.
           */
          srcRect?: {
              left: number;
              top: number;
              bottom: number;
              right: number;
          };
          imageTile?: {
              scaleX?: number;
              scaleY?: number;
              offsetX?: number;
              offsetY?: number;
              alignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
          };
          /**
           * The opacity of the fill image, ranging from 0 (completely transparent) to 1 (completely opaque).
           */
          imageOpacity?: number;
          /**
           * Whether the fill image should rotate with the shape. The default value is false, meaning the image will maintain its orientation regardless of the shape's rotation.
           */
          imageRotateWithShape?: boolean;
      };
      stroke?: IShapeLineStyle;
      adjustValues?: Record<string, number>;
      isCustom?: boolean;
      customGeometry?: IPresetShapeConfig;
      shapeText?: IShapeText | ICustomShapeTextData;
      /**
       * Text box inset used to calculate the editable/rendered text rect.
       * Values use the same drawing units as the shape rect.
       */
      textRectPadding?: IShapeTextRectPadding;
  }

  interface ICxnShapeData extends IBasicShapeData {
      points?: Array<{
          x: number;
          y: number;
      }>;
      relation?: IShapeRelation;
      ln?: IShapeLineStyle & {
          startArrow?: {
              type?: ShapeArrowTypeEnum;
              size?: ShapeArrowSizeEnum;
          };
          endArrow?: {
              type?: ShapeArrowTypeEnum;
              size?: ShapeArrowSizeEnum;
          };
      };
  }

  type IShapeData = IBasicShapeData | ICxnShapeData;

  interface IPresetShapeConfig {
      /** Adjustment values for shape parameters, each value typically ranges from 0 to 100000 */
      adjustValues?: Record<string, ShapeOperatorValue>;
      /** Guide definitions - formulas for calculating shape geometry */
      gd?: Record<string, ShapeOperatorValue>;
      gdKeyList?: string[];
      /** Adjustment handles - defines how users can modify the shape */
      ahLst?: Array<IShapeAdjustItem>;
      /** Connection sites for connecting lines to the shape */
      cxnLst?: Array<{
          /** Angle in degrees (cd4 = 90°, cd2 = 180°, 3cd4 = 270°) */
          ang: string | number;
          /** X coordinate */
          x?: string | number;
          /** Y coordinate */
          y?: string | number;
      }>;
      /** Text rectangle definition */
      rect?: {
          /** Left position */
          l: string | number;
          /** Top position */
          t: string | number;
          /** Right position */
          r: string | number;
          /** Bottom position */
          b: string | number;
      };
      /**
       * Path list - can have multiple paths for complex shapes
       * For example: one for fill, one for stroke, one for shadow
       */
      pathLst?: IShapePath[];
  }

  interface IShapePoint {
      x: number;
      y: number;
  }

  interface IShapeAdjustItem {
      /** Handle type: XY or polar */
      type: 'ahXY' | 'ahPolar';
      /** Guide reference for X or radius */
      gdRefX?: string;
      /** Guide reference for radius ， 控制半径*/
      gdRefR?: string;
      /** Min/Max values for X or radius */
      minX?: string | number;
      maxX?: string | number;
      minR?: string | number;
      maxR?: string | number;
      /** Guide reference for Y or angle */
      gdRefY?: string;
      /** Guide reference for angle， 控制角度 */
      gdRefAng?: string;
      /** Min/Max values for Y or angle */
      minY?: string | number;
      maxY?: string | number;
      minAng?: string | number;
      maxAng?: string | number;
      /** Position (for ahXY) or polar coordinates (for ahPolar) */
      pos: {
          x: string | number;
          y: string | number;
      };
  }

  interface IShapeRelationItem {
      shapeId: string;
      cxnIndex: number;
  }

  /**
   * Shape relation interface for connecting shapes
   * from: starting shape and connection point index
   * to: ending shape and connection point index
   */
  interface IShapeRelation {
      from?: IShapeRelationItem;
      to?: IShapeRelationItem;
  }

  interface IShapeLineStyle {
      color?: string;
      width?: number;
      opacity?: number;
      cornerRadius?: number;
      dashType?: ShapeLineDashEnum;
      capType?: ShapeLineCapEnum;
      lineJoinType?: ShapeLineJoinEnum;
      lineStrokeType?: ShapeLineTypeEnum;
      /**
       * Hand-drawn / sketch style.  Defaults to `ShapeSketchTypeEnum.None`.
       */
      sketchType?: ShapeSketchTypeEnum;
  }
}

declare module "@univerjs-pro/sheets-shape/facade" {
  import type { ICxnShapeData, IShapeData, IShapePoint, IShapeRelationItem, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeTypeEnum } from "@univerjs-pro/engine-shape";

  /**
   * The connector shape builder. It extends `FShape` and adds connector-specific properties
   * such as start/end arrow types and sizes. Use `fWorksheet.newConnector()` to create a new connector builder.
   *
   * @example
   * ```ts
   * const fWorkbook = univerAPI.getActiveWorkbook();
   * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
   * if (!fWorksheet) return;
   *
   * // Create a straight connector with arrows
   * const connectorInfo = fWorksheet.newConnector()
   *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
   *   .setPosition(1, 1, 0, 0)
   *   .setWidth(200)
   *   .setHeight(100)
   *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
   *   .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
   *   .setStrokeColor('#000000')
   *   .setStrokeWidth(2)
   *   .build();
   * await fWorksheet.insertShape(connectorInfo);
   * ```
   */
  class FConnectorShape extends FShape {
      /**
       * @property {ICxnShapeData} shapeData The connector shape data containing line styles, arrow settings, and connection info.
       */
      shapeData: ICxnShapeData;
      setShapeType(shapeType: ShapeTypeEnum): this;
      /**
       * Sets the start arrow type of the connector line.
       * @param {ShapeArrowTypeEnum} arrowType The arrow type for the start point. Which can be found from `univerAPI.Enum.ShapeArrowTypeEnum`.
       * @returns {FConnectorShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      setStartArrowType(arrowType: ShapeArrowTypeEnum): this;
      /**
       * Sets the end arrow type of the connector line.
       * @param {ShapeArrowTypeEnum} arrowType The arrow type for the end point. Which can be found from `univerAPI.Enum.ShapeArrowTypeEnum`.
       * @returns {FConnectorShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.StealthArrow)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      setEndArrowType(arrowType: ShapeArrowTypeEnum): this;
      /**
       * Sets the start arrow size of the connector line.
       * @param {ShapeArrowSizeEnum} arrowSize The arrow size for the start point.
       * @returns {FConnectorShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.OvalArrow)
       *   .setStartArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Large)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(200)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      setStartArrowSize(arrowSize: ShapeArrowSizeEnum): this;
      /**
       * Sets the end arrow size of the connector line.
       * @param {ShapeArrowSizeEnum} arrowSize The arrow size for the end point.
       * @returns {FConnectorShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setEndArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Large)
       *   .setStrokeWidth(3)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      setEndArrowSize(arrowSize: ShapeArrowSizeEnum): this;
      /**
       * Builds the connector shape builder info. This method does not automatically draw the connector on top of the spreadsheet.
       * A new connector must be inserted via `fWorksheet.insertShape(shapeInfo)`.
       * @returns {IShapeBuilderInfo} The shape builder info containing all the accumulated properties.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(200)
       *   .setHeight(100)
       *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setStrokeColor('#000000')
       *   .setStrokeWidth(2)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      build(): IShapeBuilderInfo;
      /**
       * Returns the end connection info for this connector shape.
       * If this connector's end point is connected to a basic shape, returns the target shape id and connection site index.
       * @returns {IShapeRelationItem | null} The end connection info, or `null` if not connected.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       * const connector = shapes.find((s) => s.isLineShape());
       *
       * if (connector) {
       *   const endInfo = connector.getEndConnectInfo();
       *   if (endInfo) {
       *     console.log(`End connected to shape ${endInfo.shapeId} at site ${endInfo.cxnIndex}`);
       *   }
       * }
       * ```
       */
      getEndConnectInfo(): IShapeRelationItem | null;
      /**
       * Returns the start connection info for this connector shape.
       * If this connector's start point is connected to a basic shape, returns the target shape id and connection site index.
       * @returns {IShapeRelationItem | null} The start connection info, or `null` if not connected.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       * const connector = shapes.find((s) => s.isLineShape());
       *
       * if (connector) {
       *   const startInfo = connector.getStartConnectInfo();
       *   if (startInfo) {
       *     console.log(`Start connected to shape ${startInfo.shapeId} at site ${startInfo.cxnIndex}`);
       *   }
       * }
       * ```
       */
      getStartConnectInfo(): IShapeRelationItem | null;
  }

  /**
   * The shape builder info. It is the return value of the `build()` method. It contains all the information needed to insert a shape.
   */
  interface IShapeBuilderInfo {
      /**
       * @property {string} unitId The workbook id where the shape is located.
       */
      unitId: string;
      /**
       * @property {string} subUnitId The worksheet id where the shape is located.
       */
      subUnitId: string;
      /**
       * @property {string} shapeId The id of the shape.
       */
      shapeId: string;
      /**
       * @property {ShapeTypeEnum} shapeType The type of the shape.
       */
      shapeType: ShapeTypeEnum;
      /**
       * @property {IShapeData} [shapeData] The shape data containing fill and stroke styles.
       */
      shapeData?: IShapeData;
      /**
       * @property {number} x The x-coordinate of the shape.
       */
      x: number;
      /**
       * @property {number} y The y-coordinate of the shape.
       */
      y: number;
      /**
       * @property {number} width The width of the shape.
       */
      width: number;
      /**
       * @property {number} height The height of the shape.
       */
      height: number;
  }

  /**
   * The shape builder. It is used to create or update a shape in the sheet.
   * All set methods store properties on the builder instance, and the `build()` method
   * returns an `IShapeBuilderInfo` object that can be used with `fWorksheet.insertShape()`.
   *
   * @example
   * ```ts
   * const fWorkbook = univerAPI.getActiveWorkbook();
   * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
   * if (!fWorksheet) return;
   *
   * // Create a rectangle shape at cell B2 with offset
   * const shapeInfo = fWorksheet.newShape()
   *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
   *   .setPosition(1, 1, 0, 0)
   *   .setWidth(200)
   *   .setHeight(200)
   *   .setShapeSolidFill('#000000')
   *   .setStrokeColor('#000000')
   *   .setStrokeWidth(2)
   *   .build();
   * await fWorksheet.insertShape(shapeInfo);
   * ```
   */
  class FShape {
      /**
       * @property {string} unitId The workbook id where the shape is located.
       */
      unitId: string;
      /**
       * @property {string} subUnitId The worksheet id where the shape is located.
       */
      subUnitId: string;
      /**
       * @property {string} drawId The id of the shape.
       */
      drawId: string;
      /**
       * @property {number} x The x-coordinate of the shape. IF not set, it will default to 100 when building the shape info.
       */
      x: number;
      /**
       * @property {number} y The y-coordinate of the shape. If not set, it will default to 100 when building the shape info.
       */
      y: number;
      /**
       * @property {number} width The width of the shape in pixels.
       */
      width: number;
      /**
       * @property {number} height The height of the shape in pixels.
       */
      height: number;
      /**
       * @property {ShapeTypeEnum | undefined} shapeType The type of the shape.
       */
      shapeType: ShapeTypeEnum | undefined;
      /**
       * @property {IShapeData} shapeData The shape data containing fill and stroke styles.
       */
      shapeData: IShapeData;
      /**
       * Sets the position, changing where the shape appears on the sheet. anchorRowPos and anchorColPos are 0-indexed.
       * @description The shape's start anchor position is the top left-hand corner of the shape. The rowOffset and columnOffset are the pixel offsets from the anchor position.
       * @param {number} anchorRowPos The shape's top side is anchored in this row.
       * @param {number} anchorColPos The shape's left side is anchored in this column.
       * @param {number} rowOffset The shape's top left-hand corner is offset by this many pixels from the row.
       * @param {number} columnOffset The shape's top left-hand corner is offset by this many pixels from the column.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(2, 5, 20, 20)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setPosition(anchorRowPos: number, anchorColPos: number, rowOffset: number, columnOffset: number): this;
      /**
       * Sets the position by absolute pixel coordinates.
       * @description The shape's start anchor position is the top left-hand corner of the shape.
       * @param {number} x The x-coordinate of the shape's top left-hand corner.
       * @param {number} y The y-coordinate of the shape's top left-hand corner.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setAbsolutePosition(100, 200)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setAbsolutePosition(x: number, y: number): this;
      /**
       * Sets the type of the shape.
       * @param {ShapeTypeEnum} shapeType The type of shape to create. Which can be found from `univerAPI.Enum.ShapeTypeEnum`.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setShapeType(shapeType: ShapeTypeEnum): this;
      /**
       * Sets the full shape data for the shape.
       * @param {IShapeData} shapeData The shape data containing type, fill, stroke, text, geometry, adjustment values, and connector data.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeData({
       *     shapeType: univerAPI.Enum.ShapeTypeEnum.Rect,
       *     fill: {
       *       fillType: univerAPI.Enum.ShapeFillEnum.SolidFill,
       *       color: '#ff0000',
       *     },
       *     shapeText: {
       *       isRichText: false,
       *       isHorizontal: true,
       *       text: 'Sheet shape',
       *     },
       *   })
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setShapeData(shapeData: IShapeData): this;
      /**
       * Sets the solid fill style for the shape.
       * @param {string} color The fill color, e.g., '#ff0000'. If not specified, it will default to '#156082'.If the opacity is set both, the color string should be hex string or rgb string, the color like 'red' will not work.
       * @param {number} [opacity] The opacity of the fill (0 to 1).
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setShapeSolidFill('#f0f000', 0.8)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setShapeSolidFill(color: string, opacity?: number): this;
      /**
       * Sets the gradient fill style for the shape.
       * @param {ShapeGradientTypeEnum} shapeGradientType The gradient type. Which can be found from `univerAPI.Enum.ShapeGradientTypeEnum`.
       * @param {Array<{ position: number; color: string; opacity?: number }>} colorStops An array of gradient color stops. Each stop has a `position` (0 to 1), a `color` (e.g., '#ff0000'), and optional `opacity` (0 to 1).
       * @param {number} [gradientAngle] The angle of the gradient in degrees (e.g., 0 for left-to-right, 90 for top-to-bottom).
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * // Gradient fill with angle and color stops
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setShapeGradientFill(
       *     univerAPI.Enum.ShapeGradientTypeEnum.Linear,
       *     [
       *       { position: 0, color: '#ff0000' },
       *       { position: 0.5, color: '#00ff00' },
       *       { position: 1, color: '#0000ff' },
       *     ],
       *     90,
       *   )
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setShapeGradientFill(shapeGradientType: ShapeGradientTypeEnum, colorStops: Array<{
          position: number;
          color: string;
          opacity?: number;
      }>, gradientAngle?: number): this;
      /**
       * Removes the fill from the shape, making it transparent.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setNoneFill()
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setNoneFill(): this;
      /**
       * Sets the stroke color of the shape.
       * @param {string} color The stroke color, e.g., '#ff0000'.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeColor('#ff0000')
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeColor(color: string): this;
      /**
       * Sets the stroke width of the shape.
       * @param {number} width The stroke width in pixels.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeWidth(3)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeWidth(width: number): this;
      /**
       * Sets the stroke line dash type of the shape.
       * @param {ShapeLineDashEnum} lineDashType The line dash type.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineDashType(univerAPI.Enum.ShapeLineDashEnum.Dash)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeLineDashType(lineDashType: ShapeLineDashEnum): this;
      /**
       * Sets the stroke line join type of the shape.
       * @param {ShapeLineJoinEnum} lineJoinType The line join type.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineJoinType(univerAPI.Enum.ShapeLineJoinEnum.Round)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeLineJoinType(lineJoinType: ShapeLineJoinEnum): this;
      /**
       * Sets the stroke line cap type of the shape.
       * @param {ShapeLineCapEnum} lineCapType The line cap type.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineCapType(univerAPI.Enum.ShapeLineCapEnum.Round)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeLineCapType(lineCapType: ShapeLineCapEnum): this;
      /**
       * Sets the stroke opacity of the shape.
       * @param {number} opacity The opacity of the stroke (0 to 1).
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeColor('#ff0000')
       *   .setStrokeOpacity(0.5)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeOpacity(opacity: number): this;
      /**
       * Sets the stroke line type of the shape.
       * @param {ShapeLineTypeEnum} lineType The line type. Which can be found from `univerAPI.Enum.ShapeLineTypeEnum`.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineType(univerAPI.Enum.ShapeLineTypeEnum.SolidLine)
       *   .setStrokeColor('#000000')
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setStrokeLineType(lineType: ShapeLineTypeEnum): this;
      /**
       * Sets the width of the shape in pixels.
       * @param {number} width The width of the shape in pixels.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setWidth(300)
       *   .setHeight(200)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setWidth(width: number): this;
      /**
       * Sets the height of the shape in pixels.
       * @param {number} height The height of the shape in pixels.
       * @returns {FShape} this builder, for chaining.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setWidth(300)
       *   .setHeight(200)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      setHeight(height: number): this;
      /**
       * Returns whether this shape is a line/connector shape (e.g., straight connector, bent connector, curved connector).
       * @returns {boolean} `true` if the shape is a line/connector shape, `false` otherwise.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * for (const shape of shapes) {
       *   console.log(`Shape ${shape.drawId} is line: ${shape.isLineShape()}`);
       * }
       * ```
       */
      isLineShape(): boolean;
      /**
       * Returns the connection sites (points where connectors can attach) for this shape.
       * Connection sites are only available for non-connector (basic) shapes.
       * The coordinates are in the shape's local coordinate space (relative to shape bounds).
       * @returns {Array<{ x: number; y: number; index: number; ang: number }>} An array of connection site info.
       *   Each item contains `x`, `y` (local coordinates), `index` (site index), and `ang` (angle in 60000ths of a degree).
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * const basicShape = shapes.find((s) => !s.isLineShape());
       * if (basicShape) {
       *   const sites = basicShape.getConnectionSites();
       *   console.log('Connection sites:', sites);
       * }
       * ```
       */
      getConnectionSites(): Array<{
          x: number;
          y: number;
          index: number;
          ang: number;
      }>;
      /**
       * Returns the adjust points (adjust handles) for this shape.
       * Adjust points allow the user to change the geometry of the shape (e.g., corner radius, arrow size).
       * The coordinates are in the shape's local coordinate space.
       * @returns {Array<{ x: number; y: number; adjName: string }>} An array of adjust point info,
       *   each containing `x`, `y` (local coordinates) and `adjName` (the adjust parameter name).
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * const shape = shapes[0];
       * const adjustPoints = shape.getAdjustPoints();
       * console.log('Adjust points:', adjustPoints);
       * ```
       */
      getAdjustPoints(): Array<{
          x: number;
          y: number;
          adjName: string;
      }>;
      /**
       * Returns the connector line points for a line/connector shape.
       * The coordinates are in the shape's local coordinate space.
       * Returns an empty array if this shape is not a connector shape.
       * @returns {IShapePoint[]} An array of line points `{ x, y }`.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * const lineShape = shapes.find((s) => s.isLineShape());
       * if (lineShape) {
       *   const points = lineShape.getConnectorLinePoints();
       *   console.log('Connector points:', points);
       * }
       * ```
       */
      getConnectorLinePoints(): IShapePoint[];
      /**
       * Returns the start connection info for a connector shape.
       * If this connector's start point is connected to a basic shape, returns the target shape id and connection site index.
       * @returns {IShapeRelationItem | null} The start connection info, or `null` if not connected.
       *
       * @example
       * ```ts
       * const lineShape = fWorksheet.getShapes().find((s) => s.isLineShape());
       * if (lineShape) {
       *   const startInfo = lineShape.getStartConnectInfo();
       *   if (startInfo) {
       *     console.log(`Connected to shape ${startInfo.shapeId} at site ${startInfo.cxnIndex}`);
       *   }
       * }
       * ```
       */
      getStartConnectInfo(): IShapeRelationItem | null;
      /**
       * Returns the end connection info for a connector shape.
       * If this connector's end point is connected to a basic shape, returns the target shape id and connection site index.
       * @returns {IShapeRelationItem | null} The end connection info, or `null` if not connected.
       *
       * @example
       * ```ts
       * const lineShape = fWorksheet.getShapes().find((s) => s.isLineShape());
       * if (lineShape) {
       *   const endInfo = lineShape.getEndConnectInfo();
       *   if (endInfo) {
       *     console.log(`Connected to shape ${endInfo.shapeId} at site ${endInfo.cxnIndex}`);
       *   }
       * }
       * ```
       */
      getEndConnectInfo(): IShapeRelationItem | null;
      /**
       * Builds the shape builder info. This method does not automatically draw the shape on top of the spreadsheet.
       * A new shape must be inserted via `fWorksheet.insertShape(shapeInfo)`.
       * @returns {IShapeBuilderInfo} The shape builder info containing all the accumulated properties.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(300)
       *   .setHeight(200)
       *   .setStrokeColor('#000000')
       *   .setStrokeWidth(2)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      build(): IShapeBuilderInfo;
      /**
       * Returns the unique identifier of this shape.
       * @returns {string} The shape id.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * if (shapes.length > 0) {
       *   console.log('Shape ID:', shapes[0].getShapeId());
       * }
       * ```
       */
      getShapeId(): string;
      /**
       * Returns the type of this shape.
       * @returns {ShapeTypeEnum | undefined} The shape type, or `undefined` if not set.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * if (shapes.length > 0) {
       *   console.log('Shape type:', shapes[0].getShapeType());
       * }
       * ```
       */
      getShapeType(): ShapeTypeEnum | undefined;
      /**
       * Returns the shape data containing fill and stroke styles.
       * @returns {IShapeData} The shape data object.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * if (shapes.length > 0) {
       *   const data = shapes[0].getShapeData();
       *   console.log('Fill:', data.fill);
       *   console.log('Stroke:', data.stroke);
       * }
       * ```
       */
      getShapeData(): IShapeData;
      /**
       * Returns the absolute pixel position of this shape's top-left corner.
       * @returns {{ x: number; y: number }} An object with `x` and `y` pixel coordinates.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * if (shapes.length > 0) {
       *   const pos = shapes[0].getPosition();
       *   console.log(`Position: (${pos.x}, ${pos.y})`);
       * }
       * ```
       */
      getPosition(): {
          x: number;
          y: number;
      };
      /**
       * Returns the size of this shape in pixels.
       * @returns {{ width: number; height: number }} An object with `width` and `height` in pixels.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * const shapes = fWorksheet.getShapes();
       *
       * if (shapes.length > 0) {
       *   const size = shapes[0].getSize();
       *   console.log(`Size: ${size.width} x ${size.height}`);
       * }
       * ```
       */
      getSize(): {
          width: number;
          height: number;
      };
  }

  /**
   * Parameters for connecting shapes via a connector.
   */
  interface IConnectShapesParams {
      /** The connector/line shape to update. */
      connector: FShape;
      /** Optional start target. If provided, connects the connector's start to this shape's connection site. */
      startTarget?: {
          shape: FShape;
          connectionSiteIndex: number;
      };
      /** Optional end target. If provided, connects the connector's end to this shape's connection site. */
      endTarget?: {
          shape: FShape;
          connectionSiteIndex: number;
      };
  }

  interface IFWorksheetShapeMixin {
      /**
       * Adds a new shape to this sheet.
       * @param {IShapeBuilderInfo} shapeBuilderInfo - The shape builder info returned by `FShape.build()`.
       * @returns {Promise<boolean>} - Whether the shape was inserted successfully.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape at cell B2.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(200)
       *   .setHeight(200)
       *   .setStrokeColor('#000000')
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      insertShape(shapeBuilderInfo: IShapeBuilderInfo): Promise<boolean>;
      /**
       * Updates an existing shape on this sheet.
       * @param {IShapeBuilderInfo} shapeBuilderInfo - The shape builder info returned by `FShape.build()`.
       * @returns {Promise<boolean>} - Whether the shape was updated successfully.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape at cell B2.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       *
       * // Get all shapes on the active sheet.
       * const shapes = fWorksheet.getShapes();
       *
       * // Update the first shape after 3 seconds.
       * setTimeout(async () => {
       *   const newShapeInfo = fWorksheet.newShape(shapes[0])
       *     .setStrokeColor('#ff0000')
       *     .setStrokeWidth(3)
       *     .build();
       *   await fWorksheet.updateShape(newShapeInfo);
       * }, 3000);
       * ```
       */
      updateShape(shapeBuilderInfo: IShapeBuilderInfo): Promise<boolean>;
      /**
       * Returns a builder to create a new shape for this sheet. The builder will not automatically create the shape.
       * You must call `build()` on the returned builder to get the shape info, then insert it via `insertShape(shapeInfo)`.
       * @description If an existing FShape is provided, the builder will be initialized with that shape's current properties (id, type, position, size) for updating.
       * @param {FShape} [existingShape] An existing shape to initialize the builder with for updating.
       * @returns {FShape} - A new shape builder.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape at cell B2 with 200x200 size.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(200)
       *   .setHeight(200)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      newShape(existingShape?: FShape): FShape;
      /**
       * Returns an array of shapes on this sheet.
       * @returns {FShape[]} - An array of shapes on this sheet.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Get all shapes on the active sheet.
       * const shapes = fWorksheet.getShapes();
       * console.log(shapes);
       * ```
       */
      getShapes(): FShape[];
      /**
       * Removes a shape from this sheet.
       * @param {FShape} shape - The shape to remove.
       * @returns {Promise<boolean>} - Whether the shape was removed successfully.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       *
       * // Get all shapes on the active sheet.
       * const shapes = fWorksheet.getShapes();
       *
       * // Remove the first shape after 3 seconds.
       * setTimeout(async () => {
       *   await fWorksheet.removeShape(shapes[0]);
       *   console.log(fWorksheet.getShapes());
       * }, 3000);
       * ```
       */
      removeShape(shape: FShape): Promise<boolean>;
      /**
       * Connects a connector (line) shape's endpoints to basic shapes' connection sites.
       * At least one of `startTarget` or `endTarget` must be provided. If an endpoint is not provided,
       * its existing connection (if any) is preserved, or it remains as a free point.
       *
       * This method requires the sheet to be active (has a render context).
       *
       * @param {IConnectShapesParams} params - Parameters specifying the connector and target shapes.
       * @returns {Promise<boolean>} - Whether the connection was established successfully.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Get all shapes on the sheet.
       * const shapes = fWorksheet.getShapes();
       * const basicShapes = shapes.filter((s) => !s.isLineShape());
       * const connectors = shapes.filter((s) => s.isLineShape());
       *
       * if (connectors.length > 0 && basicShapes.length >= 2) {
       *   // Connect the first connector's start to the first basic shape's cxn site 0,
       *   // and the end to the second basic shape's cxn site 2.
       *   await fWorksheet.connectShapes({
       *     connector: connectors[0],
       *     startTarget: { shape: basicShapes[0], connectionSiteIndex: 0 },
       *     endTarget: { shape: basicShapes[1], connectionSiteIndex: 2 },
       *   });
       * }
       * ```
       */
      connectShapes(params: IConnectShapesParams): Promise<boolean>;
      /**
       * Returns a builder to create a new connector (line) shape for this sheet. The builder will not automatically create the connector.
       * You must call `build()` on the returned builder to get the shape info, then insert it via `insertShape(shapeInfo)`.
       * @description If an existing FShape is provided, the builder will be initialized with that shape's current properties (id, type, position, size) for updating.
       * @param {FShape} [existingShape] An existing connector shape to initialize the builder with for updating.
       * @returns {FConnectorShape} - A new connector shape builder.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a straight connector with arrows at cell B2 with 200x100 size.
       * const connectorInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setPosition(1, 1, 0, 0)
       *   .setWidth(200)
       *   .setHeight(100)
       *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setEndArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setStrokeColor('#000000')
       *   .setStrokeWidth(2)
       *   .build();
       * await fWorksheet.insertShape(connectorInfo);
       * ```
       */
      newConnector(existingShape?: FShape): FConnectorShape;
  }

  class FWorksheetShapeMixin {
      insertShape(shapeBuilderInfo: IShapeBuilderInfo): Promise<boolean>;
      updateShape(shapeBuilderInfo: IShapeBuilderInfo): Promise<boolean>;
      newShape(existingShape?: FShape): FShape;
      newConnector(existingShape?: FShape): FConnectorShape;
      getShapes(): FShape[];
      removeShape(shape: FShape): Promise<boolean>;
      connectShapes(connectParams: IConnectShapesParams): Promise<boolean>;
  }
}

declare module "@univerjs/core/facade" {
  import { ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeTypeEnum } from "@univerjs-pro/engine-shape";

  interface IFSheetsShapeEnumMixin {
      /**
       * Represents the type of the shape. {@link ShapeTypeEnum}
       * @description This enum defines almost all Excel supported shape types, including basic shapes, block arrows, flowchart shapes, callouts, stars and banners, symbols, and lines.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Diamond)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeTypeEnum: typeof ShapeTypeEnum;
      /**
       * Represents the fill type of the shape. {@link ShapeFillEnum}
       * The possible values are: NoFill, SolidFil, GradientFill, PatternFill, PictureFill.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with solid fill.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setShapeSolidFill('#ff0000')
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeFillEnum: typeof ShapeFillEnum;
      /**
       * Represents the gradient type of the shape fill. {@link ShapeGradientTypeEnum}
       * The possible values are: Linear, Radial, Angular, Diamond.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with linear gradient fill.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setShapeGradientFill(univerAPI.Enum.ShapeGradientTypeEnum.Linear, [{
       *          position: 0,
       *          color: '#ff0000'
       *      }, {
       *          position: 0.5,
       *          color: '#00ff00'
       *      }, {
       *          position: 1,
       *          color: '#0000ff'
       *      }], 90  )
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeGradientTypeEnum: typeof ShapeGradientTypeEnum;
      /**
       * Represents the line fill type of the shape stroke. {@link ShapeLineTypeEnum}
       * The possible values are: NoLine, SolidLine, GradientLine.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with solid line stroke type.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineType(univerAPI.Enum.ShapeLineTypeEnum.SolidLine)
       *   .setStrokeColor('#000000')
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeLineTypeEnum: typeof ShapeLineTypeEnum;
      /**
       * Represents the line dash type of the shape stroke. {@link ShapeLineDashEnum}
       * The possible values are: Solid, RoundDot, SquareDot, Dash, DashDot, LongDash, LongDashDot, LongDashDotDot.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with dashed stroke.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineDashType(univerAPI.Enum.ShapeLineDashEnum.Dash)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeLineDashEnum: typeof ShapeLineDashEnum;
      /**
       * Represents the line cap type of the shape stroke. {@link ShapeLineCapEnum}
       * The possible values are: Flat, Round, Square.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with round line cap.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineCapType(univerAPI.Enum.ShapeLineCapEnum.Round)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeLineCapEnum: typeof ShapeLineCapEnum;
      /**
       * Represents the line join type of the shape stroke. {@link ShapeLineJoinEnum}
       * The possible values are: Miter, Round, Bevel.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a rectangle shape with round line join.
       * const shapeInfo = fWorksheet.newShape()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.Rect)
       *   .setStrokeLineJoinType(univerAPI.Enum.ShapeLineJoinEnum.Round)
       *   .setPosition(1, 1, 0, 0)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeLineJoinEnum: typeof ShapeLineJoinEnum;
      /**
       * Represents the arrow type of connector line shape. {@link ShapeArrowTypeEnum}
       * The possible values are: None, Arrow, OpenArrow, DiamondArrow, StealthArrow, OvalArrow.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       *
       * // Create a line shape with arrow type.
       * const shapeInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.StraightConnector1)
       *   .setPosition(1, 1, 0, 0)
       *   .setStartArrowType(univerAPI.Enum.ShapeArrowTypeEnum.Arrow)
       *   .setStrokeWidth(3)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeArrowTypeEnum: typeof ShapeArrowTypeEnum;
      /**
       * Represents the arrow size of connector line shape. {@link ShapeArrowSizeEnum}
       * The possible values are:Small, Medium, Large.
       *
       * @example
       * ```ts
       * const fWorkbook = univerAPI.getActiveWorkbook();
       * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
       * if (!fWorksheet) return;
       * // Create a line shape with arrow size.
       * const shapeInfo = fWorksheet.newConnector()
       *   .setShapeType(univerAPI.Enum.ShapeTypeEnum.BentConnector3)
       *   .setPosition(1, 1, 0, 0)
       *   .setStartArrowSize(univerAPI.Enum.ShapeArrowSizeEnum.Medium)
       *   .setStrokeWidth(3)
       *   .build();
       * await fWorksheet.insertShape(shapeInfo);
       * ```
       */
      ShapeArrowSizeEnum: typeof ShapeArrowSizeEnum;
  }
}

declare module "@univerjs/core/facade" {
  import { ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeTypeEnum } from "@univerjs-pro/engine-shape";

  interface FEnum extends IFSheetsShapeEnumMixin {
  }
}

declare module "@univerjs/sheets/facade" {
  import type { IFWorksheetShapeMixin } from "@univerjs-pro/sheets-shape/facade";

  interface FWorksheet extends IFWorksheetShapeMixin {
  }
}

declare module "@univerjs-pro/sheets-shape/facade" {
  import type { ICxnShapeData, IShapeData, IShapePoint, IShapeRelationItem, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeTypeEnum } from "@univerjs-pro/engine-shape";

  interface FShape {
  }

  interface IShapeBuildOptions {
  }
}
