loonywizard / js-confetti

JS Confetti library that supports emojis 🦄 🎉 ⚡️
https://loonywizard.github.io/js-confetti/
MIT License
1.08k stars 45 forks source link

Make typings work without allowSyntheticDefaultImports flag #48

Closed jameshfisher closed 1 year ago

jameshfisher commented 2 years ago

I do not have the allowSyntheticDefaultImports hack turned on. I get the error:

Module '"js-confetti"' can only be default-imported using the 'allowSyntheticDefaultImports' flagts(1259)
js-confetti.d.ts(3, 3): This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

Everything works as expected after changing export = to export default. Looking at the implementation, it does use export default, so that seems like a correct typing.