diff --git a/packages/interface-connection/src/index.ts b/packages/interface-connection/src/index.ts index ee087d30a..ea5d9296d 100644 --- a/packages/interface-connection/src/index.ts +++ b/packages/interface-connection/src/index.ts @@ -158,6 +158,15 @@ export interface Stream extends Duplex, Source } +export interface NewStreamOptions extends AbortOptions { + /** + * If specified, and no handler has been registered with the registrar for the + * successfully negotiated protocol, use this as the max outbound stream limit + * for the protocol + */ + maxOutboundStreams?: number +} + /** * A Connection is a high-level representation of a connection * to a remote peer that may have been secured by encryption and @@ -172,7 +181,7 @@ export interface Connection { tags: string[] streams: Stream[] - newStream: (multicodecs: string | string[], options?: AbortOptions) => Promise + newStream: (multicodecs: string | string[], options?: NewStreamOptions) => Promise addStream: (stream: Stream) => void removeStream: (id: string) => void close: () => Promise