Skip to content
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

JSDoc for types #3

Closed
david-luna opened this issue Aug 16, 2023 · 4 comments
Closed

JSDoc for types #3

david-luna opened this issue Aug 16, 2023 · 4 comments

Comments

@david-luna
Copy link
Owner

As an exercise on the type system and to remove the tsc build step it is possible to replace the TypeScript grammar in favor of adding JSDoc comments. VSCode supports it so we should not loose any type metadata.

Also check if possible to generate an index.d.ts file from the JSDoc info.

@david-luna
Copy link
Owner Author

Tip for method overloading

microsoft/TypeScript#25590 (comment)

@david-luna
Copy link
Owner Author

The heavy usage of type parameters and arguments makes it not possible, yet. JSDoc support from TS is not wide in terms of generic types https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html

To be reviewed after a while

@david-luna
Copy link
Owner Author

david-luna commented Nov 12, 2023

Revisit this based on the tip explained in this article
https://dev.to/manuartero/type-hints-on-pure-js-files-8ee

The idea is to have a pure js lib but exporting types and also using the internally. So there is no need for source maps and also will give more control to bundlers

@david-luna david-luna reopened this Nov 12, 2023
@david-luna
Copy link
Owner Author

done in https://github.com/david-luna/basol/releases/tag/0.5.0. Also moved to ESM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant