Skip to content
This repository

Callback tag/type #33

Open
spocke opened this Issue · 1 comment

3 participants

Johan Sörlin Gabriel Llamas Dav Glass
Johan Sörlin
spocke commented

It would be nice to be able to document function callbacks and reference these from functions like this.

/**
 * My function.
 *
 * @method myMethod
 * @param {MyCallback} callback A callback to be executed.
 */

/**
 * A callback.
 *
 * @callback MyCallback
 * @param {String} myString Some string.
 */
Gabriel Llamas

I also think this would be nice...

Currently for callback parameters I use helpers that applies the same css:

@param {Function} cb Callback to notify the result.

It receives one parameter:

* error {{#Object}}{{/Object}}  
Error or <code>null</code>.

result: http://image.gxzone.com/images/f/d/fdb05564fe5.png

helpers:

var def = function (type){
    module.exports[type] = function (){
        return "<a target='_blank' class='crosslink external type' style='border-bottom: 1px do" +
                "tted #AFAFAF' onmouseover='this.style.borderBottom = \"\";' onmouseout='this.s" +
                "tyle.borderBottom = \"1px dotted #AFAFAF\";' href='https://developer.mozilla.o" +
                "rg/en/JavaScript/Reference/Global_Objects/" + type + "'>" + type + "</a>";
    };
};

module.exports = {};
def ("Array");
def ("Boolean");
def ("Date");
def ("Function");
def ("Iterator");
def ("Number");
def ("Object");
def ("RegExp");
def ("String");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.