import type { HeliaWithLibp2pPubsub } from "./types.js"; import type { PeerId } from "@libp2p/interface"; import type { IPNSRecord } from "ipns"; import Logger from "../logger.js"; export interface HeliaDebugContext { heliaPeerId: string; heliaStatus: HeliaWithLibp2pPubsub["libp2p"]["status"]; connectedPeerCount: number; connections: { peer: string; multiaddr: string; direction: string; }[]; } export declare function getHeliaDebugContext(helia: HeliaWithLibp2pPubsub): HeliaDebugContext; export declare function waitForTopicSubscriber({ helia, topic, timeoutMs, abortSignal }: { helia: HeliaWithLibp2pPubsub; topic: string; timeoutMs: number; abortSignal?: AbortSignal; }): Promise; export declare function connectToPubsubPeers({ helia, pubsubTopic, maxPeers, options, log }: { helia: HeliaWithLibp2pPubsub; pubsubTopic: string; maxPeers: number; log: Logger; options?: { signal?: AbortSignal; }; }): Promise>[]>; export declare function selectBitswapSessionSeedPeers(args: { connectedPeers: PeerId[]; scopedPubsubSubscriberPeerIdStrings: string[]; pubsubSubscriberPeerIdStrings: string[]; maxSeeds: number; }): PeerId[]; export declare const BITSWAP_SESSION_STALLED_GET_FAILOVER_MS = 2500; type HeliaSessionBlockstore = ReturnType; type FetchBlockCid = Parameters[0]; type FetchBlockOptions = Parameters[1]; export type FetchBlockFn = (cid: FetchBlockCid, options?: FetchBlockOptions) => ReturnType; export declare function fetchBlockWithStalledSessionFailover(args: { cid: FetchBlockCid; sessionGet: FetchBlockFn; fallbackGet: FetchBlockFn; stallTimeoutMs: number; options: FetchBlockOptions; log: Logger; }): AsyncGenerator; export interface DirectFetchResult { recordBytes: Uint8Array; peerId: string; source: "subscriber" | "provider"; durationMs: number; } export declare function directFetchIpnsRecordFromProviders({ helia, pubsubTopic, routingKey, maxPeers, validate, options, log }: { helia: HeliaWithLibp2pPubsub; pubsubTopic: string; routingKey: Uint8Array; maxPeers: number; validate: (routingKey: Uint8Array, bytes: Uint8Array) => Promise; log: Logger; options?: { signal?: AbortSignal; timeoutMs?: number; }; }): Promise; export interface IpnsPubsubLocalStore { has(routingKey: Uint8Array, options?: { signal?: AbortSignal; }): Promise; get(routingKey: Uint8Array, options?: { signal?: AbortSignal; }): Promise<{ record: Uint8Array; created: Date; }>; put(routingKey: Uint8Array, marshalledRecord: Uint8Array, options?: { signal?: AbortSignal; }): Promise; } export declare function cacheIpnsRecordInPubsubLocalStore({ localStore, routingKey, marshalledRecord }: { localStore: IpnsPubsubLocalStore; routingKey: Uint8Array; marshalledRecord: Uint8Array; }): Promise; export declare function ipnsCacheTtlJitterFactor(routingKey: Uint8Array): number; export declare function readFreshCachedIpnsRecordFromPubsubLocalStore({ localStore, routingKey, lastNetworkValidatedAtMs, pushChannelHealthy }: { localStore: IpnsPubsubLocalStore; routingKey: Uint8Array; lastNetworkValidatedAtMs?: number; pushChannelHealthy?: boolean; }): Promise; export {};