Can I convert TypeScript file to JavaScript file with JSDoc?
For example, if I have this main.ts file:
let x: string = "hello";
// This could be number or array of numbers
let y: number | number[];
It will be converted to something like this main.js file:
/**
* @type {string}
*/
let x = "hello";
/**
* This could be number or array of numbers
* @type {number | number[]}
*/
let y;
And so on.
Is there a way to do that?
Thank you!
Based on the description of this tool it could be useful for you since it seems to do exactly what you need, i.e. transpile TypeScript into plain ES code with JSDoc comments - have a look here:
https://github.com/SoftwareBrothers/better-docs#examples