2
我批量导入一束性质的与与扩散构件打字稿接口
import * as actionCreators from './billingUtil2';
和打字原稿被正确识别的actionCreators
内的各出口。是否有可能将这些成员“传播”到一个界面中?理想的情况是这样的,但有效
interface componentState {
...actionCreators
}
我的使用情况是,我想创建一个组件作出反应,准确地描述它会从终极版将接收道具的形状。因此,理想的东西沿着这些线路
import * as actionCreators from './billingUtil2';
interface State {
name: string;
age: number
}
interface componentState extends State {
...actionCreators
}
,然后我可以告诉打字稿期望形式componentState
的道具。 我的redux reducer将已经返回实现接口的结果;我的主要目标是避免手动输入每个动作创建者。