/** * Preserves `${VAR}` environment variable references during config write-back. * * When config is read, `${VAR}` references are resolved to their values. * When writing back, callers pass the resolved config. This module detects * values that match what a `${VAR}` reference would resolve to and restores * the original reference, so env var references survive config round-trips. * * A value is restored only if: * 1. The pre-substitution value contained a `${VAR}` pattern * 2. Resolving that pattern with current env vars produces the incoming value * * If a caller intentionally set a new value (different from what the env var * resolves to), the new value is kept as-is. */ /** * Deep-walk the incoming config and restore `${VAR}` references from the * pre-substitution parsed config wherever the resolved value matches. * * @param incoming - The resolved config about to be written * @param parsed - The pre-substitution parsed config (from the current file on disk) * @param env - Environment variables for verification * @returns A new config object with env var references restored where appropriate */ export declare function restoreEnvVarRefs(incoming: unknown, parsed: unknown, env?: NodeJS.ProcessEnv): unknown;