export = PeerDistanceList; /** * @typedef {import('peer-id')} PeerId */ /** * Maintains a list of peerIds sorted by distance from a DHT key. */ declare class PeerDistanceList { /** * Creates a new PeerDistanceList. * * @param {Uint8Array} originDhtKey - the DHT key from which distance is calculated * @param {number} capacity - the maximum size of the list */ constructor(originDhtKey: Uint8Array, capacity: number); originDhtKey: Uint8Array; capacity: number; /** @type {{ peerId: PeerId, distance: Uint8Array }[]} */ peerDistances: { peerId: PeerId; distance: Uint8Array; }[]; /** * The length of the list */ get length(): number; /** * The peerIds in the list, in order of distance from the origin key */ get peers(): import("peer-id")[]; /** * Add a peerId to the list. * * @param {PeerId} peerId */ add(peerId: PeerId): Promise; /** * Indicates whether any of the peerIds passed as a parameter are closer * to the origin key than the furthest peerId in the PeerDistanceList. * * @param {PeerId[]} peerIds */ anyCloser(peerIds: PeerId[]): Promise; } declare namespace PeerDistanceList { export { PeerId }; } type PeerId = import('peer-id'); //# sourceMappingURL=peer-distance-list.d.ts.map