import { EventIterable } from "./generator"; import { _ChannelInternal } from "./channel"; import { t_HubInternal } from "./hub"; /** * Internal call to handle running generator iter trees */ export declare class IterRunner { private channel; private hub; private iterStack; private cancelled; constructor(iter: Generator, channel: _ChannelInternal, hub: t_HubInternal); /** * Run the current iterator * @param onCompletion * @param onError */ run(onCompletion?: (result?: any) => void, onError?: (error: any) => void): IterRunner; cancel(): void; /** true if not cancelled and the channel is not disposed */ get canProcessNextIteration(): boolean; /** * Run all iters in the stack * @param argument Value to return from left side of `yeild` keyword * @param onCompletion * @param onError */ private doRun; /** * Run the current iter and recursivly process the iter tree/promises if they are returned * @param val * @param onCompletion * @param onError */ private handleIterValue; /** * Run next iteration of the current iter on the top of the stack * @param iter * @param argument argument to return out of left side of `yeild` keyword */ private next; /** * Try and throw inside the top most iter and propogate up the iter stack until it is handled successfuly * @param err */ private handleIterError; /** * Call all generator middleware for the current `EventIterable` event * @param iterable Event * @param index Current middleware index */ private processEventIterable; }