// 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-content-type-options":"nosniff","x-goog-stored-content-encoding":"identity","x-goog-hash":"crc32c=6A9A9w==,md5=7WGFsrx5mNmhAb37T03qog==","x-goog-generation":"1717673457078768","expires":"Tue, 29 Sep 2026 23:15:47 GMT","cache-control":"public, max-age=31536000, immutable","content-type":"text/typescript","x-jsr-cache-id":"ORD-cc9fc96","accept-ranges":"bytes","content-length":"1256","etag":"\"ed6185b2bc7998d9a101bdfb4f4deaa2\"","x-jsr-cache-status":"revalidated","x-goog-metageneration":"1","x-guploader-uploadid":"AAwnv3LfBy1MChLlv4FoHVLMq80Gi1XEjdcMP0FxTT2ts1njJ7jqdb7bmJl-UPFXS4DegjV6","date":"Mon, 29 Sep 2025 23:15:47 GMT","x-robots-tag":"noindex","access-control-allow-origin":"*","access-control-expose-headers":"*","x-goog-stored-content-length":"1256","age":"0","cross-origin-resource-policy":"cross-origin","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000","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';","server":"UploadServer","x-goog-storage-class":"STANDARD","via":"1.1 google","last-modified":"Thu, 06 Jun 2024 11:30:57 GMT"},"url":"https://jsr.io/@std/semver/0.224.3/types.ts","time":1759187747}