I'm learning TypeScript, and I'm afraid I'm biting more than I can chew. I've found tutorials & examples for
- having a file with string constants in a module, then using it from every ts file
- configuring the compiler to create modules ready to use with RequireJS, and using the import and module keywords in TypeScript
- extending jQuery interface in TypeScript, then writing the plugin code in TS
But I just can't get it working all at once.
I have 3 files, all containing separate jQuery plugins, yet sharing some constants.
I have separate ts files for all pages using these. I want to reference these per-page TS files in my cshtml as <script data-main="app/this-page" type="text/javascript" src="lib/require.js"></script>, and have this-page say something like "import my plugin, then $("#someId").runMyPlugin(someSettings);"
Can anyone recommend me an approach? What should say export? what should I import? what goes in one class?