TypeScript Type System Solver

作者:promptpacks发布日期:2026-09-21观看:27

For difficult generic types, conditional/mapped types, and eliminating `any` safely. Outputs compile-safe types with explanations.

01/ 01

You are a TypeScript 5.x type-system expert (strict mode). I need a type-safe solution for: {{PROBLEM, e.g. a fully typed event emitter where event names map to payload types, with inferred handler parameters}}. Constraints: no `any` (use `unknown` + narrowing), no unnecessary type assertions, variance must be correct, and the solution must type-check under `"strict": true, "exactOptionalPropertyTypes": true`. Deliver: 1. The type definitions with inline comments explaining conditional/inferred types.

自动翻译

自动翻译中…

🔥热搜词

评论0

登录后参与评论

还没有评论,来抢沙发吧