1 | import * as Config from '.';
|
2 | export interface Options {
|
3 | root: string;
|
4 | name?: string;
|
5 | type?: string;
|
6 | tag?: string;
|
7 | }
|
8 | export interface IPlugin {
|
9 | |
10 |
|
11 |
|
12 | _base: string;
|
13 | |
14 |
|
15 |
|
16 | name: string;
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 | version: string;
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 | pjson: Config.PJSON;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | type: string;
|
34 | |
35 |
|
36 |
|
37 | root: string;
|
38 | |
39 |
|
40 |
|
41 |
|
42 | tag?: string;
|
43 | |
44 |
|
45 |
|
46 | plugins: IPlugin[];
|
47 | |
48 |
|
49 |
|
50 | valid: boolean;
|
51 | allCommands(): Config.Command.Plugin[];
|
52 | allTopics(): Config.Topic[];
|
53 | findCommand(id: string, opts: {
|
54 | must: true;
|
55 | }): Config.Command.Plugin;
|
56 | findCommand(id: string, opts?: {
|
57 | must: boolean;
|
58 | }): Config.Command.Plugin | undefined;
|
59 | findTopic(id: string, opts: {
|
60 | must: true;
|
61 | }): Config.Topic;
|
62 | findTopic(id: string, opts?: {
|
63 | must: boolean;
|
64 | }): Config.Topic | undefined;
|
65 | runHook<T extends {}>(event: string, opts?: T): Promise<void>;
|
66 | }
|
67 | export declare class Plugin implements IPlugin {
|
68 | _base: string;
|
69 | name: string;
|
70 | version: string;
|
71 | pjson: Config.PJSON;
|
72 | type: string;
|
73 | root: string;
|
74 | tag?: string;
|
75 | manifest: Config.Manifest;
|
76 | topics: Config.Topic[];
|
77 | plugins: IPlugin[];
|
78 | hooks: {
|
79 | [k: string]: string[];
|
80 | };
|
81 | valid: boolean;
|
82 | constructor(opts: Options);
|
83 | readonly commandsDir: string | undefined;
|
84 | allTopics(): Config.Topic[];
|
85 | allCommands(): {
|
86 | load: () => Config.Command.Full;
|
87 | id: string;
|
88 | hidden: boolean;
|
89 | aliases: string[];
|
90 | description?: string | undefined;
|
91 | title?: string | undefined;
|
92 | usage?: string | string[] | undefined;
|
93 | examples?: string[] | undefined;
|
94 | type?: string | undefined;
|
95 | flags: {
|
96 | [name: string]: Config.Command.Flag.Boolean | Config.Command.Flag.Option;
|
97 | };
|
98 | args: {
|
99 | name: string;
|
100 | description?: string | undefined;
|
101 | required?: boolean | undefined;
|
102 | hidden?: boolean | undefined;
|
103 | default?: string | undefined;
|
104 | options?: string[] | undefined;
|
105 | }[];
|
106 | }[];
|
107 | findCommand(id: string, opts: {
|
108 | must: true;
|
109 | }): Config.Command.Plugin;
|
110 | findCommand(id: string, opts?: {
|
111 | must: boolean;
|
112 | }): Config.Command.Plugin | undefined;
|
113 | _findCommand(id: string): Config.Command.Full;
|
114 | findTopic(id: string, opts: {
|
115 | must: true;
|
116 | }): Config.Topic;
|
117 | findTopic(id: string, opts?: {
|
118 | must: boolean;
|
119 | }): Config.Topic | undefined;
|
120 | runHook<T extends {}>(event: string, opts?: T): Promise<void>;
|
121 | protected _manifest(): Config.Manifest;
|
122 | protected loadPlugins(dev?: boolean): Config.PJSON.Plugin[] | undefined;
|
123 | }
|