import { eRole } from '@/types/role'
import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from 'vue'
type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent

export interface iMenuConfigItem {
  getName: (role: eRole) => string
  getChildren?: () => Omit<iMenuConfigItem, 'getChildren'>[]
  path?: string
  belongToMenuName?: string
  hiddeInMenu?: boolean
  component?: Component
  onClick?: (e: Event) => any
  routeName?: string
  roles: eRole[]
}

export type iMenuItem = Omit<iMenuConfigItem, 'getChildren'> & {
  children?: Omit<iMenuConfigItem, 'getChildren'>[]
}

export type iMenuList = (Omit<iMenuConfigItem, 'getChildren'> & {
  children?: Omit<iMenuConfigItem, 'getChildren'>[]
})[]

type ia = {
  a: string
  b: string
}

type ib = Omit<ia, 'a'>
const b: ib = {
  b: 'sdf',
}
