Type Alias IDeserializer<TSerializedValue>

IDeserializer: {
    deserialize<TValue>(serializedValue: TSerializedValue): TValue;
}

Deserializer contract for converting serialized data back to runtime values. Transforms a serialized format (usually JSON-compatible) to runtime objects.

Difference from ICodec (Decoder):

  • Deserializer: Works with arbitrary plain data (no custom class instances)
  • Decoder: Can be specialized for specific types

Common use cases:

  • Parse JSON from API requests into runtime objects
  • Reconstruct data structures from stored serialized data
  • Process incoming network data

Type Parameters

  • TSerializedValue = unknown

    The serialized input format (usually JSON-compatible, defaults to unknown)

    IMPORT_PATH: "@daiso-tech/core/serde/contracts"

Type declaration

  • deserialize:function
    • Deserializes the given serialized value into a runtime value. Converts from storage/transmission format back to usable runtime objects.

      Type Parameters

      • TValue

        The type of value being deserialized to

      Parameters

      Returns TValue

      The deserialized runtime value

      If deserialization fails (invalid format, type mismatch, etc.)