export type PermissionMenuSection = 'main' | 'bottom'

export type PermissionOpenMode = 'route' | 'blank'

export interface PermissionMenuNode {
	code: string
	name: string
	langName?: string
	link?: string
	menuIndex: number
	menuType?: number
	openType?: number
	children: PermissionMenuNode[]
}

export interface PermissionMenuDefinition {
	menuCode: string
	path: string
	icon: string
	section: PermissionMenuSection
	titleKey: string
	openMode?: PermissionOpenMode
}

export interface PermissionRouteMenuItem {
	type: 'route'
	menuCode: string
	path: string
	icon: string
	label: string
	badge?: string
	section: PermissionMenuSection
	openMode: PermissionOpenMode
	menuIndex: number
}

export interface PermissionActionMenuItem {
	type: 'action'
	action: 'template' | 'settings'
	icon: string
	label: string
	activeKey?: string
	settingsName?: 'help' | 'settings'
	showChevron?: boolean
}

export type SidebarPermissionMenuItem = PermissionRouteMenuItem | PermissionActionMenuItem

export type PermissionDirectiveValue =
	| string
	| [menuCode: string, buttonCode: string]
	| {
			buttonCode: string
			menuCode?: string
	  }
