Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Closed Unassigned: Node.js with TypeScript: calling node.js function instead of standard [984]

$
0
0
please help me with the following problem. I created default node.js app with express using Visual Studio nodejs tools and now I'm trying to call setTimeout function that is declared in node.d.ts. The code is like this:

```
var timer: NodeTimer;
timer = setTimeout(somecallback, 1000);
```
But the code doesn't compile saying 'Cannot convert 'Number' to 'NodeTimer''

As I understand, the problem is that it takes standard setTimeout function instead of taking the one from node.d.ts.

I tried specifying the reference to node.d.ts with \\\<reference> tag - this doesn't help. How can I state explicitly that I want to use setTimeout from node.d.ts?
Comments: http://stackoverflow.com/questions/23653113/node-js-with-typescript-calling-node-js-function-instead-of-standard/

Viewing all articles
Browse latest Browse all 4630

Trending Articles