/** * Maps over an array asynchronously, applying an async function to each element. * * @param array - The array to map over. * @param asyncFn - The async function to apply to each element. * @param concurrency - Maximum number of concurrent operations (default: 5). * @returns Promise that resolves with array of mapped results. * * @throws {Error} If concurrency is less than 1. * * @example * // Basic async map * const results = await asyncMap( * [1, 2, 3, 4, 5], * async (num) => { * const response = await fetch(`/api/data/${num}`); * return response.json(); * } * ); * * @example * // With custom concurrency * const results = await asyncMap( * ['file1.txt', 'file2.txt', 'file3.txt'], * async (filename) => { * const content = await readFile(filename); * return content.length; * }, * 2 // Only process 2 files at a time * ); * * @example * // Processing user data * const enrichedUsers = await asyncMap( * userIds, * async (userId) => { * const user = await getUser(userId); * const preferences = await getUserPreferences(userId); * return { ...user, preferences }; * } * ); * * @note Results maintain the same order as the input array. * * @complexity Time: O(n/c) where n is array length and c is concurrency, Space: O(n) */ export declare function asyncMap(array: T[], asyncFn: (item: T, index: number) => Promise, concurrency?: number): Promise; //# sourceMappingURL=asyncMap.d.ts.map