/** * An enumeration representing different types of environments. * @enum {number} * @readonly * @property {number} PlainRemote - Represents a plain remote environment. * @property {number} SecureRemote - Represents a secure remote environment. * @property {number} Local - Represents a local environment. */ export declare enum EnvironmentType { PlainRemote = 0, SecureRemote = 1, Local = 2 } /** * Represents an environment variable with methods to resolve its value based on the environment type. * @template T - The type of the environment variable value. */ export default class EnvironmentVar { /** * The name of the parameter. */ private readonly paramName; /** * The type of environment. * @readonly */ private readonly type; /** * A boolean flag indicating whether the field is optional or not. */ private readonly optional; /** * The prefix used for parameters in the class. * @type {string} */ private readonly paramPrefix; /** * Constructs a new instance of the EnvironmentVar class. * @param {string} paramName - The name of the environment variable. * @param {EnvironmentType} type - The type of the environment. * @param {boolean} [optional] - Indicates whether the environment variable is optional. * @param {string} [paramPrefix] - The prefix to be added to the environment variable name. */ constructor(paramName: string, type: EnvironmentType, optional?: boolean, paramPrefix?: string); /** * Resolves the value of the environment variable synchronously. * @returns {T} - The resolved value of the environment variable. * @throws {Error} - If the environment type is not 'Local'. */ syncResolve(): T; /** * Resolves the value based on the environment type. * @returns {Promise} - The resolved value. */ resolve(): Promise; /** * Retrieves the value of a local environment variable. * @returns {T} - The value of the local environment variable. * @throws {Error} - If the local environment variable is not defined and is not optional. */ private getLocalValue; /** * Retrieves the plain value of a remote environment parameter. * @returns {Promise} - A promise that resolves to the plain value of the parameter. * @throws {Error} - If the parameter cannot be retrieved and is not optional. */ private getPlainValue; /** * Retrieves a secure value from the secrets manager. * @returns {Promise} - A promise that resolves to the secure value. * @throws {Error} - Throws an error if the secure value cannot be retrieved and is not optional. */ private getSecureValue; }