-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect typings for ReadableStream #7217
Comments
I don't think this is a Deno issue. It seems the 'dom' type library (from typescript) doesn't include types for getIterator. So this looks like a upstream typescript issue. |
Actually, we have a challenge. The specification was updated in June and |
Actually looking at that now, there is a whole load of changes there... 😭 it needs to be gone through with a fine toothed comb and realigned. |
Is there at least a way to temporarily monkey-patch this (such as |
Interfaces are open ended. Something like this should work in your main module, assuming it is TypeScript: declare global {
interface ReadableStream<R = any> {
getIterator(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
}
} |
Great, thanks @kitsonk! (my naïve attempts were missing the |
Oh no! I was worried this was the case. This is going to definitely be a breaking change to fix, and it is going to break std types again 😭. |
I suspect we can have |
This error still comes up. Is there a workaround? |
The code mentioned in #7217 (comment) is a suitable workaround for my use case. |
It works indeed, thank you @ondras ! I misread kitsonk's comment the first time. |
This was resolved in #9103. |
Hi,
my code uses the following tsconfig
lib
declaration:after updating to Deno 1.3.1, the following TS error emerges:
...which is preventing me from running the code.
Thanks,
O.
The text was updated successfully, but these errors were encountered: