我有以下形状:
const type A = shape(
'b' => dict<string, int>,
);
Run Code Online (Sandbox Code Playgroud)
如何使用空字典创建此形状?例如从这个函数
function getA(): A {
return shape(
'b' => ???
);
}
Run Code Online (Sandbox Code Playgroud)
不知道我使用了哪些语言功能,但这可以解决问题。
function getA(): A {
return shape(
'b' => dict[]
);
}
Run Code Online (Sandbox Code Playgroud)
如果有人有更多背景,请添加您的答案,我会接受
| 归档时间: |
|
| 查看次数: |
3827 次 |
| 最近记录: |