UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

34 lines (32 loc) 1.28 kB
import { MenuCheckboxItemType } from "./checkboxItem.mjs"; import { MenuSwitchItemType } from "./switchItem.mjs"; import { MenuDividerType, MenuItemType, SubMenuType } from "./type.mjs"; import { Key, ReactNode } from "react"; //#region src/Menu/baseItem.d.ts /** * Group type for Base UI driven menus (DropdownMenu / ContextMenu). * Unlike MenuItemGroupType, this supports checkbox/switch items in children. */ interface BaseMenuItemGroupType { children?: BaseMenuItemType[]; key?: Key; label?: ReactNode; type: 'group'; } /** * Submenu type for Base UI driven menus (DropdownMenu / ContextMenu). * Unlike SubMenuType, this supports checkbox/switch items in children. */ interface BaseSubMenuType extends Omit<SubMenuType, 'children'> { children?: BaseMenuItemType[]; } /** * Base item union for Base UI driven menus (DropdownMenu / ContextMenu). * * Note: This intentionally does NOT change `GenericItemType` itself, * because `GenericItemType` maps to rc-menu/antd Menu item types. */ type BaseMenuItemType = MenuItemType | BaseSubMenuType | BaseMenuItemGroupType | MenuDividerType | MenuCheckboxItemType | MenuSwitchItemType | null; //#endregion export { BaseMenuItemGroupType, BaseMenuItemType, BaseSubMenuType }; //# sourceMappingURL=baseItem.d.mts.map