I have been looking for a way to have a common set of typescript files used in two projects. I am looking at having some basic interfaces and classes defined. One of the projects is node.js so using exports and modules is no problem.
The other is for a cloud based game backend that does not support modules.
I would like to able to use the same typescript interfaces in both projects. Preferably without duplicating files.
I have tried a few things and searched but no luck. I was hoping there was a to disable modules through typescript. I could not find anything that this would be possible due to way modules can be structured. I know my project is simple enough. And I could get by with just having interfaces if classes were issues.
I tried to put the base interfaces in a file. Then have a second one that exported them and had a <//reference> to the base definitions but this didn't seem to work. Gives errors about exports and local files. This fixed the one project because I could just use all /// but broke the node.js
If there was a directive like a C include I think it could be made to work.