jsdoc3

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

久未见 提交于 2019-12-05 01:37:05
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: { priority: 9; writable: false; } } I already have /** * @typedef {Object} DescriptorEntry *

What is the correct JSDoc syntax for a local variable?

眉间皱痕 提交于 2019-12-05 00:43:19
For a function like this... function example() { var X = 100; ... var Y = 'abc'; ... return Z; } I need to explain the purpose of some of the local variables. Adding a description like this... function example() { /** * @description - Need to explain the purpose of X here. */ var X = 100; ... /** * @description - Need to explain the purpose of Y here. */ var Y = 'abc'; ... return Z; } ...doesn't seem to be getting picked up by JS Doc v3.4.0 . What is the correct syntax? P.S. Some of my use cases call for multi-line comments. I usually use something like the code below in my projects. function

static class property not working with Babel

前提是你 提交于 2019-12-04 10:50:23
I am using JSDOC and all it supported npm plugins to create nice documentation. Getting hard time when jsdoc is running and parsing JSX file it always throws error as below near = sign SyntaxError: unknown: Unexpected token export default class SaveDesign extends Component { static displayName = 'SaveDesign'; } conf.json file { "source": { "include": [ "src/app/test.js", "src/app/components/Modals/Template/SaveDesign.jsx"], "exclude": [ "src/fonts", "src/icons", "src/less", "src/vector-icon" ], "includePattern": ".+\\.js(doc|x)?$", "excludePattern": "(^|\\/|\\\\)_" }, "plugins": ["node_modules

How To Use JSDOC3 To Document Enum Constants

☆樱花仙子☆ 提交于 2019-12-04 07:27:39
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: 'account_entityform', type: Enum.WidgetType.Form }).add(); How can we document this with JSDOC? ASA2 After

create custom tags with jsdoc

故事扮演 提交于 2019-12-03 14:16:58
I am trying to create custom tags in jsdoc 3.4.2. The config.json file is { "tags": { "allowUnknownTags": true, "dictionaries": ["jsdoc","closure"] }, "source": { "include": [ "app/" ], "exclude": [], "includePattern": ".+\\.js(doc|x)?$", "excludePattern": "(^|\\/|\\\\)_" }, "plugins": [ "plugins/custom-tags.js" ], "templates": { "cleverLinks": false, "monospaceLinks": false }, "opts": { "destination": "./docs", "recurse": true, "encoding": "utf8" } } In the custom-tags.js i have added these lines exports.defineTags = function (dictionary) { dictionary.defineTag("service", { mustHaveValue:

jsdoc: multiline description @property

你说的曾经没有我的故事 提交于 2019-12-01 20:51:46
问题 I am documenting my code using jsdoc, so far so good, I have a comment like below ... * @property {string} mode - mode of display 'video' - display video or 'audio' - play only the audio. * @property... and it comes in html document like | ... | | | mode | string | mode of display 'video' - display video or 'audio' - play only the audio.| | ... | | I want it to appear something like | ... | | | | mode | string | mode of display | | | | 'video' - display video | | | | 'audio' - play only the

Default “Home” text and content for JSDoc

主宰稳场 提交于 2019-12-01 02:51:56
After running a basic JSDoc compile/render from Node.js: jsdoc file1.js file2.js I get a well-formatted document using the default template inside a directory "out". Almost all is as expected! But when opening the document, it always says "Home" on the index.html page, has no content on that initial page, and has "Home" in the sidebar navigation. How and where do I notate the name of the project so that it replaces "Home"? I would also like to see a project description, as well as author and copyright information. It seems like the most basic of things to do in a JSDoc, but I can't find the

Default “Home” text and content for JSDoc

柔情痞子 提交于 2019-11-30 21:46:21
问题 After running a basic JSDoc compile/render from Node.js: jsdoc file1.js file2.js I get a well-formatted document using the default template inside a directory "out". Almost all is as expected! But when opening the document, it always says "Home" on the index.html page, has no content on that initial page, and has "Home" in the sidebar navigation. How and where do I notate the name of the project so that it replaces "Home"? I would also like to see a project description, as well as author and

How to document a function returned by a function using JSDoc

China☆狼群 提交于 2019-11-30 11:15:20
I am using JSDoc for parameter documentation. It is clear how to document the parameter types for many_prompts , but what is the right way to document the function it returns? /** * @param {Number} - number of times to prompt * @return {Function(prompt{Number})} - the returned function */ function many_prompts(count) { return function(prompt) { for(var i=0; i < count; i++) alert(prompt); } } //Example of use: var y =many_prompts(3); y('Hello World'); You can document the inner function and then reference it like so /** * @param {Number} - number of times to prompt * @return {many_prompts~inner

JSDoc UML Diagram

戏子无情 提交于 2019-11-30 07:08:41
Question: I'm editing and using an open source javascript library that has JSDoc tags in its code. I was wondering if anyone knew of a JSDoc plugin that would allow me to generate a class diagram from the JSDoc tags. Edit I decided to try out js/uml and found the following. The JS/UML eclipse extension requires an older version of Eclipse (Indigo) and a non-supported dependency library UML2tools. I found the dependencies needed and according to the Eclipse software manager installed correctly. When I tried to enable the uml functionality (having configured the js root), the process would hang.