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