API for working with (document) tabs in the working area of Studio Pro

interface ITabApi {
    _apiId: "mendix.TabApi";
    addEventListener<K>(eventType: K, listener: EventHandler<{}, K>): DisposeListener;
    close(tabHandle: TabHandle): Promise<void>;
    open(tabInfo: TabInfo, uiSpec: UISpec): Promise<TabHandle>;
    removeEventListener<K>(eventType: K, listener: EventHandler<{}, K>): void;
}

Hierarchy (view full)

Properties

_apiId

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.

  • Closes the tab with the given handle.

    Parameters

    • tabHandle: TabHandle

      The handle of the tab to be closed

    Returns Promise<void>

  • Opens a new tab in the working area of Studio Pro.

    Parameters

    • tabInfo: TabInfo

      Information about the tab to be opened

    • uiSpec: UISpec

      UI specification of the UI to show inside the tab

    Returns Promise<TabHandle>

    A handle to the tab that can be used to close it

  • 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