declare namespace API {
  type MenuChildrenItem = {
    id: string
    parentId: string
    weight: number
    name: string
    path: string
    visible: boolean
    isKeepAlive: boolean
    sortOrder: number
    icon: string
    menuType: string
    permission?: any
    label: string
    type?: number
    [key: string]: any
  }

  type MenuResultItem = {
    children?: MenuChildrenItem[]
  } & MenuChildrenItem

  /** 获取的菜单结果 */
  type MenuResult = MenuResultItem[]

  type MenuTreeItem = {
    children?: MenuTreeItem[]
  } & MenuChildrenItem

  /** 菜单树结果 */
  type MenuTreeResult = MenuTreeItem[]

  /** 单个菜单详情 */
  type MenuDetailResult = Omit<MenuChildrenItem, 'label' | 'weight'> & {
    createdBy: string
    createdTime: string
    modifiedBy: string
    modifiedTime: string
    optFlag: string
  }

  /** 修改菜单入参 */
  type UpdateMenuParams = {
    menuId: number
    name: string
    path?: string
    icon?: string
    permission?: any // 不确定
    menuType: string
    keepAlive?: boolean
    visible?: boolean
    sortOrder: number
    parentId?: number
    /** 是否Iframe */
    embedded: boolean
  }

  /** 新增菜单入参 */
  type AddMenuParams = Omit<UpdateMenuParams, 'menuId'>

  type MenuPackPageResultItem = {
    bundleId: number
    bundleName: string
    menuIds: number[]
    lockFlag: string
    delFlag: string
    createdBy: string
    modifiedBy: string
    createdTime: string
    modifiedTime: string
  }

  /** 功能包分页结果 */
  type MenuPackPageResult = MenuPackPageResultItem[]

  /** 修改菜单功能包入参 */
  type UpdateMenuPackParams = {
    //功能包id
    bundleId: number
    // 功能包名称
    bundleName: string
    // 锁定标记
    lockFlag: 锁定标记
    // 菜单id
    menuIds: number[]
  }

  /** 新增菜单功能包入参 */
  type AddMenuPackParams = Omit<UpdateMenuParams, 'bundleId'>

  /** 获取所有可用的bundle */
  interface BundleItem {
    bundleId: string
    bundleName: string
    menuIds: string[]
    lockFlag: string
    delFlag: string
    createdBy: string
    modifiedBy: string
    createdTime: string
    modifiedTime: string
  }
  type BundleList = BundleItem[]
}
