import { CalculatedColumn } from 'react-data-grid'; import { DropdownProps } from '../../Dropdown'; export type ContextMenuDropdownItem = NonNullable[number]; export type ContextMenuDropDownProps = Omit; export type DropdownContextMenu = { type: 'dropdown'; getDropDownItems: (params: { columnLabel: string; }) => DropdownProps['items']; } & ContextMenuDropDownProps; export type HeaderContextMenuProps = (event: React.MouseEvent, columnLabel: string | undefined, closestTargetElement: HTMLElement | undefined) => void; export type CellContextMenuDropDownProps = { type: 'dropdown'; getDropDownItems: (params: { row: RowType; column: CalculatedColumn; }) => DropdownProps['items']; onOpen?: (params: { row: RowType; column: CalculatedColumn; }) => void; onItemSelect?: (item: ContextMenuDropdownItem, context: { row: RowType; column: CalculatedColumn; selectCell: (enableEditor?: boolean) => void; }, event?: React.SyntheticEvent) => void; } & ContextMenuDropDownProps; export type HeaderContextMenuDropDownProps = { type: 'dropdown'; getDropDownItems: (params: { columnLabel: string | undefined; }) => DropdownProps['items']; onOpen?: (params: { columnLabel: string | undefined; }) => void; onItemSelect?: (item: ContextMenuDropdownItem, context: { columnLabel: string | undefined; }, event?: React.SyntheticEvent) => void; } & ContextMenuDropDownProps;