How to document overloaded methods in YuiDoc?

122 Views Asked by At

Lets say I have a method on a class, foo, with a method, bar, that accepts all optional parameters, but if the parameters and order are changed, the method's return value changes significantly.

var foo = {

    bar: function (param1, param2) {
        if (typeof param1 === 'object' && param2) {
           //do something and return something
        }
        if (typeof param1 === 'boolean') {
           //do something a little different
        }
    }

}

How can I represent the different ways of calling this method in yuidoc?

optional params are ok, but the method description becomes a bit long if I just put it all in there.

0

There are 0 best solutions below