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 typings for Hyperswarm #56

Closed
wants to merge 4 commits into from
Closed

Add typings for Hyperswarm #56

wants to merge 4 commits into from

Conversation

JonasKruckenberg
Copy link

@JonasKruckenberg JonasKruckenberg commented Apr 3, 2020

Here we go. This aims to resolve #55. Basic Types for all the classes. A few descriptions are still missing, but maybe we get that sorted out, I also marked all the methods starting with an underscore as private, not sure if that's right or not.
Maybe you can also complete some of the method and property descriptions since you know much better what they're supposed to do.
Maybe don't merge this yet though, we should wait with this until all the Hyperswarm dependencies have typings right?

"dependencies": {
"@hyperswarm/network": "^1.2.0",
"shuffled-priority-queue": "^2.1.0",
"utp-native": "^2.1.3"
},
"devDependencies": {
"@hyperswarm/dht": "0.0.1",
"@types/node": "^13.11.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed and how do you make sure it's up to date with all active Node versions?

@JonasKruckenberg
Copy link
Author

It’s for the type definitions of classes taken from nodejs like EventEmitter and Socket, as they’re not defined otherwise.
Keeping them compatible with all LTS versions and versions going forward should not be that big of a deal since both interfaces are stable and did not change since version 8 ( as far as i can tell ) so no problem there.

@mafintosh
Copy link
Contributor

Closing for now as we did tons of updates! @kasperisager maybe this could act as a foundation for our typings?

@mafintosh mafintosh closed this Oct 14, 2021
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.

Typescript support / docs
3 participants