import type { ScanConfig, SyncConfig, SyncPattern, SyncResult, VersionMismatch } from './types'; /** * Synchronizes configured files to a single version string. * * @public * @since 0.1.0 * @remarks * File globs are resolved relative to `cwd`, then each matched file is updated * with the configured replacement patterns. * * @param version - Version string to write into matching files. * @param config - Sync configuration describing files and replacement patterns. * @param cwd - Project directory used to resolve file globs. * @returns A sync result for each resolved file. * @example * ```ts * import { getDefaultConfig, syncVersion } from 'versionguard'; * * const results = syncVersion('1.2.3', getDefaultConfig().sync, process.cwd()); * ``` */ export declare function syncVersion(version: string, config: SyncConfig, cwd?: string): SyncResult[]; /** * Synchronizes a single file to a target version. * * @public * @since 0.1.0 * @remarks * Each configured regex is applied globally, and `{{version}}` placeholders in * templates are replaced with the supplied version. * * @param filePath - Absolute or relative path to the file to update. * @param version - Version string to write. * @param patterns - Replacement patterns to apply. * @returns A result describing whether the file changed and what changed. * @example * ```ts * import { getDefaultConfig, syncFile } from 'versionguard'; * * const result = syncFile('README.md', '1.2.3', getDefaultConfig().sync.patterns); * ``` */ export declare function syncFile(filePath: string, version: string, patterns: SyncPattern[]): SyncResult; /** * Checks configured files for hardcoded version mismatches. * * @public * @since 0.1.0 * @remarks * Files matching the sync config are scanned without modification, and every * captured version that differs from `expectedVersion` is returned. * * @param expectedVersion - Version all matching entries should use. * @param config - Sync configuration describing files and replacement patterns. * @param ignorePatterns - Glob patterns to exclude while scanning. * @param cwd - Project directory used to resolve file globs. * @returns A list of detected version mismatches. * @example * ```ts * import { checkHardcodedVersions, getDefaultConfig } from 'versionguard'; * * const mismatches = checkHardcodedVersions( * '1.2.3', * getDefaultConfig().sync, * getDefaultConfig().ignore, * process.cwd(), * ); * ``` */ export declare function checkHardcodedVersions(expectedVersion: string, config: SyncConfig, ignorePatterns: string[], cwd?: string): VersionMismatch[]; /** * Scans the entire repository for hardcoded version literals. * * @public * @since 0.8.0 * @remarks * Unlike {@link checkHardcodedVersions}, which only checks files listed in * `sync.files`, this function globs the entire repository (respecting * `.gitignore` and `ignore` patterns) and applies configurable version-like * regex patterns. An allowlist filters out intentional references. * * @param expectedVersion - Version all matching entries should use. * @param scanConfig - Scan configuration with patterns and allowlist. * @param ignorePatterns - Glob patterns to exclude while scanning. * @param cwd - Project directory used to resolve file globs. * @returns A list of detected version mismatches across the repository. * @example * ```ts * import { getDefaultConfig, scanRepoForVersions } from 'versionguard'; * * const config = getDefaultConfig(); * const findings = scanRepoForVersions('1.2.3', config.scan, config.ignore, process.cwd()); * ``` */ export declare function scanRepoForVersions(expectedVersion: string, scanConfig: ScanConfig, ignorePatterns: string[], cwd?: string): VersionMismatch[]; //# sourceMappingURL=sync.d.ts.map