json-joy
    Preparing search index...

    Interface JsonNode<View>

    Each JsonNode represents a structural unit of a JSON document. It is like an AST node, where each node has one of the following types: "object", "array", "string", "number", "boolean", and "null".

    "make" operations result into JSON nodes, for example, "make object" operation create a new "object" JSON node, "make number" operation creates a number JSON node, etc.

    interface JsonNode<View = unknown> {
        api: unknown;
        id: ITimestampStruct;
        child(): undefined | JsonNode<unknown>;
        children(callback: (node: JsonNode) => void): void;
        container(): undefined | JsonNode<unknown>;
        name(): string;
        span(): number;
        toString(tab?: string): string;
        view(): View;
    }

    Type Parameters

    • View = unknown

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    api: unknown

    A singleton cache, instance which provides public API for this node.

    Unique ID within a document.

    Methods

    • Returns itself if the node is a container node. Or asks its child (if any) to return a container node. A container node is one that holds other multiple other nodes which can be addressed. For example, an object and an array are container nodes, as they hold other nodes.

      Returns undefined | JsonNode<unknown>

    • Sometimes an Identifiable can be a compound entity, which holds multiple entries with sequentially growing timestamps. In this case span represents the number of entries.

      Returns number

    • Parameters

      • Optionaltab: string

      Returns string