ipfs-core
Version:
JavaScript implementation of the IPFS specification
22 lines • 1.85 kB
TypeScript
/**
* @param {object} config
* @param {import('../types').NetworkService} config.network
* @param {import('ipfs-repo').IPFSRepo} config.repo
* @param {PeerId} config.peerId
*/
export function createDht({ network, repo, peerId }: {
network: import('../types').NetworkService;
repo: import('ipfs-repo').IPFSRepo;
peerId: PeerId;
}): {
get: (key: string | Uint8Array, options?: import("ipfs-core-types/src/utils").AbortOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
put: (key: string | Uint8Array, value: Uint8Array, options?: import("ipfs-core-types/src/utils").AbortOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
findProvs: (cid: CID<unknown, number, number, import("multiformats/cid").Version>, options?: import("ipfs-core-types/src/utils").AbortOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
findPeer: (peerId: import("@libp2p/interface-peer-id").PeerId, options?: import("ipfs-core-types/src/utils").AbortOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
provide: (cid: CID<unknown, number, number, import("multiformats/cid").Version>, options?: import("ipfs-core-types/src/dht").DHTProvideOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
query: (peerId: CID<unknown, number, number, import("multiformats/cid").Version> | import("@libp2p/interface-peer-id").PeerId, options?: import("ipfs-core-types/src/utils").AbortOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/dht").QueryEvent>;
};
export type QueryEvent = import('@libp2p/interface-dht').QueryEvent;
export type Network = import('./network').Network;
export type PeerId = import('@libp2p/interface-peer-id').PeerId;
//# sourceMappingURL=dht.d.ts.map