An interface describing a menu item.

interface IMenuItem {
    args?: PartialJSONObject;
    command?: string;
    disabled?: boolean;
    rank?: number;
    submenu?: null | IMenu;
    type?: "separator" | "command" | "submenu";
    [key: string]: undefined | PartialJSONValue;
}

Hierarchy (View Summary)

Indexable

Properties

args?: PartialJSONObject

The arguments for the command.

The default value is an empty object.

command?: string

The command to execute when the item is triggered.

The default value is an empty string.

disabled?: boolean

Whether a menu item is disabled. false by default.

This allows an user to suppress menu items.

rank?: number

The rank order of the menu item among its siblings.

submenu?: null | IMenu

The submenu for a 'submenu' type item.

The default value is null.

type?: "separator" | "command" | "submenu"

The type of the menu item.

The default value is 'command'.