import type { Hl7Version } from "./types"; /** * Parses a version string into a structured version object. * * @param input - Version string to parse (e.g., "2.5.1", "2.3", "2") * @returns Structured version with major, minor, and patch components * @throws {VersionParseError} If the input format is invalid or exceeds safety limits * * @example * ```typescript * const v = parse("2.5.1"); * // => { major: 2, minor: 5, patch: 1 } * * parse("2"); * // => { major: 2, minor: 0, patch: 0 } * * parse("HELLO"); * // => throws VersionParseError * ``` */ export declare function parse(input: string): Hl7Version; /** * Converts a version string to canonical format (major.minor.patch). * * @param input - Version string to clean * @returns Canonical version string * @throws {VersionParseError} If the input format is invalid * * @example * ```typescript * clean("2"); // => "2.0.0" * clean("2.5"); // => "2.5.0" * clean(" 2.5 "); // => "2.5.0" * ``` */ export declare function clean(input: string): string; /** * Checks if a string is a valid version format. * This function never throws - use it for validation. * * @param input - Version string to validate * @returns true if valid, false otherwise * * @example * ```typescript * valid("2.5.1"); // => true * valid("2"); // => true * valid("HELLO"); // => false * valid("2."); // => false * ``` */ export declare function valid(input: string): boolean; /** * Internal helper to ensure a value is a parsed Hl7Version object. * Parses strings, returns objects as-is. * * @internal */ export declare function ensure(v: string | Hl7Version): Hl7Version; /** * Increments a version component and resets all lower components to zero. * * @param version - Version string to increment * @param release - Component to increment: 'major', 'minor', or 'patch' * @returns New version string with incremented component * @throws {VersionParseError} If version string is invalid * * @example * ```typescript * increment("2.5.1", "major"); // => "3.0.0" * increment("2.5.1", "minor"); // => "2.6.0" * increment("2.5.1", "patch"); // => "2.5.2" * * // Works with partial versions too * increment("2", "minor"); // => "2.1.0" * increment("2.5", "patch"); // => "2.5.1" * ``` */ export declare function increment(version: string, release: "major" | "minor" | "patch"): string; //# sourceMappingURL=parse.d.ts.map