Class DataSerializer

Allows the serialization and deserialization of objects using the SerializableObject decorator.

Usage

Registration

Objects are registered upon loading with the SerializableObject decorator. Manual registration is possible using:

DataSerializer.registerType(MyObjectClass);

Constructors

Properties

deserializer: Deserializer = ...
eventEmitter: EventEmitter<DefaultEventMap> = ...
knownTypes: Map<string, Serializable<any>> = ...
serializer: Serializer = ...

Methods

  • Clone a serializable object

    Type Parameters

    • T
    • D = T

    Parameters

    • object: T

      Serializable object

    • Optional dataType: Constructor<D>

      Data type to clone to

    Returns D

    Cloned object