Define a schema to encode / decode convert type T to type E.

Type Parameters

Hierarchy (view full)

Constructors

Methods

  • Decodes the encoded data using the schema.

    Parameters

    • encoded: Uint8Array
    • Optionalvalidate: boolean

    Returns TypeFromBitSchema<T>

  • Encodes the value using the schema.

    Parameters

    Returns Uint8Array

  • Optional validator that can be used to enforce constraints on the data before encoding / after decoding.

    Parameters

    Returns void