The raw data describing a single context-menu entry, before it is normalized into a ContextMenuEntry or compiled for Foundry's ContextMenu base class.

interface ContextMenuEntryContext {
    callback?: ContextMenuCallback;
    condition: ContextMenuCondition;
    functionName?: string;
    group: SohlContextMenuSortGroup;
    icon?: HTMLString;
    iconFAClass?: string;
    id: string;
    name: string;
}

Properties

Handler invoked when the entry is clicked; takes precedence over functionName.

Predicate (string SafeExpression or function) gating visibility. See ContextMenuCondition.

functionName?: string

Name of the logic method to invoke when no explicit callback is given.

Sort group the entry belongs to.

icon?: HTMLString

Pre-built HTML icon markup; mutually optional with iconFAClass.

iconFAClass?: string

Font-Awesome CSS class used to build an icon when icon is absent.

id: string

Unique identifier for the entry.

name: string

Display label for the entry.