jsdoc3

Documenting complex JavaScript Objects with custom Inheritance System

…衆ロ難τιáo~ 提交于 2019-12-08 08:12:01
问题 I'm currently trying to migrate an existing server-side JavaScript API from its existing manually copy-and paste Inheritance System to a better and more reliable system. The pure prototyping cannot be used because state (variables) of the objects must also be inherited and must not be overriden in parent Objects. So i'm thinking about using a good solution from John Reisig described here: http://ejohn.org/blog/simple-javascript-inheritance/ which workrs great for my case. The only challenge i

JSDoc for reused Function interface

╄→尐↘猪︶ㄣ 提交于 2019-12-08 01:13:56
问题 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 which has an identical JSDoc describing the same @params and same @returns ... Is there a valid JSDoc syntax to use @typedef or similar with a Function, where instead of declaring @params and @returns above each function, just describe the type? ..

How to document a method with multiple aliases?

半腔热情 提交于 2019-12-07 19:23:17
问题 I'm trying to document the getName() method of The following Person constructor : Javascript code : /** * Creates a person instance. * @param {string} name The person's full name. * @constructor */ function Person( name ) { /** * Returns the person's full name. * @return {string} The current person's full name. */ function getName() { return name; } this.getName = getName; this.getN = getName; this.getFullName = getName; } As you can see, the getName() method has two aliases ( getN() and

JSDoc: What is a relationship between modules and namespaces

喜夏-厌秋 提交于 2019-12-07 02:28:37
问题 I faced a problem with understanding the purpose of namespaces and modules in a union. For example I have a class Game.utils.Matrix . I want to annotate Game as a namespace, utils as a module and Matrix as a class: /** * @namespace Game */ /** * @module utils * @memberOf Game */ /** * Create a matrix * @constructor */ function Matrix(){} It creates a documentation and the name path of the Matrix class is Game.utils~ Matrix , but if I follow the Module link its name path is Module: utils

The error message “There are no input files to process” from jsdoc

不问归期 提交于 2019-12-07 01:54:14
问题 Jsdoc is installed locally ( npm install jsdoc ). I get the following error while trying to execute .\node_modules.bin\jsdoc --debug ./lib/JavaScriptSource.js Output: DEBUG: JSDoc 3.3.0-dev (Sun, 15 Jun 2014 18:39:52 GMT) DEBUG: Environment info: {"env":{"conf":{"tags":{"allowUnknownTags":true},"templ ates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles" :true}},"source":{"includePattern":".+\.js(doc)?$","excludePattern":"(^|\/|\\ )_"},"plugins":[]},"opts":{"_":[".

JsDoc: How do I document that an object can have arbritrary (unknown) properties but with a particular type?

爷,独闯天下 提交于 2019-12-06 20:10:53
问题 This is a similar to question 30360391. I want to express that the parameter of a function is a plain JS object that can have arbitrary properties (with unknown) names but all properties are objects themselves with fixed properties. An example: The function is just like this /** * @param {Descriptor} desc */ function foo( desc ) { // ... } and a typical desc looks like desc = { unknownEntity1: { priority: 5; writable: false; }, unknownEntity2: { priority: 42; writable: true; }, unknownEntity3

How to document a method with multiple aliases?

谁说我不能喝 提交于 2019-12-06 07:52:19
I'm trying to document the getName() method of The following Person constructor : Javascript code : /** * Creates a person instance. * @param {string} name The person's full name. * @constructor */ function Person( name ) { /** * Returns the person's full name. * @return {string} The current person's full name. */ function getName() { return name; } this.getName = getName; this.getN = getName; this.getFullName = getName; } As you can see, the getName() method has two aliases ( getN() and getFullName() ), so the obvious tag to use is the @alias tag, but unfortunately, it has two major problems

JSDoc3 documentation of a function's argument being an array of objects?

丶灬走出姿态 提交于 2019-12-06 07:14:24
UseJSDoc.org's page on @type explains how to document arrays and objects, but not arrays of objects. My function accepts an array of objects with a specific list of properties and it's these properties that I'd like to document. The function might look like function foo(people) and the people array might have been created by the caller of the function as arr = []; arr.push({name: "Alfred", profession: "Butler", hitpoints: 2}); arr.push({name: "Batman", profession: "Vigilante", hitpoints: 42}); // ... foo(arr) I'd like to use the {{name: string, profession: string, hitpoints: number}} Person

How To Use JSDOC3 To Document Enum Constants

丶灬走出姿态 提交于 2019-12-06 03:56:30
问题 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 Enum */ export namespace { /** * @enum WidgetType {string} */ Enum.WidgetType = { /** Dashboard */ Dashboard: 'dashboard', /** Form */ Form: 'entityeditform', /** Report */ Report: 'report' }; } Here's how the 'enums' are used in code: app.widget({ id:

Using JsDoc3 for large apps, How to group modules into sections/categories/submodules

微笑、不失礼 提交于 2019-12-05 08:16:07
I am working on an app wich will become quite huge in time. I have decided to use JsDoc3 and DocStrap to document all modules. Modules are defined via require.js and in some places they are nested up to 3 or 4 levels deep. Untill now I understand that JsDoc documentation is split into four main sections: Modules, Classes, Tutorials, Globals. Each section has a header dropdown menu and a sidebar each of them listing all of the modules in liniar fashion, alphabetically. I was wondering if there are options to display/group modules and Classes somehow to reflect the project structure. I saw a git