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