TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
`ReadableStream` should be async-iterable
As per https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#async_iteration and https://streams.spec.whatwg.org/#rs-asynciterator
ReadableStreamimplements the async iterable protocol. This enables asynchronous iteration over the chunks in a stream using the for await...of syntax.
The current types declare no Symbol.asyncIterator nor extends AsyncIterator:
https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/f4e507c3d0ba16fde16026d9265c201fecdb6538/baselines/dom.generated.d.ts#L18604-L18631
I'd expect a Symbol.asyncIterator member on the ReadableStream.
I noticed that it does seem like an iterator is added to the input file: https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/f4e507c3d0ba16fde16026d9265c201fecdb6538/inputfiles/overridingTypes.jsonc#L2629-L2635