How do I split my module across multiple files in Typescript with node.js

后端 未结 3 1848
时光说笑
时光说笑 2020-12-28 12:29

It seems that the information on how to actually structure code when writing Typescript is next to non-existent.

I want to make a server in node. It has external dep

3条回答
  •  梦毁少年i
    2020-12-28 13:23

    Multi-file external modules are not supported yet in TypeScript.

    For module structuring recommendations, this page has a good rundown of the options. In particular, if you have exactly one class per file, you can use export = so that the second line of code in your example would simply be var vec = new vector();, which would be reasonably straightforward.

提交回复
热议问题