Skip to content

Commit 3a6e562

Browse files
committed
Also do AsyncIterable
1 parent 9483d42 commit 3a6e562

23 files changed

+54
-148
lines changed
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,2 @@
1-
/////////////////////////////
2-
/// Window Async Iterable APIs
3-
/////////////////////////////
4-
5-
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
6-
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
7-
}
8-
9-
interface FileSystemDirectoryHandle {
10-
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
11-
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
12-
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
13-
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
14-
}
15-
16-
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
17-
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
18-
}
19-
20-
interface ReadableStream<R = any> {
21-
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
22-
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
23-
}
1+
// This file's contents are now included in the main DOM types.
2+
// The file has been left for backward compatibility.

src/lib/dom.generated.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference lib="es2015" />
2+
/// <reference lib="es2018.asynciterable" />
23

34
/////////////////////////////
45
/// Window APIs
@@ -39965,3 +39966,27 @@ interface WebGLRenderingContextOverloads {
3996539966
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
3996639967
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
3996739968
}
39969+
39970+
/////////////////////////////
39971+
/// Window Async Iterable APIs
39972+
/////////////////////////////
39973+
39974+
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
39975+
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
39976+
}
39977+
39978+
interface FileSystemDirectoryHandle {
39979+
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
39980+
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
39981+
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
39982+
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
39983+
}
39984+
39985+
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
39986+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
39987+
}
39988+
39989+
interface ReadableStream<R = any> {
39990+
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
39991+
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
39992+
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
/// <reference lib="dom" />
2-
31
// This file's contents are now included in the main DOM types.
42
// The file has been left for backward compatibility.

tests/baselines/reference/ES5SymbolProperty1.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
=== ES5SymbolProperty1.ts ===
44
interface SymbolConstructor {
5-
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(ES5SymbolProperty1.ts, 0, 0))
5+
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.asynciterable.d.ts, --, --), Decl(ES5SymbolProperty1.ts, 0, 0))
66

77
foo: string;
88
>foo : Symbol(SymbolConstructor.foo, Decl(ES5SymbolProperty1.ts, 0, 29))
99
}
1010
var Symbol: SymbolConstructor;
1111
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(ES5SymbolProperty1.ts, 3, 3))
12-
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(ES5SymbolProperty1.ts, 0, 0))
12+
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.asynciterable.d.ts, --, --), Decl(ES5SymbolProperty1.ts, 0, 0))
1313

1414
var obj = {
1515
>obj : Symbol(obj, Decl(ES5SymbolProperty1.ts, 5, 3))

tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=node16).trace.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@
5757
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
5858
"File '/package.json' does not exist according to earlier cached lookups.",
5959
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
60+
"File '/package.json' does not exist according to earlier cached lookups.",
61+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
6062
"File '/package.json' does not exist according to earlier cached lookups."
6163
]

tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).trace.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@
5757
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
5858
"File '/package.json' does not exist according to earlier cached lookups.",
5959
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
60+
"File '/package.json' does not exist according to earlier cached lookups.",
61+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
6062
"File '/package.json' does not exist according to earlier cached lookups."
6163
]

tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.errors.txt

Lines changed: 0 additions & 98 deletions
This file was deleted.

tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ const testIterator: Iterator<any, any, any> = null as any;
364364

365365
const testAsyncIterator: AsyncIterator<any, any, any> = null as any;
366366
>testAsyncIterator : Symbol(testAsyncIterator, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 66, 5))
367-
>AsyncIterator : Symbol(AsyncIterator)
367+
>AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
368368

369369
const testStringCodePointAt = "".codePointAt(0);
370370
>testStringCodePointAt : Symbol(testStringCodePointAt, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 67, 5))

tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.types

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ const testReflectApply = Reflect.apply(noOp, this, []);
2828

2929
const testReflectConstruct = Reflect.construct(noOp, []);
3030
>testReflectConstruct : any
31-
> : ^^^
3231
>Reflect.construct(noOp, []) : any
33-
> : ^^^
3432
>Reflect.construct : { <A extends readonly any[], R>(target: new (...args: A) => R, argumentsList: Readonly<A>, newTarget?: new (...args: any) => any): R; (target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any; }
3533
> : ^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^
3634
>Reflect : typeof Reflect
@@ -78,9 +76,7 @@ const testReflectDeleteProperty = Reflect.deleteProperty({}, "");
7876

7977
const testReflectGet = Reflect.get({}, "");
8078
>testReflectGet : any
81-
> : ^^^
8279
>Reflect.get({}, "") : any
83-
> : ^^^
8480
>Reflect.get : <T extends object, P extends PropertyKey>(target: T, propertyKey: P, receiver?: unknown) => P extends keyof T ? T[P] : any
8581
> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^
8682
>Reflect : typeof Reflect
@@ -418,9 +414,7 @@ const testObjectConstructorIs = Object.is({}, {});
418414

419415
const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {});
420416
>testObjectConstructorSetPrototypeOf : any
421-
> : ^^^
422417
>Object.setPrototypeOf({}, {}) : any
423-
> : ^^^
424418
>Object.setPrototypeOf : (o: any, proto: object | null) => any
425419
> : ^ ^^ ^^ ^^ ^^^^^
426420
>Object : ObjectConstructor
@@ -762,13 +756,11 @@ const testMap: Map<any, any> = null as any;
762756
>testMap : Map<any, any>
763757
> : ^^^^^^^^^^^^^
764758
>null as any : any
765-
> : ^^^
766759

767760
const testSet: Set<any> = null as any;
768761
>testSet : Set<any>
769762
> : ^^^^^^^^
770763
>null as any : any
771-
> : ^^^
772764

773765
const testPromiseAll = Promise.all([]);
774766
>testPromiseAll : Promise<[]>
@@ -854,25 +846,21 @@ const testWeakMap: WeakMap<any, any> = null as any;
854846
>testWeakMap : WeakMap<any, any>
855847
> : ^^^^^^^^^^^^^^^^^
856848
>null as any : any
857-
> : ^^^
858849

859850
const testWeakSet: WeakMap<any, any> = null as any;
860851
>testWeakSet : WeakMap<any, any>
861852
> : ^^^^^^^^^^^^^^^^^
862853
>null as any : any
863-
> : ^^^
864854

865855
const testIterator: Iterator<any, any, any> = null as any;
866856
>testIterator : Iterator<any, any, any>
867857
> : ^^^^^^^^^^^^^^^^^^^^^^^
868858
>null as any : any
869-
> : ^^^
870859

871860
const testAsyncIterator: AsyncIterator<any, any, any> = null as any;
872861
>testAsyncIterator : AsyncIterator<any, any, any>
873862
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
874863
>null as any : any
875-
> : ^^^
876864

877865
const testStringCodePointAt = "".codePointAt(0);
878866
>testStringCodePointAt : number

tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=node16).trace.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@
5252
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
5353
"File '/package.json' does not exist according to earlier cached lookups.",
5454
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
55+
"File '/package.json' does not exist according to earlier cached lookups.",
56+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
5557
"File '/package.json' does not exist according to earlier cached lookups."
5658
]

0 commit comments

Comments
 (0)