export type SemverInput = string | Semver; export type SemverTokens = [major: number, minor: number, patch: number]; /** * Simple Semver implementation. * * Suitable for Browser usage, unlike npm `semver` which is Node-targeted and simply too big for the Browser. * * Parsing algorithm is simple: * 1. Split by `.` * 2. parseInt each of 3 tokens, set to 0 if falsy * * toString returns `major.minor.patch` * Missing tokens are replaced with 0. * * _semver('1').toString() === '1.0.0' * * @experimental */ export declare class Semver { tokens: SemverTokens; private constructor(); get major(): number; get minor(): number; get patch(): number; static of(input: SemverInput): Semver; static parseOrNull(input: SemverInput | undefined | null): Semver | null; isAfter: (other: SemverInput) => boolean; isSameOrAfter: (other: SemverInput) => boolean; isBefore: (other: SemverInput) => boolean; isSameOrBefore: (other: SemverInput) => boolean; isSame: (other: SemverInput) => boolean; /** * Returns 1 if this > other * returns 0 if they are equal * returns -1 if this < other */ cmp(other: SemverInput): -1 | 0 | 1; toJSON: () => string; toString(): string; } /** * Shortcut for Semver.of(input) */ export declare function _semver(input: SemverInput): Semver; /** * Returns 1 if a > b * returns 0 if they are equal * returns -1 if a < b * * Quick&dirty implementation, which should suffice for 95% of the cases. * * Credit: https://stackoverflow.com/a/47159772/4919972 */ export declare function _semverCompare(a: string, b: string): -1 | 0 | 1;