import { Consumer } from "../util/function/Consumer";
import { Element } from "./Collection";
/**
 * Implementing this interface allows an object to be the target of the enhanced _for-of_ statement.
 * Redefines TypeScript's native implementation to adhere to the `Java Collections Framework` interface.
 */
export interface Iterable<T> {
    /** Returns the default iterator over elements of type T */
    [Symbol.iterator](): Iterator<Element<T>>;
    /** Returns an iterator over elements of type T */
    get iterator(): Iterator<Element<T>>;
    /**
     * Performs the `Consumer` action for each element of the iterable object until all elements have been processed or the action throws an exception
     * @param action Action to perform
     */
    forEach(action: Consumer<Element<T>>): void;
}
