catdad-experiments / heic-convert

🤳 convert heic/heif images to jpeg and png
252 stars 26 forks source link

feat: add browser export #39

Open leonardlib opened 3 months ago

catdad commented 3 months ago

Hello! Thanks for contributing.

Can you please elaborate what the purpose of this is? I am not seeing exports in the pacakge.json spec.

leonardlib commented 3 months ago

Hello! Thanks for contributing.

Can you please elaborate what the purpose of this is? I am not seeing exports in the pacakge.json spec.

Yup, sure!

I'm using the package as a module: import convert from 'heic-convert' and with TypeScript there is no problem because I'm using the @types/heic-convert package too.

But when I try to use the browser submodule: import convert from 'heic-convert/browser' with TypeScript, there is an error about missing type definitions, so I created the type definitions for the browser submodule: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69983, but it also requires adding the exports field to the package.json to tell the NodeJS engine that there is submodule browser.

References:

taylorhakes commented 1 month ago

I am also running into this issue. Can this be merged?

kyselberg commented 2 weeks ago

this would be very helpful if merged

BuZZ-dEE commented 2 weeks ago

I had also this issue.

https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/69573