• constructor

@param DocumentJS.tags.param

 

@param {TYPE} NAME [DESCRIPTION]

/**
 * Finds an order by id.
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter order search by this date.
 */
 findById: function( id, success ) {

Use @param within a [documentjs/tags/function @function] comment block or after a [documentjs/tags/signature @signature] tag.

Parameters

  1. TYPE {TYPE}

    A type expression. Examples:

    {String} - type is a String.
    {function(name)} - type is a function that takes one name argument.

    Use [documentjs/tags/option @option] to detail a function's arguments or an object's properties.

  2. NAME {NAME(name, [], (args...), '...', =default)}

    A name expression. Examples:

    age - age is item.
    [age] - age is item, age is optional.
    [age=0] - age defaults to 0.

Adds parameter information to a [documentjs/tags/function @function] or [documentjs/tags/signature @signature].

@param within a function comment

If using a comment preceeds a function like ...

/**
 * Finds an order by id.
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter order search by this date.
 */
 findById: function( id, success ) {

... DocumentJS will automatically make the comment's DocObject type a function and create params with just names (in this case id and success).

The comment's @params tags should use the same names as the function. Any params that specifies a name that isn't present is added at the end of the arguments.

@param within a signature

Use @param to specify the params in a signature.

/**
 * Finds an order by id.
 * 
 * @signature `Order.findById(id=0,[success])`
 * 
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter order search by this date.
 */
findById: function( id, success ) {

When a @signature is used, any params automatically created from code are overwritten.