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 :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just wondering, if instead of jsDoc, we can use only *.d.ts files for the type-checking purposes same as the jsDoc comment
This will allow my code to be lightly coupled with type-system at the same time, allowing me the benefits of type-safety
To summarize: Idea is to have .ts / .js files without any typescript specific language construct, with only .d.ts files accompanying them
Anyone used it like this or any thoughts on this ?
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 :)