12
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【独習】無名関数によるクラス作りのための JSDoc テンプレート

Posted at

出力結果:http://www.wakuworks.com/test/jsdoc/

Google さんのコード見ると、型は小文字っぽいな〜。
よくわからんちん。

js_doc_test.js
/**
 * 名前空間の説明
 * @namespace
 */
var Namespace = Namespace || {};

/**
 * クラスの説明など
 * @constructor
 * @param {String} str 引数の説明
 */
var Namespace.Class = Namespace.Class || (function()
{
    /** @exports Class as Namespace.Class */

    var PRIVATE_CONSTANT = "private";
    var _str = "private";

    /** constructor */
    function Class(str)
    {
        this.str = str;
    }

    /**
     * 定数の説明
     * @constant
     * @type {String}
     */
    Class.PUBLIC_CONSTANT = "public";

    /**
     * クラスメソッドの説明
     * @param {Number} n 引数の説明
     * @returns {Number} 戻り値の説明
     */
    Class.method = function(n)
    {
        return n;
    };

    Class.prototype = {
        /**
         * インスタンス変数の説明
         * @type {String}
         */
        str: "",

        /**
         * インスタンス変数の説明
         * @type {String}
         * @private
         */
        _str: "",

        /**
         * インスタンスメソッドの説明
         * @param {Number} n 引数の説明
         * @returns {Number} 戻り値の説明
         */
        method: function(n)
        {
            return n;
        },

        /**
         * インスタンスメソッドの説明
         * @param {Number} n 引数の説明
         * @returns {Number} 戻り値の説明
         * @private
         */
        _method: function(n)
        {
            return n;
        }
    };

    return Class;
}
)();
12
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?