且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将子属性添加到jsdoc中的现有属性列表

更新时间:2023-12-02 23:40:16

另一种方法是使用typedef:

Another way to do it would be to use a typedef:

/** 
 * @typedef {{
 *   issues: number,
 *   source: string
 * }}
 */
var WorldPeaceOptions;

/**
 * @constructor
 * @param {WorldPeaceOptions} defaults
 */
var WorldPeace = function (defaults) {
  // code here
};