import { ServiceContainer } from '@govflanders/vl-widget-dependency-injection'; import { ModuleManager } from '@govflanders/vl-widget-module'; import { PluginContext } from './context'; import { PluginFactory } from './factory'; import { Plugin } from './plugin'; /** * Interface which describes a plugin discovery mechanism. */ export interface PluginDiscovery { /** * Resolve the plugin factory. * * @param {PluginContext} pluginContext * An object which describes a plugin context. * * @return {Promise} * A promise to resolve the plugin factory. */ resolvePluginFactory(pluginContext: PluginContext): Promise>; } /** * Plugin discovery which uses a inversion of control container. */ export declare class ContainerPluginDiscovery implements PluginDiscovery { /** * Holds the service container. * * @var {ServiceContainer} */ protected container: ServiceContainer; /** * Holds the plugin factory service identifier. * * @var {string} */ protected pluginFactoryServiceId: string; /** * Create a ContainerPluginDiscovery object. * * @param {ServiceContainer} container * A service container. * @param {string} pluginFactoryServiceId * Name of the plugin factory service. */ constructor(container: ServiceContainer, pluginFactoryServiceId: string); /** * Get the service container. * * @return {ServiceContainer} * A service container. */ protected getContainer(): ServiceContainer; /** * Get the plugin service factory identifier. * * @return {string} * The service identifier. */ protected getPluginFactoryServiceId(): string; /** * Get the plugin factory from the service container. * * @param {PluginContext} pluginContext * An object which represents the plugin context. * * @return {PluginFactory} * An object which represents the plugin factory. */ protected getPluginFactoryFromContainer(pluginContext: PluginContext): PluginFactory; /** * {@inheritdoc} */ resolvePluginFactory(pluginContext: PluginContext): Promise>; } /** * Plugin discovery which supports loading modules. */ export declare class ModulePluginDiscovery extends ContainerPluginDiscovery { /** * Holds the module manager. * * @var {ModuleManager} */ protected moduleManager: ModuleManager; /** * Create ModulePluginDiscovery object. * * @param {ModuleManager} moduleManager * The module manager. * @param {ServiceContainer} container * A service container. * @param {string} pluginFactoryServiceId * Name of the plugin factory service. */ constructor(moduleManager: ModuleManager, container: ServiceContainer, pluginFactoryServiceId: string); /** * Get the module manager. * * @return {ModuleManager} * The module manager. */ protected getModuleManager(): ModuleManager; /** * {@inheritdoc} */ resolvePluginFactory(pluginContext: PluginContext): Promise>; }