/** * Compares two version strings for ordering. * * This function supports semantic versioning comparison (e.g., "1.0.0" vs "2.1.0") * and falls back to lexicographic comparison for non-semver strings. * * Rules: * - Empty/undefined versions are considered equal to each other * - An empty version is considered less than a non-empty version * - Semantic versions are compared numerically by component (major.minor.patch) * - Non-semantic versions are compared lexicographically (case-insensitive) * * @param sourceVersion - The first version to compare. * @param otherVersion - The second version to compare. * @returns A negative number if sourceVersion < otherVersion, * zero if sourceVersion === otherVersion, * a positive number if sourceVersion > otherVersion. * * @example * ```typescript * compareVersions("1.0.0", "2.0.0"); // Returns negative number * compareVersions("2.0.0", "1.0.0"); // Returns positive number * compareVersions("1.0.0", "1.0.0"); // Returns 0 * compareVersions("", "1.0.0"); // Returns negative number * ``` */ export declare function compareVersions(sourceVersion: string | undefined, otherVersion: string | undefined): number;