import { Network } from './network.ts'; import { PeerWantLists } from './peer-want-lists/index.ts'; import { Stats } from './stats.ts'; import { WantList } from './want-list.ts'; import type { BitswapOptions, Bitswap as BitswapInterface, BitswapWantProgressEvents, BitswapNotifyProgressEvents, WantListEntry, BitswapComponents, PeerWantListEntry } from './index.ts'; import type { CreateSessionOptions, ProviderOptions, SessionBlockBroker } from '@helia/interface'; import type { Libp2p, PeerId, AbortOptions } from '@libp2p/interface'; import type { Blockstore } from 'interface-blockstore'; import type { CID } from 'multiformats/cid'; import type { ProgressOptions } from 'progress-events'; export interface WantOptions extends AbortOptions, ProgressOptions, ProviderOptions { /** * When searching the routing for providers, stop searching after finding this * many providers. * * @default 3 */ maxProviders?: number; } /** * JavaScript implementation of the Bitswap 'data exchange' protocol * used by IPFS. */ export declare class Bitswap implements BitswapInterface { private readonly log; private readonly logger; readonly stats: Stats; network: Network; blockstore: Blockstore; peerWantLists: PeerWantLists; wantList: WantList; libp2p: Libp2p; constructor(components: BitswapComponents, init?: BitswapOptions); createSession(options?: CreateSessionOptions): Required, 'retrieve' | 'addPeer'>>; want(cid: CID, options?: WantOptions): Promise; /** * Sends notifications about the arrival of a block */ notify(cid: CID, options?: ProgressOptions & AbortOptions): Promise; getWantlist(): WantListEntry[]; getPeerWantlist(peer: PeerId): PeerWantListEntry[] | undefined; /** * Start the bitswap node */ start(): Promise; /** * Stop the bitswap node */ stop(): Promise; } //# sourceMappingURL=bitswap.d.ts.map