import type { Profile } from '@remixproject/plugin-utils'; import { Plugin, PluginOptions } from './abstract'; export declare class Engine { private plugins; private events; private listeners; private eventMemory; private manager; onRegistration?(plugin: Plugin): void; /** Update the options of the plugin when being registered */ setPluginOption?(profile: Profile): PluginOptions; /** * Broadcast an event to the plugin listening * @param emitter Plugin name that emits the event * @param event The name of the event * @param payload The content of the event */ private broadcast; /** * Start listening on an event from another plugin * @param listener The name of the plugin that listen on the event * @param emitter The name of the plugin that emit the event * @param event The name of the event * @param cb Callback function to trigger when the event is trigger */ private addListener; /** * Remove an event from the list of a listener's events * @param listener The name of the plugin that was listening on the event * @param emitter The name of the plugin that emitted the event * @param event The name of the event */ private removeListener; /** * Create a listener that listen only once on an event * @param listener The name of the plugin that listen on the event * @param emitter The name of the plugin that emitted the event * @param event The name of the event * @param cb Callback function to trigger when event is triggered */ private listenOnce; /** * Call a method of a plugin from another * @param caller The name of the plugin that calls the method * @param path The path of the plugin that manages the method * @param method The name of the method * @param payload The argument to pass to the method */ private callMethod; /** * Create an object to easily access any registered plugin * @param name Name of the caller plugin * @note This method creates a snapshot at the time of activation */ private createApp; /** * Activate a plugin by making its method and event available * @param name The name of the plugin * @note This method is trigger by the plugin manager when a plugin has been activated */ private activatePlugin; /** * Deactivate a plugin by removing all its event listeners and making it inaccessible * @param name The name of the plugin * @note This method is trigger by the plugin manager when a plugin has been deactivated */ private deactivatePlugin; /** * Update error message when trying to call a method when not activated * @param plugin The deactivated plugin to update the methods from */ private updateErrorHandler; /** * Register a plugin to the engine and update the manager * @param plugin The plugin */ register(plugins: Plugin | Plugin[]): string | string[]; /** Register the manager */ private registerManager; /** Remove plugin(s) from engine */ remove(names: string | string[]): Promise | Promise; /** * Check is a name is already registered * @param name Name of the plugin */ isRegistered(name: string): boolean; }