Using TypeScript inside Meteor packages?

It’s great that Meteor has official TypeScript support now, but as a complete TypeScript newbie myself I find the lack of info about the topic a bit scary… Especially since a lot of the info that does exist out there seems outdated.

More specifically, I’m wondering if there are any examples or guides about using TypeScript inside Meteor packages. I get how you’d define a TypeScript type inside your package code, but then what? Do you just export your functions as you usually would? Or do you need to explicitly export your types as well? What about inside your app code? Is there additional steps needed to enable auto-complete inside VS Code based on those type definitions?

Sorry if those seem like basic questions, any help will be much appreciated!

4 Likes

I just made my first typescript package today!
Inside the package, it just works.
Outside the package, it only gave me very basic intellisense about function arguments with the type name, but no type definition or checking in JS.
Still need to test with a ts file outside the package

Ran into this issue as well meteor#10828, since it seems typescript has trouble parsing the meteor/author:package paths

Thanks for pointing me to that issue!