network icon indicating copy to clipboard operation
network copied to clipboard

fix(network, DHT): stricter typing for event listeners in interfaces

Open juslesan opened this issue 1 year ago • 0 comments

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.

juslesan avatar Apr 23 '24 12:04 juslesan