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: number
    • Optionalvalidate: boolean

    Returns TypeFromBitSchema<T>

  • Allow to use a fully defined Bitmap schema as input, but also allow one where only the entries of bits set are provided, rest is unset.

    Parameters

    Returns number

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

    Parameters

    Returns void