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