fix interfaces to be compatible with libp2p-ts

This commit is contained in:
Marin Petrunić 2020-04-03 13:20:15 +02:00
parent 489fcf2b60
commit ba7182685a
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
3 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,8 @@
export type Duplex = [Stream, Stream];
declare module 'it-pair' {
export type Duplex = [Stream, Stream];
type Stream = {
sink(source: Iterable<any>);
source: Record<string, any>;
type Stream = {
sink(source: Iterable<any>): void;
source: Record<string, any>;
}
}

View File

@ -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;
}

View File

@ -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";