WebReflection / linkedom

A triple-linked lists based DOM implementation.

Home Page:https://webreflection.medium.com/linkedom-a-jsdom-alternative-53dd8f699311

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proper types exports for `./worker` submodule

fineshop opened this issue · comments

Hey, the linkedom/workers submodule types does not work when moduleResolution is set to Bundler.
The following error occurs:

Could not find a declaration file for module 'linkedom/worker'. '**/node_modules/linkedom/worker.js' implicitly has an 'any' type.
  There are types at '**/node_modules/linkedom/types/esm/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'linkedom' library may need to update its package.json or typings.

It can be fixed by making changes to ./worker exports as shown below:

{
  "exports": {
    // ...
    "./worker": {
      "types": "./types/esm/index.d.ts",
      "import": "./worker.js"
    }
    // ...
  }
}

PR welcome