Skip to content
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

Separate WebAssembly types from lib.dom.d.ts into their own file #826

Open
ExE-Boss opened this issue Feb 21, 2020 · 2 comments · May be fixed by #959
Open

Separate WebAssembly types from lib.dom.d.ts into their own file #826

ExE-Boss opened this issue Feb 21, 2020 · 2 comments · May be fixed by #959

Comments

@ExE-Boss
Copy link
Contributor

ExE-Boss commented Feb 21, 2020

Currently, if you wish to use WebAssembly, you need to include lib.dom.d.ts, even in cases where that’s incorrect (e.g.: NodeJS or Deno).

The solution would be to move non‑web‑specific1 WebAssembly types to a new lib.wasm.d.ts file.


See also: #211

Footnotes

  1. Web‑specific WebAssembly types are those defined in https://webassembly.github.io/spec/web-api/index.html.
    Non‑web‑specific WebAssembly types are those defined in https://webassembly.github.io/spec/js-api/index.html.

@ExE-Boss ExE-Boss changed the title Separete WebAssembly types from lib.dom.d.ts into their own file Separate WebAssembly types from lib.dom.d.ts into their own file Mar 2, 2020
@Semigradsky
Copy link

+1

Currently I can't define AbortController/AbortSignal/EventTarget/Event for node@15.x because typings include lib.dom.d.ts (with its own implementation of AbortController/AbortSignal, etc.) (DefinitelyTyped/DefinitelyTyped#48981)

@ExE-Boss
Copy link
Contributor Author

ExE-Boss commented Oct 26, 2020

@Semigradsky That’s unrelated to this.

Your case is happening because you’re defining them using class EventTarget instead of interface EventTarget { ... } and declare var EventTarget: EventTargetConstructor, but that depends on TypeScript language support: microsoft/TypeScript#39054 (comment) and microsoft/TypeScript#39504.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants