Interface BrandP<A, B, I>

Type Parameters

  • A

  • B extends A

  • I

Hierarchy

Properties

_A: Branded<A, B>

Since

1.0.0

_I: I

Since

1.0.0

_O: Branded<A, B>

Since

1.0.0

encode: Encode<Branded<A, B>, Branded<A, B>>

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

is: Is<Branded<A, B>>

a custom type guard

name: string

a unique name for this codec

validate: Validate<I, Branded<A, B>>

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

Methods

  • Returns Decoder<I, Branded<A, B>>

    Since

    1.0.0

  • Returns Encoder<Branded<A, B>, Branded<A, B>>

    Since

    1.0.0

  • a version of validate with a default context

    Parameters

    • i: I

    Returns Validation<Branded<A, B>>

    Since

    1.0.0

  • Type Parameters

    • B

    • IB

    • A

    • OB

    Parameters

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

    Returns Type<B, Branded<A, B>, I>

    Since

    1.0.0