You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it is polluting global scope and making everything available, even though we just implemented a very limited subset
it defaults to features that are implemented by at least two major browser engines, which in our case is not desired (e.g. some newer APIs such as FileSystem API are only supported by one browser engine at the moment, but we still want them in React Native as we're starting from scratch)
We should perhaps generate our own type definitions and instead of using declaration file, just export them, so we can explicitly import them when necessary.
For now, a hardcoded subset will do, but going forward, we should automate generation. This is somewhat related to enforcing spec in general.
It seems we need a fork of TypeScript-DOM-lib-generator that removes compatibility checks, can be run from the CLI, includes only specific APIs and generates TypeScript files.
The W3C uses the Web IDL standard to define APIs in each specification, like in this example. Instead of working with the large TypeScript-DOM-lib-generator, we could fork webidl-dts-gen and make some necessary changes. The tool needs a bit of attention, as it currently generates incorrect types for the File API (like adding static members in interfaces and missing return types for constructors), but these issues should be easy to fix.
There are a few issues with libdom:
We should perhaps generate our own type definitions and instead of using declaration file, just export them, so we can explicitly import them when necessary.
For now, a hardcoded subset will do, but going forward, we should automate generation. This is somewhat related to enforcing spec in general.
Ideas are welcome!
CC: @thymikee @V3RON @kraenhansen
The text was updated successfully, but these errors were encountered: