@villedemontreal/workit-core
Version:
This package provides default and no-op implementations of the WorkIt types for client packages.
33 lines (32 loc) • 1.25 kB
TypeScript
import { IIoC, ILogger, IPlugins } from '@villedemontreal/workit-types';
/**
* The PluginLoader class can load instrumentation plugins that use a patch
* mechanism to enable automatic tracing for specific target modules.
*/
export declare class PluginLoader {
readonly ioc: IIoC;
readonly logger: ILogger;
/** A list of loaded plugins. */
private _plugins;
/**
* A field that tracks whether the plugin has been loaded
* for the first time, as well as whether the plugin is activated or not.
*/
private _hookState;
/** Constructs a new PluginLoader instance. */
constructor(ioc: IIoC, logger: ILogger);
/**
* Loads a list of plugins. Each plugin module should implement the core
* {@link Plugin} interface and export an instance named as 'plugin'.
* @param Plugins an object whose keys are plugin names and whose
* {@link PluginConfig} values indicate several configuration options.
*/
load(plugins: IPlugins): void;
/** Unloads plugins. */
unload(): void;
}
/**
* Adds a search path for plugin modules. Intended for testing purposes only.
* @param searchPath The path to add.
*/
export declare function searchPathForTest(searchPath: string): void;