Closed MKRhere closed 1 month ago
The main reason is that TypeScript still supports target: es5
and lib.dom
needs to be compatible with it.
@types/web
has the reference because it assumes es2015+ use should be the vast majority, but still we can't just throw es5 compatibility away for bundled types in the typescript compiler.
I understand, that makes sense. I'll work around it; thanks.
For my own reasons, I have a script that converts ambient types into being exports. Naturally, the separation of iterables causes an issue with my approach.
At first, I thought the separation is because of old browsers where iterable versions of DOM constructs aren't available yet (IE?). But that opens up two big concerns:
@types/web
references iterable.d.ts anyway, which means there is actually no way to have DOM types without iterables.Since my reasoning doesn't add up, is there an official reason for this separation? If there isn't a convincing reason (maybe there was a reason, but is no longer valid), would it be possible to merge them?