import { Decoder } from "../utils/interface"; /** * Decodes a given array into a Typescript tuple with a fixed number of elements, * possibly with different types. * * @example * ```typescript * const latLngDecoder = decoder.tuple(decoder.number, decoder.number); * const geoDecoder = decoder.struct({ * markers: decoder.array(latLngDecoder), * }); * * async function fetchGeoData() { * const response = await fetch("https://api.example.com/points-of-interest"); * const decodeResult = geoDecoder.decode(await response.json()); * if (decodeResult.ok) { * // decodeResult.value.markers is an array of lat/long tuples * addMarkersToMap(decodeResult.value.markers); * } else { * // decodeResult is now an Error, which may indicate an index that failed to decode * } * } * ``` * * @typeParam T the tuple type to decode * @param decoders Set of {@linkcode Decoder}s to apply to each element of the given array * @returns a {@linkcode Result} of the attempt to decode the given value as a tuple */ export declare function tuple>(...decoders: { [I in keyof T]: Decoder; }): Decoder;