// 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":{"cross-origin-resource-policy":"cross-origin","date":"Fri, 30 Oct 2026 15:57:53 GMT","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","x-content-type-options":"nosniff","x-jsr-backend":"modules","cf-ray":"a52b9e468814f0a6-DFW","accept-ranges":"bytes","content-length":"1256","content-type":"text/typescript","access-control-allow-origin":"*","vary":"Origin","age":"1228131","access-control-expose-headers":"*","cf-cache-status":"HIT","cache-control":"public, max-age=31536000, immutable","x-robots-tag":"noindex","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=XLKF5vLOoj4Ww%2Ffog5gbyNHWkHHHiLyW3DX9NDJuf2chu%2FCvOLYQxPq0Aoq%2BWa9i4YjS8v5hZQvYsR9AJ6dgRhUI4wxqlxEOXwzoWngjVVwsipYhqwf25K4%3D\"}]}","server":"cloudflare","set-cookie":"__cf_bm=GGGLyBxPrk3G1wRKu02a.XzxSVIBBxHkQNf0HdFYQ24-1793375873.109592-1.0.1.1-I3yxFso9iHMytfDK9rt7W3HT3O_rAK7kqEanMjYabmUQiYEwmyBjm..hSt2MznoKhMUhdlwHiq7iXSl1G3AKMFt8wSxRIJo7_ZT4nsEqflX2yDEewsaSubQzmPBZk_Vl; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Fri, 30 Oct 2026 16:27:53 GMT","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';","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","alt-svc":"h3=\":443\"; ma=86400"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1793375873}