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
0
votes
1 answer

Inheriting documentation in JSDoc

I am trying to write documentation for my JS project, and my code is object-oriented. Here is a sample code: /** * @classdesc Represents a Layer. * @class * @param {object} satellite - The satellite object. * @param {string} date - The image…
0
votes
1 answer

JSDoc not detecting class inheritance in JS

I am trying to document my code using JSDoc but I can't figure out how to make it work for it to recognise class inheritance. Here is a sample code: /** * @classdesc Represents a Layer. * @class * @param {object} satellite - The satellite…
0
votes
0 answers

Is it possible to use dynamic key names from @template parameters in JSDoc?

I am documenting a set of GraphQL-based APIs, which all return a response of similar structure. I have a @typedef with @template parameters to document these, which looks like this: /** * @template DataType * @typedef {Promise<{ * data: DataType…
cristian
  • 866
  • 3
  • 8
  • 26
0
votes
1 answer

How to add description to a property type, so that intellisense shows it in VSCode

I am trying to create a reusable type, that is present as arguments a few functions. But intellisense only shows descriptions added to interfaces and not the original type declaration. So, why this Prop1 description is shown. but my formattedString…
apt
  • 117
  • 1
  • 7
0
votes
0 answers

JsDoc export const with nested object but assigned properties

I have some modules, where I export Objects (as const) that contain several objects and those objects contain certain properties or functions. For better readability I decided against direct nested structure ({ foo: {} }) in favour of assigning the…
Jankapunkt
  • 8,128
  • 4
  • 30
  • 59
0
votes
1 answer

JSDoc create object with some defined and some undefined properties (Typescript [key: string]: any;)

I am trying to convert the following interface to JSDoc export interface Payload { [key: string]: any; level?: string; code?: number; } so by conversion, it looks like /** * @typedef Payload * @type {Object} * @property {string}…
eliezra236
  • 547
  • 1
  • 4
  • 16
0
votes
1 answer

trying to add jsdocs to dynamically generated functions

I have a class that generates simple CRUD functions of a given table. I have the jsdoc documentation working the way I want it (mostly for autofill purposes) when I init it once. ie const providerService = new CrudFunctions('provider'). However I…
0
votes
1 answer

How to prevent @param types from becoming broken links

When generating docs, the type "string" (among others) will become a link to "string.html" which does not exist. How do we prevent that from happening? I want plain text to show for these types. /** * the comment * * @param {string} myString …
Gravity123
  • 1,130
  • 3
  • 21
  • 39
0
votes
1 answer

How can I document randomly-assigned properties of a custom type in JSDoc?

/** * @typedef {string} UUID * */ /** * @typedef {Object} ITEM * @property {UUID} id * */ /** * @typedef {Object} THINGY * @property {??????} * */ const oneThingy = { asdf: {id: 'asdf', ...}, sdfg: {id: 'sdfg', ...}, dfgh: {id:…
0
votes
1 answer

How to document a class as member of namespace

// in some file /** * @typedef myspace * @property {Object} models * @property {Object} services */ // in other files /** @typedef myspace.models.ModelA */ class ModelA { ... } /** @typedef myspace.models.ModelB */ class ModelB { ... } /**…
Alexander
  • 409
  • 4
  • 11
0
votes
1 answer

JSDoc: Auto detecting class methods

My jsdocs look like the following module.exports = class gateio extends Exchange { /** * @class * @name gateio */ async fetchOrder (id, symbol = undefined, params = {}) { /** * @method * @name…
Sam
  • 1,765
  • 11
  • 82
  • 176
0
votes
1 answer

How to document a function's parameters if some are deconstructed while others are not (JSDoc)

How to document deconstructed parameters with JsDoc explains how to document params if there is only a single argument, which is being deconstructed. I have this class to create custom events: const EVENT_CONFIG_DEFAULTS = Object.freeze({ …
connexo
  • 53,704
  • 14
  • 91
  • 128
0
votes
1 answer

Dynamic key name inside an object

I'm trying to do the following: I have an object that looks like that const object = { healthcheck: [ { method: 'get', name: 'test' } ], users: [ { method: 'get', name: 'auth' } ], }; So I have an object that has…
Asaf
  • 949
  • 2
  • 13
  • 14
0
votes
0 answers

How can I access JSDoc at runtime

I need to get jsdoc in runtime like this /** * this is my class */ class Foo { } // getJsDoc(Foo) ==> 'this is my class\n' I am using typescript actually, I noticed during compile, ts copy TSdoc to target .js file, so if I can access using…
Cheng Bao
  • 161
  • 1
  • 4
0
votes
1 answer

Adding custom content to generated JSDoc docs

We are working on a rewrite of our API documentation and we would like to add custom content to our generated JSDocs. This custom content could for instance be runnable snippets of code, which is a feature we currently have in our manually written…
oligofren
  • 20,744
  • 16
  • 93
  • 180