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 support / docs #55

Open
JonasKruckenberg opened this issue Mar 31, 2020 · 6 comments
Open

Typescript support / docs #55

JonasKruckenberg opened this issue Mar 31, 2020 · 6 comments

Comments

@JonasKruckenberg
Copy link

I really like this module, I love that it is way simpler to use and understand than many other solutions out there. But I wish it would work better with typescript and all the other tooling out there.
That's why I started working on 'porting' Hyperswarm to typescript on my fork, it's not yet complete and I'm probably also not the best typescript dev in existence, but it's a starting point that I use in my project.
Since I think other users of the module might benefit from stuff that I've been doing i.e. typings, docs, etc. I thought I ask you what the wisest thing to do would be.
Are you open to accepting a .d.ts file PR? Or should my fork be kept separate?
I've generated a bit of WIP docs from the code as well, maybe that can be put to use somehow.
I'm here to help make this module more accessible if that's possible!
Cheers!

@JonasKruckenberg JonasKruckenberg changed the title Typescript support Typescript support / docs Mar 31, 2020
@davidmarkclements
Copy link
Contributor

hey @JonasKruckenberg would you be willing to maintain a d.ts file long term?

I personally think d.ts files are great with just normal JS because of the intellisense benefits and ease integration for those who do use typescript. The only issue is that TypeScript moves forward as a language quite quickly so the d.ts files can quickly become outdated, not because of breaking library changes but because of breaking TypeScript changes. This is what I found with Pino anyway, eventually we removed the d.ts file as it became too contentious.

But if you're okay to commit to maintaining d.ts files each of the hyperswarm modules then I'm +1 on accepting a PR for a d.ts file on each repo

@JonasKruckenberg
Copy link
Author

JonasKruckenberg commented Apr 3, 2020

Yeah I think the majority of the work isn’t to maintain the typings but to create them in the first place, so yeah I‘m willing to maintain the typings long term. I’d could use some help creating explanations for the functions though, but I can count on your help there right?

What modules are you considering part of Hyperswarm that are worth getting typings? Hyperswarm, Discovery, Network, Dht and replicator are ones I was thinking of 🤔

Edit:
Maybe also Hypercore should get typings in the long term, would be useful for the replicator repo, but that’s big task 😅

@robbiemu
Copy link

robbiemu commented Mar 6, 2023

this still is a wanted feature!

robertotomas@MacBook-Pro-2 ttt-p2p % yarn add --dev @types/hyperswarm
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@types%2fhyperswarm: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/robertotomas/Public/ttt-p2p/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@deanpress
Copy link

+1 for typescript support!

@eL1x00r
Copy link

eL1x00r commented Jan 26, 2024

guys big thing, wen ?

@Swepool
Copy link

Swepool commented Mar 18, 2024

Any plans for this?

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 a pull request may close this issue.

6 participants