1 | import { Hooks } from './hooks';
|
2 | import { PJSON } from './pjson';
|
3 | import * as Plugin from './plugin';
|
4 | export declare type PlatformTypes = 'darwin' | 'linux' | 'win32' | 'aix' | 'freebsd' | 'openbsd' | 'sunos';
|
5 | export declare type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86';
|
6 | export interface Options extends Plugin.Options {
|
7 | devPlugins?: boolean;
|
8 | userPlugins?: boolean;
|
9 | }
|
10 | export interface IConfig extends Plugin.IPlugin {
|
11 | pjson: PJSON.CLI;
|
12 | |
13 |
|
14 |
|
15 | arch: ArchTypes;
|
16 | |
17 |
|
18 |
|
19 | bin: string;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 | cacheDir: string;
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 | configDir: string;
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 | dataDir: string;
|
38 | |
39 |
|
40 |
|
41 | dirname: string;
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 | errlog: string;
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 | home: string;
|
54 | |
55 |
|
56 |
|
57 | platform: PlatformTypes;
|
58 | |
59 |
|
60 |
|
61 | shell: string;
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 | userAgent: string;
|
68 | |
69 |
|
70 |
|
71 | windows: boolean;
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 | debug: number;
|
78 | |
79 |
|
80 |
|
81 | npmRegistry: string;
|
82 | userPJSON?: PJSON.User;
|
83 | runCommand(id: string, argv?: string[]): Promise<void>;
|
84 | }
|
85 | export declare class Config extends Plugin.Plugin implements IConfig {
|
86 | arch: ArchTypes;
|
87 | bin: string;
|
88 | cacheDir: string;
|
89 | configDir: string;
|
90 | dataDir: string;
|
91 | dirname: string;
|
92 | errlog: string;
|
93 | home: string;
|
94 | platform: PlatformTypes;
|
95 | shell: string;
|
96 | windows: boolean;
|
97 | userAgent: string;
|
98 | debug: number;
|
99 | npmRegistry: string;
|
100 | pjson: PJSON.CLI;
|
101 | userPJSON?: PJSON.User;
|
102 | constructor(opts: Options);
|
103 | runHook<T extends Hooks, K extends keyof T>(event: K, opts: T[K]): Promise<void>;
|
104 | runCommand(id: string, argv?: string[]): Promise<void>;
|
105 | scopedEnvVar(k: string): string | undefined;
|
106 | scopedEnvVarTrue(k: string): boolean;
|
107 | scopedEnvVarKey(k: string): string;
|
108 | protected dir(category: 'cache' | 'data' | 'config'): string;
|
109 | protected windowsHome(): string | undefined;
|
110 | protected windowsHomedriveHome(): string | undefined;
|
111 | protected windowsUserprofileHome(): string | undefined;
|
112 | protected macosCacheDir(): string | undefined;
|
113 | protected _shell(): string;
|
114 | protected _debug(): number;
|
115 | }
|
116 | export declare type LoadOptions = Options | string | IConfig | undefined;
|
117 | export declare function load(opts?: LoadOptions): IConfig;
|