Questions tagged [jsdoc3]

JSDoc3 is an API documentation generator for JavaScript. It can be customised via a plugin mechanism and the output can be controlled via templates. It is written in Javascript and can be run with Node.js or Rhino.

JSDoc 3

JSDoc3 is an API documentation generator for JavaScript. It can be customised via a plugin mechanism and the output can be controlled via templates.

It is written in Javascript and can be run with Node.js or Rhino.

The tool can be found at https://github.com/jsdoc3/jsdoc

The documentation can be found at http://usejsdoc.org/

279 questions
5
votes
1 answer

Is there a way to document parameters of a function parameter?

Say you have this function : /** * doSomething description * @param {function} fn - A function that accepts an argument. */ function doSomething( fn ) { fn.call(this, 'This is a test'); } And doSomething should be used like this…
CryptoBird
  • 418
  • 1
  • 4
  • 16
5
votes
1 answer

How to document javascript higher order function?

I have the following higher order function for wrapping contructors: /** * Wrapper for calling constructor with given parameters * * @param {Class} Cls * @returns {function} Wrapper on constructor which creates an instance of given Class …
5
votes
1 answer

How to reference a @class in another file with JSdoc?

E.g. MyClass.js /** * @class * @name module:Bar * @param {number} a1 * @param {string} a2 */ function Bar(a1, a2){} And, in another file: /** @type module:Bar.constructor */ // made up syntax var Bar = require("./MyClass.js"); Re-defining…
Wes
  • 3,023
  • 2
  • 21
  • 43
5
votes
0 answers

Get JSDoc to correctly document nested closures

I have a large, well-structured JavaScript object that is something like this: /** * My 'class' begins here. JSDoc barfs on this. */ var MyClass = (function(window, document, $) { return function(options) { "use strict"; …
Sean Werkema
  • 3,386
  • 1
  • 27
  • 36
5
votes
0 answers

How to declare JSDoc type for an imported class?

For example, I have // ./command/queue.js export default class Queue { }; // ./myclass.js import CommandQueue from "./command/queue"; export default class MyClass { /** * @type {CommandQueue} <- ??? */ commandQueue =…
user0103
  • 1,130
  • 2
  • 16
  • 35
5
votes
2 answers

How To Use JSDOC3 To Document Enum Constants

We're using JSDOC to document our client-facing SDK and we're having difficult getting it to recognize our 'enums' (i.e. constants). Which tags should we use to get JSDOC to pick it up in the documentation? Here's a sample: /** * @module…
A2MetalCore
  • 1,394
  • 2
  • 22
  • 42
5
votes
1 answer

JSDoc: Why aren't my nested objects links (why aren't they click-able)?

I would think that all members / objects / etc. documented by JSDoc should be their own click-able links; e.g., if I have levelOne --> levelTwo --> levelThree --> levelFour, then I should see levelOne on the first page and be able to click my way…
5
votes
1 answer

JSDOC: Is it possible to link to a module property?

I'd like know if it's possible to link from one module to another module`s property/method. What I've tried so far but wasn't working: /** * {@link module:modules/modulName#id} */ My modules follow this pattern: /** * @module modules/modulName …
damian
  • 4,849
  • 5
  • 29
  • 60
5
votes
1 answer

JSDoc CommonJS with exports object passed into IIFE

UPDATE: @spenibus helped me reach the conclusion that this may be an issue with JSDoc itself. I added my findings to this open issue on their GitHub. @spenibus found a solution, but it requires a slightly altered version of the IIFE I'm using an…
ejfrancis
  • 2,465
  • 3
  • 22
  • 41
5
votes
0 answers

How to document a 'parameter-list like' array in JSDoc?

It is common in JavaScript to work with arrays that are essentially argument lists: a small fixed length, and known types for each position. This is especially true for ECMAScript 6, which introduced features like the rest operator, spread operator…
mhelvens
  • 3,795
  • 3
  • 28
  • 53
5
votes
1 answer

JSDoc: How to avoid duplicate documentation for properties/getters?

I am currently documenting one of my APIs using JSDoc. Although this works well, one thing that really annoys me is the occurence of duplicate documentation. One common example of this is the documentation of a property and its getter: function…
BlackWolf
  • 3,919
  • 3
  • 26
  • 44
5
votes
1 answer

How to describe js module with jsdoc

Please, explain to me the best way to describe this module: /** * Common util methods * @module Utils */ var Utils = (/** @lends module:Utils */ function () { /** * Some default value * @constant * @public * @static …
Vova
  • 61
  • 2
5
votes
1 answer

jQuery plugin documentation with JSDoc

I'm wondering how to documenting jQuery plugin by using JSDoc? My code is: /** * The default configurations of comments * @typedef {Object} CommentConfig ... */ /** * Show comments * @method comments *…
ducdhm
  • 1,899
  • 14
  • 24
5
votes
2 answers

JSDoc3: How to document a AMD module that returns a function

I'm trying to find a way to document AMD modules using JSDoc3. /** * Module description. * * @module path/to/module */ define(['jquery', 'underscore'], function (jQuery, _) { /** * @param {string} foo Foo-Description * @param…
Jens Simon
  • 61
  • 4
4
votes
1 answer

How to document array destructured parameter in JSDoc

Given the following code, how do I properly document that using the latest JSDoc? function docMe([foo, bar = null, baz = 1]) { /* */ } I have tried this: /** * @param {Array} options Array containing the options. * @param {HTMLElement}…
connexo
  • 41,035
  • 12
  • 60
  • 87