import type { AnyIterable, MaybePromise } from "../../types"; /** * Applies a given function to each element of the input iterable. * Returns the same iterable passed as input. * * @template T - The type of elements in the input iterable. * @param fn - A function that takes an element and its index, applies side effects, and returns nothing. * @returns A function that accepts an input iterable and returns an async iterable. * @group Lazy helpers * * @example * ```ts * using([1, 2, 3]) * .forEach((n) => console.log(n)) // Logs 1, 2, and 3 * .consume(); * ``` */ export declare const forEach: (fn: (element: T, index: number) => MaybePromise) => (input: AnyIterable) => AsyncIterable>; /** * Applies a given function to each element of the input iterable. * Returns the same iterable passed as input. * * @template T - The type of elements in the input iterable. * @param fn - A function that takes an element and its index, applies side effects, and returns nothing. * @returns A function that accepts an input iterable and returns a sync iterable. * @group Lazy helpers * * @example * ```ts * using([1, 2, 3]) * .forEach((n) => console.log(n)) // Logs 1, 2, and 3 * .consume(); * ``` * * @remarks * Available as `forEach` when imported from `peter-piper/sync`. */ export declare const forEachSync: (fn: (element: T, index: number) => void) => (input: Iterable) => Iterable;