import { type ManifestConfig, type VersionGuardConfig } from '../types'; /** * Auto-fix helpers for package versions, synced files, and changelog entries. * * @packageDocumentation * @public */ /** * Fix entry point exports for auto-remediation helpers. * * @packageDocumentation * @public * @since 0.1.0 * @forgeIgnore E020 */ export interface FixResult { /** * Indicates whether the operation changed repository state. */ fixed: boolean; /** * Human-readable description of the fix attempt. */ message: string; /** * Absolute path to the file that was updated, when applicable. * * @defaultValue `undefined` */ file?: string; } /** * Updates the `package.json` version field when needed. * * @public * @since 0.1.0 * @remarks * This helper writes the target version only when `package.json` exists and the * current version differs from the requested value. * * @param targetVersion - Version that should be written to `package.json`. * @param cwd - Repository directory containing `package.json`. * @param manifest - Optional manifest configuration for language-agnostic support. * @returns The result of the package version fix attempt. * * @example * ```typescript * // Fix using legacy package.json fallback * const result = fixPackageVersion('1.2.3', process.cwd()); * console.log(result.fixed); * * // Fix using a configured manifest source * const result2 = fixPackageVersion('1.2.3', process.cwd(), { source: 'Cargo.toml' }); * ``` */ export declare function fixPackageVersion(targetVersion: string, cwd?: string, manifest?: ManifestConfig): FixResult; /** * Synchronizes configured files to the package version. * * @public * @since 0.1.0 * @remarks * This helper uses the configured sync targets to update version strings across * the repository and reports only the files that changed. * * @param config - Loaded VersionGuard configuration. * @param cwd - Repository directory to synchronize. * @returns A list of per-file sync results. * * @example * ```typescript * const results = fixSyncIssues(config, process.cwd()); * console.log(results.length); * ``` */ export declare function fixSyncIssues(config: VersionGuardConfig, cwd?: string): FixResult[]; /** * Ensures the changelog contains an entry for a version. * * @public * @since 0.1.0 * @remarks * When the changelog file does not exist, this helper creates a starter changelog. * Otherwise it appends a new version entry only when one is missing. * * @param version - Version that should appear in the changelog. * @param config - Loaded VersionGuard configuration. * @param cwd - Repository directory containing the changelog file. * @returns The result of the changelog fix attempt. * * @example * ```typescript * const result = fixChangelog('1.2.3', config, process.cwd()); * console.log(result.message); * ``` */ export declare function fixChangelog(version: string, config: VersionGuardConfig, cwd?: string): FixResult; /** * Runs all configured auto-fix operations. * * @public * @since 0.1.0 * @remarks * This helper optionally updates the package version first, then synchronizes * configured files, and finally updates the changelog when changelog support is * enabled. * * @param config - Loaded VersionGuard configuration. * @param targetVersion - Optional version to apply before running other fixes. * @param cwd - Repository directory where fixes should run. * @returns Ordered results describing every fix step that ran. * * @example * ```typescript * const results = fixAll(config, '1.2.3', process.cwd()); * console.log(results.some((result) => result.fixed)); * ``` */ export declare function fixAll(config: VersionGuardConfig, targetVersion?: string, cwd?: string): FixResult[]; /** * Suggests candidate next versions for a release. * * @public * @since 0.1.0 * @remarks * The suggestions depend on the configured versioning mode. SemVer returns one or * more bump options, while CalVer suggests the current date-based version and an * incremented same-day release. * * @param currentVersion - Current package version. * @param config - Loaded VersionGuard configuration. * @param changeType - Preferred bump type, or `auto` to include common options. * @returns Candidate versions paired with the reason for each suggestion. * * @example * ```typescript * const suggestions = suggestNextVersion('1.2.3', config, 'minor'); * console.log(suggestions[0]?.version); * ``` */ export declare function suggestNextVersion(currentVersion: string, config: VersionGuardConfig, changeType?: 'major' | 'minor' | 'patch' | 'auto'): { version: string; reason: string; }[]; //# sourceMappingURL=index.d.ts.map