import { Plugin } from './plugin'; /** * Interface which describes a plugin registry filter. */ export interface PluginLookupFilter { (plugin: PluginType): boolean; } /** * Interface which describes a plugin registry callback. */ export interface PluginLookupCallback { (plugin: PluginType): Promise; } /** * Interface which describes a plugin registry. */ export interface PluginLookup { /** * Get a list of plugins in the registry optionally filtered. * * @param {PluginLookupFilter} [filter=null] * Optional. A filter which should be applied to each plugin. * Defaults to all available plugins. * * @return {Plugin[]} * A list of plugins. */ list(filter?: PluginLookupFilter): PluginBaseType[]; /** * Iterate through the plugin registry. * * @param {PluginLookupCallback} callback * A callback which should be applied to each plugin. * * @returns {Promise} * A promise to iterate through the plugins. */ each(callback: PluginLookupCallback): Promise; }