diff --git a/src/@types/it-pair/index.d.ts b/src/@types/it-pair/index.d.ts index b325693..1f05d9b 100644 --- a/src/@types/it-pair/index.d.ts +++ b/src/@types/it-pair/index.d.ts @@ -1,6 +1,8 @@ -export type Duplex = [Stream, Stream]; +declare module 'it-pair' { + export type Duplex = [Stream, Stream]; -type Stream = { - sink(source: Iterable); - source: Record; + type Stream = { + sink(source: Iterable): void; + source: Record; + } } diff --git a/src/@types/libp2p.ts b/src/@types/libp2p.ts index e31acaa..151d0ca 100644 --- a/src/@types/libp2p.ts +++ b/src/@types/libp2p.ts @@ -1,5 +1,4 @@ import { bytes, bytes32 } from "./basic"; -import { Duplex } from "it-pair"; import PeerId from "peer-id"; export type KeyPair = { @@ -14,7 +13,7 @@ export interface INoiseConnection { } export type SecureOutbound = { - conn: Duplex; + conn: any; remotePeer: PeerId; } diff --git a/src/noise.ts b/src/noise.ts index 8372197..404d9a7 100644 --- a/src/noise.ts +++ b/src/noise.ts @@ -14,7 +14,7 @@ import {uint16BEDecode, uint16BEEncode} from "./encoder"; import {decryptStream, encryptStream} from "./crypto"; import {bytes} from "./@types/basic"; import {INoiseConnection, KeyPair, SecureOutbound} from "./@types/libp2p"; -import {Duplex} from "./@types/it-pair"; +import {Duplex} from "it-pair"; import {IHandshake} from "./@types/handshake-interface"; import {KeyCache} from "./keycache"; import {logger} from "./logger";