/** * Type of a version. */ export declare enum VersionType { /** * Available to everyone. */ GeneralAvailability = "GA", /** * Pre-release - interface shouldn't change (or at least not much). */ Beta = "beta", /** * Pre-release - interface may change a lot. */ Alpha = "alpha" } /** * Contract for the data passed to the [[Version]] constructor. */ export interface VersionDetails { /** * Major version number. */ major: number; /** * Minor version number. */ minor: number; /** * Bugfix version number. */ bugfix?: number; /** * Prerelease version number. * * NOTE: This may only be specified if type is not [[VersionType.GeneralAvailability]]. */ prerelease?: number; /** * Version type. * * Must be specified if prerelease is specified. */ type?: VersionType; } /** * Object representation of a version. */ export declare class Version { #private; /** * Parses a version string like "1.0", "1.32.752", "1.0.0-alpha.1", or "1.3.7-beta.5". * @param versionText The version text to be parsed. * @returns The parsed version. */ static parse(versionText: string): Version; /** * Initializes a new instance of the [[Version]] class. * @param details The version details. * @throws [[InvalidParameterError]] If version is invalid. */ constructor(details: VersionDetails); /** * Gets the major version. */ get major(): number; /** * Gets the minor version. */ get minor(): number; /** * Gets the bugfix version. * * Returns 0 if bugfix version was not specified. */ get bugfix(): number; /** * Gets the prerelease version. * * Returns 0 if prerelease version was not specified. * * NOTE: This value only has relevance if type is not [[VersionType.GeneralAvailability]]. */ get prerelease(): number; /** * Gets the type of the version. * * Returns [[VersionType.GeneralAvailability]] if type was not specified. */ get type(): VersionType; /** * Returns a JSON representation of the current object instance. * @returns A JSON representation of the current object instance. */ toJSON(): unknown; /** * Creates a string representation of the current object instance. * @returns A string representation of the current object instance. */ toString(): string; /** * Validates a segment of the version. * @param value The segment value. * @param name The name of the segment. * @param details All version details. * @throws [[InvalidParameterError]] If value is negative. */ private static validateSegment; }