import { Key } from 'interface-datastore/key'; import { CID } from 'multiformats/cid'; import type { Operation, OperationMetrics } from './kad-dht.js'; import type { AbortOptions, PeerId, PeerInfo } from '@libp2p/interface'; export declare function removePrivateAddressesMapper(peer: PeerInfo): PeerInfo; export declare function removePublicAddressesMapper(peer: PeerInfo): PeerInfo; export declare function passthroughMapper(info: PeerInfo): PeerInfo; /** * Creates a DHT ID by hashing a given Uint8Array */ export declare function convertBuffer(buf: Uint8Array, options?: AbortOptions): Promise; /** * Creates a DHT ID by hashing a Peer ID */ export declare function convertPeerId(peerId: PeerId, options?: AbortOptions): Promise; /** * Convert a Uint8Array to their SHA2-256 hash */ export declare function bufferToKey(buf: Uint8Array): Key; /** * Convert a Uint8Array to their SHA2-256 hash */ export declare function bufferToRecordKey(prefix: string, buf: Uint8Array): Key; /** * Generate the key for a public key. */ export declare function keyForPublicKey(peerId: PeerId): Uint8Array; export declare function isPublicKeyKey(key: Uint8Array): boolean; export declare function isIPNSKey(key: Uint8Array): boolean; export declare function fromPublicKeyKey(key: Uint8Array): PeerId; export declare function uint8ArrayToBigInt(buf: Uint8Array): bigint; /** * Create a new put record, encodes and signs it if enabled */ export declare function createPutRecord(key: Uint8Array, value: Uint8Array): Uint8Array; /** * Parse the CID and provider peer id from the key */ export declare function parseProviderKey(key: Key): { cid: CID; peerId: PeerId; }; /** * Encode the given key its matching datastore key */ export declare function toProviderKey(prefix: string, cid: CID | string, peerId?: PeerId): Key; export declare function readProviderTime(buf: Uint8Array): Date; /** * Wraps the passed generator function with timing metrics */ export declare function timeOperationGenerator(fn: (...args: any[]) => AsyncGenerator, operationMetrics: OperationMetrics, type: Operation): (...args: any[]) => AsyncGenerator; export declare function timeOperationMethod(fn: (...args: any[]) => Promise, operationMetrics: OperationMetrics, type: Operation): (...args: any[]) => Promise; //# sourceMappingURL=utils.d.ts.map