@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
67 lines (66 loc) • 2.07 kB
TypeScript
/**
* Represents an environment mode. Supports `production`, `development`, `demo`, and `test`
* with the default mode being `production`.
*
* To set the mode, `export SFDX_ENV=<mode>` in your current environment.
*/
export declare enum Mode {
PRODUCTION = "production",
DEVELOPMENT = "development",
DEMO = "demo",
TEST = "test"
}
/**
* Global constants, methods, and configuration.
*/
export declare class Global {
/**
* Enable interoperability between `.sfdx` and `.sf`.
*
* When @salesforce/core@v2 is deprecated and no longer used, this can be removed.
*/
static SFDX_INTEROPERABILITY: boolean;
/**
* The global folder in which sfdx state is stored.
*/
static readonly SFDX_STATE_FOLDER = ".sfdx";
/**
* The global folder in which sf state is stored.
*/
static readonly SF_STATE_FOLDER = ".sf";
/**
* The preferred global folder in which state is stored.
*/
static readonly STATE_FOLDER = ".sfdx";
/**
* The full system path to the global sfdx state folder.
*
* **See** {@link Global.SFDX_STATE_FOLDER}
*/
static get SFDX_DIR(): string;
/**
* The full system path to the global sf state folder.
*
* **See** {@link Global.SF_STATE_FOLDER}
*/
static get SF_DIR(): string;
/**
* The full system path to the preferred global state folder
*/
static get DIR(): string;
/**
* Gets the current mode environment variable as a {@link Mode} instance.
*
* ```
* console.log(Global.getEnvironmentMode() === Mode.PRODUCTION);
* ```
*/
static getEnvironmentMode(): Mode;
/**
* Creates a directory within {@link Global.SFDX_DIR}, or {@link Global.SFDX_DIR} itself if the `dirPath` param
* is not provided. This is resolved or rejected when the directory creation operation has completed.
*
* @param dirPath The directory path to be created within {@link Global.SFDX_DIR}.
*/
static createDir(dirPath?: string): Promise<void>;
}