【问题标题】:Proper JSDoc typedef declaration of function with optional arguments in javascriptjavascript中带有可选参数的函数的正确JSDoc typedef声明
【发布时间】:2018-05-28 23:06:45
【问题描述】:
给定以下类型定义
/***
* @typedef {object} Queue
* @property {function(string):string[]} listQueueNames Gets an optionally
filtered list of QueueNames.
*/
将 listQueueName 的 Argument 标记为可选 Argument 的正确方法是什么?
【问题讨论】:
标签:
javascript
webstorm
typedef
jsdoc
【解决方案1】:
使用Closure Compiler 语法应该在这里工作:
/***
* @typedef {object} Queue
* @property {function(string=):string[]} listQueueNames Gets an optionally
filtered list of QueueNames.
*/