UXP Toolkit
    Preparing search index...

    Interface UxpMenuItems

    Class describing the menu of a panel.

    interface UxpMenuItems {
        getItem: (id: string) => UxpMenuItem;
        getItemAt: (index: number) => UxpMenuItem;
        insertAt: (index: number, newItem: MenuItem | "-") => void;
        removeAt: (index: number) => void;
        size: number;
    }
    Index

    Properties

    getItem: (id: string) => UxpMenuItem

    Get menu item with specified ID.

    Type Declaration

    getItemAt: (index: number) => UxpMenuItem

    Get menu item at specified index.

    Type Declaration

    insertAt: (index: number, newItem: MenuItem | "-") => void

    Inserts/replaces the menu item at the specified index with the new menu item.

    • index < size of menuItems array : Replaces the existing menu item.
    • index = size of menuItems array : Inserts menu item at end.
    • index > size of menuItems array : Throws invalid index exception.
    removeAt: (index: number) => void

    Removes menu item from specified index.

    size: number

    Get number of menu items.