UNPKG

1.08 kBTypeScriptView Raw
1import { ICachedCommand, IConfig, IEngine, IPlugin, IPluginManifest, ITopic, LoadPluginOptions } from '@anycli/config';
2export default class Engine implements IEngine {
3 config: IConfig;
4 private readonly _plugins;
5 private readonly _commands;
6 private readonly _topics;
7 private readonly _hooks;
8 private rootPlugin;
9 private debug;
10 readonly plugins: IPlugin[];
11 readonly topics: ITopic[];
12 readonly commands: ICachedCommand[];
13 readonly commandIDs: string[];
14 readonly rootTopics: ITopic[];
15 readonly rootCommands: ICachedCommand[];
16 load(config: IConfig): Promise<void>;
17 findCommand(id: string, must: true): ICachedCommand;
18 findCommand(id: string, must?: true): ICachedCommand | undefined;
19 findTopic(name: string, must: true): ITopic;
20 findTopic(name: string, must?: boolean): ITopic | undefined;
21 runHook<T extends {}>(event: string, opts: T): Promise<void>;
22 loadPlugin(opts: LoadPluginOptions): Promise<IPlugin>;
23 getPluginManifest(config: IConfig, opts: LoadPluginOptions): Promise<IPluginManifest>;
24}