Interface AsyncGenerator<T, TReturn, TNext>

    Describes an AsyncIterator produced by the runtime that inherits from the intrinsic AsyncIterator.prototype.

    interface AsyncGenerator<T, TReturn, TNext> {
        [asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
        next(...__namedParameters: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
        return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
        throw(e: any): Promise<IteratorResult<T, TReturn>>;
    }

    Type Parameters

    • T = unknown
    • TReturn = any
    • TNext = any
    Hierarchy

    Methods