Open josh-hemphill opened 1 year ago
That's great idea. The only concern I have is how to do this and not break existing API.
I started experimenting, and while it took a little more modification than I thought to get the types to automatically resolve, it's still just an additional flag in the options that defaults to still returning the html as a string, so I'm not sure if there'd really be anything breaking other than maybe if some people are doing other things like re-exporting the types. 🤔
If you mean not changing the options at all, then I could expose it as a separate export maybe. 🤷
I forked and branched with what I have so far: https://github.com/josh-hemphill/favicons/tree/html-obj-return
When writing front-end tooling plugins, I need to track the individual tags/elements and their attributes for when html regenerates.
I think the easiest thing to do would be to make it possible to get back the html elements as objects. I can probably put together a PR pretty quick, just want to see if there'd be any interest in merging first.