I'm trying to specify the types of req and res, to get intellisense to work on the parameters as I'm trying to illustrate below, but I'm not sure how to accomplish it.
var http = require('http');
http.createServer(foo).listen(8081);
/**
* @? ? ?
*/
function foo(req, res) {
req.<intellisense context menu>
}
I've looked through some of the documentation at https://github.com/Microsoft/TypeScript/wiki/JavaScript-Language-Service-in-Visual-Studio and https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript, but don't know if this is even possible. I'm a beginner at javascript, can somebody point me in correct direction?
Bonus question: How can I make this work also if foo is in another module/file, and that module doesn't in itself require('http')?