import { Peer as PeerPB } from './pb/peer.ts'; import type { PersistentPeerStoreComponents, PersistentPeerStoreInit } from './index.ts'; import type { PeerUpdate as PeerUpdateExternal, PeerId, Peer, PeerData, PeerQuery, AbortOptions } from '@libp2p/interface'; import type { Mortice, Release } from 'mortice'; /** * Event detail emitted when peer data changes */ export interface PeerUpdate extends PeerUpdateExternal { updated: boolean; } export interface ExistingPeer { peerPB: PeerPB; peer: Peer; } export interface Lock { refs: number; lock: Mortice; } export declare class PersistentStore { #private; private readonly peerId; private readonly datastore; private locks; private readonly addressFilter?; private readonly log; private readonly maxAddressAge; private readonly maxPeerAge; constructor(components: PersistentPeerStoreComponents, init?: PersistentPeerStoreInit); getLock(peerId: PeerId): Lock; private maybeRemoveLock; getReadLock(peerId: PeerId, options?: AbortOptions): Promise; getWriteLock(peerId: PeerId, options?: AbortOptions): Promise; has(peerId: PeerId, options?: AbortOptions): Promise; delete(peerId: PeerId, options?: AbortOptions): Promise; load(peerId: PeerId, options?: AbortOptions): Promise; save(peerId: PeerId, data: PeerData, options?: AbortOptions): Promise; patch(peerId: PeerId, data: Partial, options?: AbortOptions): Promise; merge(peerId: PeerId, data: PeerData, options?: AbortOptions): Promise; all(options?: PeerQuery): AsyncGenerator; } //# sourceMappingURL=store.d.ts.map