libp2p
Version:
JavaScript implementation of libp2p, a modular peer to peer network stack
30 lines • 1.19 kB
TypeScript
import type { Address } from '@libp2p/interface';
/**
* Sorts addresses by order of reliability, where they have presented the fewest
* problems:
*
* TCP -> WebSockets/Secure -> WebRTC -> WebRTCDirect -> WebTransport
*/
export declare function reliableTransportsFirst(a: Address, b: Address): -1 | 0 | 1;
/**
* Compare function for array.sort() that moves loopback addresses to the end
* of the array.
*/
export declare function loopbackAddressLast(a: Address, b: Address): -1 | 0 | 1;
/**
* Compare function for array.sort() that moves public addresses to the start
* of the array.
*/
export declare function publicAddressesFirst(a: Address, b: Address): -1 | 0 | 1;
/**
* Compare function for array.sort() that moves certified addresses to the start
* of the array.
*/
export declare function certifiedAddressesFirst(a: Address, b: Address): -1 | 0 | 1;
/**
* Compare function for array.sort() that moves circuit relay addresses to the
* end of the array.
*/
export declare function circuitRelayAddressesLast(a: Address, b: Address): -1 | 0 | 1;
export declare function defaultAddressSorter(addresses: Address[]): Address[];
//# sourceMappingURL=address-sorter.d.ts.map