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

    Interface IMessageBoxApi

    API for showing message boxes

    interface IMessageBoxApi {
        _apiId: "mendix.MessageBoxApi";
        addEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): DisposeListener;
        removeEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): void;
        show(
            type: "info" | "warning" | "error",
            message: string,
            details?: string,
        ): Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _apiId: "mendix.MessageBoxApi"

    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.

    • 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

    • Shows a message box with the given type, message and optional details.

      Parameters

      • type: "info" | "warning" | "error"

        The type of message box. One of "info", "warning" or "error".

      • message: string

        The message to show in the message box.

      • Optionaldetails: string

        The optional details to show in the message box.

      Returns Promise<void>

      A promise that resolves when the message box is closed.