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
Copy file name to clipboardExpand all lines: content/en/tags-access.md
+17-4
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,32 @@ related:
17
17
18
18
## Overview
19
19
20
-
The @access tag specifies the access level of a member. Note that "@access private" is the same as "@private", "@access protected" is the same as "@protected", and "@access public" is the same as "@public" which is the same as not including the tag at all. Private members will not show in the output documentation unless JSDoc is given the `--private` option.
20
+
The `@access` tag specifies the access level of a member. You can use the `@access` tag as a
21
+
synonym for other tags:
21
22
22
-
Note that a doclet's _access level_ is different from its _scope_. For example, if "Parent" has an inner variable "child" that is documented as @public, "child" will still be treated as an inner variable with the namepath "Parent~child".
23
-
To change a doclet's scope, see the [@instance][instance-tag], [@static][static-tag], and [@global][global-tag] tags.
23
+
+`@access private` is the same as `@private`.
24
+
+`@access protected` is the same as `@protected`.
25
+
+`@access public` is the same as `@public`.
24
26
27
+
Private members are not shown in the generated output unless JSDoc is run with the `-p/--private`
28
+
command-line option. In JSDoc 3.3.0 and later, you can also use the [`-a/--access` command-line
29
+
option][access-option] to change this behavior.
30
+
31
+
Note that a doclet's _access level_ is different from its _scope_. For example, if `Parent` has an
32
+
inner variable named `child` that is documented as `@public`, the `child` variable will still be
33
+
treated as an inner variable with the namepath `Parent~child`. In other words, the `child` variable
34
+
will have an inner scope, even though the variable is public. To change a doclet's scope, use the
35
+
[`@instance`][instance-tag], [`@static`][static-tag], and [`@global`][global-tag] tags.
36
+
37
+
[access-option]: about-commandline.html
25
38
[global-tag]: tags-global.html
26
39
[instance-tag]: tags-instance.html
27
40
[static-tag]: tags-static.html
28
41
29
42
30
43
## Examples
31
44
32
-
{% example "@accessis a synonym for @private, @protected, @public." %}
45
+
{% example "Using @accessas a synonym for other tags" %}
<p>The @access tag specifies the access level of a member. Note that "@access private" is the same as "@private", "@access protected"
45
-
is the same as "@protected", and "@access public" is the same as "@public" which is the same as not including the tag at all.
46
-
Private members will not show in the output documentation unless JSDoc is given the <code>--private</code> option.</p>
47
-
<p>Note that a doclet's <em>access level</em> is different from its <em>scope</em>. For example, if "Parent" has an inner variable "child"
48
-
that is documented as @public, "child" will still be treated as an inner variable with the namepath "Parent~child". To change a doclet's
49
-
scope, see the <ahref="tags-instance.html">@instance</a>, <ahref="tags-static.html">@static</a>, and <ahref="tags-global.html">@global</a> tags.</p>
44
+
<p>The <code>@access</code> tag specifies the access level of a member. You can use the <code>@access</code> tag as a synonym for other tags:</p>
45
+
<ul>
46
+
<li><code>@access private</code> is the same as <code>@private</code>.</li>
47
+
<li><code>@access protected</code> is the same as <code>@protected</code>.</li>
48
+
<li><code>@access public</code> is the same as <code>@public</code>.</li>
49
+
</ul>
50
+
<p>Private members are not shown in the generated output unless JSDoc is run with the <code>-p/--private</code> command-line option. In JSDoc 3.3.0 and later, you
51
+
can also use the <ahref="about-commandline.html"><code>-a/--access</code> command-line
52
+
option</a> to change this behavior.</p>
53
+
<p>Note that a doclet's <em>access level</em> is different from its <em>scope</em>. For example, if <code>Parent</code> has an inner variable named <code>child</code> that is documented as <code>@public</code>, the <code>child</code> variable will still be treated as an inner variable with the namepath <code>Parent~child</code>.
54
+
In other words, the <code>child</code> variable will have an inner scope, even though the variable is public. To change a doclet's scope, use the
55
+
<ahref="tags-instance.html"><code>@instance</code></a>, <ahref="tags-static.html"><code>@static</code></a>, and <ahref="tags-global.html"><code>@global</code></a> tags.</p>
50
56
<h2id="examples">Examples</h2>
51
57
<figure>
52
-
<figcaption>@access is a synonym for @private, @protected, @public.</figcaption><preclass="prettyprint lang-js"><code>/** @constructor */
58
+
<figcaption>Using @access as a synonym for other tags</figcaption><preclass="prettyprint lang-js"><code>/** @constructor */
Copy file name to clipboardExpand all lines: tags-public.html
+4-5
Original file line number
Diff line number
Diff line change
@@ -35,11 +35,10 @@ <h2>Table of Contents</h2>
35
35
</li>
36
36
</ul>
37
37
<h2id="overview">Overview</h2>
38
-
<p>The @public tag indicates that a symbol should be documented as if it were public.</p>
39
-
<p>By default, JSDoc treats all symbols as public, so using this tag does not normally affect the generated documentation. However, you may prefer to use the @public
40
-
tag explicitly so it is clear to others that you intended to make the symbol public.</p>
41
-
<p>In contrast to previous version of JSDoc, the @public tag does <em>not</em> affect a symbol's scope. Use the <ahref="tags-instance.html">@instance</a>,
42
-
<ahref="tags-static.html">@static</a>, and <ahref="tags-global.html">@global</a> tags to change a symbol's scope.</p>
38
+
<p>The <code>@public</code> tag indicates that a symbol should be documented as if it were public.</p>
39
+
<p>By default, JSDoc treats all symbols as public, so using this tag does not normally affect the generated documentation. However, you may prefer to use the <code>@public</code> tag explicitly so it is clear to others that you intended to make the symbol public.</p>
40
+
<p>In JSDoc 3, the <code>@public</code> tag does <em>not</em> affect a symbol's scope. Use the
41
+
<ahref="tags-instance.html"><code>@instance</code></a>, <ahref="tags-static.html"><code>@static</code></a>, and <ahref="tags-global.html"><code>@global</code></a> tags to change a symbol's scope.</p>
43
42
<h2id="examples">Examples</h2>
44
43
<figure>
45
44
<figcaption>Using the @public tag</figcaption><preclass="prettyprint lang-js"><code>/**
0 commit comments