Interface ContextMenuItemConfig

Configuration for a single context-menu item.

interface ContextMenuItemConfig {
    callback?: ItemAction;
    doAction?: ItemAction;
    doHover?: ItemAction;
    getEnabled?: ItemStateGetter;
    getShown?: ItemStateGetter;
    getTitle?: ItemTitleGetter;
    items?: ContextMenuItemConfig[][];
    title?: string;
}

Properties

callback?: ItemAction

Legacy alias for doAction.

doAction?: ItemAction

Action invoked when the item is activated.

doHover?: ItemAction

Optional action invoked when the pointer enters the item.

getEnabled?: ItemStateGetter

Resolves whether the item is enabled for the current context.

Defaults to true.

getShown?: ItemStateGetter

Resolves whether the item is shown for the current context.

Defaults to true.

getTitle?: ItemTitleGetter

Dynamic item title resolver.

Nested submenu item groups.

Each inner array represents a visual group.

title?: string

Static item title.

Ignored when getTitle is provided.