Types for LibP2pConnection

This commit is contained in:
Tuyen 2020-02-06 16:27:03 +07:00
parent c8e1c8e436
commit f9cbf455fc

View File

@ -3,8 +3,13 @@
// Definitions by: Jaco Greeff <https://github.com/jacogr> // Definitions by: Jaco Greeff <https://github.com/jacogr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="peer-info"/> /// <reference types="multiaddr"/>
declare interface LibP2pConnection { declare interface LibP2pConnection {
getPeerInfo (cb: (error: Error | null, peerInfo?: PeerInfo) => any): void; localPeer: import("peer-id");
remotePeer: import("peer-id");
id: string;
localAddr: Multiaddr.Multiaddr;
remoteAddr: Multiaddr.Multiaddr;
close(): Promise<void>;
} }