/** * Represents a semantic version with major, minor, patch, and optional prerelease components. * Follows the SemVer specification format: MAJOR.MINOR.PATCH[-prerelease.PRERELEASE] * Example: 1.2.3-prerelease.4 * * @internal This interface is exported for testing purposes only and is not part of the public API. */ export interface SemVersion { /** Major version number (incremented for incompatible API changes) */ major: number; /** Minor version number (incremented for backward-compatible functionality) */ minor: number; /** Patch version number (incremented for backward-compatible bug fixes) */ patch: number; /** Optional prerelease information */ prerelease?: { /** Prerelease version number */ number: number; }; } /** * Validates if an object conforms to the SemVersion interface. * This function performs thorough validation of all properties and their types. * * @param obj - The object to validate * @returns true if the object is a valid SemVersion, false otherwise * * @internal This function is exported for testing purposes only and is not part of the public API. */ export declare function isValidSemVersionObject(obj: unknown): obj is SemVersion; /** * Parses and validates a version string into a SemVersion object. * Supports formats: * - x.y.z (standard version) * - x.y.z-prerelease.n (version with prerelease) * * @param version - The version string to parse * @throws Error if version string is invalid or malformed * @returns A validated SemVersion object * * @internal This function is exported for testing purposes only and is not part of the public API. */ export declare function parseSemVersion(version: string | null | undefined): SemVersion; /** * Represents the result of comparing two versions. * * @internal This enum is exported for testing purposes only and is not part of the public API. */ export declare enum VersionComparisonResult { /** First version is less than second version */ LessThan = 0, /** Versions are equal */ EqualTo = 1, /** First version is greater than second version */ GreaterThan = 2 } /** * Compares two SemVersion objects following SemVer rules. * Comparison order: major, minor, patch, then prerelease if necessary. * * @param a - First version to compare * @param b - Second version to compare * @returns VersionComparisonResult indicating the relationship between versions * * @internal This function is exported for testing purposes only and is not part of the public API. */ export declare function compareSemVersions(a: SemVersion, b: SemVersion): VersionComparisonResult; /** * Checks if a version meets or exceeds a minimum required version. * * @param requiredVersion - The minimum version required * @param testVersion - The version to test * @returns true if testVersion is equal to or greater than requiredVersion * * @internal This function is exported for testing purposes only and is not part of the public API. */ export declare function meetsMinimumSemVersion(requiredVersion: SemVersion, testVersion: SemVersion): boolean; /** * Checks if a version is at or below a maximum allowed version. * * @param maximumVersion - The maximum version allowed * @param testVersion - The version to test * @returns true if testVersion is equal to or less than maximumVersion * * @internal This function is exported for testing purposes only and is not part of the public API. */ export declare function isWithinMaximumSemVersion(maximumVersion: SemVersion, testVersion: SemVersion): boolean; /** * Represents the possible outcomes when comparing versions with validation. */ export declare enum VersionValidationResult { /** Operation succeeded, version requirements are met */ Success = 0, /** Failed to parse the control version (min/max version) */ ControlVersionParseFailure = 1, /** Control version (min/max version) is invalid */ InvalidControlVersion = 2, /** Failed to parse the test version */ TestVersionParseFailure = 3, /** Test version is invalid */ InvalidTestVersion = 4, /** Version comparison failed */ ComparisonFailed = 5 } /** * Validates and checks if a version meets or exceeds a minimum required version. * This function handles parsing, validation, and comparison in one step. * * @param requiredVersionStr - The minimum version required (as a string) * @param testVersionStr - The version to test (as a string) * @returns A VersionValidationResult indicating success or the specific failure reason */ export declare function meetsMinimumVersion(requiredVersionStr: string | null | undefined, testVersionStr: string | null | undefined): VersionValidationResult; /** * Validates and checks if a version is at or below a maximum allowed version. * This function handles parsing, validation, and comparison in one step. * * @param maximumVersionStr - The maximum allowed version (as a string) * @param testVersionStr - The version to test (as a string) * @returns A VersionValidationResult indicating success or the specific failure reason */ export declare function isWithinMaximumVersion(maximumVersionStr: string | null | undefined, testVersionStr: string | null | undefined): VersionValidationResult;