Typescript compiler errors when turning on node.d.ts

I recently started switching the PHP form to Node.js, and since I'm a big Typescript fan, I use Typescript + Node.js. I had a very good sample when I started building up and really creating my code. But then I ran into problems. Whenever Node.d.ts is referenced (with reference to a doc comment) in one of my .ts files, the Typescript compiler in Node.js complains about duplicate definitions. Two of my .ts files complain about the lack of Node.d.ts parameters, but not in my main.js file. (Files below :)

search_request.ts

/// <reference path="definitions/mustache.d.ts" />

import url = module("url");
import mu = module("mu2");

export function handler(request, response) {
    //code..
}

main.ts

/// <reference path="servers/search_request.ts" />

import search_request = module("./servers/search_request");
import express = module("express");

var app = express();

app.get("/search.html", search_request.handler);
app.listen(3000);

<reference path="node.d.ts" /> search_request.ts, . , . , , main.ts .

Typescript, Node.js tsc , VS2012. ? Node.d.ts lib.d.ts? , search_request.ts?

+5
2

, , . , : node.d.ts ( express.d.ts). :

C:\Project
   -node.d.ts
   \public
      -main.ts
      \definitions
         -node.d.ts

, main.ts / node.d.ts. - node (, , tsc) node.d.ts, main.ts. , , , .

+3
/// <reference path="servers/search_request.ts" />

import search_request = module("./servers/search_request");
import express = module("express");

reference , .d.ts, import export.

, reference search_request.ts.

+2

All Articles