/** * Valid VERS comparator operators. */ type VersComparator = '=' | '!=' | '<' | '<=' | '>' | '>='; /** * Special wildcard comparator matching all versions. */ type VersWildcard = '*'; /** * A single version constraint within a VERS range. */ type VersConstraint = { comparator: VersComparator | VersWildcard; version: string; }; /** * VERS (VErsion Range Specifier) parser and evaluator. * * **Early adoption:** The VERS spec is pre-standard draft. This implementation * supports semver-based schemes (npm, cargo, golang, gem, etc.). Additional * version schemes may be added as the spec matures. * * @example * ```typescript * const range = Vers.parse('vers:npm/>=1.0.0|<2.0.0') * range.contains('1.5.0') // true * range.contains('2.0.0') // false * range.toString() // 'vers:npm/>=1.0.0|<2.0.0' * * // Wildcard matches all versions * Vers.parse('vers:semver/*').contains('999.0.0') // true * ``` */ declare class Vers { readonly scheme: string; readonly constraints: readonly VersConstraint[]; private constructor(); /** * Parse a VERS string. * * @param versStr - VERS string (e.g., 'vers:npm/>=1.0.0|<2.0.0') * @returns Vers instance * @throws {PurlError} If the string is not a valid VERS */ static parse(versStr: string): Vers; /** * Parse a VERS string. * * @param versStr - VERS string (e.g., 'vers:npm/>=1.0.0|<2.0.0') * @returns Vers instance * @throws {PurlError} If the string is not a valid VERS */ static fromString(versStr: string): Vers; /** * Check if a version is contained within this VERS range. * * Implements the VERS containment algorithm for semver-based schemes. * * @param version - Version string to check * @returns true if the version matches the range * @throws {PurlError} If the scheme is not supported */ contains(version: string): boolean; /** * Serialize to canonical VERS string. */ toString(): string; } export { Vers }; export type { VersComparator, VersConstraint, VersWildcard };