import { CSSProperties, VNodeChild } from 'vue'; export type MenuKey = string | number; export type MenuMode = 'horizontal' | 'vertical' | 'inline'; export type MenuTheme = 'light' | 'dark'; export type MenuNode = VNodeChild | (() => VNodeChild); export type MenuIcon = VNodeChild | ((item: MenuItemType | SubMenuType) => VNodeChild); export type MenuTriggerAction = 'click' | 'hover'; export type MenuExpandIconInfo = SubMenuType & { isOpen?: boolean; }; interface ItemSharedProps { style?: CSSProperties; class?: string; } export interface MenuItemType extends ItemSharedProps { key: MenuKey; label?: MenuNode; disabled?: boolean; danger?: boolean; icon?: MenuIcon; title?: MenuNode; } export interface SubMenuType extends ItemSharedProps { key: MenuKey; label?: MenuNode; children: ItemType[]; disabled?: boolean; icon?: MenuIcon; expandIcon?: (info: MenuExpandIconInfo) => VNodeChild; theme?: MenuTheme; title?: MenuNode; popupClassName?: string; popupOffset?: [number, number]; onTitleClick?: (info: MenuTitleInfo) => void; } export interface MenuItemGroupType extends ItemSharedProps { type: 'group'; label?: MenuNode; children?: ItemType[]; } export interface MenuDividerType extends ItemSharedProps { type: 'divider'; dashed?: boolean; } export type ItemType = SubMenuType | MenuItemType | MenuItemGroupType | MenuDividerType | null | undefined; export interface MenuInfo { key: MenuKey; keyPath: MenuKey[]; item: MenuItemType | SubMenuType; domEvent: MouseEvent | KeyboardEvent; } export interface MenuTitleInfo { key: MenuKey; domEvent: MouseEvent | KeyboardEvent; } export interface MenuSelectInfo extends MenuInfo { selectedKeys: MenuKey[]; } export {};