mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-03-16 18:20:50 +00:00
Merge pull request #23 from polkadot-js/jg-libp2p-star
Extend libp2p-{webrtc,websocket}-star
This commit is contained in:
commit
5706ed40a3
@ -16,6 +16,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.2",
|
||||
"@polkadot/dev": "^0.25.11"
|
||||
"@polkadot/dev": "^0.25.12"
|
||||
}
|
||||
}
|
||||
|
3
types/libp2p-mdns/index.d.ts
vendored
3
types/libp2p-mdns/index.d.ts
vendored
@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="peer-info"/>
|
||||
/// <reference types="libp2p-bootstrap"/>
|
||||
|
||||
declare namespace LibP2pMdns {
|
||||
type Options = {
|
||||
@ -17,7 +18,7 @@ declare namespace LibP2pMdns {
|
||||
type Events = 'peer';
|
||||
}
|
||||
|
||||
declare class LibP2pMdns {
|
||||
declare class LibP2pMdns extends LibP2pBootstrap {
|
||||
constructor (options: LibP2pMdns.Options);
|
||||
|
||||
on (event: LibP2pMdns.Events, cb: (peerInfo: PeerInfo) => any): void;
|
||||
|
3
types/libp2p-webrtc-star/index.d.ts
vendored
3
types/libp2p-webrtc-star/index.d.ts
vendored
@ -4,9 +4,12 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="interface-transport"/>
|
||||
/// <reference types="libp2p-bootstrap"/>
|
||||
|
||||
declare class LibP2pWebRtcStar implements LibP2pTransport {
|
||||
constructor(config?: any);
|
||||
|
||||
discovery: LibP2pBootstrap;
|
||||
}
|
||||
|
||||
declare module 'libp2p-webrtc-star' {
|
||||
|
@ -12,5 +12,5 @@
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "bn.js-tests.ts"]
|
||||
"files": ["index.d.ts", "libp2p-swbsocket-star-tests.ts"]
|
||||
}
|
||||
|
17
types/libp2p-websocket-star/index.d.ts
vendored
Normal file
17
types/libp2p-websocket-star/index.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Type definitions for libp2p-websocket-star 0.15.3
|
||||
// Project: https://github.com/libp2p/js-libp2p-websocket-star
|
||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="interface-transport"/>
|
||||
/// <reference types="libp2p-bootstrap"/>
|
||||
|
||||
declare class LibP2pWebsocketStar implements LibP2pTransport {
|
||||
constructor(config?: any);
|
||||
|
||||
discovery: LibP2pBootstrap;
|
||||
}
|
||||
|
||||
declare module 'libp2p-websocket-star' {
|
||||
export default LibP2pWebsocketStar;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
// @ts-ignore
|
||||
import T from 'libp2p-websocket-star';
|
||||
|
||||
new T();
|
16
types/libp2p-websocket-star/tsconfig.json
Normal file
16
types/libp2p-websocket-star/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "libp2p-swbsocket-star-tests.ts"]
|
||||
}
|
1
types/libp2p-websocket-star/tslint.json
Normal file
1
types/libp2p-websocket-star/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
7
types/libp2p/index.d.ts
vendored
7
types/libp2p/index.d.ts
vendored
@ -29,9 +29,12 @@ declare namespace LibP2p {
|
||||
interval?: number
|
||||
enabled?: boolean
|
||||
},
|
||||
webrtcStar?: {
|
||||
webRTCStar?: {
|
||||
interval?: number
|
||||
enabled?: boolean
|
||||
},
|
||||
websocketStar?: {
|
||||
enabled?: boolean
|
||||
}
|
||||
},
|
||||
peerRouting?: {},
|
||||
@ -49,7 +52,7 @@ declare namespace LibP2p {
|
||||
connEncryption: Array<LibP2pSecio>,
|
||||
streamMuxer: Array<LibP2pMplex | LibP2pSpdy | PullMplex>,
|
||||
dht?: typeof LibP2pKadDht,
|
||||
peerDiscovery: Array<LibP2pBootstrap | LibP2pMdns>,
|
||||
peerDiscovery: Array<LibP2pBootstrap>,
|
||||
transport: LibP2pTransport[]
|
||||
};
|
||||
|
||||
|
@ -1499,10 +1499,10 @@
|
||||
universal-user-agent "^2.0.0"
|
||||
url-template "^2.0.8"
|
||||
|
||||
"@polkadot/dev@^0.25.11":
|
||||
version "0.25.11"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.25.11.tgz#73235add1eb0c86257ed8f1ab60e213be79a93f1"
|
||||
integrity sha512-Fs9VFlwwZVKtk+J9kjNG0lWDpTYvcVXOksMXJ1lQLnf2YhqFILsq8kETfoXWbDbusgcok69hoA4YcNtwiEAGWg==
|
||||
"@polkadot/dev@^0.25.12":
|
||||
version "0.25.12"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.25.12.tgz#de440a96dba3c9b4a92e6be0f0276b8c1f4daf24"
|
||||
integrity sha512-pISn6l4+brHCE04jjqSc7j7V63QmuhFykJFV2WejZHvUtKzBJa35C1ps+U9iKfa5Ma2gFyjyvlQOOvAKRwuKrA==
|
||||
dependencies:
|
||||
"@babel/cli" "^7.2.3"
|
||||
"@babel/core" "^7.3.4"
|
||||
|
Loading…
x
Reference in New Issue
Block a user