js-libp2p
js-libp2p copied to clipboard
Followup: Types
https://github.com/libp2p/js-libp2p/pull/802 has deliberately opt-ed out couple of modules from TS checking with an intent to address that in followups. This is an issue to track that effort.
What are we missing / What is next?
- [ ] https://github.com/libp2p/js-libp2p/pull/831
- [ ] Event Emitters
- @Gozala created https://www.npmjs.com/package/typed-events.ts for the EventEmitter typedefs ❤️ . After syncing with him, we might want to get the declaration file from there in and use https://www.npmjs.com/package/proper-event-emitter per https://github.com/libp2p/js-libp2p/pull/761 (we also have emittery and some modules and we need to double check ig we should just use it).
- [ ] Improve Circuit Message definitions
- https://github.com/libp2p/js-libp2p/pull/831#issuecomment-742494373
- [ ] DHT should have typedefs for its options
- [ ] Metrics and Latency monitor needs to be finished (currently @ts-nocheck)
- [ ] Keychain (currently @ts-nocheck)
- Needs https://github.com/ipfs/interface-datastore/pull/56 + keychain types
- [ ] Configuration Options
- Probably together with https://github.com/libp2p/js-libp2p/issues/576
Thanks @Gozala ! Just added a checklist of things that need to be done in follow up
I found that the Libp2pModules type for the config is missing keys for peerDiscovery and dht.
Yes, thanks for adding that! We still need to create interfaces for peerDiscovery, peerRouting and so on to add the types here. For now they should be accepted as any while we finish that
Has anyone started working on the types for DHT etc? If not, I plan on creating a PR for these today.
Hey @peterbraden
Thanks for reaching out. It is not released yet but we just got types for the DHT per https://github.com/libp2p/js-libp2p-kad-dht/pull/214 This does not include integration of the DHT config types in libp2p core as this issue is tracking.
You can see the broad state of types in https://github.com/libp2p/js-libp2p/issues/659 . If you would like to help out in any other module let me know
Ah, awesome, thanks for getting back to me so quickly!
I'll try these out locally, and get back to you if there are any other modules we use that I can contribute to.
I found that the
Libp2pModulestype for the config is missing keys forpeerDiscoveryanddht.
It is also missing the key for pubsub.
If someone would like to help getting this to the finish line would be super helpful
@achingbrain @wemeetagain @maschad is this related to https://github.com/multiformats/js-multiformats/issues/249 ?
This can be closed