import { Decoder } from "../utils/interface"; /** * Decodes an unknown value into an array of identical elements. * * @example * ```typescript * const arrayOfStringsDecoder = decoder.array(decoder.string); * * async function getTodoList() { * const response = await fetch("https://api.example.com/my-todos"); * const decodeResult = arrayOfStringsDecoder.decode(await response.json()); * if (decodeResult.ok) { * // decodeResult.value is now of type Array * } else { * // decodeResult.error is now an Error with a message describing which * // index failed to conform to the desired type * } * } * ``` * * @typeParam T the element type of the decoded array * @param elementDecoder {@linkcode Decoder} used for each element of the array * @returns a {@linkcode Decoder} for an array of consistent elements */ export declare function array(elementDecoder: Decoder): Decoder>;