Type Alias TupleOfResults<T>

TupleOfResults: { [K in keyof T]: T[K] extends Decoder<infer R> ? R : never }

Type-level helper that extracts the type parameters from an array of decoders.

Given an array of decoders, this type will produce a tuple type where each element corresponds to the type that each decoder produces.

Type Parameters

  • T extends readonly [] | readonly Decoder<any>[]

    An array of decoders

type Point = TupleOfResults<[Decoder<number>, Decoder<number>]>; // [number, number]