I need to write a server in TypeScript and Node.
- I downloaded Node from DefinitelyTyped repository
- I created my typescript file
- Imported the definition
- Tries to use it
The result is:
/// <reference path="definitions/commonjs.d.ts" />
/// <reference path="definitions/node.d.ts" />
var http = require("http");
namespace MyProj {
export class Server {
public run() {
var server = http.createServer(); // TypeScript does not recognize 'http'
}
}
}
But I cannot understand how I can reference the http module. Where can I find the types? In the definition file i am having hard time recognizing this information.