[Question] How to import "wavesurfer.js" with typescript? #2870
-
I got everything working, i.e., I can load the library and show the wave form and play it. Just typescript is not happy. I am importing the code with: import WaveSurfer from 'wavesurfer.js'; But typescript throws: Using the import style typescript is suggesting, breaks the code as I cannot create the Wavesurfer object anymore. import { WaveSurfer } from 'wavesurfer.js'; How can I make typescript happy? These are my dependencies:
Other typescript issues:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
@aburai they already have that dependency installed. I’d recommend upgrading to v7 beta. Then you don’t need the @types package, and it should just work in TypeScript. |
Beta Was this translation helpful? Give feedback.
@aburai they already have that dependency installed.
I’d recommend upgrading to v7 beta. Then you don’t need the @types package, and it should just work in TypeScript.