leaonline / easy-speech

🔊 Cross browser Speech Synthesis also known as Text to speech or TTS; no dependencies; uses Web Speech API
https://leaonline.github.io/easy-speech/
170 stars 20 forks source link

Typescript types don't work out of the box #268

Open enyo opened 3 months ago

enyo commented 3 months ago

After installing and importing the package, I get:

There are types at '.../node_modules/easy-speech/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'easy-speech' library may need to update its package.json or typings.

I'm not entirely sure, but I think changing the exports field to this should work:

"exports": {
  ".": {
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./dist/EasySpeech.js"
    }
  }
},
jankapunkt commented 2 months ago

Please try easy-speech@2.4.0-rc.0 and let me know if things work as expected