import type { Comparator } from "./types"; /** * Pre-parsed range expression for efficient reuse. * * Parse a range once and reuse it for multiple version checks, * avoiding repeated parsing overhead. * * @example * ```typescript * // Parse once * const range = new Range(">=2.0 <3.0"); * * // Reuse many times (much faster than re-parsing) * satisfies("2.5.1", range); // => true * satisfies("2.3.0", range); // => true * satisfies("3.0.0", range); // => false * ``` */ export declare class Range { readonly comparators: readonly Comparator[]; readonly raw: string; constructor(range: string); /** * Test if a version satisfies this range. * * @param version - Version string to test * @returns true if version satisfies all comparators * @throws {VersionParseError} If version string is invalid */ test(version: string): boolean; } /** * Checks if a version satisfies a range expression. * * Range expressions consist of one or more space-separated comparators. * Each comparator is an optional operator followed by a version. * * Supported operators: * - `=` (or no operator): exact match * - `<`: less than * - `<=`: less than or equal * - `>`: greater than * - `>=`: greater than or equal * * Multiple comparators create AND conditions - all must be satisfied. * * For performance when checking many versions against the same range, * use a Range object instead of a string. * * @param version - Version string to test * @param range - Range expression string or pre-parsed Range object * @returns true if version satisfies all comparators, false for empty range * @throws {VersionParseError} If version string is invalid * @throws {RangeParseError} If range expression is invalid or exceeds length limit * * @example * ```typescript * // String range (parsed every call) * satisfies("2.5.1", ">=2.0 <3.0"); // => true * satisfies("2.5.1", "2.5.1"); // => true (exact match) * satisfies("2.5.1", ">=2.6"); // => false * * // Range object (parse once, reuse many times - much faster) * const range = new Range(">=2.0 <3.0"); * satisfies("2.5.1", range); // => true * satisfies("2.3.0", range); // => true * satisfies("3.0.0", range); // => false * ``` */ export declare function satisfies(version: string, range: string | Range): boolean; //# sourceMappingURL=range.d.ts.map