I made a tool that would output a bunch of Typescript types based on the JSON object you feed to it. I made it after I got tired of mapping an undocumented API endpoint's response to a type in the frontend.

It worked pretty well on my case, albeit with a little caveat when it comes to arrays. I had to manually singularize them.

https://daeram.com/sides/json-to-types/index.html