// Ported from js-yaml v3.13.1:
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

export type KindType = "sequence" | "scalar" | "mapping";
/**
 * The style variation for `styles` option of {@linkcode stringify}
 */
export type StyleVariant =
  | "lowercase"
  | "uppercase"
  | "camelcase"
  | "decimal"
  | "binary"
  | "octal"
  | "hexadecimal";

export type RepresentFn<D> = (data: D, style?: StyleVariant) => string;

// deno-lint-ignore no-explicit-any
export interface Type<K extends KindType, D = any> {
  tag: string;
  kind: K;
  predicate?: (data: unknown) => data is D;
  represent?: RepresentFn<D> | Record<string, RepresentFn<D>>;
  defaultStyle?: StyleVariant;
  // deno-lint-ignore no-explicit-any
  resolve: (data: any) => boolean;
  // deno-lint-ignore no-explicit-any
  construct: (data: any) => D;
}

// denoCacheMetadata={"headers":{"accept-ranges":"bytes","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","etag":"\"243c373f1b78bf9cda22c8b82ac6b91c\"","vary":"Origin","x-robots-tag":"noindex","access-control-expose-headers":"*","x-jsr-backend":"modules","content-type":"text/typescript","date":"Thu, 17 Sep 2026 12:54:04 GMT","content-length":"1044","server":"cloudflare","cache-control":"public, max-age=31536000, immutable","cf-cache-status":"HIT","x-content-type-options":"nosniff","age":"3164","access-control-allow-origin":"*","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=OeLo8HmgYxEthPztwlNydeY53VNFeWMZy4PwiQjvk2Ofyd7TplF8xsWqaisLfM89yjUc%2F%2FPlhET3GBSEs8cuNTLV%2FArP9GpJMwqpdw4S1N3yk4tF3CDDpco%3D\"}]}","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","alt-svc":"h3=\":443\"; ma=86400","set-cookie":"__cf_bm=dnaYpUb0VS9sbJyIFV2Q34bJHHIoyUu4f9ugzQ40l94-1789649644.225941-1.0.1.1-tGmyxh76IFfdHjGtXfaIK5MPSaAg3bBb.uU_OIj77Y2ErAJU57F_WhD6PxRBp6UVUc2L5.VEH6E5Eb6IqoRNtFpT1DsbKuyNRjWKNVLcW2eL5wJUTvgfqqfO9NVyUJPW; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Thu, 17 Sep 2026 13:24:04 GMT","cf-ray":"a3c841e44e5e9bcc-ORD"},"url":"https://jsr.io/@std/yaml/1.0.5/_type.ts","time":1789649644}