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