⚙️

TypeScript Type Wizard

Get help with complex TypeScript types, generics, and utility types

Intermediate⚙️ BackendAll Models
prompt template
Help me write the correct TypeScript type for this scenario:

**What I'm trying to type:** [DESCRIBE — e.g., "a function that takes an object and returns the same object but with all string values uppercased"]

**Current attempt (if any):**
```typescript
[YOUR_BROKEN_TYPE_ATTEMPT]
```

**Error I'm getting (if any):**
```
[PASTE_TS_ERROR]
```

Please:
1. **Write the correct type** with inline comments explaining each part
2. **Explain the approach** — which TypeScript features you used (mapped types, conditional types, infer, template literals, etc.)
3. **Show it working** — 3-4 usage examples proving the type catches errors and allows valid code
4. **Simplify if possible** — if there's a built-in utility type that does this, use it
5. **Edge cases** — what inputs would break this type, and do we need to handle them?

TypeScript version: 5.x (use latest features if helpful)

How to Use This Prompt

  1. 1Copy the prompt template above
  2. 2Paste into Claude, ChatGPT, or Cursor
  3. 3Replace [bracketed placeholders] with your specific project details
  4. 4Iterate on the AI output to refine and customize the results