Documentation
    Preparing search index...

    Function serializeScene

    • Serializes the subtree rooted at root into a canonical §79 document.

      The document holds one root node, whose type records whether it was a Scene or a Group so the reader rebuilds the same class. Traversal is depth-first in insertion order (§6), and components appear in the registry's registration order, so serializing one scene twice yields identical text (§33).

      Parameters

      • root: Node

        the node to serialize, with its descendants

      • registry: ComponentSerializerRegistry

        the component serializers to apply

      • options: SerializeSceneOptions = {}

        node-type mapping and subclass-state writer for application classes, and the unknown-component policy

      Returns SceneDocument

      the canonical, frozen document

      FourError INVALID_APPLICATION_STATE for a node class with no type name, or a component with no registered serializer (unless SerializeSceneOptions.unknownComponents is "skip")

      TypeError if any value cannot be represented as JSON — a NaN in a transform, a Map in metadata, a component payload holding undefined