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

    Interface IEnumerationApi

    API for working with enumerations

    interface IEnumerationApi {
        _apiId: "mendix.EnumerationApi";
        addEnumeration(
            containerId: string,
            options?: EnumerationCreationOptions,
        ): Promise<Enumeration>;
        addEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): DisposeListener;
        applyChanges(operations: Operation[]): Promise<ApplyChangesResult>;
        createElement<TElement extends ElementBase>(
            type: TElement["$Type"],
            options?: TElement["$CreationOptions"],
        ): Promise<TElement>;
        createUnit(
            type: "Enumerations$Enumeration",
            containerId: string,
            options?: EnumerationCreationOptions,
        ): Promise<Enumeration>;
        deleteUnit(unitId: string): Promise<void>;
        getElementMetadata(): Promise<ElementMetadataMap>;
        loadUnits(
            type: "Enumerations$Enumeration",
            unitIds: string[],
        ): Promise<Enumeration[]>;
        removeEventListener<K extends never>(
            eventType: K,
            listener: EventHandler<{}, K>,
        ): void;
    }

    Hierarchy

    Index

    Properties

    _apiId: "mendix.EnumerationApi"

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

    Example: mendix.EditorsAPI, mycompany.MyFunkyAPI

    Methods

    • Adds an enumeration document to the specified container.

      Parameters

      • containerId: string

        The ID of the container where the enumeration will be added. It could be a module or folder.

      • Optionaloptions: EnumerationCreationOptions

        Options for that will be used during the enumeration initilization.

      Returns Promise<Enumeration>

      A promise that resolves to the newly created enumeration.

    • 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.

    • Parameters

      • operations: Operation[]

      Returns Promise<ApplyChangesResult>

    • Parameters

      • unitId: string

      Returns Promise<void>

    • Returns Promise<ElementMetadataMap>

    • Parameters

      • type: "Enumerations$Enumeration"
      • unitIds: string[]

      Returns Promise<Enumeration[]>

    • 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