export type TomlAppliedChange = { groupId: string; artifactId: string; newVersion: string; oldVersion: string; type: ('ref' | 'inline'); alias: string; versionRef?: string; }; /** * One entry in {@link updateTomlVersions}' `applied` list: a version that was changed and where. * `type` discriminates the edit site — `'ref'` for a `[libraries]` entry pointing at a shared * `[versions]` alias via `version.ref` (then `versionRef` names that alias), `'inline'` for a * version declared directly on the library. `alias` is the library's catalog key in both cases. * @typedef {{ * groupId: string, * artifactId: string, * newVersion: string, * oldVersion: string, * type: ('ref'|'inline'), * alias: string, * versionRef?: string * }} TomlAppliedChange */ /** * Stable edit-site key for a TOML (Gradle version catalog) change: same key => same commit/PR. * Deps sharing one `[versions]` alias via `version.ref` share the ref key and are inseparable. * @param {string} manifestPath * @param {TomlAppliedChange} applied * @returns {string} */ export declare function tomlChangeKey(manifestPath: string, applied: TomlAppliedChange): string; /** * Maps every edit-site key to the canonical, version-less purls of the dependencies that * share it, without mutating content. Used to detect whether bumping a retained remediation * would also affect an excluded dep. * @param {string} tomlContent * @param {string} manifestPath * @returns {Map} editSiteKey → canonical purls */ export declare function tomlDepsForEditSite(tomlContent: string, manifestPath: string): Map; /** * Updates dependency versions in a Gradle version catalog (libs.versions.toml) file. * * Supports two version declaration patterns: * - Centralized: [versions] section defines version aliases, [libraries] references via version.ref * - Inline: [libraries] entries include version = "x.y.z" directly * * Uses smol-toml parse() to locate keys, then performs position-based string replacement * on the raw content to preserve formatting and comments. * * @param {string} tomlContent - raw TOML file content * @param {import('../remediate.js').VersionChangeRequest[]} versionChanges * @returns {{content: string, applied: TomlAppliedChange[], skipped: Array<{groupId: string, artifactId: string, newVersion: string, reason: string}>}} */ export declare function updateTomlVersions(tomlContent: string, versionChanges: import('../remediate.js').VersionChangeRequest[]): { content: string; applied: TomlAppliedChange[]; skipped: Array<{ groupId: string; artifactId: string; newVersion: string; reason: string; }>; };