network
network copied to clipboard
fix(network, DHT): stricter typing for event listeners in interfaces
Summary
Stricter listener typing for events in the ITransport and Layer1Node interfaces.
It is no longer possible to set a listener with an inproper listener function for example:
layer1Node.on('manualRejoinRequired', (peerDescriptor: PeerDescriptor) => {})
will now be caught by the compiler.
Changes
- DhtNode no longer export an Events type. It now only exports a DhtNodeEvents type that includes DhtNode and ITransport specific events.