import { FC, ReactNode } from 'react'; export declare const CONTEXT_MENU_FRAME_ID = "context_menu_frame", ACTIVE_CONTEXT_MENU_CLASS = "active_context_menu", BASE_CONTEXT_MENU = "base_context_menu", PRIOR_CONTEXT_MENU_CLASS = "previous_context_menu", CONTEXT_MENU_ANIMATION_DURATION = 200; export type CustomContextMenuData = { type: string; option?: string; }; export type ContextMenuTemplate = { /** * Can be `normal`, `separator`, `submenu`, or `checkbox`. * Defaults to 'normal' unless a 'submenu' key exists */ type?: 'normal' | 'separator' | 'submenu' | 'checkbox' | 'widget'; /** * The text to show on the menu item. * Must be unique within context menu. * Should be left undefined for type: 'separator' */ label?: string; /** * If false, the menu item will be greyed out and unclickable. */ enabled?: boolean; /** * If false, the menu item will be entirely hidden. */ visible?: boolean; /** * Should only be specified for `checkbox` type menu items. */ checked?: boolean; /** * Should be specified for `submenu` type menu items. If `submenu` is specified, * the `type: 'submenu'` can be omitted. */ submenu?: CustomContextMenuTemplate[]; /** * Data to be returned if the user selects the element. Must be serializable */ data?: Data; /** * Image Data URI with image dimensions inferred from the encoded string */ icon?: string; }; export interface WidgetContextMenuTemplate extends ContextMenuTemplate { type: 'widget'; config: { type: 'add-to-channel'; channels: ({ color: string; label?: string; data: Data; checked?: boolean; } | { isNone: boolean; label?: string; data: Data; })[]; }; } export type CustomContextMenuTemplate = ContextMenuTemplate | WidgetContextMenuTemplate; export type CustomContextMenuProps = { /** * The menu template to render. */ menuTemplate: CustomContextMenuTemplate[]; /** * Callback for when a menu item is clicked. */ onClick: (data?: CustomContextMenuData) => void; /** * Optional Icon to be displayed in root menu header */ icon?: ReactNode; /** * Optional callback used for when the menu is resized. This is used for custom animations when the menu is resized. */ onMenuResize?: (height: number, width: number) => void; /** * Optional callback used for when the context menu is opened. This is used for custom animations when the menu is opened. */ onContextMenuReady?: () => void; /** * Optional boolean used to determine whether to apply border radius. When true, no border radius is applied. * When false, a border radius of 10px is applied to match the rounded corners on MacOS windows. Defaults to true. */ isWindows?: boolean; }; export type SubmenulessMenuItemTemplate = Omit & { hasSubMenu: boolean; }; export interface SubMenuNavigationTemplate { parentLabel: string; menuTemplate: SubmenulessMenuItemTemplate[]; } export declare const CustomContextMenu: FC;