import type { Plugin } from './interfaces'; import type { Logger } from './logging'; export declare type PluginEventArgs = { [K in keyof Required as Required[K] extends (...args: any[]) => any ? K : never]: Required[K] extends (...args: any[]) => any ? Parameters[K]> : never; }; export default class PluginInterface { private plugins?; constructor(); /** * @deprecated use the `options` parameter pattern instead */ constructor(plugins?: Plugin[], logger?: Logger); constructor(plugins?: Plugin[], options?: { logger?: Logger; suppressErrors?: boolean; }); private logger; /** * Should plugin errors cause the program to fail, or should they be caught and simply logged */ private suppressErrors; /** * Call `event` on plugins */ emit & string>(event: K, ...args: PluginEventArgs[K]): void; /** * Add a plugin to the beginning of the list of plugins */ addFirst(plugin: T): T; /** * Add a plugin to the end of the list of plugins */ add(plugin: T): T; has(plugin: Plugin): boolean; remove(plugin: T): T; /** * Remove all plugins */ clear(): void; }