JSDocs @Interface
I have a virtual interface (from the JSDocs site) defined as :
/**
* @interface SVGTool
* @property {string} SVGTool#name
* @property {string} SVGTool#type
* @method SVGTool#createShape
* @method SVGTool#renderShape
* @method SVGTool#updateShape
*/
Which I use elsewhere as:
/** @type SVGTool the current selected/active tool*/
var selectedTool = null;
When I control click on the above to go to the declaration I get a popup window showing 'multiple declarations' one is a Property icon pointing at the SVGTool interface and the other is a Lambda icon pointing again at the same SVGTool interface definition.
Is there a way to get webstorm to recognise this as one single interface declaration?
TIA
Rob
请先登录再写评论。
You can try defining it in the way suggested in docs (http://usejsdoc.org/tags-interface.html):
Tks for that although it does remove the duplicate declarations there is no autocomplete/intraspection.
i.e. I type selectedTool. and the help window pops with just generic methods and if I continue to type selectedTool.updateShape it has no clue there is such a method.
TIA
Rob
works fine for me using the syntax from my previous comment: