Since

1.0.0

Type Parameters

Hierarchy

  • Type<T["_A"], T["_O"], T["_I"]>
    • DefaultedType

Constructors

  • Type Parameters

    • T extends Any<T>

    Parameters

    • type: T
    • defaultValue: T["_A"]
    • Optional name: string

    Returns DefaultedType<T>

Properties

_A: T["_A"]

Since

1.0.0

_I: T["_I"]

Since

1.0.0

_O: T["_O"]

Since

1.0.0

defaultValue: T["_A"]
encode: Encode<T["_A"], T["_O"]>

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

is: Is<T["_A"]>

a custom type guard

name: string

a unique name for this codec

type: T
validate: Validate<T["_I"], T["_A"]>

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

Methods

  • Since

    1.0.0

    Returns Decoder<T["_I"], T["_A"]>

  • Since

    1.0.0

    Returns Encoder<T["_A"], T["_O"]>

  • a version of validate with a default context

    Since

    1.0.0

    Parameters

    • i: T["_I"]

    Returns Validation<T["_A"]>

  • Since

    1.0.0

    Type Parameters

    • B

    • IB

    • A

    • OB

    Parameters

    • this: Type<A, T["_O"], T["_I"]>
    • ab: Type<B, OB, IB>
    • Optional name: string

    Returns Type<B, T["_O"], T["_I"]>

Generated using TypeDoc