import * as Config from '.'; export interface Options { root: string; name?: string; type?: string; tag?: string; } export interface IPlugin { /** * @anycli/config version */ _base: string; /** * name from package.json */ name: string; /** * version from package.json * * example: 1.2.3 */ version: string; /** * full package.json * * parsed with read-pkg */ pjson: Config.PJSON; /** * used to tell the user how the plugin was installed * examples: core, link, user, dev */ type: string; /** * base path of plugin */ root: string; /** * npm dist-tag of plugin * only used for user plugins */ tag?: string; /** * subplugins of this plugin */ plugins: IPlugin[]; /** * if it appears to be an npm package but does not look like it's really a CLI plugin, this is set to false */ valid: boolean; allCommands(): Config.Command.Plugin[]; allTopics(): Config.Topic[]; findCommand(id: string, opts: { must: true; }): Config.Command.Plugin; findCommand(id: string, opts?: { must: boolean; }): Config.Command.Plugin | undefined; findTopic(id: string, opts: { must: true; }): Config.Topic; findTopic(id: string, opts?: { must: boolean; }): Config.Topic | undefined; runHook(event: string, opts?: T): Promise; } export declare class Plugin implements IPlugin { _base: string; name: string; version: string; pjson: Config.PJSON; type: string; root: string; tag?: string; manifest: Config.Manifest; topics: Config.Topic[]; plugins: IPlugin[]; hooks: { [k: string]: string[]; }; valid: boolean; constructor(opts: Options); readonly commandsDir: string | undefined; allTopics(): Config.Topic[]; allCommands(): { load: () => Config.Command.Full; id: string; hidden: boolean; aliases: string[]; description?: string | undefined; title?: string | undefined; usage?: string | string[] | undefined; examples?: string[] | undefined; type?: string | undefined; flags: { [name: string]: Config.Command.Flag.Boolean | Config.Command.Flag.Option; }; args: { name: string; description?: string | undefined; required?: boolean | undefined; hidden?: boolean | undefined; default?: string | undefined; options?: string[] | undefined; }[]; }[]; findCommand(id: string, opts: { must: true; }): Config.Command.Plugin; findCommand(id: string, opts?: { must: boolean; }): Config.Command.Plugin | undefined; _findCommand(id: string): Config.Command.Full; findTopic(id: string, opts: { must: true; }): Config.Topic; findTopic(id: string, opts?: { must: boolean; }): Config.Topic | undefined; runHook(event: string, opts?: T): Promise; protected _manifest(): Config.Manifest; protected loadPlugins(dev?: boolean): Config.PJSON.Plugin[] | undefined; }