-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Support #23
Comments
Appreciate the suggestion :). I believe we have pretty good support for the three elements you listed with JSDoc, with the added benefits of not having a build step and being able to copy/paste code in the REPL. |
Ahh, I was involved with porting warcio.js to TypeScript, and was looking into doing the same here :)
Unfortunately, if you are looking to target browsers in #14, you will still need a build step with babel for backwards compatibility
ts-node features a TypeScript REPL environment While JSDoc can be used for type information, you will likely need In addition, I find that TypeScript syntax less verbose and more readable than JSDoc, and more developers are familiar with TypeScript than JSDoc. |
I understand :). An additional factor is that we are developing and maintaining multiple JavaScript + JSDoc codebases at the moment, so this is where we are focusing our efforts on. It is therefore unlikely we'll port to TypeScript anytime soon, but I'm happy to revisit further down the road if either of those things change. PS: Also happy to consider adding |
I bring up the To reproduce, try these steps from the TypeScript documentation:
{
// Change this to match your project
"include": ["./**/*"],
"exclude": ["./dist"],
"compilerOptions": {
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
"allowJs": true,
// Generate d.ts files
"declaration": true,
// This compiler run should
// only output d.ts files
"emitDeclarationOnly": true,
// Types should go into this directory.
// Removing this would place the .d.ts files
// next to the .js files
"outDir": "dist",
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
}
} If you are open to it, I am expecting to have time in the upcoming months to convert this library to TypeScript 😄 |
Benefits of native TypeScript include:
The underlying library warcio.js was also recently ported to TypeScript.
The text was updated successfully, but these errors were encountered: