import type { PeerId } from '@libp2p/interface'; /** * We can't use PeerIds as map keys because map keys are * compared using same-value-zero equality, so this is just * a map that stringifies the PeerIds before storing them. * * PeerIds cache stringified versions of themselves so this * should be a cheap operation. * * @example * * ```TypeScript * import { peerMap } from '@libp2p/peer-collections' * * const map = peerMap() * map.set(peerId, 'value') * ``` */ export declare class PeerMap { private readonly map; constructor(map?: PeerMap); [Symbol.iterator](): IterableIterator<[PeerId, T]>; clear(): void; delete(peer: PeerId): boolean; entries(): IterableIterator<[PeerId, T]>; forEach(fn: (value: T, key: PeerId, map: PeerMap) => void): void; get(peer: PeerId): T | undefined; has(peer: PeerId): boolean; set(peer: PeerId, value: T): void; keys(): IterableIterator; values(): IterableIterator; get size(): number; } export declare function peerMap(): PeerMap; //# sourceMappingURL=map.d.ts.map