Field Notes
    Preparing search index...

    Interface ActionDefinition

    interface ActionDefinition {
        allowShift?: boolean;
        enabled?: (ctx: ActionContext) => boolean;
        icon?: string;
        id: string;
        keywords?: readonly string[];
        label: string | ((ctx: ActionContext) => string);
        menu?: ActionMenuPlacement;
        perform: (
            ctx: ActionContext,
            invocation: ActionInvocation,
        ) => boolean | void;
        preventDefault?: boolean;
        shortcut?: readonly string[];
    }
    Index
    allowShift?: boolean

    Match with or without Shift held (nudge). Default false.

    enabled?: (ctx: ActionContext) => boolean

    Default: always enabled. Disabled actions are hidden from the menu and ignored by run().

    icon?: string

    Identifier only (e.g. 'undo'); UI layers map it to a glyph. Core never renders it.

    id: string

    Namespaced, unique, e.g. 'edit.undo', 'tool.pencil', 'my-plugin.frobnicate'.

    keywords?: readonly string[]
    label: string | ((ctx: ActionContext) => string)

    Present when the action appears in the context menu.

    perform: (ctx: ActionContext, invocation: ActionInvocation) => boolean | void

    Return false to report "nothing happened" (keyboard then does not preventDefault).

    preventDefault?: boolean

    Call preventDefault on the triggering keyboard event. Default true.

    shortcut?: readonly string[]

    Default bindings in ShortcutMap syntax. User rebinding overrides these.