Turn a JSON Response Into Types
Typing an API response by hand is slow and easy to get wrong. Paste a real JSON sample and QodeCat writes the TypeScript declarations for you, live as you type, ready to copy into your project.
- Named nested types: Every nested object becomes its own interface, named after its key.
- Optional fields: A key that is missing in some items of an array is marked with ?.
- Unions: Mixed arrays become union types, null values become T | null and empty arrays become unknown[].
- Options: Root name, interface or type alias, readonly properties and the export keyword.