import { AsyncWrappable, AsyncIteratorResult, AsyncNonIterableIterator } from '../../types/async-iterable'; export interface AsyncForkeratorIterator { next(): AsyncIteratorResult; return(): AsyncIteratorResult; [Symbol.asyncIterator](): AsyncNonIterableIterator; } interface AsyncForkeratorBase { readonly index: number; advance(n?: number): Promise>; return(): Promise>; fork(): AsyncForkeratorIterator; asIterator(): AsyncForkeratorIterator; [Symbol.asyncIterator](): AsyncForkeratorIterator; } interface AsyncDoneForkerator extends AsyncForkeratorBase { readonly current: { done: true; value: undefined; }; readonly done: true; readonly value: undefined; } interface AsyncValueForkerator extends AsyncForkeratorBase { readonly current: { done: false; value: T; }; readonly done: false; readonly value: T; } export type AsyncForkerator = AsyncDoneForkerator | AsyncValueForkerator; declare function asyncForkerate(source: AsyncWrappable): Promise>; export { asyncForkerate };