Copilot prompt

Create TypeScript Type Definitions

Generate TypeScript interfaces, types, and generics from runtime data, API responses, or informal descriptions.

Create TypeScript type definitions for {{type_context}}.

## Input (one of):
- Runtime data (JSON): {{runtime_data}}
- API endpoint description: {{api_description}}
- Informal description: {{description}}

### Type Generation Rules

**Naming Conventions**
- Interfaces: PascalCase, noun (User, Product, OrderItem)
- Types: PascalCase for unions/intersections, camelCase for utility types
- Enums: PascalCase name, SCREAMING_SNAKE_CASE values
- Generic parameters: T, TItem, TKey (single letter or descriptive)

**Null Safety**
- Required fields: no ?
- Optional fields: fieldName?: type
- Nullable values: fieldName: type | null
- Both optional AND nullable: fieldName?: type | null — add a comment explaining why

**Type Precision**
- Avoid any — always use unknown for truly unknown types
- Use string literal unions over plain string: "active" | "inactive" | "pending"
- Use number literal unions for enum-like numbers
- Use Record<K, V> over { [key: string]: V } for indexable types

**Generics Where Appropriate**
Create generic types for: API response wrappers, pagination, list responses.
```typescript
interface PaginatedResponse<T> {
  data: T[];
  total: number;
  page: number;
  pageSize: number;
  hasMore: boolean;
}
```

**JSDoc on Every Type**
Brief description on each interface.
@description on non-obvious fields.

### Output
Complete type definitions file ready to import.
Include: all interfaces, types, enums, and re-exports.

Fill in: {{type_context}}, {{runtime_data}}, {{api_description}}, {{description}}. In Loopy you fill these in a form and copy the finished prompt in one click.