行动的定义是
type Action<T = string, P = any> = { p: P }["p"] extends undefined
? { type: T; payload?: P }
: { type: T; payload: P };但是,即使我已经在对象中完成了有效负载的检查,它仍然被扩展到了联合中:
type Actions = Action<"runTest", boolean>决意

我不想它被传播出去。如何将有效负载类型保持为布尔值?
https://stackoverflow.com/questions/73961900
复制相似问题