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/

294 questions
6
votes
2 answers

JSDoc for reused Function interface

I'm connecting to multiple email tools and abstracting their APIs to one common sendEmail function with the same params and same returns for each service. That means that for every email service (Mailchimp, SendGrid...), I have to write a function…
Shruggie
  • 869
  • 6
  • 20
6
votes
2 answers

JSDoc: Define allowed values of parameter which has string type

I'm using JSDoc and I would like to add the info to my documentation which value a parameter should have. In this example you can see, that the parameter operator has string type. But furthermore there can only be open or close as valid value of the…
user3142695
  • 15,844
  • 47
  • 176
  • 332
6
votes
2 answers

JSDoc type for returned class instances

I'm using Node.js with two modules and one script that depends on them: lib/Bar.js module.exports = class Bar { // .. }; lib/Foo.js const Bar = require('./Bar.js'); module.exports = class Foo { /** * @return {Bar} A Bar instance */ get…
Felix Edelmann
  • 4,959
  • 3
  • 28
  • 34
6
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 …
6
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,978
  • 4
  • 24
  • 45
6
votes
1 answer

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
  • 5,810
  • 2
  • 38
  • 42
6
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,246
  • 3
  • 18
  • 36
6
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,621
  • 4
  • 25
  • 49
6
votes
2 answers

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
  • 5,314
  • 5
  • 34
  • 63
6
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
  • 4,225
  • 4
  • 31
  • 55
6
votes
2 answers

Autocomplete for my functions in the google-apps-script editor

Can I get in editor autocomplete for my functions using JSDoc somehow? I am creating a big google spreadsheet with a lot of code in the associated script editor. I get autocompletion help when I write the period on LINE 1 (see code below), but not…
consideRatio
  • 1,091
  • 13
  • 19
6
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
  • 71
  • 1
  • 2
6
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,954
  • 15
  • 26
5
votes
0 answers

How do I comment an entire file in JSDoc?

I'm trying to comment an entire file describing an overall functionality. I put something like this at the top of each file /** * @file File with helper functions that facilitate reading config JSON files. */ but when I generate the documentation…
samuelg0rd0n
  • 1,080
  • 2
  • 15
  • 27
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
  • 508
  • 1
  • 5
  • 22