mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 01:34:55 -06:00
24 lines
725 B
TypeScript
24 lines
725 B
TypeScript
/// <reference path="lib.es2015.symbol.d.ts" />
|
|
/// <reference path="lib.es2015.iterable.d.ts" />
|
|
|
|
interface SymbolConstructor {
|
|
/**
|
|
* A method that returns the default async iterator for an object. Called by the semantics of
|
|
* the for-await-of statement.
|
|
*/
|
|
readonly asyncIterator: symbol;
|
|
}
|
|
|
|
interface AsyncIterator<T> {
|
|
next(value?: any): Promise<IteratorResult<T>>;
|
|
return?(value?: any): Promise<IteratorResult<T>>;
|
|
throw?(e?: any): Promise<IteratorResult<T>>;
|
|
}
|
|
|
|
interface AsyncIterable<T> {
|
|
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
}
|
|
|
|
interface AsyncIterableIterator<T> extends AsyncIterator<T> {
|
|
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
} |