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

    Interface IExtensionPermissionsApi<E>

    Every component API must implement this interface, which is usually done by inheriting from ComponentApiBase.

    This interface exists because APIs can be distributed by an interface alone (that inherits from this one), where the inplementation can live in another web context and is thus unknown.

    interface IExtensionPermissionsApi<
        E extends
            ExtensionPermissionsApiEventMap = ExtensionPermissionsApiEventMap,
    > {
        _apiId: "mendix.ExtensionPermissionsApi";
        addEventListener<K extends string | number | symbol>(
            eventType: K,
            listener: EventHandler<E, K>,
        ): DisposeListener;
        getPermissions(): Promise<PermissionInfo[]>;
        removeEventListener<K extends string | number | symbol>(
            eventType: K,
            listener: EventHandler<E, K>,
        ): void;
    }

    Type Parameters

    • E extends ExtensionPermissionsApiEventMap = ExtensionPermissionsApiEventMap

      An object type that represents the events that this API can emit (keys) and the shape of their event args (types).

    Hierarchy (View Summary)

    Index

    Properties

    _apiId: "mendix.ExtensionPermissionsApi"

    Unique identifier for the ExtensionPermissions API.

    Methods

    • Adds an event listener for the specified event type.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • eventType: K

        The type of event to listen for.

      • listener: EventHandler<E, K>

        The event listener to add.

      Returns DisposeListener

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

    • Gets the current permission state for this extension on demand.

      Returns Promise<PermissionInfo[]>

    • Removes an event listener for the specified event type.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • eventType: K

        The type of event to remove the listener from.

      • listener: EventHandler<E, K>

        The event listener to remove.

      Returns void