// 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":{"alt-svc":"h3=\":443\"; ma=86400","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=c44ZSkY5oyaSi2%2FRSBeD8h0bNChAKaNnm%2FJQuk36odHpdxFZCcRLQKUaXWwmyxJgc4qtTM9bSUOvUs%2BM5mQUvI3AbJPtkwLiM1D%2B4rz%2BUuC7Vkwxh2vdPy5MXpUEHnitRezLMUU%3D\"}]}","content-type":"text/typescript","access-control-allow-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';","age":"3939803","cf-ray":"a493801b6e8ae621-IAD","x-content-type-options":"nosniff","date":"Mon, 12 Oct 2026 04:53:21 GMT","cf-cache-status":"HIT","accept-ranges":"bytes","vary":"Origin","content-length":"1044","cross-origin-resource-policy":"cross-origin","x-robots-tag":"noindex","server":"cloudflare","x-jsr-backend":"modules","set-cookie":"__cf_bm=u7NwgCiYSao1ejJcemy_VVjWTFsJ.GoyjpPgf3eipPI-1791780801.8411486-1.0.1.1-hLaEFUcAs2GvUl2nZRvjwdbbpg3eZMOdwFwAQ_id7X3q67dIMfMtkkBFz0JMXfX1.0dMCsbNuEHKfQNbFqeRm70u0gm0Q_zLdHdTBXtJN.Im0bJtDDRO3Nsx0BjXogCI; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Mon, 12 Oct 2026 05:23:21 GMT","cache-control":"public, max-age=31536000, immutable","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","etag":"\"243c373f1b78bf9cda22c8b82ac6b91c\"","access-control-expose-headers":"*"},"url":"https://jsr.io/@std/yaml/1.0.5/_type.ts","time":1791780801}