import { FxError, Result } from "@microsoft/teamsfx-api"; export type DotenvOutput = { [k: string]: string; }; declare class EnvUtil { /** * read .env file and set to process.env (if loadToProcessEnv = true) * if silent = true, no error will return if .env file is not available, this function returns ok({ TEAMSFX_ENV: env }) * if silent = false, this function will return error if .env file is not available. * @param projectPath * @param env * @param loadToProcessEnv * @param silent * @returns */ readEnv(projectPath: string, env: string, loadToProcessEnv?: boolean, silent?: boolean): Promise>; loadEnvFile(dotEnvFilePath: string): Promise>; mergeEnv(envWithHigherPriority: NodeJS.ProcessEnv | DotenvOutput, envWithLowerPriority: DotenvOutput): void; /** * write env variables into .env file, * if .env file does not exist, this function will create a default one * if .env fila path is not available, the default path is `./env/.env.{env}` * @param projectPath * @param env * @param envs * @returns */ writeEnv(projectPath: string, env: string, envs: DotenvOutput): Promise>; listEnv(projectPath: string, remoteOnly?: boolean): Promise>; object2map(obj: DotenvOutput): Map; map2object(map: Map): DotenvOutput; extractEnvNameFromFileName(inputFileName: string): string | undefined; resetEnv(projectPath: string, env: string, ignoreKeys: string[]): Promise; resetEnvFile(envFilePath: string, ignoreKeys: string[]): Promise; } export declare const envUtil: EnvUtil; type DotenvParsedLine = string | { key: string; value: string; comment?: string; quote?: '"' | "'"; }; interface DotenvParseResult { lines?: DotenvParsedLine[]; obj: DotenvOutput; } declare class DotenvUtil { deserialize(src: string | Buffer): DotenvParseResult; serialize(parsed: DotenvParseResult): string; } export declare const dotenvUtil: DotenvUtil; export {}; //# sourceMappingURL=envUtil.d.ts.map