Conformal TypeScript API
    Preparing search index...

    Type Alias Codec<T>

    A Codec for a type T defines how to serialize and deserialize the value to and from a binary format.

    type Codec<T> = {
        decode: (value: Uint8Array) => T;
        encode: (value: T) => Uint8Array;
    }

    Type Parameters

    • T

      The type of the value to encode and decode.

    Index

    Properties

    Properties

    decode: (value: Uint8Array) => T

    Decode a value from a binary format.

    Should throw an error if the value is not deserializable.

    encode: (value: T) => Uint8Array

    Encode a value into a binary format.