Paste an example of the JSON an API returns and get TypeScript interfaces for it: nested objects become their own interfaces, lists get their item type, and fields missing from some items become optional.
| JSON | TypeScript |
|---|---|
{"id":1,"tags":["a"],"owner":{"name":"Ann"}} | export interface Root { |
One example can’t show every case. A field that is null in your example comes out as null; a list that’s empty comes out as unknown[]. Widen those by hand (string | null) once you know the real shape.
For object shapes either works. Interfaces can be extended and merged; types can also describe unions. Pick whichever your codebase uses.
No. The types are worked out in your browser.
Open all 35 Dev Tools. Everything runs in your browser; nothing you paste is uploaded.