// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

/**
 * The possible release types are used as an operator for the
 * increment function and as a result of the difference function.
 */
export type ReleaseType =
  | "pre"
  | "major"
  | "premajor"
  | "minor"
  | "preminor"
  | "patch"
  | "prepatch"
  | "prerelease";

/**
 * SemVer comparison operators.
 */
export type Operator =
  | undefined
  | "="
  | "!="
  | ">"
  | ">="
  | "<"
  | "<=";

/**
 * The shape of a valid semantic version comparator
 * @example >=0.0.0
 */
export interface Comparator extends SemVer {
  /** The operator */
  operator?: Operator;
}

/**
 * A SemVer object parsed into its constituent parts.
 */
export interface SemVer {
  /** The major version */
  major: number;
  /** The minor version */
  minor: number;
  /** The patch version */
  patch: number;
  /** The prerelease version */
  prerelease?: (string | number)[];
  /** The build metadata */
  build?: string[];
}

/**
 * A type representing a semantic version range. The ranges consist of
 * a nested array, which represents a set of OR comparisons while the
 * inner array represents AND comparisons.
 */
export type Range = Comparator[][];

// denoCacheMetadata={"headers":{"x-jsr-cache-id":"SFO-1d5601d9","cache-control":"public, max-age=31536000, immutable","via":"1.1 google","server":"UploadServer","x-goog-hash":"crc32c=6A9A9w==,md5=7WGFsrx5mNmhAb37T03qog==","x-goog-stored-content-encoding":"identity","accept-ranges":"bytes","x-goog-stored-content-length":"1256","age":"1678","x-goog-generation":"1717673457078768","x-goog-metageneration":"1","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","x-goog-storage-class":"STANDARD","cross-origin-resource-policy":"cross-origin","x-guploader-uploadid":"AAwnv3I0Z7bkLWun8bjQ3_ZqTfMJTgOP5iCZF-0eJLyxnDPmone1G6V8XE8WfaiKObvmyvUv","expires":"Wed, 30 Sep 2026 15:19:10 GMT","last-modified":"Thu, 06 Jun 2024 11:30:57 GMT","content-length":"1256","x-robots-tag":"noindex","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000","date":"Tue, 30 Sep 2025 15:19:10 GMT","access-control-allow-origin":"*","content-type":"text/typescript","x-jsr-cache-status":"hit","access-control-expose-headers":"*"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1759247228}