UNPKG

1.42 kBTypeScriptView Raw
1/**
2 * Represents an environment mode. Supports `production`, `development`, `demo`, and `test`
3 * with the default mode being `production`.
4 *
5 * To set the mode, `export SFDX_ENV=<mode>` in your current environment.
6 */
7export declare enum Mode {
8 PRODUCTION = "production",
9 DEVELOPMENT = "development",
10 DEMO = "demo",
11 TEST = "test"
12}
13/**
14 * Global constants, methods, and configuration.
15 */
16export declare class Global {
17 /**
18 * The global folder in which state is stored.
19 */
20 static readonly STATE_FOLDER = ".sfdx";
21 /**
22 * The full system path to the global state folder.
23 *
24 * **See** {@link Global.STATE_FOLDER}
25 */
26 static readonly DIR: string;
27 /**
28 * The full system path to the global log file.
29 */
30 static readonly LOG_FILE_PATH: string;
31 /**
32 * Gets the current mode environment variable as a {@link Mode} instance.
33 *
34 * ```
35 * console.log(Global.getEnvironmentMode() === Mode.PRODUCTION);
36 * ```
37 */
38 static getEnvironmentMode(): Mode;
39 /**
40 * Creates a directory within {@link Global.DIR}, or {@link Global.DIR} itself if the `dirPath` param
41 * is not provided. This is resolved or rejected when the directory creation operation has completed.
42 *
43 * @param dirPath The directory path to be created within {@link Global.DIR}.
44 */
45 static createDir(dirPath?: string): Promise<void>;
46}