Generate a type definitions file
Generate a complete TypeScript definitions file with interfaces, type aliases, union types for discriminated unions, and JSDoc for every exported type.
Preview
Copy prompt
Generate a complete TypeScript declaration file for the following [JavaScript library / JSON API response shape / database schema]: [Paste source]. Create well-named interfaces for every object shape, type aliases for union types and string literals, and discriminated union types for polymorphic structures. Add a JSDoc comment to every exported type and interface explaining what it represents and when it is used. Export everything from a single index.d.ts entry point.
More
Documentation
Prompts
