UNPKG

2.18 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 * Enable interoperability between `.sfdx` and `.sf`.
19 *
20 * When @salesforce/core@v2 is deprecated and no longer used, this can be removed.
21 */
22 static SFDX_INTEROPERABILITY: boolean;
23 /**
24 * The global folder in which sfdx state is stored.
25 */
26 static readonly SFDX_STATE_FOLDER = ".sfdx";
27 /**
28 * The global folder in which sf state is stored.
29 */
30 static readonly SF_STATE_FOLDER = ".sf";
31 /**
32 * The preferred global folder in which state is stored.
33 */
34 static readonly STATE_FOLDER = ".sfdx";
35 /**
36 * The full system path to the global sfdx state folder.
37 *
38 * **See** {@link Global.SFDX_STATE_FOLDER}
39 */
40 static get SFDX_DIR(): string;
41 /**
42 * The full system path to the global sf state folder.
43 *
44 * **See** {@link Global.SF_STATE_FOLDER}
45 */
46 static get SF_DIR(): string;
47 /**
48 * The full system path to the preferred global state folder
49 */
50 static get DIR(): string;
51 /**
52 * The full system path to the global log file.
53 */
54 static readonly LOG_FILE_PATH: string;
55 /**
56 * Gets the current mode environment variable as a {@link Mode} instance.
57 *
58 * ```
59 * console.log(Global.getEnvironmentMode() === Mode.PRODUCTION);
60 * ```
61 */
62 static getEnvironmentMode(): Mode;
63 /**
64 * Creates a directory within {@link Global.SFDX_DIR}, or {@link Global.SFDX_DIR} itself if the `dirPath` param
65 * is not provided. This is resolved or rejected when the directory creation operation has completed.
66 *
67 * @param dirPath The directory path to be created within {@link Global.SFDX_DIR}.
68 */
69 static createDir(dirPath?: string): Promise<void>;
70}