PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wiki/InlineDocs.wiki

http://jsdoc-toolkit.googlecode.com/
Unknown | 51 lines | 39 code | 12 blank | 0 comment | 0 complexity | 40ed1c82bc106b609f15b7aeecf32f19 MD5 | raw file
 1#summary Inline doclets.
 2
 3== Using Inline Doc Comments ==
 4
 5It is possible to add documentation to a function (including a constructor or method) to indicate its parameter type(s) and its return type, using special inline doc comments. For example, consider the following example:
 6
 7{{{
 8/**
 9    @param {String} name
10    @type Array
11*/
12function getPerson(name) {
13}
14}}}
15
16The above example could be written using inline doc comments instead, like so:
17
18{{{
19function getPerson(/**String*/ name) /**Array*/ {
20}
21}}}
22
23Multiple parameter comments are allowed:
24
25{{{
26function getPerson(/**String*/ name, /**City*/ birthplace) {
27}
28}}}
29
30If you have a standard doc comment that refers to parameters, the type information from the inline comment will be merged with it.
31
32{{{
33/**
34    @param name The name of the person.
35 */
36function getPerson(/**String*/ name) {
37}
38}}}
39
40If you provide type information in _both_ the standard comment and the inline comment, the type information in the standard comment will take precedence over the inline comment.
41
42{{{
43/**
44    @param {NameObject} name The name of the person.
45 */
46function getPerson(/**String*/ name) {
47}
48}}}
49
50== See Also ==
51  * The [TagParam @param] tag.