@mendix/extensions-api - v0.2.4
    Preparing search index...

    Interface IExtensionsMenuApi

    API for working with the Extensions menu in Studio Pro.

    interface IExtensionsMenuApi {
        _apiId: "mendix.ExtensionsMenuApi";
        add(menuItem: Menu): Promise<void>;
        addEventListener<K extends "menuItemActivated">(
            eventType: K,
            listener: EventHandler<ExtensionsMenuApiEventMap, K>,
        ): DisposeListener;
        removeEventListener<K extends "menuItemActivated">(
            eventType: K,
            listener: EventHandler<ExtensionsMenuApiEventMap, K>,
        ): void;
        update(
            menuId: string,
            state: { caption?: string; enabled?: boolean },
        ): Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _apiId: "mendix.ExtensionsMenuApi"

    Unique identifier that can be used to register or retrieve a specific API.

    Example: mendix.EditorsAPI, mycompany.MyFunkyAPI

    Methods

    • Adds a menu item to the Extensions menu in the main menu bar of Studio Pro.

      Parameters

      • menuItem: Menu

        The menu item to add.

      Returns Promise<void>

    • Adds an event listener for the specified event type.

      Type Parameters

      • K extends "menuItemActivated"

      Parameters

      • eventType: K

        The type of event to listen for.

      • listener: EventHandler<ExtensionsMenuApiEventMap, K>

        The event listener to add.

      Returns DisposeListener

      A function that can be called to remove the event listener.

    • Removes an event listener for the specified event type.

      Type Parameters

      • K extends "menuItemActivated"

      Parameters

      • eventType: K

        The type of event to remove the listener from.

      • listener: EventHandler<ExtensionsMenuApiEventMap, K>

        The event listener to remove.

      Returns void

    • Updates a menu item in the Extensions menu in the main menu bar of Studio Pro.

      Parameters

      • menuId: string

        The ID of the menu to be updated.

      • state: { caption?: string; enabled?: boolean }

        The menu item state to update (caption and/or enabled).

      Returns Promise<void>