export declare type ConsoleEffects = string | string[] | (() => any) | IterableIterator any)>; interface ExecuteIteratorOptions { interceptHandler: (effect: Effects, handler: (effect: Effects) => any) => any; } /** * Executes an ConsoleEffects iterator. * The effects are handled the following way: * - string: print it to stdout * - string[]: concat and print it to stdout * - function: execute and await the result and push it back to the iterator */ export declare function executeIterator(iterator: AsyncIterableIterator | IterableIterator, options?: ExecuteIteratorOptions): Promise; declare type Effects = CallEffect | BranchEffect | WriteEffect | UnhandledEffect; interface CallEffect { readonly type: "CALL"; payload: { fn: () => Promise; }; } declare type ShorthandCallEffect = () => (Promise | void); interface BranchEffect { readonly type: "BRANCH"; payload: { iterator: IterableIterator; }; } declare type ShorthandBranchEffect = IterableIterator; interface WriteEffect { readonly type: "WRITE"; payload: { buffer: string; }; } declare type ShorthandWriteEffect = string | string[]; interface UnhandledEffect { readonly type: "UNHANDLED"; payload: { effect: any; }; } declare type ShorthandEffects = ShorthandBranchEffect | ShorthandCallEffect | ShorthandWriteEffect; export declare function isIterable(obj: any): boolean; export declare function isAsyncIterable(obj: any): boolean; export {}; //# sourceMappingURL=iterator.d.ts.map