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.
More coding prompts
- CursorAdd File Upload with Cloud StorageMulti-file upload with type checking, size limits, virus scanning, cloud storage, and progress tracking.
- CursorAdd Redis Caching LayerCache-aside Redis caching with typed get/set helpers, TTL management, pattern-based invalidation, and monitoring.
- CursorAdd Stripe Payment IntegrationComplete Stripe checkout, webhooks, subscription management, and billing portal with idempotent webhook handling.
- LovableBooking and Scheduling SystemCalendar-based booking with availability management, confirmations, reminders, and payment collection.
- CursorBuild Admin Dashboard with CRUDData table with server-side CRUD, column sorting and filtering, bulk actions, and role-protected admin panel.
- CursorBuild Data Export FeatureExport large datasets to CSV or Excel with streaming for memory efficiency, background jobs, and signed download links.

