// 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":{"nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","content-type":"text/typescript","date":"Mon, 01 Jun 2026 04:18:13 GMT","content-length":"1256","access-control-expose-headers":"*","x-robots-tag":"noindex","cache-control":"public, max-age=31536000, immutable","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","access-control-allow-origin":"*","vary":"Origin","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';","cross-origin-resource-policy":"cross-origin","server":"cloudflare","x-jsr-backend":"modules","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=Vohn%2BoZhLoHpuVE6z4PlvQrDBQQZdw9w%2BffMN5P6sy9085bmHK9PD4qwtnLG63BrHA0fFHlyKpU1RvdfXBwp7hqiE3Bq53OwtauKgWGi6N1JC8yIRJvmQ2A%3D\"}]}","cf-ray":"a04b69c2ce14c978-IAD","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=86400"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1780287493}