@casual-simulation/aux-common
Version:
Common library for AUX projects
56 lines • 1.7 kB
TypeScript
export interface SimpleVersionNumber {
/**
* The major version of the package.
*/
major: number;
/**
* The minor version of the package.
*/
minor: number;
/**
* The patch version of the package.
*/
patch: number;
/**
* The pre-release version of the package.
* If empty or null, then this is a stable release.
*/
tag: string | null;
}
export interface VersionNumber extends SimpleVersionNumber {
version: string | null;
major: number | null;
minor: number | null;
patch: number | null;
alpha: boolean | number | null;
tag: string | null;
}
/**
* Parses the given version number.
* @param version The version number.
*/
export declare function parseVersionNumber(version: string | null | undefined): VersionNumber;
/**
* Formats the given version as a string.
* @param version The version.
*/
export declare function formatVersion(version: SimpleVersionNumber): string;
/**
* Formats the given version number.
* @param major The major version number.
* @param minor The minor version number.
* @param patch The patch.
* @param tag The tag of the version number.
*/
export declare function formatVersionNumber(major: number, minor: number, patch: number, tag: string): string;
/**
* Compares two version numbers.
*
* Returns -1 if the first version is less than the second,
* 1 if the first version is greater than the second,
* and 0 if they are equal.
* @param first The first version number.
* @param second The second version number.
*/
export declare function compareVersions(first: SimpleVersionNumber, second: SimpleVersionNumber): number;
//# sourceMappingURL=Version.d.ts.map