如何在JSDoc中将对象数组作为参数进行记录? [英] How do you document an array of objects as a parameter in JSDoc?

查看:118
本文介绍了如何在JSDoc中将对象数组作为参数进行记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的数组:

I have an array that looks like this:

[{
    "name": "c917379",
    "email": "jim@bmw.de"

},
{
    "name": "c917389",
    "email": "jane@bmw.de"
}]

这是一个任意长度的数组一些重复的字段(我为了清晰起见将其缩减为两个字段)。这会传递给JavaScript方法。

It is an array of arbitrary length with a number of repeating fields (I've reduced this to two fields for clarity). This gets passed into a JavaScript method.

/**
 * @param {?}  data
 */
update:  function(data) {...}

我想知道如何在JSDoc中记录这个。 IE浏览器。你会如何记录问号所在的类型?

I was wondering how you would document this in JSDoc. Ie. how would you document the type where the question mark is?

推荐答案

我刚刚找到了问题的答案:

I just figured out the answer to my question :

看起来像这样:

/**
 *
 * @param {{name:string, email:string}[]}  
 *
 */

这篇关于如何在JSDoc中将对象数组作为参数进行记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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