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

Type Parameters

  • T
  • E

Hierarchy (view full)

Constructors

Methods

  • Decodes the encoded data using the schema.

    Parameters

    • encoded: E
    • Optionalvalidate: boolean

    Returns T

  • Parameters

    • encoded: E

    Returns T

  • Encodes the value using the schema.

    Parameters

    • value: T

    Returns E

  • Parameters

    • value: T

    Returns E

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

    Parameters

    • _value: T

    Returns void