Advertisement
nordlaender

Untitled

Dec 29th, 2012
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. <lhk_>there's another problem that I have with typescripts declaration files
  2. <lhk_>maybe you could take a look at it ?
  3. <jden>I can try
  4. <lhk_>http://stackoverflow.com/questions/14083427/using-nodejs-with-typescript
  5. <lhk_>I'm importing the .d.ts for nodejs
  6. <lhk_>and VisualStudio marks a lot of errors
  7. <lhk_>basically complaining that a private interface is extended
  8. <jden>.d.ts files are like C headers, a combination of interface definitions and `declare` statements
  9. <jden>let me fire up a vm with visual studio and have a look
  10. <lhk_>jden, I've taken a look at node.d.ts
  11. <lhk_>i think i coud create the .d.ts for socket.io
  12. <lhk_>but this error with the private interfaces, I don't understand it
  13. <lhk_>thanks for your efforts
  14. <lhk_>it's really great, that i've finally found someone who can help
  15. <lhk_>here's a pastebin
  16. <lhk_>http://pastebin.com/Q4E3mw2z
  17. <lhk_>the final line is marked red by VS2012
  18. <lhk_>the error message is
  19. <lhk_>"exported interface 'Server' extends interface from private module 'events'"
  20. <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
  21. <lhk_>I'll try that right now
  22. <lhk_>hm, that will take some setup time, since I have neither codeplex nor mongodb
  23. <lhk_>there's a simple example, too
  24. <lhk_>ill use that
  25. <jden>hmm, I got it working without issue
  26. <jden>https://gist.github.com/4409621
  27. <jden>exact steps: Visual Studio -> new project -> HTML application with TypeScript template. Open command line, cd to project directory, run `tsd install node`
  28. <jden>then using the code in that gist, had full intellisense & could compile w/o errors
  29. <lhk_>ill try it
  30. <lhk_>you are right, it works
  31. <lhk_>I downloaded the gist, compiled HttpServer and fired up node
  32. <lhk_>no error
  33. <lhk_>ill try to use this node.d.ts in my typescript project
  34. <lhk_>one moment
  35. <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.
  36. <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
  37. <lhk_>this already is the .d.ts file installed by tsd
  38. <lhk_>the error occurs in this line
  39. <lhk_>export interface ServerResponse extends http.ServerResponse {
  40. <lhk_>and the error message is:
  41. <lhk_>"exported interface 'ServerResponse' extends interface from private module 'http'"
  42. <lhk_>really I don't get it
  43. <lhk_>at first this error was in node.d.ts, too
  44. <lhk_>although nothing is marked as private
  45. <lhk_>then i switched to the node.d.ts from microsofts typescript sample and the error just vanished
  46. <lhk_>now this line was valid
  47. <lhk_>export interface Server extends events.NodeEventEmitter{
  48. <lhk_>but the error persisted in express-3.0.d.ts
  49. <lhk_>which just seems completely arbitrary
  50. <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
  51. <lhk_>WHY ???
  52. <lhk_>jden sorry that this takes so long, but I really don't know how to fix the error
  53. <jden>hmm, I don't really understand TS's attempt to introduce public/private.
  54. <lhk_>me neither
  55. <lhk_>i will create an issue on the typescript codeplex project
  56. <lhk_>may I add a link to a copy of our conversation ?
  57. <jden>sure
  58. <lhk_>thanks, do you have any idea left, that I could try ?
  59. <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
  60. <lhk_>hm. These errors are the worst kind of errors
  61. <jden>could you paste the code that's giving you the errors in a gist?
  62. <lhk_>sure
  63. <lhk_>one moment
  64. <lhk_>I've created a pastebin
  65. <lhk_>here's how I produce the error
  66. <lhk_>cd to an empty folder
  67. <lhk_>tsd install node
  68. <lhk_>tsd install express
  69. <lhk_>open the express-3.0.d.ts in VS2012 and change the reference path to point to node-0.8.d.ts
  70. <lhk_>then the file is found
  71. <jden>k, gotta run
  72. <jden>I'll check in later
  73. <lhk_>here's the pastebin
  74. - jden hat sich zu jden}away umbenannt
  75. <lhk_>http://pastebin.com/93Srp4M5
  76. - jden}away hat sich zu jden|away umbenannt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement