/** * Substitutes environment variables in a string. * Replaces ${VAR_NAME} patterns with their corresponding values from the env object. * Supports default values with ${VAR_NAME:-default} syntax. * If a variable is not found in env and no default is provided, the pattern is left as-is. * * @param str - The string containing environment variable patterns * @param env - A record of environment variable names to their values * @returns The string with all ${VAR_NAME} patterns replaced * * @example * substituteEnvVars("Hello ${USER}!", { USER: "Alice" }) * // Returns: "Hello Alice!" * * @example * substituteEnvVars("Path: ${HOME}/docs", { HOME: "/Users/alice" }) * // Returns: "Path: /Users/alice/docs" * * @example * substituteEnvVars("Missing: ${UNKNOWN}", {}) * // Returns: "Missing: ${UNKNOWN}" * * @example * substituteEnvVars("URL: ${API_URL:-https://api.example.com}", {}) * // Returns: "URL: https://api.example.com" * * @example * substituteEnvVars("URL: ${API_URL:-https://api.example.com}", { API_URL: "https://custom.com" }) * // Returns: "URL: https://custom.com" */ export declare function substituteEnvVars(str: string, env: Record): string;