summaryrefslogtreecommitdiff
path: root/cli/tsc/dts/lib.es2018.asynciterable.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tsc/dts/lib.es2018.asynciterable.d.ts')
-rw-r--r--cli/tsc/dts/lib.es2018.asynciterable.d.ts22
1 files changed, 16 insertions, 6 deletions
diff --git a/cli/tsc/dts/lib.es2018.asynciterable.d.ts b/cli/tsc/dts/lib.es2018.asynciterable.d.ts
index f3de8021d..a2ddd99be 100644
--- a/cli/tsc/dts/lib.es2018.asynciterable.d.ts
+++ b/cli/tsc/dts/lib.es2018.asynciterable.d.ts
@@ -27,17 +27,27 @@ interface SymbolConstructor {
readonly asyncIterator: unique symbol;
}
-interface AsyncIterator<T, TReturn = any, TNext = undefined> {
+interface AsyncIterator<T, TReturn = any, TNext = any> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
- next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
+ next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
}
-interface AsyncIterable<T> {
- [Symbol.asyncIterator](): AsyncIterator<T>;
+interface AsyncIterable<T, TReturn = any, TNext = any> {
+ [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
}
-interface AsyncIterableIterator<T> extends AsyncIterator<T> {
- [Symbol.asyncIterator](): AsyncIterableIterator<T>;
+/**
+ * Describes a user-defined {@link AsyncIterator} that is also async iterable.
+ */
+interface AsyncIterableIterator<T, TReturn = any, TNext = any> extends AsyncIterator<T, TReturn, TNext> {
+ [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
+}
+
+/**
+ * Describes an {@link AsyncIterator} produced by the runtime that inherits from the intrinsic `AsyncIterator.prototype`.
+ */
+interface AsyncIteratorObject<T, TReturn = unknown, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
+ [Symbol.asyncIterator](): AsyncIteratorObject<T, TReturn, TNext>;
}