getTupleDecoder
Call Signature
Returns a decoder for tuples.
This decoder deserializes a fixed-size array (tuple) by decoding its items sequentially using the provided item decoders.
For more details, see getTupleCodec.
Type Parameters
| Type Parameter | Description |
|---|---|
TItems extends readonly FixedSizeDecoder<any>[] | An array of decoders, each corresponding to a tuple element. |
Parameters
| Parameter | Type | Description |
|---|---|---|
items | TItems | The decoders for each item in the tuple. |
Returns
FixedSizeDecoder<DrainOuterGeneric<{ [I in string | number | symbol]: TItems[I<I>] extends Decoder<TTo> ? TTo : never }>>
A FixedSizeDecoder or VariableSizeDecoder for decoding tuples.
Example
Decoding a tuple with 2 items.
See
Call Signature
Returns a decoder for tuples.
This decoder deserializes a fixed-size array (tuple) by decoding its items sequentially using the provided item decoders.
For more details, see getTupleCodec.
Type Parameters
| Type Parameter | Description |
|---|---|
TItems extends readonly Decoder<any>[] | An array of decoders, each corresponding to a tuple element. |
Parameters
| Parameter | Type | Description |
|---|---|---|
items | TItems | The decoders for each item in the tuple. |
Returns
VariableSizeDecoder<DrainOuterGeneric<{ [I in string | number | symbol]: TItems[I<I>] extends Decoder<TTo> ? TTo : never }>>
A FixedSizeDecoder or VariableSizeDecoder for decoding tuples.
Example
Decoding a tuple with 2 items.