如何在谷歌关闭中注释哈希?

时间:2011-12-17 22:02:51

标签: javascript annotations google-closure

google closure reference演示了如何注释记录:

{{myNum: number, myObject}} 
An anonymous type with both a property named myNum that has a value of type number and a property named myObject that has a value of any type.

我有一个任意字符串到数字的哈希。目前尚不清楚我是如何指出这一点的,因为在这个例子中,左手边都是特定的属性名称。我应该如何注释我的哈希?

1 个答案:

答案 0 :(得分:2)

/** @type {Object.<number>} */ 

/** @type {Object.<string, number>} */