YamlDocument
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:13
The yaml node, tag and visitor model, re-exported so a caller can write a
custom tag without taking its own dependency on yaml.
Names are Yaml-prefixed rather than kept as upstream. This package’s index
is a flat export *, so a bare Node, Document, Scalar or Schema
would sit beside YamlParseStream and parseYaml under names that say
nothing about YAML — and Node and Document are DOM globals, which this
package, being portable, is expected to be imported alongside.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”Contents
Section titled “Contents”Contents extends YamlNode = YamlNode
Strict
Section titled “Strict”Strict extends boolean = true
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new YamlDocument<
Contents,Strict>(value?,options?):Document<Contents,Strict>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:47
Parameters
Section titled “Parameters”value?
Section titled “value?”any
The initial value for the document, which will be wrapped in a Node container.
options?
Section titled “options?”DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions
Returns
Section titled “Returns”Document<Contents, Strict>
Constructor
Section titled “Constructor”new YamlDocument<
Contents,Strict>(value,replacer,options?):Document<Contents,Strict>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:48
Parameters
Section titled “Parameters”any
replacer
Section titled “replacer”Replacer | null
options?
Section titled “options?”DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions
Returns
Section titled “Returns”Document<Contents, Strict>
Properties
Section titled “Properties”[NODE_TYPE]
Section titled “[NODE_TYPE]”
readonly[NODE_TYPE]:symbol
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:21
comment
Section titled “comment”comment:
string|null
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:25
A comment immediately after this Document
commentBefore
Section titled “commentBefore”commentBefore:
string|null
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:23
A comment before this Document
contents
Section titled “contents”contents:
Strictextendstrue?Contents|null:Contents
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:27
The document contents.
directives
Section titled “directives”directives:
Strictextendstrue?Directives|undefined:Directives
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:28
errors
Section titled “errors”errors:
YAMLError[]
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:30
Errors encountered during parsing.
options
Section titled “options”options:
Required<Omit<ParseOptions&DocumentOptions,"_directives"|"lineCounter"|"version">>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:31
range?
Section titled “range?”
optionalrange?:YamlRange
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:38
The [start, value-end, node-end] character offsets for the part of the
source parsed into this document (undefined if not parsed). The value-end
and node-end positions are themselves not included in their respective
ranges.
schema
Section titled “schema”schema:
YamlSchema
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:40
The schema used with the document. Use setSchema() to change.
warnings
Section titled “warnings”warnings:
YAMLWarning[]
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:42
Warnings encountered during parsing.
Methods
Section titled “Methods”add(
value):void
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:56
Adds a value to the document.
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”void
addIn()
Section titled “addIn()”addIn(
path,value):void
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:58
Adds a value to the document.
Parameters
Section titled “Parameters”Iterable<unknown>
unknown
Returns
Section titled “Returns”void
clone()
Section titled “clone()”clone():
Document<Contents,Strict>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:54
Create a deep copy of this Document and its contents.
Custom Node values that inherit from Object still refer to their original instances.
Returns
Section titled “Returns”Document<Contents, Strict>
createAlias()
Section titled “createAlias()”createAlias(
node,name?):YamlAlias
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:68
Create a new Alias node, ensuring that the target node has the required anchor.
If node already has an anchor, name is ignored.
Otherwise, the node.anchor value will be set to name,
or if an anchor with that name is already present in the document,
name will be used as a prefix for a new unique anchor.
If name is undefined, the generated anchor will use ‘a’ as a prefix.
Parameters
Section titled “Parameters”Strict extends true ? YamlScalar<unknown> | YamlMap<unknown, unknown> | YamlSeq<unknown> : YamlNode
string
Returns
Section titled “Returns”createNode()
Section titled “createNode()”Call Signature
Section titled “Call Signature”createNode<
T>(value,options?):NodeType<T>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:73
Convert any value into a Node using the current schema, recursively
turning objects into collections.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”T
options?
Section titled “options?”CreateNodeOptions
Returns
Section titled “Returns”NodeType<T>
Call Signature
Section titled “Call Signature”createNode<
T>(value,replacer,options?):NodeType<T>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:74
Convert any value into a Node using the current schema, recursively
turning objects into collections.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”T
replacer
Section titled “replacer”CreateNodeOptions | Replacer | null
options?
Section titled “options?”CreateNodeOptions
Returns
Section titled “Returns”NodeType<T>
createPair()
Section titled “createPair()”createPair<
K,V>(key,value,options?):YamlPair<K,V>
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:79
Convert a key and a value into a Pair using the current schema,
recursively wrapping all values as Scalar or Collection nodes.
Type Parameters
Section titled “Type Parameters”Parameters
Section titled “Parameters”unknown
unknown
options?
Section titled “options?”CreateNodeOptions
Returns
Section titled “Returns”YamlPair<K, V>
delete()
Section titled “delete()”delete(
key):boolean
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:84
Removes a value from the document.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
true if the item was found and removed.
deleteIn()
Section titled “deleteIn()”deleteIn(
path):boolean
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:89
Removes a value from the document.
Parameters
Section titled “Parameters”Iterable<unknown, any, any> | null
Returns
Section titled “Returns”boolean
true if the item was found and removed.
get(
key,keepScalar?):Strictextendstrue?unknown:any
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:95
Returns item at key, or undefined if not found. By default unwraps
scalar values from their surrounding node; to disable set keepScalar to
true (collections are always returned intact).
Parameters
Section titled “Parameters”unknown
keepScalar?
Section titled “keepScalar?”boolean
Returns
Section titled “Returns”Strict extends true ? unknown : any
getIn()
Section titled “getIn()”getIn(
path,keepScalar?):Strictextendstrue?unknown:any
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:101
Returns item at path, or undefined if not found. By default unwraps
scalar values from their surrounding node; to disable set keepScalar to
true (collections are always returned intact).
Parameters
Section titled “Parameters”Iterable<unknown, any, any> | null
keepScalar?
Section titled “keepScalar?”boolean
Returns
Section titled “Returns”Strict extends true ? unknown : any
has(
key):boolean
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:105
Checks if the document includes a value with the key key.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
hasIn()
Section titled “hasIn()”hasIn(
path):boolean
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:109
Checks if the document includes a value at path.
Parameters
Section titled “Parameters”Iterable<unknown, any, any> | null
Returns
Section titled “Returns”boolean
set(
key,value):void
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:114
Sets a value in this document. For !!set, value needs to be a
boolean to add/remove the item from the set.
Parameters
Section titled “Parameters”any
unknown
Returns
Section titled “Returns”void
setIn()
Section titled “setIn()”setIn(
path,value):void
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:119
Sets a value in this document. For !!set, value needs to be a
boolean to add/remove the item from the set.
Parameters
Section titled “Parameters”Iterable<unknown, any, any> | null
unknown
Returns
Section titled “Returns”void
setSchema()
Section titled “setSchema()”setSchema(
version,options?):void
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:127
Change the YAML version and schema used by the document.
A null version disables support for directives, explicit tags, anchors, and aliases.
It also requires the schema option to be given as a Schema instance value.
Overrides all previously set schema options.
Parameters
Section titled “Parameters”version
Section titled “version”"1.1" | "1.2" | "next" | null
options?
Section titled “options?”SchemaOptions
Returns
Section titled “Returns”void
toJS()
Section titled “toJS()”toJS(
opt?):any
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:129
A plain JavaScript representation of the document contents.
Parameters
Section titled “Parameters”ToJSOptions & object
Returns
Section titled “Returns”any
toJSON()
Section titled “toJSON()”toJSON(
jsonArg?,onAnchor?):any
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:138
A JSON representation of the document contents.
Parameters
Section titled “Parameters”jsonArg?
Section titled “jsonArg?”string | null
Used by JSON.stringify to indicate the array index or
property name.
onAnchor?
Section titled “onAnchor?”(value, count) => void
Returns
Section titled “Returns”any
toString()
Section titled “toString()”toString(
options?):string
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:140
A YAML representation of the document.
Parameters
Section titled “Parameters”options?
Section titled “options?”ToStringOptions
Returns
Section titled “Returns”string