Type

import { Type } from "jsr:@ende/yaml/unstable-parse";

interface ยท experimental

interface Type<K extends KindType, D = any>

A type definition for a YAML node.

Properties

tag

tag: string

Tag to identify the type

kind

kind: K

Kind of type

predicate

predicate?: (data: unknown) => data is D

Cast the type. Used to stringify

represent

represent?: RepresentFn<D> | Record<string, RepresentFn<D>>

Function to represent data. Used to stringify

defaultStyle

defaultStyle?: StyleVariant

Default style for the type. Used to stringify

resolve

resolve: (data: any) => boolean

Function to test whether data can be resolved by this type. Used to parse

construct

construct: (data: any) => D

Function to construct data from string. Used to parse

Source