UNPKG

@lobehub/ui

Version:

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

71 lines • 2.29 kB
import { CSSProperties, Key, KeyboardEvent, MouseEvent, ReactInstance, ReactNode, Ref } from "react"; //#region src/Menu/itemInterface.d.ts interface MenuInfo { domEvent: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>; item: ReactInstance; key: string; keyPath: string[]; } interface MenuTitleInfo { domEvent: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>; key: string; } type MenuClickEventHandler = (info: MenuInfo) => void; type MenuHoverEventHandler = (info: { domEvent: MouseEvent<HTMLElement>; key: string; }) => void; interface RenderIconInfo { disabled?: boolean; isOpen?: boolean; isSelected?: boolean; isSubMenu?: boolean; } type RenderIconType = ReactNode | ((props: RenderIconInfo) => ReactNode); interface ItemSharedProps { className?: string; ref?: Ref<HTMLLIElement | null>; style?: CSSProperties; } interface RcSubMenuType extends ItemSharedProps { children: RcItemType[]; disabled?: boolean; expandIcon?: RenderIconType; itemIcon?: RenderIconType; key: string; label?: ReactNode; onClick?: MenuClickEventHandler; onMouseEnter?: MenuHoverEventHandler; onMouseLeave?: MenuHoverEventHandler; onTitleClick?: (info: MenuTitleInfo) => void; onTitleMouseEnter?: MenuHoverEventHandler; onTitleMouseLeave?: MenuHoverEventHandler; popupClassName?: string; popupOffset?: number[]; popupStyle?: CSSProperties; rootClassName?: string; type?: 'submenu'; } interface RcMenuItemType extends ItemSharedProps { disabled?: boolean; extra?: ReactNode; itemIcon?: RenderIconType; key: Key; label?: ReactNode; onClick?: MenuClickEventHandler; onMouseEnter?: MenuHoverEventHandler; onMouseLeave?: MenuHoverEventHandler; type?: 'item'; } interface RcMenuItemGroupType extends ItemSharedProps { children?: RcItemType[]; label?: ReactNode; type: 'group'; } interface RcMenuDividerType extends Omit<ItemSharedProps, 'ref'> { type: 'divider'; } type RcItemType = RcSubMenuType | RcMenuItemType | RcMenuItemGroupType | RcMenuDividerType | null; //#endregion export { MenuClickEventHandler, MenuHoverEventHandler, MenuInfo, MenuTitleInfo, RcItemType, RcMenuDividerType, RcMenuItemGroupType, RcMenuItemType, RcSubMenuType, RenderIconInfo, RenderIconType }; //# sourceMappingURL=itemInterface.d.mts.map