@libp2p/interface
Advanced tools
Comparing version 1.6.0-d1aec4d9f to 1.6.0-e1f0b307c
@@ -27,5 +27,5 @@ /** | ||
import type { Topology } from './topology/index.js'; | ||
import type { Listener } from './transport/index.js'; | ||
import type { Listener, OutboundConnectionUpgradeEvents } from './transport/index.js'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
import type { ProgressOptions } from 'progress-events'; | ||
import type { ProgressOptions, ProgressEvent } from 'progress-events'; | ||
/** | ||
@@ -301,2 +301,8 @@ * Used by the connection manager to sort addresses into order before dialling | ||
} | ||
export type TransportManagerDialProgressEvents = ProgressEvent<'transport-manager:selected-transport', string>; | ||
export type OpenConnectionProgressEvents = TransportManagerDialProgressEvents | ProgressEvent<'dial-queue:already-connected'> | ProgressEvent<'dial-queue:already-in-dial-queue'> | ProgressEvent<'dial-queue:add-to-dial-queue'> | ProgressEvent<'dial-queue:start-dial'> | ProgressEvent<'dial-queue:calculated-addresses', Address[]> | OutboundConnectionUpgradeEvents; | ||
export interface DialOptions extends AbortOptions, ProgressOptions { | ||
} | ||
export interface DialProtocolOptions extends NewStreamOptions { | ||
} | ||
/** | ||
@@ -471,3 +477,3 @@ * Libp2p nodes implement this interface. | ||
*/ | ||
dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise<Connection>; | ||
dial(peer: PeerId | Multiaddr | Multiaddr[], options?: DialOptions): Promise<Connection>; | ||
/** | ||
@@ -489,3 +495,3 @@ * Dials to the provided peer and tries to handshake with the given protocols in order. | ||
*/ | ||
dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise<Stream>; | ||
dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: DialProtocolOptions): Promise<Stream>; | ||
/** | ||
@@ -492,0 +498,0 @@ * Attempts to gracefully close an open connection to the given peer. If the |
@@ -135,3 +135,3 @@ import type { MultiaddrConnection, Stream, Connection } from '../connection/index.js'; | ||
* ```typescript | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics' | ||
* | ||
@@ -165,3 +165,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics' | ||
* | ||
@@ -194,3 +194,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics | ||
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics' | ||
* | ||
@@ -226,3 +226,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics } from '@libp2p/interface/metrics | ||
* import { Metrics } from '@libp2p/interface/metrics' | ||
* | ||
@@ -253,3 +253,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics } from '@libp2p/interface/metrics | ||
* import { Metrics } from '@libp2p/interface/metrics' | ||
* | ||
@@ -256,0 +256,0 @@ * interface MyServiceComponents { |
@@ -40,3 +40,3 @@ import type { Connection, MultiaddrConnection } from '../connection/index.js'; | ||
} | ||
export interface DialOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> { | ||
export interface DialTransportOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> { | ||
upgrader: Upgrader; | ||
@@ -59,3 +59,3 @@ } | ||
*/ | ||
dial(ma: Multiaddr, options: DialOptions<DialEvents>): Promise<Connection>; | ||
dial(ma: Multiaddr, options: DialTransportOptions<DialEvents>): Promise<Connection>; | ||
/** | ||
@@ -62,0 +62,0 @@ * Create transport listeners. |
{ | ||
"name": "@libp2p/interface", | ||
"version": "1.6.0-d1aec4d9f", | ||
"version": "1.6.0-e1f0b307c", | ||
"description": "The interface implemented by a libp2p node", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -28,5 +28,5 @@ /** | ||
import type { Topology } from './topology/index.js' | ||
import type { Listener } from './transport/index.js' | ||
import type { Listener, OutboundConnectionUpgradeEvents } from './transport/index.js' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
import type { ProgressOptions } from 'progress-events' | ||
import type { ProgressOptions, ProgressEvent } from 'progress-events' | ||
@@ -338,2 +338,22 @@ /** | ||
export type TransportManagerDialProgressEvents = | ||
ProgressEvent<'transport-manager:selected-transport', string> | ||
export type OpenConnectionProgressEvents = | ||
TransportManagerDialProgressEvents | | ||
ProgressEvent<'dial-queue:already-connected'> | | ||
ProgressEvent<'dial-queue:already-in-dial-queue'> | | ||
ProgressEvent<'dial-queue:add-to-dial-queue'> | | ||
ProgressEvent<'dial-queue:start-dial'> | | ||
ProgressEvent<'dial-queue:calculated-addresses', Address[]> | | ||
OutboundConnectionUpgradeEvents | ||
export interface DialOptions extends AbortOptions, ProgressOptions { | ||
} | ||
export interface DialProtocolOptions extends NewStreamOptions { | ||
} | ||
/** | ||
@@ -520,3 +540,3 @@ * Libp2p nodes implement this interface. | ||
*/ | ||
dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise<Connection> | ||
dial(peer: PeerId | Multiaddr | Multiaddr[], options?: DialOptions): Promise<Connection> | ||
@@ -539,3 +559,3 @@ /** | ||
*/ | ||
dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise<Stream> | ||
dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: DialProtocolOptions): Promise<Stream> | ||
@@ -542,0 +562,0 @@ /** |
@@ -153,3 +153,3 @@ import type { MultiaddrConnection, Stream, Connection } from '../connection/index.js' | ||
* ```typescript | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics' | ||
* | ||
@@ -183,3 +183,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics | ||
* import { Metrics, Metric } from '@libp2p/interface/metrics' | ||
* | ||
@@ -212,3 +212,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics | ||
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics' | ||
* | ||
@@ -244,3 +244,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics } from '@libp2p/interface/metrics | ||
* import { Metrics } from '@libp2p/interface/metrics' | ||
* | ||
@@ -271,3 +271,3 @@ * interface MyServiceComponents { | ||
* ```typescript | ||
* import { Metrics } from '@libp2p/interface/metrics | ||
* import { Metrics } from '@libp2p/interface/metrics' | ||
* | ||
@@ -274,0 +274,0 @@ * interface MyServiceComponents { |
@@ -43,3 +43,3 @@ import type { Connection, MultiaddrConnection } from '../connection/index.js' | ||
export interface DialOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> { | ||
export interface DialTransportOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> { | ||
upgrader: Upgrader | ||
@@ -65,3 +65,3 @@ } | ||
*/ | ||
dial(ma: Multiaddr, options: DialOptions<DialEvents>): Promise<Connection> | ||
dial(ma: Multiaddr, options: DialTransportOptions<DialEvents>): Promise<Connection> | ||
@@ -68,0 +68,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235804
5737