ipfs-core
Version:
JavaScript implementation of the IPFS specification
37 lines • 1.18 kB
TypeScript
/**
* @param {object} config
* @param {import('../types').NetworkService} config.network
*/
export function createPing({ network }: {
network: import('../types').NetworkService;
}): (peerId: import("@libp2p/interface-peer-id").PeerId, options?: import("ipfs-core-types/src/root").PingOptions | undefined) => AsyncIterable<import("ipfs-core-types/src/root").PingResult>;
/**
* Note that not all ping response objects are "pongs".
* A "pong" message can be identified by a truthy success property and an empty
* text property. Other ping responses are failures or status updates.
*/
export type Packet = Pong | PingFailure | StatusUpdate;
export type Pong = {
success: true;
time: number;
text: '';
};
export type PingFailure = {
success: false;
time: number;
text: string;
};
export type StatusUpdate = {
success: true;
time: 0;
text: string;
};
export type PingOptions = PingSettings & AbortOptions;
export type PingSettings = {
/**
* - The number of ping messages to send
*/
count?: number | undefined;
};
export type AbortOptions = import('ipfs-core-types/src/utils').AbortOptions;
//# sourceMappingURL=ping.d.ts.map