AddOnContextType

Context type for the AddOnContext, providing add-on data and utility functions.

Definition

interface AddOnContextType {
    /**
     * Base URL for add-on assets stored in S3.
     */
    AddOnS3BaseUrl: string;

    /**
     * Array of available add-ons.
     */
    addOns: IAddOn[];

    /**
     * Array of installed add-ons.
     */
    installedAddOns: IInstalledAddOn[];

    /**
     * Checks if a module ID corresponds to an add-on.
     */
    isAddOn: (moduleId: string) => boolean;

    /**
     * Retrieves details for an add-on by its module ID, or null if not found.
     */
    getAddOnDetails: (moduleId: string) => IAddOn | null;

    /**
     * Checks if an add-on is installed and configured.
     */
    isAddOnInstalledAndConfigured: (moduleId: string) => { installed: boolean; configured: boolean };

    /**
     * Gets the thumbnail image path for an add-on by its module ID, or null if not found.
     */
    getThunmbNailImagePath: (moduleId: string) => string | null;

    /**
     * Checks if configuration is required for an add-on.
     */
    isConfigurationRequired: (moduleId: string) => boolean;

    /**
     * Refreshes the list of installed add-ons.
     */
    refreshInstalledAddOns: () => Promise<void>;

    /**
     * Gets the name of an add-on from a widget or module ID, or null if not found.
     */
    getAddOnName: (widget?: IWidget, moduleId?: string) => string | null;
}

Usage

Last updated