mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-21 04:51:33 +00:00
chore: config types and dependencies update (#904)
BREAKING CHANGES: top level types were updated, multiaddr@9.0.0 is used, dialer and keychain internal property names changed and connectionManager minPeers is not supported anymore
This commit is contained in:
@ -1,12 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
// Pubsub adapter to keep API with handlers while not removed.
|
||||
/**
|
||||
* @typedef {import('libp2p-interfaces/src/pubsub').InMessage} InMessage
|
||||
* @typedef {import('libp2p-interfaces/src/pubsub')} PubsubRouter
|
||||
*/
|
||||
|
||||
// Pubsub adapter to keep API with handlers while not removed.
|
||||
/**
|
||||
* @param {import("libp2p-interfaces/src/pubsub")} PubsubRouter
|
||||
* @param {import('.')} libp2p
|
||||
* @param {{ enabled: boolean; } & import(".").PubsubLocalOptions & import("libp2p-interfaces/src/pubsub").PubsubOptions} options
|
||||
*/
|
||||
function pubsubAdapter (PubsubRouter, libp2p, options) {
|
||||
// @ts-ignore Pubsub constructor type not defined
|
||||
const pubsub = new PubsubRouter(libp2p, options)
|
||||
pubsub._subscribeAdapter = pubsub.subscribe
|
||||
pubsub._unsubscribeAdapter = pubsub.unsubscribe
|
||||
|
Reference in New Issue
Block a user