///
import { UseButtonRootSlotProps } from '@mui/base/useButton';
import { MuiCancellableEventHandler } from '@mui/base/utils/MuiCancellableEvent';
interface UseMenuItemRootSlotOwnProps {
id: string | undefined;
role: 'menuitem';
ref: React.RefCallback | null;
}
export interface MenuItemMetadata {
id: string;
disabled: boolean;
label?: string;
ref: React.RefObject;
}
export type UseMenuItemRootSlotProps = ExternalProps & UseMenuItemRootSlotOwnProps & UseButtonRootSlotProps & {
onClick: MuiCancellableEventHandler;
};
export interface UseMenuItemParameters {
disabled?: boolean;
id?: string;
label?: string;
onClick?: React.MouseEventHandler;
rootRef: React.Ref;
/**
* If `true`, the menu item won't receive focus when the mouse moves over it.
*
* @default false
*/
disableFocusOnHover?: boolean;
}
export interface UseMenuItemReturnValue {
/**
* Resolver for the root slot's props.
* @param externalProps event handlers for the root slot
* @returns props that should be spread on the root slot
*/
getRootProps: = {}>(externalProps?: ExternalProps) => UseMenuItemRootSlotProps;
/**
* If `true`, the component is disabled.
*/
disabled: boolean;
/**
* If `true`, the component is being focused using keyboard.
*/
focusVisible: boolean;
/**
* If `true`, the component is being highlighted.
*/
highlighted: boolean;
/**
* 0-based index of the item in the menu.
*/
index: number;
/**
* The ref to the component's root DOM element.
*/
rootRef: React.RefCallback | null;
/**
* Total number of items in the menu.
*/
totalItemCount: number;
}
export {};