I do not know of any agreements for this. I would just use:
@param {Function} Called on success with the response (string) as the first param and the status code (int) as the second
I know this is pretty verbose.
Another option would do it this way (similar to how jQuery does it, not in the code I know about, but in their documentation)
@param {Function} onSuccess(response, statusCode)
Here is an example http://api.jquery.com/jQuery.ajax/ This, of course, differs in that it is an options object, and the documentation has a different structure than the built-in documentation. But look at the callbacks and you will see the similarities.
For clarity, it is also much better to use a callback (response, statusCode) than callback (string, int). If you need to choose the one that is. The value before the type.
source share