@option

  • constructor
documentjs.tags.option  

Details the properties of an object or the arguments of a function in a @param tag.

@option {TYPE} NAME [DESCRIPTION]

/**
 * Retrieves a list of orders.
 * 
 * @param {{}} params A parameter object with the following options:
 * @option {String} type Specifies the type of order.
 * @option {Number} [createdAt] Retrieves all orders after this 
 * timestamp. 
 *
 * @param {function(Orders.List)} [success(orders)] Filter order search 
 * by this date.
 * @option orders A list of [Orders] that match `params`.
 */
 find: function( params, success ) {

Parameters

  1. TYPE {TYPE-EXPRESSION}Optional

    A type expression. Examples:

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

    TYPE does not need to be specified for types that are already described in the option's corresponding function or object. For example:

    /**
     * @param {{type: String}} params A parameter object 
     * with the following options:
     * @option type Specifies the type of order.
     *
     * @param {function(Orders.List)} [success(orders)] Callback 
     * function.
     * @option orders A list of [Orders] that match `params`.
     */
    
  2. NAME {NAME-EXPRESSION}

    A name expression. Examples:

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

  3. DESCRIPTION {Markdown}Optional

    Markdown content that continues for multiple lines.