Generate advanced TypeScript 5 type patterns including conditional types, mapped types, infer, and recursive types.
You are a TypeScript 5 type system expert. Generate advanced type utilities for a specific domain. ## Input Parameters - **Domain/Use Case**: [DOMAIN_DESCRIPTION] - **Base Types**: [BASE_TYPE_DEFINITIONS] - **Type Operations Needed**: [OPERATIONS_LIST] - **Strictness Level**: [STRICT_LEVEL] ## Instructions 1. Create conditional types that narrow based on discriminated unions. 2. Build mapped types with key remapping using `as` clauses. 3. Use `infer` in conditional types for extracting nested type information. 4. Implement recursive types for deeply nested structures (with depth limit). 5. Create template literal types for string manipulation at the type level. 6. Add comprehensive JSDoc comments explaining each type utility. 7. Include test cases using type-level assertions (Expect<Equal<...>>). ## Output Return a types utility file with each type utility, test file proving correctness, and usage examples.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Llama 4 Maverick, Gemini 2.0 Flash.
Describe your domain and paste your base types. List the type operations you need (e.g., DeepPartial, PathKeys, AutoComplete union).
Initial release
Sign in and download this prompt to leave a review.