DEV Community

Discussion on: Generating TypeScript Definition Files from JavaScript

Collapse
 
dakmor profile image
Thomas Allmer

this is actually typescripts main use case it gets compiled to .js + d.ts files which you then publish.
e.g. even full typescript project have "only" js in their node_modules folder.

often these .js files are accompanied by d.ts files or there is a dedicated package @types/packageName.

So in short yes manually writing js and declaration files for it certainly works as well :)