Class SerializableBase<TProperties>Abstract

Default implementation of a Serializable that supports observability and serialization.

Type Parameters

  • TProperties

Hierarchy (view full)

Implements

Constructors

Methods

  • Sets the properties for this item.

    Parameters

    • properties: Partial<TProperties>

      A plain object containing property values to set, keyed by property name.

    Returns void

  • Sets the properties for this item.

    This version will also await any asynchronous logic that is needed to set the properties.

    Parameters

    • properties: Partial<TProperties>

      A plain object containing property values to set, keyed by property name.

    Returns Promise<void>

  • Waits for all deserialization logic initiated thus far to finish, whether invoked by passing properties into the constructor, or by invoking assignProperties() or assignPropertiesAsync().

    Returns Promise<void>

  • Gets the default value of an object's property.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: K

      The property of the object for which to get the default value.

    Returns TProperties[K]

  • Returns a serializable representation of the item.

    Parameters

    • serializeMode: SerializeMode = "all"

      If specified, only properties that are appropriate for the given mode are returned. Otherwise, all properties will be serialized.

    Returns TProperties