import { type ValidationError, type VersionGuardConfig } from '../types'; /** * Feedback helpers that turn validation failures into actionable suggestions. * * @packageDocumentation * @public */ /** * Feedback entry point exports for suggestion and guidance helpers. * * @packageDocumentation * @public * @since 0.1.0 * @forgeIgnore E020 */ export interface Suggestion { /** * Human-readable guidance for the user. */ message: string; /** * Command or action text that can be used to address the issue. * * @defaultValue `undefined` */ fix?: string; /** * Indicates whether VersionGuard can apply the suggestion automatically. */ autoFixable: boolean; } /** * Aggregates validation errors with suggested next steps. * * @public * @since 0.1.0 */ export interface FeedbackResult { /** * Indicates whether the inspected version state is valid. */ valid: boolean; /** * Validation errors collected during the check. */ errors: ValidationError[]; /** * Suggested next steps for resolving the reported issues. */ suggestions: Suggestion[]; /** * Indicates whether at least one suggestion can be auto-applied. */ canAutoFix: boolean; } /** * Generates actionable feedback for a version string. * * @public * @since 0.1.0 * @remarks * This helper dispatches to the SemVer or CalVer feedback flow based on the * configured versioning strategy and returns both hard validation errors and * softer suggestions for likely fixes. * * @param version - Version string to evaluate. * @param config - Loaded VersionGuard configuration. * @param previousVersion - Optional previous version used for progression checks. * @returns A feedback object with validation errors and suggested fixes. * * @example * ```typescript * const feedbackResult = getVersionFeedback('1.2.3', config, '1.2.2'); * console.log(feedbackResult.valid); * ``` */ export declare function getVersionFeedback(version: string, config: VersionGuardConfig, previousVersion?: string): FeedbackResult; /** * Generates suggestions for version sync mismatches in a file. * * @public * @since 0.1.0 * @remarks * The returned suggestions include a general sync command and may include * file-type-specific hints for markdown or source files. * * @param file - File containing the mismatched version string. * @param foundVersion - Version currently found in the file. * @param expectedVersion - Version that should appear in the file. * @returns Suggestions for resolving the mismatch. * * @example * ```typescript * const suggestions = getSyncFeedback('README.md', '1.0.0', '1.0.1'); * console.log(suggestions[0]?.message); * ``` */ export declare function getSyncFeedback(file: string, foundVersion: string, expectedVersion: string): Suggestion[]; /** * Generates suggestions for changelog-related validation issues. * * @public * @since 0.1.0 * @remarks * This helper suggests either creating a missing entry or reconciling the latest * changelog version with the package version. * * @param hasEntry - Whether the changelog already contains an entry for the version. * @param version - Package version that should appear in the changelog. * @param latestChangelogVersion - Most recent version currently found in the changelog. * @returns Suggestions for bringing changelog state back into sync. * * @example * ```typescript * const suggestions = getChangelogFeedback(false, '1.2.3', '1.2.2'); * console.log(suggestions.length > 0); * ``` */ export declare function getChangelogFeedback(hasEntry: boolean, version: string, latestChangelogVersion?: string): Suggestion[]; /** * Generates suggestions for git tag mismatches. * * @public * @since 0.1.0 * @remarks * This helper focuses on discrepancies between git tag versions, package.json, * and repository files that still need to be synchronized. * * @param tagVersion - Version represented by the git tag. * @param packageVersion - Version currently stored in `package.json`. * @param hasUnsyncedFiles - Whether repository files are still out of sync. * @returns Suggestions for correcting tag-related issues. * * @example * ```typescript * const suggestions = getTagFeedback('v1.2.2', '1.2.3', true); * console.log(suggestions.map((item) => item.message)); * ``` */ export declare function getTagFeedback(tagVersion: string, packageVersion: string, hasUnsyncedFiles: boolean): Suggestion[]; //# sourceMappingURL=index.d.ts.map