webstorm - JSDOC and Revealing Module Pattern -
i have functions return objects. wish put jsdoc definitions see property , methods on webstorm intellisense.
how have write jsdoc of below functions?
function myotherfunc() { return { a:'for eg string', b:12 } } function myfunc() { var prop = myotherfunc(); function mymethod() { alert( 'my method' ); } function myothermethod() { alert( 'my other method' ); } // explicitly return public methods when object instantiated return { somemethod : mymethod, someothermethod : myothermethod }; }
this exact case handled in webstorm without jsdoc too, may use closure compiler type syntax this:
/** * @return {{a: string, b: number}} */ function myotherfunc() { return { a:'for eg string', b:12 } }
Comments
Post a Comment