/** * Executes an array of async functions in parallel with concurrency control. * * @param tasks - Array of async functions to execute. * @param concurrency - Maximum number of concurrent executions (default: 5). * @returns Promise that resolves with array of results in the same order as input tasks. * * @throws {Error} If concurrency is less than 1 or tasks array contains non-functions. * * @example * // Basic parallel execution with default concurrency * const results = await asyncParallel([ * async () => fetch('/api/user/1').then(r => r.json()), * async () => fetch('/api/user/2').then(r => r.json()), * async () => fetch('/api/user/3').then(r => r.json()), * ]); // Executes up to 5 concurrently * * @example * // Custom concurrency limit * const results = await asyncParallel([ * async () => heavyComputation(1), * async () => heavyComputation(2), * async () => heavyComputation(3), * async () => heavyComputation(4), * ], 2); // Only 2 concurrent executions * * @example * // With mixed async operations * const results = await asyncParallel([ * async () => databaseQuery('SELECT * FROM users'), * async () => cacheGet('config'), * async () => externalApiCall('/data'), * ], 3); * * @note Results are returned in the same order as input tasks, regardless of completion order. * * @complexity Time: O(n/c) where n is number of tasks and c is concurrency, Space: O(n) */ export declare function asyncParallel(tasks: Array<() => Promise>, concurrency?: number): Promise; //# sourceMappingURL=asyncParallel.d.ts.map