mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 11:52:23 +00:00
Merge pull request #48 from NodeFactoryIo/mpetrunic/fix-types
Fix types
This commit is contained in:
commit
9bf6c2e85d
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
- fix types to be compatible with rest of libp2p typescript projects
|
||||||
|
|
||||||
## [1.0.0-rc.9] - 2019-03-11
|
## [1.0.0-rc.9] - 2019-03-11
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
"@types/mocha": "^5.2.7",
|
"@types/mocha": "^5.2.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
||||||
"@typescript-eslint/parser": "^2.6.0",
|
"@typescript-eslint/parser": "^2.6.0",
|
||||||
"bn.js-typings": "^1.0.1",
|
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^6.6.0",
|
||||||
"karma": "^4.4.1",
|
"karma": "^4.4.1",
|
||||||
@ -64,6 +63,7 @@
|
|||||||
"webpack": "^4.41.5"
|
"webpack": "^4.41.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/bn.js": "^4.11.6",
|
||||||
"bcrypto": "5.0.3",
|
"bcrypto": "5.0.3",
|
||||||
"bn.js": "^5.0.0",
|
"bn.js": "^5.0.0",
|
||||||
"buffer": "^5.4.3",
|
"buffer": "^5.4.3",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BN } from 'bn.js';
|
import BN from 'bn.js';
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
|
|
||||||
export type bytes = Buffer;
|
export type bytes = Buffer;
|
||||||
|
10
src/@types/it-pair/index.d.ts
vendored
10
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Buffer} from "buffer";
|
import {Buffer} from "buffer";
|
||||||
import {BN} from "bn.js";
|
import BN from "bn.js";
|
||||||
|
|
||||||
import {CipherState, HandshakeState, MessageBuffer, NoiseSession} from "../@types/handshake";
|
import {CipherState, HandshakeState, MessageBuffer, NoiseSession} from "../@types/handshake";
|
||||||
import {bytes, bytes32} from "../@types/basic";
|
import {bytes, bytes32} from "../@types/basic";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
import { BN } from 'bn.js';
|
import BN from 'bn.js';
|
||||||
|
|
||||||
import { bytes32, bytes } from '../@types/basic'
|
import { bytes32, bytes } from '../@types/basic'
|
||||||
import { KeyPair } from '../@types/libp2p'
|
import { KeyPair } from '../@types/libp2p'
|
||||||
|
@ -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";
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types",
|
"./node_modules/@types",
|
||||||
"./node_modules/bn.js-typings/index.d.ts",
|
|
||||||
"./src/@types"
|
"./src/@types"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -16,7 +15,6 @@
|
|||||||
"**/src/**/*.ts"
|
"**/src/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules"
|
||||||
"./src/@types"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
19
yarn.lock
19
yarn.lock
@ -1056,6 +1056,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/bn.js@^4.11.6":
|
||||||
|
version "4.11.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c"
|
||||||
|
integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/chai@^4.2.4":
|
"@types/chai@^4.2.4":
|
||||||
version "4.2.4"
|
version "4.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.4.tgz#8936cffad3c96ec470a2dc26a38c3ba8b9b6f619"
|
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.4.tgz#8936cffad3c96ec470a2dc26a38c3ba8b9b6f619"
|
||||||
@ -1091,11 +1098,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.3.tgz#65a8d9a6a0f6af55595a2d0020617959130d6495"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.3.tgz#65a8d9a6a0f6af55595a2d0020617959130d6495"
|
||||||
integrity sha512-QZ9CjUB3QoA3f2afw3utKlfRPhpmufB7jC2+oDhLWnXqoyx333fhKSQDLQu2EK7OE0a15X67eYiRAaJsHXrpMA==
|
integrity sha512-QZ9CjUB3QoA3f2afw3utKlfRPhpmufB7jC2+oDhLWnXqoyx333fhKSQDLQu2EK7OE0a15X67eYiRAaJsHXrpMA==
|
||||||
|
|
||||||
"@types/node@^10.12.12":
|
|
||||||
version "10.17.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.2.tgz#41b5afbcde1a5a805302a4da3cf399499f1bbf64"
|
|
||||||
integrity sha512-sAh60KDol+MpwOr1RTK0+HgBEYejKsxdpmrOS1Wts5bI03dLzq8F7T0sRXDKeaEK8iWDlGfdzxrzg6vx/c5pNA==
|
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^2.6.0":
|
"@typescript-eslint/eslint-plugin@^2.6.0":
|
||||||
version "2.6.0"
|
version "2.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.0.tgz#e82ed43fc4527b21bfe35c20a2d6e4ed49fc7957"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.0.tgz#e82ed43fc4527b21bfe35c20a2d6e4ed49fc7957"
|
||||||
@ -1650,13 +1652,6 @@ bluebird@^3.3.0, bluebird@^3.5.5:
|
|||||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
||||||
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
||||||
|
|
||||||
bn.js-typings@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/bn.js-typings/-/bn.js-typings-1.0.1.tgz#00faef56401850b763cee041c0728a9aaf091e7e"
|
|
||||||
integrity sha512-PdV3AEpI5A8mHCt3KgBobIJ+3rhoxxkRl8b0dCGDgGtJNYmN4KTPLHYq7xOSmKF1Kv06aZ5k8QhXbyG73IyhdQ==
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "^10.12.12"
|
|
||||||
|
|
||||||
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.8, bn.js@^4.4.0:
|
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.8, bn.js@^4.4.0:
|
||||||
version "4.11.8"
|
version "4.11.8"
|
||||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
|
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user