You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The <code>@hideconstructor</code> tag tells JSDoc that the generated documentation should not display the constructor for a class. This tag is available in JSDoc
45
+
3.5.0 and later.</p>
46
+
<p>For pre-ES2015 classes, use this tag in combination with the <ahref="tags-class.html"><code>@class</code> or <code>@constructor</code>
47
+
tag</a>.</p>
48
+
<p>For ES2015 classes, use this tag in the JSDoc comment for your constructor. If your class does not have an explicit constructor, use this tag in the JSDoc comment
49
+
for the class.</p>
50
+
<h2id="examples">Examples</h2>
51
+
<figure>
52
+
<figcaption>@hideconstructor tag with pre-ES2015 class</figcaption><preclass="prettyprint lang-js"><code>/**
53
+
* @classdesc Toaster singleton.
54
+
* @class
55
+
* @hideconstructor
56
+
*/
57
+
var Toaster = (function() {
58
+
var instance = null;
59
+
60
+
function Toaster() {}
61
+
62
+
/**
63
+
* Toast an item.
64
+
*
65
+
* @alias toast
66
+
* @memberof Toaster
67
+
* @instance
68
+
* @param {BreadyThing} item - The item to toast.
69
+
* @return {Toast} A toasted bready thing.
70
+
*/
71
+
Toaster.prototype.toast = function(item) {};
72
+
73
+
return {
74
+
/**
75
+
* Get the Toaster instance.
76
+
*
77
+
* @alias Toaster.getInstance
78
+
* @returns {Toaster} The Toaster instance.
79
+
*/
80
+
getInstance: function() {
81
+
if (instance === null) {
82
+
instance = new Toaster();
83
+
delete instance.constructor;
84
+
}
85
+
86
+
return instance;
87
+
}
88
+
};
89
+
})();
90
+
</code></pre>
91
+
</figure>
92
+
<figure>
93
+
<figcaption>@hideconstructor tag with ES2015 class</figcaption><preclass="prettyprint lang-js"><code>/**
<ahref="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project.
142
+
<br> This website is <ahref="https://github.com/jsdoc3/jsdoc3.github.com">open source</a> and is licensed under the <arel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
0 commit comments