Type alias Codec<I, O, E>

Codec<I, O, E>: {
    decode: ((data: O) => IEither<E, I>);
    encode: ((data: I) => IEither<E, O>);
}

A encoder and decoder of metadata objects.

Type Parameters

  • I

  • O

  • E = Error

Type declaration

  • decode: ((data: O) => IEither<E, I>)
      • (data: O): IEither<E, I>
      • Decode output type to input.

        Generic

        I - input type

        Generic

        O - output type

        Returns

        I - input type

        Parameters

        • data: O

          O - output

        Returns IEither<E, I>

  • encode: ((data: I) => IEither<E, O>)
      • (data: I): IEither<E, O>
      • Encode input type to output

        Generic

        I - input type

        Generic

        O - output type

        Returns

        O - output type

        Parameters

        • data: I

          I - input

        Returns IEither<E, O>

Generated using TypeDoc