/**
 * Dotenv file parsing and loading.
 *
 * Provides `parse_dotenv` for parsing dotenv-format strings
 * and `load_env_file` for reading and parsing env files from disk.
 *
 * @module
 */
import type { FsReadDeps } from '../runtime/deps.js';
/**
 * Parse a dotenv-format string into a record.
 *
 * Values wrapped in `"..."` have `\\` → `\`, `\"` → `"`, `\n` → newline,
 * and `\r` → carriage-return decoded (symmetric with the writer in
 * `update_env_variable`). Values wrapped in `'...'` are taken literally —
 * no escape processing. Unquoted values are unchanged.
 *
 * Inline comments are stripped after a closing quote (e.g. `KEY="v" # c` → `v`)
 * and after whitespace on unquoted values (e.g. `KEY=v # c` → `v`). Unquoted
 * values keep `#` literal when no whitespace precedes it so URL fragments
 * like `KEY=https://x.com#frag` round-trip unchanged.
 *
 * Trailing whitespace on unquoted values is lost (the raw value is trimmed);
 * wrap the value in `"..."` or `'...'` to preserve surrounding spacing.
 *
 * @param content - dotenv file content
 * @returns parsed key-value pairs
 */
export declare const parse_dotenv: (content: string) => Record<string, string>;
/**
 * Load and parse an env file.
 *
 * Returns null only when the file does not exist. Other read errors
 * (permission denied, I/O failure, etc.) are re-thrown so callers can
 * distinguish "no file" from "couldn't read".
 *
 * @param runtime - runtime with `read_text_file` capability
 * @param path - path to env file
 * @returns parsed env record, or `null` if file doesn't exist
 * @throws Error if reading fails for any reason other than `ENOENT` / `NotFound`
 */
export declare const load_env_file: (runtime: Pick<FsReadDeps, "read_text_file">, path: string) => Promise<Record<string, string> | null>;
//# sourceMappingURL=dotenv.d.ts.map