/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. == Using Inline Doc Comments ==
  3. It 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:
  4. {{{
  5. /**
  6. @param {String} name
  7. @type Array
  8. */
  9. function getPerson(name) {
  10. }
  11. }}}
  12. The above example could be written using inline doc comments instead, like so:
  13. {{{
  14. function getPerson(/**String*/ name) /**Array*/ {
  15. }
  16. }}}
  17. Multiple parameter comments are allowed:
  18. {{{
  19. function getPerson(/**String*/ name, /**City*/ birthplace) {
  20. }
  21. }}}
  22. If you have a standard doc comment that refers to parameters, the type information from the inline comment will be merged with it.
  23. {{{
  24. /**
  25. @param name The name of the person.
  26. */
  27. function getPerson(/**String*/ name) {
  28. }
  29. }}}
  30. If 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.
  31. {{{
  32. /**
  33. @param {NameObject} name The name of the person.
  34. */
  35. function getPerson(/**String*/ name) {
  36. }
  37. }}}
  38. == See Also ==
  39. * The [TagParam @param] tag.