• <bdo id='1IrDv'></bdo><ul id='1IrDv'></ul>
    <tfoot id='1IrDv'></tfoot>

      <legend id='1IrDv'><style id='1IrDv'><dir id='1IrDv'><q id='1IrDv'></q></dir></style></legend>
    1. <small id='1IrDv'></small><noframes id='1IrDv'>

        <i id='1IrDv'><tr id='1IrDv'><dt id='1IrDv'><q id='1IrDv'><span id='1IrDv'><b id='1IrDv'><form id='1IrDv'><ins id='1IrDv'></ins><ul id='1IrDv'></ul><sub id='1IrDv'></sub></form><legend id='1IrDv'></legend><bdo id='1IrDv'><pre id='1IrDv'><center id='1IrDv'></center></pre></bdo></b><th id='1IrDv'></th></span></q></dt></tr></i><div id='1IrDv'><tfoot id='1IrDv'></tfoot><dl id='1IrDv'><fieldset id='1IrDv'></fieldset></dl></div>

        枚举作为 JSDoc 中的 @param 类型

        Enum as @param type in JSDoc(枚举作为 JSDoc 中的 @param 类型)

            <tbody id='kkvhY'></tbody>

        • <legend id='kkvhY'><style id='kkvhY'><dir id='kkvhY'><q id='kkvhY'></q></dir></style></legend>
              <i id='kkvhY'><tr id='kkvhY'><dt id='kkvhY'><q id='kkvhY'><span id='kkvhY'><b id='kkvhY'><form id='kkvhY'><ins id='kkvhY'></ins><ul id='kkvhY'></ul><sub id='kkvhY'></sub></form><legend id='kkvhY'></legend><bdo id='kkvhY'><pre id='kkvhY'><center id='kkvhY'></center></pre></bdo></b><th id='kkvhY'></th></span></q></dt></tr></i><div id='kkvhY'><tfoot id='kkvhY'></tfoot><dl id='kkvhY'><fieldset id='kkvhY'></fieldset></dl></div>
                <bdo id='kkvhY'></bdo><ul id='kkvhY'></ul>
              • <small id='kkvhY'></small><noframes id='kkvhY'>

                <tfoot id='kkvhY'></tfoot>
                  本文介绍了枚举作为 JSDoc 中的 @param 类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以像下面的示例一样为 JSDoc @param 类型声明使用枚举?

                  Is it possible to use an enum for the JSDoc @param type declaration like in the following example?

                  /**
                   * @enum { Number }
                   */
                  var TYPES = {
                      TYPE_A: 1,
                      TYPE_B: 2
                  }
                  
                  /**
                   * @param { TYPES } type
                   */
                  function useTypesEnum( type ) {
                  
                  }
                  

                  如果我对 JavaScript 使用 Eclipse 等 IDE,应该不会发出警告?

                  If I use an IDE like Eclipse etc. for JavaScript, there should no warning be raised?

                  推荐答案

                  JsDoc 注释对 JavaScript 代码没有影响.它确实影响的是一些旨在使用该信息的工具.使用 JsDoc 注释的两个工具是 文档生成器 和 Google Closure Compiler.

                  JsDoc comments have no impact on JavaScript code. What it does influence is some tools designed to use that information. Two of the tools that work with JsDoc comments are the documentation generator and the Google Closure Compiler.

                  我对 JsDoc3 不是特别熟悉,其中添加了 @enum 标记,但我认为它与任何其他类型一样工作.

                  I am not particularly familiar with JsDoc3, in which the @enum tag has been added, but i would assume it works just as any other type.

                  闭包编译器也能正确识别枚举,您可以像示例中提到的那样使用它并获得编译器的所有好处(例如:类型检查).

                  The Closure Compiler also recognizes the enum correctly and you can use it just like you mentioned in the example and get all the benefits of the compiler (ex: type checking).

                  这篇关于枚举作为 JSDoc 中的 @param 类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))

                        <legend id='QG723'><style id='QG723'><dir id='QG723'><q id='QG723'></q></dir></style></legend>

                        <small id='QG723'></small><noframes id='QG723'>

                          <tbody id='QG723'></tbody>
                      1. <i id='QG723'><tr id='QG723'><dt id='QG723'><q id='QG723'><span id='QG723'><b id='QG723'><form id='QG723'><ins id='QG723'></ins><ul id='QG723'></ul><sub id='QG723'></sub></form><legend id='QG723'></legend><bdo id='QG723'><pre id='QG723'><center id='QG723'></center></pre></bdo></b><th id='QG723'></th></span></q></dt></tr></i><div id='QG723'><tfoot id='QG723'></tfoot><dl id='QG723'><fieldset id='QG723'></fieldset></dl></div>

                            <bdo id='QG723'></bdo><ul id='QG723'></ul>
                            <tfoot id='QG723'></tfoot>