Type Alias IEncoder<TDecodedValue, TEncodedValue>

IEncoder: { encode(decodedValue: TDecodedValue): TEncodedValue }

Encoder contract defining the interface for converting decoded data to encoded format.

Common use cases:

  • JSON encoding: object → JSON string
  • Base64 encoding: binary data → base64 string
  • Compression: large data → compressed bytes
  • Encryption: plaintext → ciphertext

Type Parameters

  • TDecodedValue

    The type of data before encoding (original/source format)

  • TEncodedValue

    The type of data after encoding (target/transport format)

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

Type declaration