Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <lhk_>there's another problem that I have with typescripts declaration files
- <lhk_>maybe you could take a look at it ?
- <jden>I can try
- <lhk_>http://stackoverflow.com/questions/14083427/using-nodejs-with-typescript
- <lhk_>I'm importing the .d.ts for nodejs
- <lhk_>and VisualStudio marks a lot of errors
- <lhk_>basically complaining that a private interface is extended
- <jden>.d.ts files are like C headers, a combination of interface definitions and `declare` statements
- <jden>let me fire up a vm with visual studio and have a look
- <lhk_>jden, I've taken a look at node.d.ts
- <lhk_>i think i coud create the .d.ts for socket.io
- <lhk_>but this error with the private interfaces, I don't understand it
- <lhk_>thanks for your efforts
- <lhk_>it's really great, that i've finally found someone who can help
- <lhk_>here's a pastebin
- <lhk_>http://pastebin.com/Q4E3mw2z
- <lhk_>the final line is marked red by VS2012
- <lhk_>the error message is
- <lhk_>"exported interface 'Server' extends interface from private module 'events'"
- <jden>ah - I'm fumbling around in VS right now, sorry I'm not much help. In the mean time have you tried running the example with node? http://typescript.codeplex.com/SourceControl/changeset/view/2bee84410e02#samples/imageboard/README.txt
- <lhk_>I'll try that right now
- <lhk_>hm, that will take some setup time, since I have neither codeplex nor mongodb
- <lhk_>there's a simple example, too
- <lhk_>ill use that
- <jden>hmm, I got it working without issue
- <jden>https://gist.github.com/4409621
- <jden>exact steps: Visual Studio -> new project -> HTML application with TypeScript template. Open command line, cd to project directory, run `tsd install node`
- <jden>then using the code in that gist, had full intellisense & could compile w/o errors
- <lhk_>ill try it
- <lhk_>you are right, it works
- <lhk_>I downloaded the gist, compiled HttpServer and fired up node
- <lhk_>no error
- <lhk_>ill try to use this node.d.ts in my typescript project
- <lhk_>one moment
- <lhk_>after copying the node.d.ts from the sample node application to my node application, i opened it in VisualStudio and there were no errors at all. I was glad, that the problem seemed solved but at a first glance there were no differences between the two versions.
- <lhk_>I modified the other type declarations, the .d.ts files for express and socket.io to point to the new node.d.ts but in express-3.0.d.ts there's still the strange error
- <lhk_>this already is the .d.ts file installed by tsd
- <lhk_>the error occurs in this line
- <lhk_>export interface ServerResponse extends http.ServerResponse {
- <lhk_>and the error message is:
- <lhk_>"exported interface 'ServerResponse' extends interface from private module 'http'"
- <lhk_>really I don't get it
- <lhk_>at first this error was in node.d.ts, too
- <lhk_>although nothing is marked as private
- <lhk_>then i switched to the node.d.ts from microsofts typescript sample and the error just vanished
- <lhk_>now this line was valid
- <lhk_>export interface Server extends events.NodeEventEmitter{
- <lhk_>but the error persisted in express-3.0.d.ts
- <lhk_>which just seems completely arbitrary
- <lhk_>why would a module called http be public in node.d.ts and all of a sudden private in express-3.0.d.ts
- <lhk_>WHY ???
- <lhk_>jden sorry that this takes so long, but I really don't know how to fix the error
- <jden>hmm, I don't really understand TS's attempt to introduce public/private.
- <lhk_>me neither
- <lhk_>i will create an issue on the typescript codeplex project
- <lhk_>may I add a link to a copy of our conversation ?
- <jden>sure
- <lhk_>thanks, do you have any idea left, that I could try ?
- <jden>Well, I `tsd installed` the d.ts files for express and socket.io, and I'm playing around with them, and I can't reproduce the error you're seeing
- <lhk_>hm. These errors are the worst kind of errors
- <jden>could you paste the code that's giving you the errors in a gist?
- <lhk_>sure
- <lhk_>one moment
- <lhk_>I've created a pastebin
- <lhk_>here's how I produce the error
- <lhk_>cd to an empty folder
- <lhk_>tsd install node
- <lhk_>tsd install express
- <lhk_>open the express-3.0.d.ts in VS2012 and change the reference path to point to node-0.8.d.ts
- <lhk_>then the file is found
- <jden>k, gotta run
- <jden>I'll check in later
- <lhk_>here's the pastebin
- - jden hat sich zu jden}away umbenannt
- <lhk_>http://pastebin.com/93Srp4M5
- - jden}away hat sich zu jden|away umbenannt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement