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.
我有一个任意字符串到数字的哈希。目前尚不清楚我是如何指出这一点的,因为在这个例子中,左手边都是特定的属性名称。我应该如何注释我的哈希?
答案 0 :(得分:2)
/** @type {Object.<number>} */
或
/** @type {Object.<string, number>} */