I am the author of a popular JavaScript module that is published on npm. For various reasons, I want the module itself to continue to be vanilla, uncompiled JavaScript. That said, my project is used by many TypeScript projects and some power users of the module have created type definitions for my module and published them on DefinitelyTyped.
I am wondering about the following:
-
Is it best to publish type definitions to the JavaScript (TypeScript) module itself, or is it best to publish to DefinitelyTyped? If there is no definitive answer, what are the advantages/disadvantages to each approach?
-
How do I as a JavaScript developer go about creating (following e.g. How do I add TypeScript types to a JavaScript module without switching to TypeScript?) and CI-testing type definition files in a JavaScript project? In particular, how do I make sure that the syntax is correct?
5