Since

1.0.0

Type Parameters

  • A

  • O = A

  • I = unknown

Hierarchy

Implements

  • Decoder<I, A>
  • Encoder<A, O>

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • A

    • O = A

    • I = unknown

    Parameters

    • name: string

      a unique name for this codec

    • is: Is<A>

      a custom type guard

    • validate: Validate<I, A>

      succeeds if a value of type I can be decoded to a value of type A

    • encode: Encode<A, O>

      converts a value of type A to a value of type O

    Returns Type<A, O, I>

Properties

_A: A

Since

1.0.0

_I: I

Since

1.0.0

_O: O

Since

1.0.0

encode: Encode<A, O>

converts a value of type A to a value of type O

is: Is<A>

a custom type guard

name: string

a unique name for this codec

validate: Validate<I, A>

succeeds if a value of type I can be decoded to a value of type A

Methods

  • Since

    1.0.0

    Returns Decoder<I, A>

  • Since

    1.0.0

    Returns Encoder<A, O>

  • a version of validate with a default context

    Since

    1.0.0

    Parameters

    • i: I

    Returns Validation<A>

  • Since

    1.0.0

    Type Parameters

    • B

    • IB

    • A

    • OB

    Parameters

    • this: Type<A, O, I>
    • ab: Type<B, OB, IB>
    • Optional name: string

    Returns Type<B, O, I>

Generated using TypeDoc