@libp2p/interface-internal
Advanced tools
Comparing version 0.1.11-8c169db1b to 0.1.11-9197f10ba
import type { Connection, Stream, Topology } from '@libp2p/interface'; | ||
export interface IncomingStreamData { | ||
/** | ||
* The stream that has been opened | ||
*/ | ||
stream: Stream; | ||
/** | ||
* The connection that the stream was opened on | ||
*/ | ||
connection: Connection; | ||
@@ -26,3 +32,9 @@ } | ||
export interface StreamHandlerRecord { | ||
/** | ||
* The handler that was registered to handle streams opened on the protocol | ||
*/ | ||
handler: StreamHandler; | ||
/** | ||
* The options that were used to register the stream handler | ||
*/ | ||
options: StreamHandlerOptions; | ||
@@ -29,0 +41,0 @@ } |
import type { Connection, Listener, Transport } from '@libp2p/interface'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
export interface TransportManager { | ||
/** | ||
* Add a transport to the transport manager | ||
*/ | ||
add(transport: Transport): void; | ||
/** | ||
* Dial a multiaddr. Connections returned by this method will not be tracked | ||
* by the connection manager so can cause memory leaks. If you need to dial | ||
* a multiaddr, you may want to call openConnection on the connection manager | ||
* instead. | ||
*/ | ||
dial(ma: Multiaddr, options?: any): Promise<Connection>; | ||
/** | ||
* Return all addresses currently being listened on | ||
*/ | ||
getAddrs(): Multiaddr[]; | ||
/** | ||
* Return all registered transports | ||
*/ | ||
getTransports(): Transport[]; | ||
/** | ||
* Return all listeners | ||
*/ | ||
getListeners(): Listener[]; | ||
/** | ||
* Get the transport for a given multiaddr, if one has been configured | ||
*/ | ||
transportForMultiaddr(ma: Multiaddr): Transport | undefined; | ||
/** | ||
* Listen on the passed multiaddrs | ||
*/ | ||
listen(addrs: Multiaddr[]): Promise<void>; | ||
/** | ||
* Remove a previously configured transport | ||
*/ | ||
remove(key: string): Promise<void>; | ||
/** | ||
* Remove all transports | ||
*/ | ||
removeAll(): Promise<void>; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@libp2p/interface-internal", | ||
"version": "0.1.11-8c169db1b", | ||
"version": "0.1.11-9197f10ba", | ||
"description": "Interfaces implemented by internal libp2p components", | ||
@@ -66,4 +66,4 @@ "license": "Apache-2.0 OR MIT", | ||
"dependencies": { | ||
"@libp2p/interface": "1.0.1-8c169db1b", | ||
"@libp2p/peer-collections": "4.0.10-8c169db1b", | ||
"@libp2p/interface": "1.0.1-9197f10ba", | ||
"@libp2p/peer-collections": "4.0.10-9197f10ba", | ||
"@multiformats/multiaddr": "^12.1.10", | ||
@@ -70,0 +70,0 @@ "uint8arraylist": "^2.4.3" |
import type { Connection, Stream, Topology } from '@libp2p/interface' | ||
export interface IncomingStreamData { | ||
/** | ||
* The stream that has been opened | ||
*/ | ||
stream: Stream | ||
/** | ||
* The connection that the stream was opened on | ||
*/ | ||
connection: Connection | ||
@@ -32,3 +39,10 @@ } | ||
export interface StreamHandlerRecord { | ||
/** | ||
* The handler that was registered to handle streams opened on the protocol | ||
*/ | ||
handler: StreamHandler | ||
/** | ||
* The options that were used to register the stream handler | ||
*/ | ||
options: StreamHandlerOptions | ||
@@ -35,0 +49,0 @@ } |
@@ -5,11 +5,49 @@ import type { Connection, Listener, Transport } from '@libp2p/interface' | ||
export interface TransportManager { | ||
/** | ||
* Add a transport to the transport manager | ||
*/ | ||
add(transport: Transport): void | ||
/** | ||
* Dial a multiaddr. Connections returned by this method will not be tracked | ||
* by the connection manager so can cause memory leaks. If you need to dial | ||
* a multiaddr, you may want to call openConnection on the connection manager | ||
* instead. | ||
*/ | ||
dial(ma: Multiaddr, options?: any): Promise<Connection> | ||
/** | ||
* Return all addresses currently being listened on | ||
*/ | ||
getAddrs(): Multiaddr[] | ||
/** | ||
* Return all registered transports | ||
*/ | ||
getTransports(): Transport[] | ||
/** | ||
* Return all listeners | ||
*/ | ||
getListeners(): Listener[] | ||
/** | ||
* Get the transport for a given multiaddr, if one has been configured | ||
*/ | ||
transportForMultiaddr(ma: Multiaddr): Transport | undefined | ||
/** | ||
* Listen on the passed multiaddrs | ||
*/ | ||
listen(addrs: Multiaddr[]): Promise<void> | ||
/** | ||
* Remove a previously configured transport | ||
*/ | ||
remove(key: string): Promise<void> | ||
/** | ||
* Remove all transports | ||
*/ | ||
removeAll(): Promise<void> | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25946
546
+ Added@libp2p/interface@1.0.1-9197f10ba(transitive)
+ Added@libp2p/peer-collections@4.0.10-9197f10ba(transitive)
+ Added@libp2p/peer-id@4.0.1-9197f10ba(transitive)
- Removed@libp2p/interface@1.0.1-8c169db1b(transitive)
- Removed@libp2p/peer-collections@4.0.10-8c169db1b(transitive)
- Removed@libp2p/peer-id@4.0.1-8c169db1b(transitive)