【问题标题】:JSDoc: Auto detecting class methodsJSDoc:自动检测类方法
【发布时间】:2022-06-29 18:56:25
【问题描述】:

我的 jsdocs 如下所示

module.exports = class gateio extends Exchange {
    /**
     * @class
     * @name gateio
     */

    async fetchOrder (id, symbol = undefined, params = {}) {
        /**
         * @method
         * @name gateio#fetchOrder
         * @description Retrieves information on an order
         * @param {string} id : Order id
         * @param {string} symbol : Unified market symbol
         * @param {boolean} params.stop : True if the order being fetched is a trigger order
         * @param {dictionary} params : Parameters specified by the exchange api
         * @returns [Order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
         */

有什么方法可以自动检测

  • fetchOrder 是一种方法
  • 它的名字是fetchOrder,属于类gateio
  • 它的描述是“检索订单信息”
  • gateio 是一个类
  • 那个gateio的名字是gateio

或者我必须为每个文档指定@method、@name、@class、@description?

这些@似乎是多余的,如果可以的话,我想排除它们

【问题讨论】:

    标签: javascript documentation jsdoc docstring jsdoc3


    【解决方案1】:

    似乎 jsdoc 被 module.exports = class ... 弄糊涂了。 我能够让它像这样工作:

    /**
     * (description text)
     */
    class gateio extends Exchange {
        /**
         * Retrieves information on an order
         * @param {string} id : Order id
         * @param {string} symbol : Unified market symbol
         * @param {boolean} params.stop : True if the order being fetched is a trigger order
         * @param {dictionary} params : Parameters specified by the exchange api
         * @returns [Order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
         */
        async fetchOrder (id, symbol = undefined, params = {}) {
            // ...
        }
    }
    module.exports = gateio
    

    【讨论】:

      猜你喜欢
      • 2012-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-29
      • 2017-08-19
      • 2021-01-21
      • 2020-10-07
      • 2012-10-03
      相关资源
      最近更新 更多