jsdoc

How to extend a typedef parameter in JSDOC?

对着背影说爱祢 提交于 2019-11-30 08:25:30
Assuming you have the following code inside a ES6 class (documentation): /** * @typedef Test~options * @type {object.<string>} * @property {array} elements - An array containing elements * @property {number} length - The array length */ /** * @param {Test~options} opt - Option object */ test(opt){ } Now I would like to document another function, let's name it test2 . This function takes exactly the same options object, but needs another property parent . How to document this without documenting redundant options? Redundant means: /** * @typedef Test~options * @type {object.<string>} *

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.

How can I document a type in webstorm using just jsdoc?

非 Y 不嫁゛ 提交于 2019-11-30 06:30:28
When I write the following code, the annotator tells me that BrowserSelector is not defined in the second typedef: /** * @typedef {{name: String, minVer: Number, maxVer: Number}} BrowserSelector */ /** * @typedef {{type:String, browser: BrowserSelector, attribute: Object}} Selector */ I believe it is not associating the type with the name. How can I do that? I would prefer not to add actual code for it, just jsdoc comments. iolo I'm using this comment style for 'struct' like types: /** * @name BrowserSelector * @property {String} name * @property {Number} minVer * @property {Number} maxVer */

Creating a namespace-like organization in a google apps script library

这一生的挚爱 提交于 2019-11-30 04:30:21
问题 I was looking into building a toolset using google apps script. The problem with this is that as far as I can tell in only allows one level of organization. You can create a Library called Stopwatch and call methods Stopwatch.start() and Stopwatch.stop() which is pretty cool. What I had in mind though was something more like Utils.Stopwatch().start() and Utils.Timer.start() etc. I think it's certainly possible in javascript, but in order to keep breaking Apps Script autocomplete function it

How to preview jsdoc comments in google doc scripts

走远了吗. 提交于 2019-11-30 04:26:55
问题 I know that Issue 1731 has been raised requesting preview of jsdoc within the Google script editor. http://code.google.com/p/google-apps-script-issues/issues/detail?id=1731 While we wait for that to be implemented, what's the best way to preview jsdoc comments that I'm adding to my published library, without requiring me to create a new version? 回答1: Update 2014: With libraries now supported by the Google Apps Script editor's autocompletion, it's possible to get immediate feedback about SOME

How can I view the outline in eclipse when using the revealing module pattern?

徘徊边缘 提交于 2019-11-30 03:53:08
I'm currently refactoring some Javascript code we have and amongst other things I've changed it to make use of the revealing module pattern. The code is looking much tidier and it works fine but I can't see the functions anymore in the outline view. I see the top level namespace var as a var but you can't expand it to see the functions within. Lets say the code used to look like this: function myFunc1() {} function myFunc2() {} In this case you see both functions in the outline view. But if you change it to this: var myNamespace = function() { function myFunc1() {} function myFunc2() {} return

Google Closure Compiler 100% typed

夙愿已清 提交于 2019-11-30 02:20:27
How can I get my application to be 100% typed in regard to google closure compiler? I already tagged everything with jsdoc comments. Is it even possible to get 100? I'm at 64,6% kayahr It IS possible to achieve 100%. My own projects are 100% typed. The closure compiler can output warnings about expressions with unknown types. Unfortunately there is no command line option to enable this feature. You have to modify the source code to enable it: Download the current sources: git clone https://code.google.com/p/closure-compiler/ Edit src/com/google/javascript/jscomp/CompilerOptions.java and change

What's the proper way to document callbacks with jsdoc?

不打扰是莪最后的温柔 提交于 2019-11-29 22:38:58
I've spent quite a while scouring the internet looking for the best way to properly document callbacks with jsdoc, but unfortunately, I haven't found a great one yet. Here's my question: I'm writing a Node.js library for developers. This library provides multiple classes, functions, and methods that developers will be working with. In order to make my code clear and understandable, as well as to (hopefully) auto-generate some API documentation in the future, I've started using jsdoc in my code to self-document what's happening. Let's say I define a function like the following: function

How to document a dictionary in JSDoc?

心不动则不痛 提交于 2019-11-29 22:05:44
Having next example: var CONF = { locale: { "en": { name: "English", lang: "en-US" }, "es": { name: "Spanish", lang: "es-ES" } } }; And knowing that what the locale property contains is a dictionary object, which comes from the database, how can I document its inner properties with JSDoc? Currently I am thinking to typedef type for my locale objects, then may I be able to set the locale property to simply an Array of my defined type? Is this the right way to do it? Áxel Costas Pena According to the JSDoc 3 docs : Arrays and objects (type applications and record types) An object with string

How do I JSDoc A Nested Object's Methods?

喜欢而已 提交于 2019-11-29 19:58:09
I've been trying to use JSDoc3 to generate documentation on a file, but I'm having some difficulty. The file (which is a Require.js module) basically looks like this: define([], function() { /* * @exports mystuff/foo */ var foo = { /** * @member */ bar: { /** * @method */ baz: function() { /*...*/ } } }; return foo; } The problem is, I can't get baz to show up in the generated documentation. Instead I just get a documentation file for a foo/foo module, which lists a bar member, but bar has no baz (just a link to foo 's source code). I've tried changing bar 's directive to @property instead,