Options
All
  • Public
  • Public/Protected
  • All
Menu
since

1.0.0

Type parameters

  • CS: Any[]

  • A = any

  • O = A

  • I = unknown

Hierarchy

  • Type<A, O, I>
    • IntersectionType

Index

Constructors

  • new IntersectionType<CS, A, O, I>(name: string, is: Is<A>, validate: Validate<I, A>, encode: Encode<A, O>, types: CS): IntersectionType<CS, A, O, I>
  • Type parameters

    • CS: Any[]

    • A = any

    • O = A

    • I = unknown

    Parameters

    • name: string
    • is: Is<A>
    • validate: Validate<I, A>
    • encode: Encode<A, O>
    • types: CS

    Returns IntersectionType<CS, A, O, I>

Properties

_A: A
since

1.0.0

_I: I
since

1.0.0

_O: O
since

1.0.0

_tag: "IntersectionType"
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

types: CS
validate: Validate<I, A>

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

Methods

  • asDecoder(): Decoder<I, A>
  • asEncoder(): Encoder<A, O>
  • decode(i: I): Validation<A>
  • a version of validate with a default context

    since

    1.0.0

    Parameters

    • i: I

    Returns Validation<A>

  • pipe<B, IB, A, OB>(ab: Type<B, OB, IB>, name?: string): Type<B, O, I>
  • since

    1.0.0

    Type parameters

    • B

    • IB

    • A

    • OB

    Parameters

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

    Returns Type<B, O, I>

Generated using TypeDoc