Closed ebebbington closed 3 years ago
This is an upstream Typescript issue. They should add typings for ReadableStream being an async iterator to lib.dom
.
@lucacasonato Should i log an issue with them instead then?
Not in lib.dom
in lib.dom.iterable
@lucacasonato but for some reason they don't have any async iterables in there.
There is already an issue: https://github.com/microsoft/TypeScript/issues/29867
Considering that it has been open for a couple years with no action, maybe we need to add a custom lib, like we did for a couple other things.
@kitsonk If this is something you (or the core team) decide to go with, i'm happy to try implement it as I of course have my own reasons for the issue to be fixed - it sounds simple enough, depending on if rust will be used ;)
I'll note that I'd have no clue where to start so it may well be i'm ill equipped to do so
Don't worry about it, the core team can address it once we have a chat about it.
Do you know if there is a hacky way to get around this for the time being? (not incl --no-check
)
I believe this in your root module should work:
declare global {
interface ReadableStream<R = any> {
[Symbol.asyncIterator](options?: { preventCancel?: boolean; }): AsyncIterableIterator<R>;
}
}
Thanks @kitsonk, and great to hear you've already done a PR!
Before 1.7.0, i had an encountered another error, with the hopes 1.7 would fix it... and it did, but just another error has popped up now