-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Provide lib for modern DOM #21150
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
Comments
We have been more open in taking in these declarations into lib.d.ts. so feel free to send us a PR adding the new interfaces. |
My understanding is that the basis used to generated DOM lib is the MS Edge definitions. |
We are moving to generate the lib from the spec directelly. See https://github.com/Microsoft/TSJS-lib-generator/tree/master/inputfiles/idl |
👍 that would fix it as well! |
remove when microsoft/TypeScript#21150 is solved
I noticed TypeScript v3.1 introduced a lot of new DOM functionality, including (among the most common):
The release notes indicate that part of |
This is basically a re-opening of #2910, which @mhegazy asked me to do.
Nowadays TS has the
lib
compiler option that allow users to selectively choose which core definitions to include or not based on their target.It would be nice to add a new option similar to
dom
anddom.iterable
for users targetting a modern DOM runtime. Not sure how to name this since W3C has moved from releases to a "living standard" model.For example, the living standard includes interfaces
ChildNode
with methodsafter
,before
,remove
andreplaceWith
;ParentNode
with methodsprepend
andappend
.Those methods have been in Firefox and Chrome for a long while, they're in preview in Edge (17035+).
They are very convenient and there's no reason a dev that targets modern browsers shouldn't be able to do
"lib": "dom.living"
and use them.Unfortunately I am not sure if there's a list somewhere of all those new features... except going through the whole standard :(
The text was updated successfully, but these errors were encountered: