jsDoc - 如何指定数组长度 [英] jsDoc - how to specify array length

查看:206
本文介绍了jsDoc - 如何指定数组长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jsDoc 我可以指定我的数组参数和成员如下:

In jsDoc I can specify my array parameters and members like this:

/**
 * @constructor
 * @param {Array.<string>} myArray
 */
function someFunction( myArray ){

    this.firstArray = myArray;

    /** @member {Array.<float>} */
    this.secondArray = [];

}

还有办法指定<$ c $这些数组的c> length ,或 minLength maxLength

推荐答案

我想你是否可以在类型表达式中包含最小/最大长度(例如,数组。< string> )。

I think you're asking whether you can include the minimum/maximum length in the type expressions (for example, Array.<string>).

简而言之,答案是否定的。您需要记录每个数组描述中的最小/最大长度。

In short, the answer is no. You'll need to document the minimum/maximum length in the description of each array.

这篇关于jsDoc - 如何指定数组长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆