mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 18:12:33 +00:00
fix interfaces to be compatible with libp2p-ts
This commit is contained in:
parent
489fcf2b60
commit
ba7182685a
8
src/@types/it-pair/index.d.ts
vendored
8
src/@types/it-pair/index.d.ts
vendored
@ -1,6 +1,8 @@
|
|||||||
export type Duplex = [Stream, Stream];
|
declare module 'it-pair' {
|
||||||
|
export type Duplex = [Stream, Stream];
|
||||||
|
|
||||||
type Stream = {
|
type Stream = {
|
||||||
sink(source: Iterable<any>);
|
sink(source: Iterable<any>): void;
|
||||||
source: Record<string, any>;
|
source: Record<string, any>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { bytes, bytes32 } from "./basic";
|
import { bytes, bytes32 } from "./basic";
|
||||||
import { Duplex } from "it-pair";
|
|
||||||
import PeerId from "peer-id";
|
import PeerId from "peer-id";
|
||||||
|
|
||||||
export type KeyPair = {
|
export type KeyPair = {
|
||||||
@ -14,7 +13,7 @@ export interface INoiseConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type SecureOutbound = {
|
export type SecureOutbound = {
|
||||||
conn: Duplex;
|
conn: any;
|
||||||
remotePeer: PeerId;
|
remotePeer: PeerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import {uint16BEDecode, uint16BEEncode} from "./encoder";
|
|||||||
import {decryptStream, encryptStream} from "./crypto";
|
import {decryptStream, encryptStream} from "./crypto";
|
||||||
import {bytes} from "./@types/basic";
|
import {bytes} from "./@types/basic";
|
||||||
import {INoiseConnection, KeyPair, SecureOutbound} from "./@types/libp2p";
|
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 {IHandshake} from "./@types/handshake-interface";
|
||||||
import {KeyCache} from "./keycache";
|
import {KeyCache} from "./keycache";
|
||||||
import {logger} from "./logger";
|
import {logger} from "./logger";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user