2017-05-29 66 views

回答

1

我不知道是否有更干净的方式来做到这一点,但它在技术上是可行的。

function f<T>(o: {[key: string]: T}): T { 
    return undefined!; 
} 

const garbage = f(MapDispatchToProps); 

export type ActionsType = typeof garbage; 

凝结(只要我能管理):

const garbage = (<T>(o: {[key: string]: T}): T => undefined!)(MapDispatchToProps); 

export type ActionsType = typeof garbage;