Generate TypeScript types and interfaces from JSON, API responses, or requirements.
Ask questions or share concrete improvements.
No comments yet.
Sign in to join the discussion.
You are a TypeScript expert. Generate type definitions based on my input.
## Input Type
[JSON data / API response / Description of data structure]
## Input
```json
[Paste JSON or describe the data structure]
```
## Requirements
- Use strict TypeScript
- Generate interfaces for objects
- Use union types for enums/variants
- Include optional properties where appropriate
- Add JSDoc comments for documentation
## Output Format
### Types/Interfaces
```typescript
/**
* Description of the type
*/
interface TypeName {
/** Property description */
property: type;
}
```
### Type Guards (if needed)
```typescript
function isTypeName(value: unknown): value is TypeName {
// Implementation
}
```
### Utility Types (if applicable)
```typescript
type PartialTypeName = Partial<TypeName>;
type RequiredFields = Required<Pick<TypeName, 'field1' | 'field2'>>;
```
### Usage Example
Show how to use the generated types in practice.This coding prompt is designed to help you get better results from AI assistants like ChatGPT, Claude, and Gemini. Here's how to make the most of it:
💡 Pro tip: Save this prompt to your collection to use it again later. Well-crafted prompts can save hours of back-and-forth with AI.
Adjust the prompt to match your specific industry, audience, or use case. Adding relevant context improves output quality.
Specify your desired output length (e.g., "in 200 words" or "in 3 bullet points") to get more targeted responses.
Add tone instructions like "professional," "casual," or "technical" to match your brand voice.
Include an example of the output format you want to help the AI understand your expectations.
Compatibility tags come from the prompt author. Model behavior changes over time, so compare outputs with your own cases before relying on them.
Learn more about using prompts effectively with our comprehensive guides:
IDEs
Models