Closed smashercosmo closed 3 years ago
A year or two ago there was some back and forth discussions about how to define iconv-lite types, see e.g. #149. As a result, we ended up with the current version and it seems to be working for the thousands of projects that use iconv-lite (including Angular AOT compiling, Electron and some other edge cases). I'd be reluctant to change it unless there's a significant problem.
What exactly the current version breaks for you?
Alright, I checked the code again and appeared that I was confused by this line iconv = module.exports;
On the second look, everything seems to be correct. And typescript doesn't yell at you). It was just IDE who was confused and for some reason couldn't resolve named exports and showed warnings about it.
iconv-lite has just default export, but according to types it has named exports for every function.
correct types would be something like