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

    Interface ICommandRegistrationApi

    API for registering commands in Studio Pro.

    interface ICommandRegistrationApi {
        _apiId: "mendix.CommandRegistrationApi";
        addEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): DisposeListener;
        registerCommand<T extends object>(
            id: string,
            action: (arg: T) => void,
            description?: string,
        ): Promise<void>;
        removeEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _apiId: "mendix.CommandRegistrationApi"

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

    Example: mendix.EditorsAPI, mycompany.MyFunkyAPI

    Methods

    • Adds an event listener for the specified event type.

      Type Parameters

      • K extends never

      Parameters

      • eventType: K

        The type of event to listen for.

      • listener: EventHandler<{}, K>

        The event listener to add.

      Returns DisposeListener

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

    • Type Parameters

      • T extends object

      Parameters

      • id: string
      • action: (arg: T) => void
      • Optionaldescription: string

      Returns Promise<void>

    • Removes an event listener for the specified event type.

      Type Parameters

      • K extends never

      Parameters

      • eventType: K

        The type of event to remove the listener from.

      • listener: EventHandler<{}, K>

        The event listener to remove.

      Returns void