Skip to content

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.

Contents extends YamlNode = YamlNode

Strict extends boolean = true

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

any

The initial value for the document, which will be wrapped in a Node container.

DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions

Document<Contents, Strict>

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

any

Replacer | null

DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions

Document<Contents, Strict>

readonly [NODE_TYPE]: symbol

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:21


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: 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: Strict extends true ? 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: Strict extends true ? Directives | undefined : Directives

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:28


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: 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


optional range?: 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: 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: YAMLWarning[]

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/doc/Document.d.ts:42

Warnings encountered during parsing.

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.

any

void


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.

Iterable<unknown>

unknown

void


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.

Document<Contents, Strict>


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.

Strict extends true ? YamlScalar<unknown> | YamlMap<unknown, unknown> | YamlSeq<unknown> : YamlNode

string

YamlAlias


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.

T = unknown

T

CreateNodeOptions

NodeType<T>

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.

T = unknown

T

CreateNodeOptions | Replacer | null

CreateNodeOptions

NodeType<T>


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.

K extends YamlNode = YamlNode

V extends YamlNode = YamlNode

unknown

unknown

CreateNodeOptions

YamlPair<K, V>


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.

unknown

boolean

true if the item was found and removed.


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.

Iterable<unknown, any, any> | null

boolean

true if the item was found and removed.


get(key, keepScalar?): Strict extends true ? 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).

unknown

boolean

Strict extends true ? unknown : any


getIn(path, keepScalar?): Strict extends true ? 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).

Iterable<unknown, any, any> | null

boolean

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.

unknown

boolean


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.

Iterable<unknown, any, any> | null

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.

any

unknown

void


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.

Iterable<unknown, any, any> | null

unknown

void


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.

"1.1" | "1.2" | "next" | null

SchemaOptions

void


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.

ToJSOptions & object

any


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.

string | null

Used by JSON.stringify to indicate the array index or property name.

(value, count) => void

any


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.

ToStringOptions

string