Since

1.0.0

Type Parameters

  • T extends string | number

Hierarchy

Constructors

Properties

_A: T

Since

1.0.0

_I: unknown

Since

1.0.0

_O: T

Since

1.0.0

_tag: "EnumType" = ...
encode: Encode<T, T>

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

is: Is<T>

a custom type guard

name: string

a unique name for this codec

validate: Validate<unknown, T>

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

values: readonly T[]

Methods

  • Since

    1.0.0

    Returns Decoder<unknown, T>

  • Since

    1.0.0

    Returns Encoder<T, T>

  • a version of validate with a default context

    Since

    1.0.0

    Parameters

    • i: unknown

    Returns Validation<T>

  • Since

    1.0.0

    Type Parameters

    • B

    • IB

    • A

    • OB

    Parameters

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

    Returns Type<B, T, unknown>

Generated using TypeDoc