Edit: This is technically a 2-part question. I chose the best answer that covers the question as a whole and is related to the answer that handles the specific question.
What is the best way to document anonymous objects and functions with jsdoc?
var Page = function() { this.getPage = function(pageRequest, callback) { }; };
There is no PageRequest or callback object in the code. They will be provided by getPage() at runtime. But I would like to be able to determine what an object and function are.
I can get away with creating a PageRequest object to document that:
var PageRequest = { pageId : null, pageName : null };
And thatβs fine (although I am open to better ways to do this).
What is the best way to document a callback function? I want to inform in the document that, for example, the callback function looks like:
callback: function({PageResponse} pageResponse, {PageRequestStatus} pageRequestStatus)
Any ideas how to do this?
javascript tags documentation jsdoc
Josh Johnson Jul 03 '10 at 12:18 2010-07-03 12:18
source share