Type Parameters

  • A

Hierarchy

  • Type<A>
    • EnumType

Constructors

Properties

_A: A

Since

1.0.0

_I: unknown

Since

1.0.0

_O: A

Since

1.0.0

_tag: "EnumType" = 'EnumType'
encode: Encode<A, A>

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

enumObject: object
is: Is<A>

a custom type guard

name: string

a unique name for this codec

validate: Validate<unknown, A>

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

Methods

  • Since

    1.0.0

    Returns Decoder<unknown, A>

  • Since

    1.0.0

    Returns Encoder<A, A>

  • a version of validate with a default context

    Since

    1.0.0

    Parameters

    • i: unknown

    Returns Validation<A>

  • Since

    1.0.0

    Type Parameters

    • B

    • IB

    • A

    • OB

    Parameters

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

    Returns Type<B, A, unknown>