/** * Minimal, idempotent INI / TOML key upserts for package-manager config files. * * These managers each own a small, hand-edited config file (`.npmrc`, * `pip.conf`/`pip.ini`, `.cargo/config.toml`). The harness must set exactly one * or two keys without clobbering the developer's other settings, so we parse the * file line-by-line and replace just the target line — re-running yields * byte-identical output (the second pass sees the key already present and * rewrites it in place). * * `.npmrc` is a flat `key=value` file (no sections); pip and cargo are sectioned * (`[global]`, `[http]`, `[net]`). One helper covers both: pass `section: null` * for the flat case. The caller supplies the exact value text and separator so * cargo's quoted TOML (`cainfo = "..."`) and pip's bare `cert=...` both render * faithfully. */ export interface UpsertIniOptions { /** Section header to scope the key under (e.g. `global`, `http`); null for a flat file. */ section?: string | null; /** Separator between key and value. Default `=` (npm/pip); TOML uses ` = `. */ separator?: string; } /** * Insert or update `key = value` in `existing`, preserving every other line. * When a `section` is given, the key is placed inside that section (created at * the end of the file if absent). Existing EOL style (CRLF vs LF) is preserved. */ export declare function upsertIniKey(existing: string, key: string, value: string, opts?: UpsertIniOptions): string;