import type { ArgumentsCamelCase, InferredOptionTypes } from 'yargs'; export declare const yargsOptionsBuilderForEnv: { readonly 'cascade-env': { readonly description: 'Environment (fnox profile / mise env) to load environment variables for. Preferred over `cascade-node-env` and `auto-cascade-env`.'; readonly type: 'string'; }; readonly 'cascade-node-env': { readonly description: 'Same with --cascade-env=. Preferred over `auto-cascade-env`.'; readonly type: 'boolean'; }; readonly 'auto-cascade-env': { readonly description: 'Same with --cascade-env=.'; readonly type: 'boolean'; readonly default: true; }; readonly 'quiet-env': { readonly description: 'Suppress environment variable loading information.'; readonly type: 'boolean'; }; readonly verbose: { readonly description: 'Whether to show verbose information'; readonly type: 'boolean'; readonly alias: 'v'; }; }; export type EnvReaderOptions = Partial>> & { /** * Command-level fallback for an unset WB_ENV (e.g. `wb test` supplies 'test' when explicit env * flags suppress its default test cascade). Not a CLI flag. */ commandDefaultWbEnv?: string; }; /** * Resolves the cascade (fnox profile / env-file suffix) the reader loads for the given options: * the forced `--cascade-env` first, then `--cascade-node-env`'s NODE_ENV, then the auto cascade * driven by the ambient WB_ENV/NODE_ENV. Exported so commands that select a profile WITHOUT * loading environment sources (e.g. `wb gen-docker-env`) cannot drift from the reader's selection. */ export declare function resolveCascade(argv: EnvReaderOptions): string | undefined; /** * Resolves the WB_ENV value wb falls back to when no env source and no exported variable defines * it: the command-level default first (`wb test --cascade-env=staging` loads the staging files * but its tests must still run as `test`, mirroring the pre-15 `||= 'test'` behavior), then the * forced cascade, then the ambient-NODE_ENV-driven auto cascade clamped to a standard mode (a * non-standard NODE_ENV such as `qa` still selects the cascade suffix, but must not produce a * non-standard WB_ENV). */ export declare function resolveFallbackWbEnv(argv: EnvReaderOptions): string; /** * This function reads environment variables from the repository's fnox configuration and mise. * Note it does not assign them in `process.env`. * @return [envVars, [envSourceNames, envVarNames][]] * */ export declare function readEnvironmentVariables(argv: EnvReaderOptions, cwd: string, options?: { /** * Load variables even if they already exist in process.env. * Useful when a parent process has already injected the fnox values into the environment * and the configured variables themselves are needed (e.g. `wb gen-dev-vars`). */ ignoreProcessEnv?: boolean; /** * Expand `${WB_ENV}` references against the fallback mode when nothing defines WB_ENV. * Only for callers that subsequently COMPLETE WB_ENV with that fallback (wb's Project.env). */ expandFallbackWbEnv?: boolean; }): [Record, [string, string[]][]]; /** * This function reads environment variables from the repository's fnox configuration (`fnox.toml`). * The base `[secrets]` table carries the development values, and `[profiles..secrets]` * overlays it; an unknown profile falls back to the base secrets. */ export declare function readFnoxEnvironmentVariables(cwd: string, cascade: string | undefined, options?: { ignoreProcessEnv?: boolean; modeFileOverridesProcessEnv?: boolean; /** Precomputed hasProjectFnoxConfig(cwd) result, to avoid re-walking the ancestor directories. */ hasFnoxConfig?: boolean; }): [Record, string[]]; export declare function hasProjectFnoxConfig(cwd: string): boolean; export declare function shouldSuppressEnvironmentOutput(argv: EnvReaderOptions): boolean; /** * This function reads environment variables from fnox/mise and assigns them in `process.env`. * */ export declare function readAndApplyEnvironmentVariables(argv: EnvReaderOptions, cwd: string): Record; /** * This function removes environment variables related to npm and yarn from the given environment variables. * */ export declare function removeNpmAndYarnEnvironmentVariables(envVars: Record): void;