Skip to content
Hugo Giraudel edited this page Jul 7, 2014 · 28 revisions

Name

Name of the documented item is self parsed, hence @name doesn't exist.

Description

Describes the documented item.

/**
 * Here is the description
 * On several lines if you will
 */

Notes:

  • Parsed as markdown.
  • Comes on top of a comment, before any annotation.

@access

Defines the access of the documented item.

/**
 * @access private
 * @access public
 */

Notes:

  • None is considered public.

@alias

Defines if the documented item is an alias of another item.

/**
 * @alias other-item
 */

Notes:

  • The other item will automatically have a key named aliased containing the name of aliases.

@author

Describes the author of the documented item.

/**
 * @author Author's name
 */

@datatype

Describes the type of a variable.

/**
 * @datatype Bool
 */
/**
 * @datatype Bool | String
 */

Notes:

  • Has no effect on functions and mixins

@deprecated

Defines if the documented item is deprecated.

/**
 * @deprecated
 */
/**
 * @deprecated Deprecation related message
 */

Notes:

  • Message is optional.
  • Message is parsed as markdown.

@example

Describes a use case for the documented item.

/**
 * @example
 * 4 + 2 = 6
 * 4 x 2 = 8
 */

Notes:

  • Multiple @example allowed on the same item.

@ignore

Defines a line which won't be documented.

/**
 * @ignore Message
 */

Notes:

  • Multiple @ignore allowed on the same item.

@link

Describes a link.

/**
 * @link http://some.url
 * @link http://some.url Optional caption
 */

Notes:

  • Caption is optional.
  • Multiple @link allowed on the same item.

@param (synonyms: @arg, @argument)

Describes a parameter of the documented item.

/**
 * @param {type | othertype} $name
 * @param {type} $name - description
 * @param {type} $name (default value) - description of the parameter
 */

Notes:

  • Default value is optional.
  • Description is optional.
  • Description is parsed as markdown.

@requires

Defines if the documented item requires any other item.

/**
 * @requires other-item
 * @requires {type} whatever
 */

Notes:

  • Default type is function. If the documented item requires anything else than a function, add {type} before the name, where type is either function, mixin or variable.
  • The other item will automatically have a key named usedBy containing the name of function requiring it.
  • Multiple @requires allowed on the same item.

@returns (synonym: @return)

Describes the return statement of the documented item.

/**
 * @returns {type | othertype}
 */
/**
 * @returns {type} Description of the return statement
 */

Notes:

  • Description is optional.
  • Description is parsed as markdown.

@since

Describes the version at which the documented item has been implemented.

/**
 * @since version 4.2 (alpha release)
 */

Notes:

  • Description is parsed as markdown.

@throws (synonym: @throw, @exception)

Describes the error thrown by the documented item.

/**
 * @throws Error related message
 */

Notes:

  • Description is parsed as markdown.
  • Multiple @throws allowed on the same item.

@todo

Defines any task to do regarding the documented item.

/**
 * @todo Task to be done
 */

Notes:

  • Description is parsed as markdown.
  • Multiple @todo allowed on the same item.
Clone this wiki locally