Atmosphere packages with typescript definitions?

I’ve converted one of my atmosphere packages to typescript, but I still get this warning:

image

I’ve put an index.d.ts file in my package folder. Is there a way to get added to node_modules/@types/meteor automatically, or any other way to get it picked up by VS Code automatically so users of the package don’t have to manually install the type definitions?

Thanks!

1 Like

would also like to hear a solution. @wildhart did you find anything?

Sadly, atmosphere packages don’t support TS type defs yet (not even for built in TS packages like react-meteor-data). You’ll need to add a separate NPM package, maybe in definitely typed, or another npm package.

No, I couldn’t find any solution. I ended up manually copying the definition file into my own @types folder.

Worth raising an issue on Meteor? I found this stale issue: How to declare "meteor.d.ts or index.d.ts" in meteor package? · Issue #10828 · meteor/meteor · GitHub

And this closed issue, but I haven’t had time to digest it yet: [1.3] - How to prevent TypeScript from marking the `meteor/PACKAGE_NAME` imports as error? · Issue #6177 · meteor/meteor · GitHub

would be cool in a meteor-style that if you would add api.use("typescript") (and some tsconfig maybe), it would automatically create a definition file for all exported properties.

1 Like