pCon.basket - Plugin Development
    Preparing search index...

    Interface PluginManager

    interface PluginManager {
        disableCategories(
            pDisabledCategories: ReadonlySet<PluginCategory>,
        ): void;
        disablePlugins(pDisabledPlugins: ReadonlySet<string>): void;
        getDescriptor(pName: string): PluginDescriptor | null;
        getDescriptorByCategory(
            pCategory: PluginCategory,
            pSubCategory?: string,
        ): PluginDescriptor | null;
        getDescriptorsByCategory(
            pCategory: PluginCategory,
            pSubCategory?: string,
            pSorted?: boolean,
        ): PluginDescriptor[];
        getPlugin<T extends Plugin>(pName: string): Promise<T>;
        getPluginIfAvailable<T extends Plugin>(pName: string): Promise<T | null>;
        registerPlugin(pPlugin: Plugin): void;
    }
    Index
    • Disables a set of plugin categories. Once a plugin category is disabled it can not be activated again. Disabling an already active plugin instance/component is not possible.

      Parameters

      Returns void

    • Disables a set of plugins (plugin names). Once a plugin is disabled it can not be activated again. Disabling an already active plugin instance/component is not possible.

      Parameters

      • pDisabledPlugins: ReadonlySet<string>

      Returns void

    • Returns the plugin descriptor for the given plugin name.

      Parameters

      • pName: string

      Returns PluginDescriptor | null

    • Returns the first available plugin descriptor for the given plugin category. If multiple plugins exist for the same plugin category default plugins have lower priority.

      Parameters

      Returns PluginDescriptor | null

    • Returns an array of all available plugin descriptors for the given plugin category.

      Parameters

      • pCategory: PluginCategory
      • OptionalpSubCategory: string
      • OptionalpSorted: boolean

        If true the returned list will be sorted according to the sortWeight of the plugin.

      Returns PluginDescriptor[]

    • Retrieves a plugin by its name. The plugin will be loaded if it is not yet registered.

      Type Parameters

      Parameters

      • pName: string

      Returns Promise<T>

    • Retrieves a plugin by its name. Returns null if the plugin is unavailable.

      Type Parameters

      Parameters

      • pName: string

      Returns Promise<T | null>

    • Registers a new plugin instance. Has to be called from plugins after they were loaded.

      Parameters

      Returns void