/** Valid env key name (POSIX shell variable name). */ export declare const ENV_KEY_RE: RegExp; /** * A value Compose reads back from `KEY=` in an env_file as exactly * that one setting (#720, #726): * - no control character (C0, DEL, C1) or U+2028/U+2029 line separator; * - first non-blank character is not a quote or backtick. Compose closes a * quoted value and parses the rest of the line as more settings * (MOTD="" MODS=), while an unquoted value runs to the end of line. */ export declare const ENV_FILE_VALUE_RE: RegExp; /** A value that cannot be written as one `KEY=value` setting. */ export declare class EnvValueError extends Error { constructor(key: string, message?: string); } /** * Throw EnvValueError unless `value` matches ENV_FILE_VALUE_RE. A server's * config.env is an env_file with no escape syntax that the readers share, * so reject rather than escape (#726). */ export declare function assertEnvFileValue(key: string, value: string): void; export interface EnvLine { /** Original line text, without the `\n` separator. */ raw: string; /** Set when the line is a `KEY=value` entry. */ key?: string; } export interface EnvDocument { lines: EnvLine[]; /** Effective values; the last occurrence of a duplicate key wins (dotenv/bash/compose). */ values: Map; } export interface EnvChanges { set?: Record; remove?: string[]; } export interface ApplyEnvOptions { /** Server config.env style: unquoted when possible (see the module header). */ raw?: boolean; } export declare function parseEnvDocument(content: string): EnvDocument; /** * Serialize a value for `KEY=`: bare when bare-safe, otherwise * single-quoted (literal in bash, compose v2 and dotenv). A single quote, * CR, LF or NUL, or a quoted value ending with `\` (Compose reads `\'` as a * quote), cannot be represented safely and is rejected. */ export declare function serializeEnvValue(value: string): string; /** * Apply set/remove changes to env file content. `set` rewrites every * occurrence of a key and appends missing keys at the end; `remove` drops * every occurrence. All other lines stay byte-identical. Values use the quoted * style unless `options.raw` (see the module header). */ export declare function applyEnvChanges(content: string, changes: EnvChanges, options?: ApplyEnvOptions): string; /** Revision token for optimistic concurrency: sha256 hex of the file bytes. */ export declare function envRevision(content: string | Uint8Array): string; //# sourceMappingURL=env-file.d.ts.map