import type { Operation, Stream, Subscription } from "./types.js"; /** * Consume an Effection stream or subscription using a `for...of` loop. * * Given any stream or subscription, you can access its values sequentially * using the `each()` operation, just as you would use a `for await...of` loop * with an async iterable: * * @example * ```javascript * function* logValues(streamOrSubscription) { * for (let value of yield* each(streamOrSubscription)) { * console.log(value); * yield* each.next(); * } * } * ``` * * Pass an existing subscription when it must be active before iteration begins. * * You must always invoke `each.next()` at the end of each iteration of the loop, * including if the iteration ends with a `continue` statement. * * Note that just as with async iterators, there is no way to consume the * `TClose` value of a stream or subscription using the `for...of` loop. * * @typeParam T - the type of each value. * @param source - the stream or subscription to iterate * @returns an operation that iterates `source` * @since 3.0 */ export declare function each(source: Stream | Subscription): Operation>; export declare namespace each { var next: () => Operation; }