There is @instance, see the documentation // Edit: Working example /** * @constructor */ function Graph() { var nodes = []; Object.defineProperties(this, { /** * An array of all node handles in the graph * @return {Array} * @memberof Graph * @instance */ nodes: { get: function() { var ids...
javascript,annotations,documentation-generation,jsdoc
I would reduce it to: /** * My Cool Object * @constructor */ function MyCoolObject() { /** * Cool Method, private * @param {!string} parameter */ this.exportedMethod = function (parameter) { // do stuff }; } You can do var localMethod = this.exportedMethod right after if you want a local...
Apparently jsdoc will only include @param and @return docs if it considers the documented item to be a function. You can force this behavior by specifying @function in the doc comment. So this worked: /** @namespace */ var util = { /** * Repeat <tt>str</tt> several times. * @function <----...
You may use asterisk in JSDoc @returns {*} Or also, if you know all possible types, you can separate them by pipes @returns {String|Number|Boolean} ...
javascript,documentation,javadoc,jsdoc,famo.us
Looking at Lightbox.js, it looks like the type for transitions is just Transition.. eg. line 32 of Lightbox.js * @param {Transition} [options.inTransition=true] The transition in charge of showing a renderable. If you are animating opacity, I am assuming you want the user or OP (or yourself ;)) to interact as...
angularjs,ide,phpstorm,webstorm,jsdoc
Jetbrains products cannot do this by analyzing the code, there's too much magic in Angular's dependency injection system. However, you can do it by installing a typed library in at least Webstorm and PyCharm (probably PHPStorm and other Jetbrains products as well): Go to Preferences > Languages & Frameworks >...
Right now, JSDoc doesn't provide a way to inherit another symbol's documentation. For JSDoc 3.3.0 (the next major version), I plan to implement this feature by adding support for an @inheritdoc tag. This feature is tracked as issue #53 in JSDoc's GitHub repo....
java,javascript,parsing,polymer,jsdoc
There are several JSDoc parsers out there. Take a look into doctrine and jsdoc-parse for example.
angularjs,syntax-highlighting,jsdoc
Workaround: marked module is used in grunt-ngdocs (grunt-ngdocs\node_modules\marked\lib). Since grunt-ngdocs uses angular-bootstrap-prettify (which BTW uses google-code-prettify), it's enough to tweak marked a little in order to produce <pre class="prettyprint linenums">...</pre> instead of <pre>...</pre>. So at Renderer.prototype.code function (line 757 at my version), return statements can change like this: return '<pre...
There are two proper ways of dealing with line breaks in JSDoc. The first, apparently used by Google, is to indent the lines after the first: /** * @param {string} author - The author of the book, presumably some * person who writes well and does so for a living....
It turns out that using the latest version of jsdoc from npm solved the problem, and it recognizes that these methods are part of the given class if properly annotated with @function
If I understood correctly square brackets mean "optional", is that right? You understood correctly. Is the syntax I used to describe the object properties valid? jsdoc understands your syntax so I would call it "valid". The reqSettings.retryInterval property is a number, but I was unable to find a way...
Try: /**@param {string[]} callback.rows*/ Note that you can put any type there, not just string... Such as /**@param {{field1: string}[]} callback.rows */ ...
Intellij (and the family of editors) support the Google Closure Compiler syntax. So you'd do something like this: /** * @param {function(Number, String)} bar */ function foo(bar) {}; Note the lowercase f in function....
javascript,tags,order,jsdoc,google-style-guide
There's no official order for JSDoc tags. I tend to put more general tags first, followed by more specific tags, similar to your first example. In general, JSDoc doesn't care about the tag order, but there are a few notable exceptions: Any text before the first tag will be used...
You have to mark them up yourself. The basic way to do this is to use HTML markup: <code>page</code> If you are using jsdoc 3.x, it is also possible to turn on the Markdown plugin and use Markdown markup `page`....
javascript,google-closure,jsdoc,jsdoc3
Annotating optional parameters in the middle of a function's parameter list are almost as challenging as maintaining code that uses this type of method signature. Javascript doesn't truly support optional parameters in the middle of a function's argument list (to do that you need named parameters). Instead, functions that advertise...
Please vote for WEB-12376 to be notified on updates. I'd suggest using inline docs (https://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs) as a workaround: var /** String*/ foo, /**String*/ bar; ...
Generate Home page Create markdown file README.md Generating jsdoc: $ jsdoc path/to/js path/to/readme/README.md To read more about this visit official documentation Change 'Home' text I don't think this is a proper way to do it but this works. If you have jsdoc installed in your project find template file in...
javascript,annotations,google-closure-compiler,jsdoc,variadic-functions
"f5" is the expected pattern. /** * @param {...*} var_args * @return {number} */ function f5(var_args) { return arguments.length; } An alternative is: /** @type {function(...*):number} */ function f5() { return arguments.length; } ...
It's a bug. WEB-13724 is fixed, fix will be included in WebStorm 10
You can document the inner function and then reference it like so /** * @param {Number} - number of times to prompt * @return {many_prompts~inner} - the returned function * / function many_prompts(count){ /** * My inner function * * @param {object} prompt Some parameter */ var inner = function(prompt){...
You have to be explicit about the module: @memberof module:models~MySchema The fact is that jsdoc is not going to infer that when you specify MySchema you mean the MySchema entity which is in the current module. Same with @this, actually. If you modify it to have the module name, then...