1 | import { Command } from './command';
|
2 | import { Hooks } from './hooks';
|
3 | import { PJSON } from './pjson';
|
4 | import * as Plugin from './plugin';
|
5 | import { Topic } from './topic';
|
6 | export declare type PlatformTypes = 'darwin' | 'linux' | 'win32' | 'aix' | 'freebsd' | 'openbsd' | 'sunos';
|
7 | export declare type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86';
|
8 | export interface Options extends Plugin.Options {
|
9 | devPlugins?: boolean;
|
10 | userPlugins?: boolean;
|
11 | }
|
12 | export interface IConfig {
|
13 | name: string;
|
14 | version: string;
|
15 | pjson: PJSON.CLI;
|
16 | |
17 |
|
18 |
|
19 | arch: ArchTypes;
|
20 | |
21 |
|
22 |
|
23 | bin: string;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 | cacheDir: string;
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | configDir: string;
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 | dataDir: string;
|
42 | |
43 |
|
44 |
|
45 | dirname: string;
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 | errlog: string;
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 | home: string;
|
58 | |
59 |
|
60 |
|
61 | platform: PlatformTypes;
|
62 | |
63 |
|
64 |
|
65 | shell: string;
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 | userAgent: string;
|
72 | |
73 |
|
74 |
|
75 | windows: boolean;
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 | debug: number;
|
82 | |
83 |
|
84 |
|
85 | npmRegistry: string;
|
86 | userPJSON?: PJSON.User;
|
87 | plugins: Plugin.IPlugin[];
|
88 | readonly commands: Command.Plugin[];
|
89 | readonly topics: Topic[];
|
90 | readonly commandIDs: string[];
|
91 | runCommand(id: string, argv?: string[]): Promise<void>;
|
92 | runHook<T extends Hooks, K extends keyof T>(event: K, opts: T[K]): Promise<void>;
|
93 | findCommand(id: string, opts: {
|
94 | must: true;
|
95 | }): Command.Plugin;
|
96 | findCommand(id: string, opts?: {
|
97 | must: boolean;
|
98 | }): Command.Plugin | undefined;
|
99 | findTopic(id: string, opts: {
|
100 | must: true;
|
101 | }): Topic;
|
102 | findTopic(id: string, opts?: {
|
103 | must: boolean;
|
104 | }): Topic | undefined;
|
105 | }
|
106 | export declare class Config implements IConfig {
|
107 | _base: string;
|
108 | name: string;
|
109 | version: string;
|
110 | root: string;
|
111 | arch: ArchTypes;
|
112 | bin: string;
|
113 | cacheDir: string;
|
114 | configDir: string;
|
115 | dataDir: string;
|
116 | dirname: string;
|
117 | errlog: string;
|
118 | home: string;
|
119 | platform: PlatformTypes;
|
120 | shell: string;
|
121 | windows: boolean;
|
122 | userAgent: string;
|
123 | debug: number;
|
124 | npmRegistry: string;
|
125 | pjson: PJSON.CLI;
|
126 | userPJSON?: PJSON.User;
|
127 | plugins: Plugin.IPlugin[];
|
128 | protected warned: boolean;
|
129 | constructor(opts: Options);
|
130 | runHook<T extends Hooks, K extends keyof T>(event: K, opts: T[K]): Promise<void>;
|
131 | runCommand(id: string, argv?: string[]): Promise<void>;
|
132 | scopedEnvVar(k: string): string | undefined;
|
133 | scopedEnvVarTrue(k: string): boolean;
|
134 | scopedEnvVarKey(k: string): string;
|
135 | findCommand(id: string, opts: {
|
136 | must: true;
|
137 | }): Command.Plugin;
|
138 | findCommand(id: string, opts?: {
|
139 | must: boolean;
|
140 | }): Command.Plugin | undefined;
|
141 | findTopic(id: string, opts: {
|
142 | must: true;
|
143 | }): Topic;
|
144 | findTopic(id: string, opts?: {
|
145 | must: boolean;
|
146 | }): Topic | undefined;
|
147 | readonly commands: Command.Plugin[];
|
148 | readonly commandIDs: string[];
|
149 | readonly topics: Topic[];
|
150 | protected dir(category: 'cache' | 'data' | 'config'): string;
|
151 | protected windowsHome(): string | undefined;
|
152 | protected windowsHomedriveHome(): string | undefined;
|
153 | protected windowsUserprofileHome(): string | undefined;
|
154 | protected macosCacheDir(): string | undefined;
|
155 | protected _shell(): string;
|
156 | protected _debug(): number;
|
157 | protected loadPlugins(root: string, type: string, plugins: (string | {
|
158 | root?: string;
|
159 | name?: string;
|
160 | tag?: string;
|
161 | })[], options?: {
|
162 | must?: boolean;
|
163 | }): void;
|
164 | protected warn(err: any, scope?: string): void;
|
165 | }
|
166 | export declare type LoadOptions = Options | string | IConfig | undefined;
|
167 | export declare function load(opts?: LoadOptions): IConfig;
|