• <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 类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)

                        <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>