1 | import { Command } from './command';
|
2 | import { Manifest } from './manifest';
|
3 | import { PJSON } from './pjson';
|
4 | import { Topic } from './topic';
|
5 | export interface Options {
|
6 | root: string;
|
7 | name?: string;
|
8 | type?: string;
|
9 | tag?: string;
|
10 | ignoreManifest?: boolean;
|
11 | errorOnManifestCreate?: boolean;
|
12 | parent?: Plugin;
|
13 | children?: Plugin[];
|
14 | }
|
15 | export interface IPlugin {
|
16 | |
17 |
|
18 |
|
19 | _base: string;
|
20 | |
21 |
|
22 |
|
23 | name: string;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 | version: string;
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | pjson: PJSON.Plugin | PJSON.CLI;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | type: string;
|
41 | |
42 |
|
43 |
|
44 | root: string;
|
45 | |
46 |
|
47 |
|
48 |
|
49 | tag?: string;
|
50 | |
51 |
|
52 |
|
53 | valid: boolean;
|
54 | commands: Command.Plugin[];
|
55 | hooks: {
|
56 | [k: string]: string[];
|
57 | };
|
58 | readonly commandIDs: string[];
|
59 | readonly topics: Topic[];
|
60 | findCommand(id: string, opts: {
|
61 | must: true;
|
62 | }): Command.Class;
|
63 | findCommand(id: string, opts?: {
|
64 | must: boolean;
|
65 | }): Command.Class | undefined;
|
66 | load(): Promise<void>;
|
67 | }
|
68 | export declare class Plugin implements IPlugin {
|
69 | options: Options;
|
70 | _base: string;
|
71 | name: string;
|
72 | version: string;
|
73 | pjson: PJSON.Plugin;
|
74 | type: string;
|
75 | root: string;
|
76 | tag?: string;
|
77 | manifest: Manifest;
|
78 | commands: Command.Plugin[];
|
79 | hooks: {
|
80 | [k: string]: string[];
|
81 | };
|
82 | valid: boolean;
|
83 | alreadyLoaded: boolean;
|
84 | parent: Plugin | undefined;
|
85 | children: Plugin[];
|
86 | protected _debug: (..._: any[]) => void;
|
87 | protected warned: boolean;
|
88 | constructor(options: Options);
|
89 | load(): Promise<void>;
|
90 | get topics(): Topic[];
|
91 | get commandsDir(): string | undefined;
|
92 | get commandIDs(): string[];
|
93 | findCommand(id: string, opts: {
|
94 | must: true;
|
95 | }): Command.Class;
|
96 | findCommand(id: string, opts?: {
|
97 | must: boolean;
|
98 | }): Command.Class | undefined;
|
99 | protected _manifest(ignoreManifest: boolean, errorOnManifestCreate?: boolean): Promise<Manifest>;
|
100 | protected warn(err: any, scope?: string): void;
|
101 | private addErrorScope;
|
102 | }
|