// 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-goog-hash":"crc32c=6A9A9w==,md5=7WGFsrx5mNmhAb37T03qog==","x-goog-generation":"1717673457078768","x-goog-metageneration":"1","cache-control":"public, max-age=31536000, immutable","last-modified":"Thu, 06 Jun 2024 11:30:57 GMT","content-type":"text/typescript","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","server":"UploadServer","x-jsr-cache-status":"hit","x-robots-tag":"noindex","content-length":"1256","cross-origin-resource-policy":"cross-origin","access-control-expose-headers":"*","x-goog-stored-content-encoding":"identity","x-jsr-cache-id":"IAD","x-goog-stored-content-length":"1256","age":"926","x-content-type-options":"nosniff","via":"1.1 google","date":"Thu, 16 Oct 2025 17:20:00 GMT","expires":"Fri, 16 Oct 2026 17:20:00 GMT","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","x-guploader-uploadid":"AAwnv3KSi7Nw1M8nlf2RG9tKYzHqH6s6S7OY9_Xi5jOk-6UHbFqCbFN1Ysa5mWtUxyrgIRRH2HI6gwA","accept-ranges":"bytes","access-control-allow-origin":"*","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1760636126}