mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-04-22 12:22:14 +00:00
Merge pull request #33 from polkadot-js/jg-libp2p-promise
libp2p 0.26 with promises
This commit is contained in:
commit
7cb951ab9c
@ -19,6 +19,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.5.4",
|
"@babel/core": "^7.5.4",
|
||||||
"@polkadot/dev": "^0.31.0-beta.1"
|
"@polkadot/dev": "^0.31.0-beta.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27
types/libp2p/index.d.ts
vendored
27
types/libp2p/index.d.ts
vendored
@ -17,18 +17,16 @@
|
|||||||
|
|
||||||
declare namespace LibP2p {
|
declare namespace LibP2p {
|
||||||
export type OptionsConfig = {
|
export type OptionsConfig = {
|
||||||
|
contentRouting?: {},
|
||||||
dht?: {
|
dht?: {
|
||||||
kBucketSize?: number
|
kBucketSize?: number
|
||||||
},
|
},
|
||||||
EXPERIMENTAL?: {
|
|
||||||
pubsub?: boolean,
|
|
||||||
dht?: boolean
|
|
||||||
},
|
|
||||||
peerDiscovery?: {
|
peerDiscovery?: {
|
||||||
|
enabled?: boolean,
|
||||||
bootstrap?: {
|
bootstrap?: {
|
||||||
interval?: number
|
interval?: number
|
||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
list: Multiaddr.Multiaddr[]
|
list?: Multiaddr.Multiaddr[]
|
||||||
},
|
},
|
||||||
mdns?: {
|
mdns?: {
|
||||||
interval?: number
|
interval?: number
|
||||||
@ -43,7 +41,12 @@ declare namespace LibP2p {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
peerRouting?: {},
|
peerRouting?: {},
|
||||||
contentRouting?: {},
|
pubsub?: {
|
||||||
|
enabled?: boolean,
|
||||||
|
emitSelf: boolean,
|
||||||
|
signMessages: boolean,
|
||||||
|
strictSigning: boolean
|
||||||
|
},
|
||||||
relay?: {
|
relay?: {
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
hop?: {
|
hop?: {
|
||||||
@ -79,18 +82,18 @@ declare class LibP2p {
|
|||||||
readonly peerInfo: PeerInfo;
|
readonly peerInfo: PeerInfo;
|
||||||
readonly peerBook: PeerBook;
|
readonly peerBook: PeerBook;
|
||||||
|
|
||||||
dial(peerInfo: PeerInfo, cb: (error: Error | null) => any): void;
|
dial(peerInfo: PeerInfo): Promise<LibP2pConnection>;
|
||||||
dialProtocol(peerInfo: PeerInfo | Multiaddr.Multiaddr, protocol: string, cb: (error: Error | null, conn?: LibP2pConnection) => any): void;
|
dialProtocol(peerInfo: PeerInfo | Multiaddr.Multiaddr, protocol: string): Promise<LibP2pConnection>;
|
||||||
hangUp(peerInfo: PeerInfo, cb: (error: Error | null) => any): void;
|
hangUp(peerInfo: PeerInfo): Promise<void>;
|
||||||
handle(protocol: string, handler: (protocol: string, conn: LibP2pConnection) => any, matcher?: (protocol: string, requestedProtocol: string, cb: (error: Error | null, accept: boolean) => void) => any): void;
|
handle(protocol: string, handler: (protocol: string, conn: LibP2pConnection) => any, matcher?: (protocol: string, requestedProtocol: string, cb: (error: Error | null, accept: boolean) => void) => any): void;
|
||||||
unhandle(protocol: string): void;
|
unhandle(protocol: string): void;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
on(event: LibP2p.Events, cb: (event: any) => any): this;
|
on(event: LibP2p.Events, cb: (event: any) => any): this;
|
||||||
once(event: LibP2p.Events, cb: (event: any) => any): this;
|
once(event: LibP2p.Events, cb: (event: any) => any): this;
|
||||||
removeListener(event: LibP2p.Events, cb: (event: any) => any): this;
|
removeListener(event: LibP2p.Events, cb: (event: any) => any): this;
|
||||||
ping(peerInfo: PeerInfo, callback: (error: Error | null, ping: any) => void): void;
|
ping(peerInfo: PeerInfo): Promise<void>;
|
||||||
start(cb: (error: Error | null) => any): void;
|
start(): Promise<void>;
|
||||||
stop(cb: (error: Error | null) => any): void;
|
stop(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'libp2p' {
|
declare module 'libp2p' {
|
||||||
|
@ -12,5 +12,5 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
"files": ["index.d.ts", "bn.js-tests.ts"]
|
"files": ["index.d.ts", "libp2p-tests.ts"]
|
||||||
}
|
}
|
||||||
|
@ -1795,10 +1795,10 @@
|
|||||||
universal-user-agent "^3.0.0"
|
universal-user-agent "^3.0.0"
|
||||||
url-template "^2.0.8"
|
url-template "^2.0.8"
|
||||||
|
|
||||||
"@polkadot/dev@^0.31.0-beta.1":
|
"@polkadot/dev@^0.31.0-beta.3":
|
||||||
version "0.31.0-beta.1"
|
version "0.31.0-beta.3"
|
||||||
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.31.0-beta.1.tgz#444cf9b5a2d93bc0c4e054c95bb30e49842b5f06"
|
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.31.0-beta.3.tgz#f9880e7c430e6a4df423211244a1dddb509c3eca"
|
||||||
integrity sha512-VevAWJHaoftMUNG2CfKwwLeKuvOpzQDomEyTdAGnjqXsigc3Bp/aBR/SkS9EQZU/wA7HcbVDZhEHK6yUm6ETAQ==
|
integrity sha512-6VTgIR4EBvowVmaJorDmHbCctlUa+gTTL5etlU+T+yaVEA1vAS3gaSwlhgQY1baEjc9PNKHkfHun6MO/gqq+RA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/cli" "^7.5.5"
|
"@babel/cli" "^7.5.5"
|
||||||
"@babel/core" "^7.5.5"
|
"@babel/core" "^7.5.5"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user