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