-
Notifications
You must be signed in to change notification settings - Fork 446
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
libp2p (and friends) index.d.ts for TypeScript #208
Comments
Is there any update on this? |
We have basic typings (very, very, very rough linked above), which does the trick for our stuff internally. The discussions elsewhere was that the libp2p JS side will probably go towards flowtype and at that point may look at auto-generation of the I cannot comment for the libp2p project if this is something that may be entertained at some point or not. |
I'd like to vote up for TypeScript and down on 'flow'. |
I'm not opposed to including the TypeScript bindings in each of the libp2p projects, my main concern is ensuring they are kept up to date and automatically verifiable. I have not spent much time with TypeScript as of yet to understand how we could go about making sure these are always accurate. What tests can we run on CI to ensure these are up to date? cc: @Mikerah |
There are several options. The one I'm currently using is to use Polkadot-js's type definitions for libp2p. For odd reasons, I am having difficulties with this. The other option is to provide accurate JSDocs for all js-libp2p code and generate typescript definition files from those. I found this package that does this. |
Not sure if it's contributing but the recent version of libp2p includes changes that aren't yet reflected there. This is one of the things I'd like to be able to avoid if we include the definitions in the modules. We're working on improving JSDocs across libp2p and it's easy enough for us to keep those up to date. Being able to generate from JSDocs could be a reasonable path to getting support added. |
Hey guys, did any more types get published, any progress on this issue? |
@patwhite, For our ETH2 client, what we do is set the types ourselves. This does require familiarity with libp2p. We didn't create |
We released |
Type: Question
Severity: Very Low
Description:
I've been starting with TypeScript definitions, https://github.com/polkadot-js/ts/blob/master/types/libp2p/index.d.ts - these are exceptionally early, ugly, hacky, untested with still some way to go.
My question is the following: would be be appropriate to make a PR across the js-libp2p repos to add these as they are actually ready and usable or is there no appetite to have these single-definitions-per-repo included?
(Alternatively could submit them to the community DefinitelyTyped repo, but it is better if they are in the source, i.e. just installing the library allows you to use it with TS projects).
The text was updated successfully, but these errors were encountered: