@samatawy/diagrams
    Preparing search index...

    Interface DiagramAction

    interface DiagramAction {
        id: DiagramActionId;
        label: string;
        tooltip?: string;
        shortcut?: string[];
        icon?: string | Element;
        toggle?: boolean;
        execute: (diagram: DiagramEditView) => void | Promise<void>;
        isEnabled?: (diagram: DiagramEditView) => boolean;
        isActive?: (diagram: DiagramEditView) => boolean;
    }
    Index

    Properties

    Unique identifier for the action. This is used to reference the action in the toolbar.

    label: string

    Optional label for the action. This is used for accessibility and tooltips.

    tooltip?: string

    Optional tooltip text for the action. This is displayed on hover.

    shortcut?: string[]

    Optional keyboard shortcut for the action. This is displayed in the tooltip and can be used to trigger the action.

    icon?: string | Element

    Optional icon for the action. This can be an SVG use href (e.g. '#icon-undo'), a URL string, or an Element.

    toggle?: boolean

    Whether the action is a toggle action. Toggle actions can be in an active or inactive state.

    execute: (diagram: DiagramEditView) => void | Promise<void>

    Called when the button is clicked; receives the diagram view.

    isEnabled?: (diagram: DiagramEditView) => boolean

    Returns true when the button should be enabled; defaults to always enabled.

    isActive?: (diagram: DiagramEditView) => boolean

    Returns true when the button should appear active/pressed.