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

TypeScript definitions in repo do not match with latest version on npm #28

Closed
alexlawrence opened this issue May 3, 2020 · 4 comments
Closed

Comments

@alexlawrence
Copy link

Expected behavior

When installing the latest version of @use-it/event-listener from npm, the TypeScript definitions should be the same as in the latest repo version (7fd6e56#diff-88bec6beae84369c0376b56b3bb88fe1).

Actual behavior

When installing @use-it/event-listener@0.1.3 from npm, the package contains older TypeScript definitions (8494f30#diff-88bec6beae84369c0376b56b3bb88fe1). On top of that, it seems to me that they are incorrect. Since the hook uses a native host functionality to subscribe to DOM events, the type for a received should not be SyntheticEvent.

Resolution

Is it possible to release a newer version to npm with the updated TypeScript definitions?

@srmagura
Copy link
Collaborator

srmagura commented May 3, 2020

Hey Alex, unfortunately, it has been this way for a while. I've been trying to contact the maintainer, @donavon for around 2 months now.

I will publish my fork on npm later today. In the meantime, you could use some ugly type assertions to get your code to compile.

@alexlawrence
Copy link
Author

Thanks for the fast answer @srmagura ! Ah, I didn't know there was an issue with the maintenance of this project. No worries about npm publishing though. For the time being, I simply do a cast to any, which gets around the problem.

@srmagura
Copy link
Collaborator

srmagura commented May 4, 2020

Sounds good.

For anyone else looking at this, I have published the project with up-to-date TypeScript definitions at @srmagura/use-event-listener.

@srmagura srmagura pinned this issue May 4, 2020
@donavon
Copy link
Owner

donavon commented Jul 23, 2020

deployed to npm as @use-it/event-listener@0.1.4

@donavon donavon closed this as completed Jul 23, 2020
@donavon donavon unpinned this issue Nov 27, 2020
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

3 participants