ts-lambda-api - v2.5.2
    Preparing search index...

    Interface Parsed<Contents, Strict>

    The typing of directives fails in TS <= 4.2

    interface Parsed<
        Contents extends ParsedNode = ParsedNode,
        Strict extends boolean = true,
    > {
        "[NODE_TYPE]": symbol;
        comment: string;
        commentBefore: string;
        contents: Strict extends true ? Contents : Contents;
        directives: Directives;
        errors: YAMLError[];
        options: Required<
            Omit<
                ParseOptions & DocumentOptions,
                "_directives"
                | "lineCounter"
                | "version",
            >,
        >;
        range: Range;
        schema: Schema;
        warnings: YAMLWarning[];
        add(value: any): void;
        addIn(path: Iterable<unknown>, value: unknown): void;
        clone(): Document<Contents, Strict>;
        createAlias(
            node: Strict extends true
                ? Scalar<unknown>
                | YAMLMap<unknown, unknown>
                | YAMLSeq<unknown>
                : Node,
            name?: string,
        ): Alias;
        createNode<T = unknown>(value: T, options?: CreateNodeOptions): NodeType<T>;
        createNode<T = unknown>(
            value: T,
            replacer: Replacer | CreateNodeOptions,
            options?: CreateNodeOptions,
        ): NodeType<T>;
        createPair<K extends Node = Node, V extends Node = Node>(
            key: unknown,
            value: unknown,
            options?: CreateNodeOptions,
        ): Pair<K, V>;
        delete(key: unknown): boolean;
        deleteIn(path: Iterable<unknown, any, any>): boolean;
        get(
            key: unknown,
            keepScalar?: boolean,
        ): Strict extends true ? unknown : any;
        getIn(
            path: Iterable<unknown, any, any>,
            keepScalar?: boolean,
        ): Strict extends true ? unknown : any;
        has(key: unknown): boolean;
        hasIn(path: Iterable<unknown, any, any>): boolean;
        set(key: any, value: unknown): void;
        setIn(path: Iterable<unknown, any, any>, value: unknown): void;
        setSchema(version: "1.1" | "1.2" | "next", options?: SchemaOptions): void;
        toJS(opt?: ToJSOptions & { [ignored: string]: unknown }): any;
        toJSON(
            jsonArg?: string,
            onAnchor?: (value: unknown, count: number) => void,
        ): any;
        toString(options?: ToStringOptions): string;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    "[NODE_TYPE]": symbol
    comment: string

    A comment immediately after this Document

    commentBefore: string

    A comment before this Document

    contents: Strict extends true ? Contents : Contents

    The document contents.

    directives: Directives
    errors: YAMLError[]

    Errors encountered during parsing.

    options: Required<
        Omit<
            ParseOptions & DocumentOptions,
            "_directives"
            | "lineCounter"
            | "version",
        >,
    >
    range: Range

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

    The schema used with the document. Use setSchema() to change.

    warnings: YAMLWarning[]

    Warnings encountered during parsing.

    Methods

    • Adds a value to the document.

      Parameters

      • value: any

      Returns void

    • Adds a value to the document.

      Parameters

      Returns void

    • 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

      Returns Alias

    • Convert a key and a value into a Pair using the current schema, recursively wrapping all values as Scalar or Collection nodes.

      Type Parameters

      Parameters

      Returns Pair<K, V>

    • Removes a value from the document.

      Parameters

      • key: unknown

      Returns boolean

      true if the item was found and removed.

    • Removes a value from the document.

      Parameters

      Returns boolean

      true if the item was found and removed.

    • 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

      • key: unknown
      • OptionalkeepScalar: boolean

      Returns Strict extends true ? unknown : any

    • 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

      • path: Iterable<unknown, any, any>
      • OptionalkeepScalar: boolean

      Returns Strict extends true ? unknown : any

    • Checks if the document includes a value with the key key.

      Parameters

      • key: unknown

      Returns boolean

    • Checks if the document includes a value at path.

      Parameters

      Returns boolean

    • Sets a value in this document. For !!set, value needs to be a boolean to add/remove the item from the set.

      Parameters

      • key: any
      • value: unknown

      Returns void

    • Sets a value in this document. For !!set, value needs to be a boolean to add/remove the item from the set.

      Parameters

      • path: Iterable<unknown, any, any>
      • value: unknown

      Returns void

    • 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

      Returns void

    • A plain JavaScript representation of the document contents.

      Parameters

      • Optionalopt: ToJSOptions & { [ignored: string]: unknown }

      Returns any

    • A JSON representation of the document contents.

      Parameters

      • OptionaljsonArg: string

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

      • OptionalonAnchor: (value: unknown, count: number) => void

      Returns any