UNPKG

1.58 kBTypeScriptView Raw
1export interface PJSON {
2 [k: string]: any;
3 dependencies?: {
4 [name: string]: string;
5 };
6 anycli: {
7 schema?: number;
8 };
9}
10export declare namespace PJSON {
11 interface Plugin extends PJSON {
12 name: string;
13 version: string;
14 anycli: PJSON['anycli'] & {
15 schema?: number;
16 title?: string;
17 description?: string;
18 hooks?: {
19 [name: string]: (string | string[]);
20 };
21 commands?: string;
22 plugins?: string[];
23 devPlugins?: string[];
24 topics?: {
25 [k: string]: {
26 description?: string;
27 subtopics?: Plugin['anycli']['topics'];
28 hidden?: boolean;
29 };
30 };
31 };
32 }
33 interface CLI extends Plugin {
34 anycli: Plugin['anycli'] & {
35 schema?: number;
36 bin?: string;
37 npmRegistry?: string;
38 scope?: string;
39 dirname?: string;
40 };
41 }
42 interface User extends PJSON {
43 private?: boolean;
44 anycli: PJSON['anycli'] & {
45 plugins?: (string | PluginTypes.User | PluginTypes.Link)[];
46 };
47 }
48 type PluginTypes = PluginTypes.User | PluginTypes.Link;
49 namespace PluginTypes {
50 interface User {
51 type: 'user';
52 name: string;
53 tag?: string;
54 }
55 interface Link {
56 type: 'link';
57 name: string;
58 root: string;
59 }
60 }
61}