// global.d.ts
declare global {
  declare interface BranchVO {
    id: string | number
    label: string
    to?: Array<number | string>
  }

  declare interface IPosition {
    x: number
    y: number
  }

  declare interface NodeVO {
    id: string | number
    position: IPosition
    canDrag?: boolean
    title?: string
    content?: string
    width?: number
    branches: Array<BranchVO>
    [prop: string]: any
  }

  declare interface LineVO {
    fromNodeId: string | number
    fromBranchId: string | number
    toNodeId: string | number
  }

  declare interface TempConnection {
    active: boolean
    fromNodeId: null | string | number
    fromBranchId: null | string | number
    startX: number
    startY: number
    endX: number
    endY: number
    toNodeId: null | string | number
  }
}

// 这样这些类型就可以在整个项目中使用了
export {} // 这一行很重要，确保文件被视为模块
