Microsoft/TypeScript

Provide lib for modern DOM

Open

#21,150 建立於 2018年1月11日

在 GitHub 查看
 (6 留言) (5 反應) (0 負責人)TypeScript (48,455 star) (6,726 fork)batch import
Domain: lib.d.tsExperience EnhancementHelp WantedSuggestion

描述

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 and dom.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 methods after, before, remove and replaceWith; ParentNode with methods prepend and append.

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 :(

貢獻者指南