//#region src/promise/map.d.ts /** * Iterates over an array and returns a promise that resolves with an array of mapped values. * Supports concurrency limiting. * * @template T - The type of the input array elements * @template U - The type of the mapped values * @param array - The array to iterate over * @param mapper - The function to apply to each element (can be async or return a promise) * @param concurrency - The maximum number of concurrent operations (default: Infinity) * @returns Returns a promise that resolves with an array of mapped values in the same order * * @example * const ids = [1, 2, 3]; * const users = await map(ids, (id) => fetchUser(id), 2); // Max 2 concurrent requests * * @example * const numbers = [1, 2, 3]; * const doubled = await map(numbers, (n) => Promise.resolve(n * 2)); */ declare function map(array: T[], mapper: (value: T, index: number) => Promise | U, concurrency?: number): Promise; //#endregion export { map }; //# sourceMappingURL=map.d.mts.map