Tag: jsdoc

运行babel时,JSdoc for方法在传输代码中丢失

我正在通过让消费者在使用文档时查看文档来使图书馆更加便于用户使用。 我有这个脚本在build上运行: babel src –out-dir dist –quiet 这是我的.babelrc : { "presets": [ ["es2015", { "loose": true, "modules": "commonjs" }] ] } 而这个ES6类只有一个方法: const { makeRequest } = require('../../lib/api'); const commonService = require('../commonService'); /** * @augments commonService */ class bingSpellCheck extends commonService { /** * Constructor. * * @param {Object} obj * @param {string} obj.apiKey * […]

JSdoc用于文件stream

我正在创build一个stream: var stream = fs.createWriteStream("filepath"); 现在,我将这个作为parameter passing给一个函数。 当为这个方法编写JSdoc时,我不确定它的types是什么。 那么,有人能告诉我在JSdoc中它的types是什么吗?

如何在JSDoc中引用另一个文件中所需的必需类?

在文件app.js ,我有以下 const pg = require('pg'); const Engine = require('./engine.js'); 然后在engine.js ,我有这个: class Engine { /** * * @param {pg.Client} db – The pg client database object */ constructor(db) { } } module.exports = Engine; 我想让JSDoc识别来自app.js pg.Clienttypes,但JSDoc只是将types标记为“any”。

有没有可能在JSDoc中描述非JavaScript文件?

我logging了一个NodeJS + Express项目,我希望能够从JavaScript文件中引用特定的LESS视图和Jade模板。 例如: /** Displays the homepage using the {@link views/index} view. Requires {@link stylesheets/news.less} for styling the news section. */ exports.index = function(req, res){ res.render( 'index', { title: 'Welcome' } ); }; 除了能够链接到非JS文件,我想他们出现在侧边栏与其他一切。 我可以在每个.less / .jade文件中添加一个头文件,然后告诉JSDoc通过项目的conf.json来parsing它们,但是…我不想让JSDoc 真正parsing它们,因为那样会很乱。

jsdoc和vscode:logging作为parameter passing给另一个函数的函数

我试图在JavaScript中logginginput参数的函数,但我不能解决如何在jsdoc中做到这一点。 我查看了jsdoc文档,它build议使用@callback注释是必需的,但Visual Studio代码(vscode)不会像截图一样突出显示它。 location参数的intellisense显示它是typesany而不是typeslocator (带有返回Location的id参数的函数)。 显示调用函数的函数的示例代码作为parameter passing: class Location { constructor(position, count) { this.position = position; this.count = count; } } const items = { 'USB Cable': new Location('Desk Drawer', 123), Keyboard: new Location('Desk Surface', 1), }; /** * A locater. * @param {string} id * @returns {Location} */ const locaterA = id => items[id]; […]

@type为node.js的“导出的模块”和良好的文档描述?

我正在努力成为一个好公民,并logging我的节点模块….但我不确定要在@type中放置什么。 我正在使用webstorm所以它会自动把@type {出口},但我有点困惑,我应该放在那里? 任何人都帮我一把吗? 这里是我正在开发的一个小模块,删除代码以更好地强调问题。 我很困惑我应该使用什么types,以及如何logging出口,并需要一个很好的描述。 是@type {exports}一个有效的标签? 任何人都知道一个很好的标准,或给他/她们将使用/或正在使用的东西 /** * A module for logging * @module logger * @type {exports} */ /** * HOW TO DOCUMENT THIS ???????????? GOOD DESCRIPTION?? * @type {exports} */ var winston = require('winston'); /** * Returns an instance of the logger object * @param module * @returns {exports.Logger} */ […]

jsdoc不能正确生成目录

我正在运行grunt jsdoc模块,输出html缺less目录中的文件名。 见图: 注意js在modules右边的列中重复 文件顶部(AMD): /** @module identity.js * * abstracts the logic for obtaining a user's identity * @module identity.js * @type {Core} */

如何使用JSDoxloggingcallback?

如何在JSDox中loggingcallback参数? 在jsDoc中有@callback标签,但JSDOX不支持它。 self.myFunction = function (cb) { }

JSDoc链接到callback函数

我决定使用JSDoc来logging我正在处理的一个项目。 在阅读使用指南和问题的时候,我仍然觉得我并没有把握JSDoc的一些核心概念,我在下面的例子中说明了我的无能: http : //jsfiddle.net/zsbtykpv/ /** * @module testModule */ /** * @constructor */ var Test = function() { /** * @callback myCallback * @param {Object} data An object that contains important data. */ /** * A method that does something async * @param {myCallback} cb a callback function * @return {boolean} always returns true […]

JSDoc错误? 模块导出显示为全局

JSDoc错误?:模块导出显示为全局 嗨,我正在试图logging一个我已经考虑到模块化的小项目。 为此,我有以下代码结构: /├──app │└──模块 │└──申请 │├──app ││└──Application.Common.js │└──cln │└──Application.GlobalDocumentation.js │└──ModuleA │└──ModuleB / ……。 └──package.json 我有一个名为Application的模块,它将成为其余模块之间的粘合剂,其中一个职责是定义其余模块(ModuleA,ModuleB等)需要实现的公共接口。 我创build了文件Application.GlobalDocumentation.js仅用于文档目的,以logging这个全局接口(目前它只是一个函数)。 /** * Client-side Constructor Function that generates client side index interfaces * @name ClientModuleConstructor * @function * @global * @param {string} something * @return {object} */ 而Application.Common.js是共享逻辑将被放置的文件: /** * This module handle the initialization, construction and the lifecycle […]