Typescript 如何在“mergeDeepRight”中键入输入`

Typescript 如何在“mergeDeepRight”中键入输入`,typescript,ramda.js,Typescript,Ramda.js,我有功能 const updateStoreMerge = (value: PartialRecursive<StoreType>): StoreType => updateStore(s => mergeDeepRight(s, value)); 我写这个有问题 [K in keyof T except the ones in PropsThatAreObjects<T, keyof T>]?: T<K> [K在T的键中,除了PropsTh

我有功能

const updateStoreMerge = (value: PartialRecursive<StoreType>): StoreType => updateStore(s => mergeDeepRight(s, value));
我写这个有问题

[K in keyof T except the ones in PropsThatAreObjects<T, keyof T>]?: T<K> 
[K在T的键中,除了PropsThatAreObjects中的键]?:T

非常感谢:)

在我看来,
PartialAll
(或
PartialRecursive
)可以简化为:

type PartialAll=T扩展对象?{[K in keyof T]?:PartialAll}:T;

在我看来,
PartialAll
(或
PartialRecursive
)可以简化为:

type PartialAll=T扩展对象?{[K in keyof T]?:PartialAll}:T;

哇,这比我的东西容易多了!你是对的,这是对的。但不管出于什么原因,它仍然没有进行打字检查。我很乐意提供帮助,但我需要更多的信息。理想情况下,这是一个我可以重现问题的例子。如果你想确定的话。这是一个简化的例子:``类型A={x:number,y:{z:string};常量状态:A={x:123,y:{z:'zzz'};constmerge=(a:PartialAll):a=>mergeDeepRight(state,a);`我把A和PartialAll合并,想得到一个回报。右边是拉姆达。我做深度合并,而不是普通合并,否则我可以使用spread..但这足够好了``const updateStoreMerge=(value:PartialAll):StoreType=>updateStore(s=>/@ts ignore mergeDeepRight(s,value))```您至少可以将结果转换为
StoreType
,而不是@ts ignore。。。所以:
updateStore(s=>mergeDeepRight(s,value)作为StoreType)
Wow这比我的东西容易多了!你是对的,这是对的。但不管出于什么原因,它仍然没有进行打字检查。我很乐意提供帮助,但我需要更多的信息。理想情况下,这是一个我可以重现问题的例子。如果你想确定的话。这是一个简化的例子:``类型A={x:number,y:{z:string};常量状态:A={x:123,y:{z:'zzz'};constmerge=(a:PartialAll):a=>mergeDeepRight(state,a);`我把A和PartialAll合并,想得到一个回报。右边是拉姆达。我做深度合并,而不是普通合并,否则我可以使用spread..但这足够好了``const updateStoreMerge=(value:PartialAll):StoreType=>updateStore(s=>/@ts ignore mergeDeepRight(s,value))```您至少可以将结果转换为
StoreType
,而不是@ts ignore。。。所以:
updateStore(s=>mergeDeepRight(s,value)作为StoreType)
[K in keyof T except the ones in PropsThatAreObjects<T, keyof T>]?: T<K>