Trevixal API
    Preparing search index...

    Interface ToolbarItem

    A single toolbar control. Open for extension: register your own items without touching the toolbar implementation (open/closed principle).

    interface ToolbarItem {
        ariaLabel?: string;
        dataset?: () => Readonly<Record<string, string | null>>;
        icon?: IconName;
        isActive?: (snapshot: EditorSnapshot) => boolean;
        isEnabled?: (snapshot: EditorSnapshot) => boolean;
        label: string;
        name: string;
        run: (editor: Editor, event: MouseEvent) => void;
        shortcut?: string;
    }
    Index
    ariaLabel?: string

    Accessible name; falls back to label.

    dataset?: () => Readonly<Record<string, string | null>>

    Extra attributes set on every refresh, for state the document does not hold, such as whether the format painter is currently armed.

    icon?: IconName
    isActive?: (snapshot: EditorSnapshot) => boolean
    isEnabled?: (snapshot: EditorSnapshot) => boolean
    label: string

    Visible label, used when no icon is given and as the tooltip fallback.

    name: string
    run: (editor: Editor, event: MouseEvent) => void

    event is the click that triggered the item. Items that distinguish a double click (its detail is 2) can read it; most ignore it.

    shortcut?: string

    Appended to the tooltip, e.g. "Ctrl+B".