In JSDoc, it is possible to document the exact types of array contents as follows :
TestClass.protoype.someMethod = function( myClasses ){ myClasses[0].aMethodOnMyClass(); }
This makes code completion in the IDE, for example, WebStorm provides the correct type information after [0]. . This works well for the Array type, however I have my own collection types in which I would also like to use this function. The problem is that I cannot find the correct syntax (perhaps because it does not exist). I would really like to declare my class like this:
Test2 = function(){}; Test2.prototype.getGenericValue = function(){}
This syntax or function does not work with my IDE and is not listed here , so I am wondering if the syntax for this use is -case, either for WebStorm, or for any other JS authoring tool.
Sebastian
source share