Codec: {
    custom<T_1>(__namedParameters) => functional.Codec<T_1>;
    interface<T>(properties) => functional.Codec<{
        [k in string | number | symbol]: GetType<T[k]>
    }>;
}

Type declaration

  • custom:function
    • Creates a codec for any type, you can add your own deserialization/validation logic in the decode argument

      Type Parameters

      • T_1

      Parameters

      • __namedParameters: {
            decode: ((value) => functional.Either<string, T_1>);
            encode: ((value) => any);
            schema?: (() => object);
        }
        • decode: ((value) => functional.Either<string, T_1>)
        • encode: ((value) => any)
            • (value): any
            • Parameters

              • value: T_1

              Returns any

        • Optional schema?: (() => object)
            • (): object
            • Returns object

      Returns functional.Codec<T_1>

  • interface:function
    • Creates a codec for any JSON object

      Type Parameters

      Parameters

      • properties: T

      Returns functional.Codec<{
          [k in string | number | symbol]: GetType<T[k]>
      }>

Generated using TypeDoc