3
我有下面的数据结构:当JSDoc是一个包含对象的数组时,文档如何变量?
this.subscribers = [
{
callback:() => {console.log('my callback'); },
interval: 5,
remaining: 3
},
{
callback:() => {console.log('my callback 2'); },
interval: 20,
remaining: 1
}
];
我已经写了JSDoc这样的:
/**
* This variable store the array of callbacks to call repeatedly with the specified interval.
* @property {function} callback - The callback function the SchedulerService call.
* @property {number} interval - The number of minutes between the runs.
* @property {number} remaining - The remaining minutes until the next call.
* @type {Array}
*/
this.subscribers = [];
但与此jsdoc的subscriptions
变量应该是这样的:
this.subscribers = [];
this.subscribers.callback =() => {};
this.subscribers.interval = 10;
this.subscribers.remaining = 2;
对于此属性,正确的JSDoc评论如何显示?
注意:我们在这里谈论的是关于@property
而不是@param
。
喔,不知何故,我错过了那个页面。谢谢你的回答,这对我来说似乎有点复杂。 – NoNameProvided