// 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":{"report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=NQRJ70BExgN92Wf%2Fo6wQBwtgraSt5NpUgZULNHlMuxMM28u5VeyL95km2D86qvmUYZmWDRpO41V811m%2BjkURf6%2FoqIh7LlFTkEvZS8RrCGqElKlh4zTdjsY%3D\"}]}","cf-cache-status":"HIT","cf-ray":"a223e657ca7b7db6-LAX","x-jsr-backend":"modules","alt-svc":"h3=\":443\"; ma=86400","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","x-content-type-options":"nosniff","server":"cloudflare","access-control-expose-headers":"*","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';","access-control-allow-origin":"*","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","content-length":"1256","x-robots-tag":"noindex","cross-origin-resource-policy":"cross-origin","accept-ranges":"bytes","cache-control":"public, max-age=31536000, immutable","date":"Tue, 28 Jul 2026 12:31:15 GMT","vary":"Origin","age":"4150215","set-cookie":"__cf_bm=pFbiSU8FNLOW.P68p3VKoHZbnsbZRFP3TOCspJUZU_M-1785241875.165532-1.0.1.1-bCkq_GY5D.VsjH3dGwLdvtCwuSd_WhrqXfR0fQZWRgKYZk12VI1IJ0LMvvd5_7u4oTftOslfhUt6sksR5OymHVxdrsLvySIJgR4EE0nTArF9tIQlEvqR__sK9JdpYvze; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1785241875}