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

Add TypeScript type declaration file #95

Merged
merged 1 commit into from
Sep 11, 2024
Merged

Conversation

Altareos
Copy link
Contributor

I am currently using this module in a TypeScript project (thank you for your work, btw), but the compiler wouldn't stop complaining about missing types.

Instead of having you rewrite the entire thing in TypeScript (#70), I have created a type declaration file that should be enough for the compiler to understand the types of your classes and functions when used in TS projects.

The comments are directly lifted from your code, with minor modifications.

@kewisch
Copy link
Owner

kewisch commented Sep 11, 2024

Thank you so much! I'll take this for now since some type are better than no types. I was hoping we could use the jsdoc approach so we don't have to maintain separate types. There was some discussion about the future of this project w.r.t. typescript in a separate issue.

@kewisch kewisch merged commit 8185923 into kewisch:main Sep 11, 2024
2 checks passed
@Altareos
Copy link
Contributor Author

You're very welcome! I'm not a big fan of the duplication either, but I didn't want to impose a TS build step to your publication process (and also I'm still not great with JSDoc). If anyone reading this wants to merge the types and source code, they'll be very welcome to!

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

Successfully merging this pull request may close these issues.

2 participants