/** * @file Parsing helpers — `coerceVersion` rounds a sloppy input ("1.2") up to a * valid semver triple, `parseVersion` returns `{major, minor, patch, * prerelease, build}`, and the `getMajor*` / `getMinor*` / `getPatchVersion` * accessors return a single component. `isValidVersion` is also here because * validation is effectively "did parse succeed". All go through the vendored * `semver` directly — smol-versions doesn't expose the parsed shape. */ import type { ParsedVersion } from './types.js'; /** * Coerce a version string to valid semver format. * * @example * ;```typescript * coerceVersion('1.2') // '1.2.0' * coerceVersion('v3') // '3.0.0' * coerceVersion('abc') // undefined * ``` */ export declare function coerceVersion(version: string): string | undefined; /** * Get the major version number from a version string. * * @example * ;```typescript * getMajorVersion('3.2.1') // 3 * ``` */ export declare function getMajorVersion(version: string): number | undefined; /** * Get the minor version number from a version string. * * @example * ;```typescript * getMinorVersion('3.2.1') // 2 * ``` */ export declare function getMinorVersion(version: string): number | undefined; /** * Get the patch version number from a version string. * * @example * ;```typescript * getPatchVersion('3.2.1') // 1 * ``` */ export declare function getPatchVersion(version: string): number | undefined; /** * Validate if a string is a valid semantic version. * * @example * ;```typescript * isValidVersion('1.2.3') // true * isValidVersion('abc') // false * ``` */ export declare function isValidVersion(version: string): boolean; /** * Parse a version string and return major, minor, patch components. * * @example * ;```typescript * parseVersion('1.2.3') * // { major: 1, minor: 2, patch: 3, prerelease: [], build: [] } * ``` */ export declare function parseVersion(version: string): ParsedVersion | undefined;