anvil/striker-ui/types/Menu.d.ts

16 lines
529 B
TypeScript
Raw Normal View History

2023-12-11 23:32:27 +00:00
type MuiMenuProps = import('@mui/material').MenuProps;
type MenuOptionalProps<T = unknown> = Pick<MuiMenuProps, 'open'> & {
getItemDisabled?: (key: string, value: T) => boolean;
2023-12-11 23:32:27 +00:00
items?: Record<string, T>;
muiMenuProps?: Partial<MuiMenuProps>;
onItemClick?: (
key: string,
value: T,
...parent: Parameters<MuiMenuItemClickEventHandler>
) => ReturnType<MuiMenuItemClickEventHandler>;
renderItem?: (key: string, value: T) => import('react').ReactNode;
};
type MenuProps<T = unknown> = MenuOptionalProps<T>;