import * as React from 'react'; import { FloatingRootContext } from '@floating-ui/react'; import { GenericHTMLProps } from '../../utils/types'; export declare function useMenuRoot(parameters: useMenuRoot.Parameters): useMenuRoot.ReturnValue; export type MenuOrientation = 'horizontal' | 'vertical'; export type MenuDirection = 'ltr' | 'rtl'; export declare namespace useMenuRoot { interface Parameters { /** * If `true`, the Menu supports CSS-based animations and transitions. * It is kept in the DOM until the animation completes. */ animated: boolean; /** * Allows to control whether the Menu is open. * This is a controlled counterpart of `defaultOpen`. */ open: boolean | undefined; /** * Callback fired when the component requests to be opened or closed. */ onOpenChange: ((open: boolean, event: Event | undefined) => void) | undefined; /** * If `true`, the Menu is initially open. */ defaultOpen: boolean; /** * If `true`, using keyboard navigation will wrap focus to the other end of the list once the end is reached. */ loop: boolean; /** * The delay in milliseconds until the menu popup is opened when `openOnHover` is `true`. */ delay: number; /** * The orientation of the Menu (horizontal or vertical). */ orientation: MenuOrientation; /** * The direction of the Menu (left-to-right or right-to-left). */ direction: MenuDirection; /** * If `true`, the Menu is disabled. */ disabled: boolean; /** * Determines if the Menu is nested inside another Menu. */ nested: boolean; /** * Determines if pressing the Esc key closes the parent menus. * This is only applicable for nested menus. * * If set to `false` pressing Esc closes only the current menu. */ closeParentOnEsc: boolean; /** * Whether the menu popup opens when the trigger is hovered after the provided `delay`. */ openOnHover: boolean; /** * Callback fired when the user begins or finishes typing (for typeahead search). */ onTypingChange: (typing: boolean) => void; } interface ReturnValue { activeIndex: number | null; floatingRootContext: FloatingRootContext; getItemProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps; getPositionerProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps; getTriggerProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps; itemDomElements: React.MutableRefObject<(HTMLElement | null)[]>; itemLabels: React.MutableRefObject<(string | null)[]>; mounted: boolean; open: boolean; popupRef: React.RefObject; setOpen: (open: boolean, event: Event | undefined) => void; setPositionerElement: (element: HTMLElement | null) => void; setTriggerElement: (element: HTMLElement | null) => void; transitionStatus: 'entering' | 'exiting' | undefined; triggerElement: HTMLElement | null; } }