Skip to content

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

Open

Description

@ExE-Boss

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. ↩

Activity

  1. 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[/+] on Mar 2, 2020
  2. Semigradsky commented on Oct 26, 2020

    @Semigradsky

    +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)

  3. ExE-Boss commented on Oct 26, 2020

    @ExE-Boss
    ContributorAuthor

    Dmitry Semigradsky (@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions