I have a project that already includes the required JavaScript files. However, I am trying to move some code into TS and take advantage of it. There's a library that I use (sweetalert2) that has been installed and is in node_modules (though not actually used from that location).
All I want to do is somehow include it in my TS files so that I get the Intellisense and type checks. Not actually import the code. If I import the code it does a whole lot of stuff that I don't need or want.
I think I've tried every variation of tsconfig and references and I can't get it to work. There must be a way!
Is there a way to just just reference the types so that you can take advantage in TypeScript and it doesn't complain?
You can use import type()
to import only types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With