/**
 * 基于相对严格的版本号规则，规范可以参考https://semver.org/
 * 但在比较版本号时使用相对宽松的规则，具体可以查看compare-versions库的实现
 * 自测用例：https://stackblitz.com/edit/typescript-jqszbj
 */
import { CompareOperator } from 'compare-versions';
export { CompareOperator as VersionCompareOperator, default as compareVersionToNum, satisfies as satisfiesVersion, } from 'compare-versions';
export interface VersionObject {
    version: string;
    major: number;
    minor: number;
    patch: number;
    prerelease?: Array<number | string>;
}
export declare const versionRegex: RegExp;
/**
 * 获取有效的版本号，如果符合规范则返回，否则返回null
 * eg: getValidVersion('v1.2.3') // '1.2.3'
 */
export declare const getValidVersion: (version: string) => string;
/**
 * 解析版本号，如果符合规范则返回一个包含版本信息的对象
 */
export declare const parseVersion: (version: string) => VersionObject;
/**
 * 使用给定规则比较两个版本
 * lt: v1小于v2;  gt: v1大于v2;  lte: v1小于等于v2;  gte: v1大于等于v2;
 * eg: compareVersion.lt('1.2.3', '9.8.7') // true
 *     compareVersion.cmp('1.2.3', '9.8.7', '<') // true
 */
export declare const compareVersion: {
    lt: (v1: string, v2: string) => boolean;
    gt: (v1: string, v2: string) => boolean;
    eq: (v1: string, v2: string) => boolean;
    lte: (v1: string, v2: string) => boolean;
    gte: (v1: string, v2: string) => boolean;
    cmp: (firstVersion: string, secondVersion: string, operator: CompareOperator) => boolean;
};
