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

    Interface Parsed<T>

    interface Parsed<
        T extends ParsedNode
        | Pair<ParsedNode, ParsedNode | null> = ParsedNode,
    > {
        "[NODE_TYPE]": symbol;
        addToJSMap?: (ctx: ToJSContext, map: MapLike, value: unknown) => void;
        anchor?: string;
        comment?: string;
        commentBefore?: string;
        flow?: boolean;
        items: T[];
        range: Range;
        schema: Schema;
        spaceBefore?: boolean;
        srcToken?: BlockSequence | FlowCollection;
        tag?: string;
        add(value: T): void;
        addIn(path: Iterable<unknown>, value: unknown): void;
        clone(schema?: Schema): Collection;
        delete(key: unknown): boolean;
        deleteIn(path: Iterable<unknown>): boolean;
        get(key: unknown, keepScalar: true): Scalar<T>;
        get(key: unknown, keepScalar?: false): T;
        get(key: unknown, keepScalar?: boolean): T | Scalar<T>;
        getIn(path: Iterable<unknown>, keepScalar?: boolean): unknown;
        has(key: unknown): boolean;
        hasAllNullValues(allowScalar?: boolean): boolean;
        hasIn(path: Iterable<unknown>): boolean;
        set(key: unknown, value: T): void;
        setIn(path: Iterable<unknown>, value: unknown): void;
        toJS(
            doc: Document<Node<unknown>, boolean>,
            __namedParameters?: ToJSOptions,
        ): any;
        toJSON(_?: unknown, ctx?: ToJSContext): unknown[];
        toString(
            ctx?: StringifyContext,
            onComment?: () => void,
            onChompKeep?: () => void,
        ): string;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    "[NODE_TYPE]": symbol
    addToJSMap?: (ctx: ToJSContext, map: MapLike, value: unknown) => void

    Customize the way that a key-value pair is resolved. Used for YAML 1.1 !!merge << handling.

    anchor?: string

    An optional anchor on this node. Used by alias nodes.

    comment?: string

    A comment on or immediately after this

    commentBefore?: string

    A comment before this

    flow?: boolean

    If true, stringify this and all child nodes using flow rather than block styles.

    items: T[]
    range: Range

    The [start, value-end, node-end] character offsets for the part of the source parsed into this node (undefined if not parsed). The value-end and node-end positions are themselves not included in their respective ranges.

    schema: Schema
    spaceBefore?: boolean

    A blank line before this node and its commentBefore

    The CST token that was composed into this node.

    tag?: string

    A fully qualified tag, if required

    Methods

    • Adds a value to the collection.

      Parameters

      • value: T

      Returns void

    • Adds a value to the collection. For !!map and !!omap the value must be a Pair instance or a { key, value } object, which may not have a key that already exists in the map.

      Parameters

      Returns void

    • Create a copy of this collection.

      Parameters

      • Optionalschema: Schema

        If defined, overwrites the original's schema

      Returns Collection

    • Removes a value from the collection.

      key must contain a representation of an integer for this to succeed. It may be wrapped in a Scalar.

      Parameters

      • key: unknown

      Returns boolean

      true if the item was found and removed.

    • Removes a value from the collection.

      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).

      key must contain a representation of an integer for this to succeed. It may be wrapped in a Scalar.

      Parameters

      • key: unknown
      • keepScalar: true

      Returns Scalar<T>

    • 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).

      key must contain a representation of an integer for this to succeed. It may be wrapped in a Scalar.

      Parameters

      • key: unknown
      • OptionalkeepScalar: false

      Returns T

    • 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).

      key must contain a representation of an integer for this to succeed. It may be wrapped in a Scalar.

      Parameters

      • key: unknown
      • OptionalkeepScalar: boolean

      Returns T | Scalar<T>

    • 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

      • path: Iterable<unknown>
      • OptionalkeepScalar: boolean

      Returns unknown

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

      key must contain a representation of an integer for this to succeed. It may be wrapped in a Scalar.

      Parameters

      • key: unknown

      Returns boolean

    • Parameters

      • OptionalallowScalar: boolean

      Returns boolean

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

      Parameters

      Returns boolean

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

      If key does not contain a representation of an integer, this will throw. It may be wrapped in a Scalar.

      Parameters

      • key: unknown
      • value: T

      Returns void

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

      Parameters

      Returns void

    • A plain JavaScript representation of this node.

      Parameters

      Returns any

    • A plain JS representation of this node

      Parameters

      Returns unknown[]

    • Parameters

      • Optionalctx: StringifyContext
      • OptionalonComment: () => void
      • OptionalonChompKeep: () => void

      Returns string