我有一个字符串数组的数组,我不知道如何用JSDoc记录它。
/**
@class
*/
function PostbackList() {
/**
@type {int}
@default
*/
this.TypeID = 0;
/**
@type {PostbackList.Field[]}
*/
this.Fields = new Array();
/**
!! Issue here !!
@type {string[][]}
*/
this.Values = null;
}
导致错误。
无效的类型表达式“ string [] []”:预期为“!”,“?” 或“ |” 但是找到“ [”。
而且我不知道是否应该?
在类型前面放置以指示它可以为null。
根据当前jsdoc的维护者在此问题报告中所说,正如我们所说的jsdoc 3无法通过添加方括号来处理多维数组的声明。您可以像使用Array.<string[]>
或使用那样进行操作Array.<Array.<string>>
。
根据问题报告,版本3.3.0将允许使用您想要的符号。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句