Interface AsyncGenerator<T, TReturn, TNext>
interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> {
"[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>>;
}
"[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
Hierarchy
- AsyncIteratorObject<T, TReturn, TNext>
- AsyncGenerator (View Summary)
Index
Methods
Methods
[asyncIterator]
- "[asyncIterator]"(): AsyncGenerator<T, TReturn, TNext>
Returns AsyncGenerator<T, TReturn, TNext>
next
- next(...__namedParameters: [] | [TNext]): Promise<IteratorResult<T, TReturn>>
Parameters
- ...__namedParameters: [] | [TNext]
Returns Promise<IteratorResult<T, TReturn>>
return
- return(
value: TReturn | PromiseLike<TReturn>,
): Promise<IteratorResult<T, TReturn>> Parameters
- value: TReturn | PromiseLike<TReturn>
Returns Promise<IteratorResult<T, TReturn>>
throw
- throw(e: any): Promise<IteratorResult<T, TReturn>>
Parameters
- e: any
Returns Promise<IteratorResult<T, TReturn>>
Describes an AsyncIterator produced by the runtime that inherits from the intrinsic
AsyncIterator.prototype
.