@libp2p/interface
Advanced tools
Comparing version
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var X=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},Y=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of V(r))!W.call(t,o)&&o!==e&&n(t,o,{get:()=>r[o],enumerable:!(s=Q(r,o))||s.enumerable});return t};var Z=t=>Y(n({},"__esModule",{value:!0}),t);var dr={};X(dr,{AbortError:()=>c,AlreadyStartedError:()=>M,ConnectionClosedError:()=>E,ConnectionClosingError:()=>f,ConnectionFailedError:()=>h,DialError:()=>U,FaultTolerance:()=>i,InvalidCIDError:()=>P,InvalidCryptoExchangeError:()=>l,InvalidMessageError:()=>C,InvalidMultiaddrError:()=>g,InvalidMultihashError:()=>A,InvalidParametersError:()=>u,InvalidPeerIdError:()=>I,InvalidPrivateKeyError:()=>x,InvalidPublicKeyError:()=>m,KEEP_ALIVE:()=>sr,LimitedConnectionError:()=>K,ListenError:()=>N,MuxerClosedError:()=>b,NotFoundError:()=>v,NotStartedError:()=>D,ProtocolError:()=>w,StreamResetError:()=>S,StreamStateError:()=>y,StrictNoSign:()=>ar,StrictSign:()=>nr,TimeoutError:()=>T,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>_,TopicValidatorResult:()=>a,TypedEventEmitter:()=>F,UnexpectedPeerError:()=>p,UnsupportedKeyTypeError:()=>B,UnsupportedOperationError:()=>d,UnsupportedProtocolError:()=>L,connectionSymbol:()=>j,contentRoutingSymbol:()=>k,isConnection:()=>$,isPeerId:()=>er,isPrivateKey:()=>rr,isPubSub:()=>ir,isPublicKey:()=>q,isStartable:()=>O,isTransport:()=>cr,peerDiscoverySymbol:()=>tr,peerIdSymbol:()=>z,peerRoutingSymbol:()=>or,pubSubSymbol:()=>G,serviceCapabilities:()=>mr,serviceDependencies:()=>xr,setMaxListeners:()=>pr,start:()=>lr,stop:()=>ur,transportSymbol:()=>H});var j=Symbol.for("@libp2p/connection");function $(t){return t!=null&&!!t[j]}var k=Symbol.for("@libp2p/content-routing");function q(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function rr(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&q(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var tr=Symbol.for("@libp2p/peer-discovery");var z=Symbol.for("@libp2p/peer-id");function er(t){return!!t?.[z]}var or=Symbol.for("@libp2p/peer-routing");var sr="keep-alive";var nr="StrictSign",ar="StrictNoSign",a;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(a||(a={}));var G=Symbol.for("@libp2p/pubsub");function ir(t){return!!t?.[G]}var H=Symbol.for("@libp2p/transport");function cr(t){return t!=null&&!!t[H]}var i;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(i||(i={}));var c=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},p=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},l=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},u=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},m=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},x=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},d=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},f=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},E=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},h=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},b=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},y=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},v=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},I=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},g=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},P=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},A=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},L=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},C=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},w=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},T=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},D=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},M=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},U=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},N=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},K=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},_=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},B=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}};function pr(){}var F=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){super.addEventListener(r,e,s);let o=this.#r.get(r);o==null&&(o=[],this.#r.set(r,o)),o.push({callback:e,once:(s!==!0&&s!==!1&&s?.once)??!1})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:J})=>J!==e),this.#r.set(r,o))}dispatchEvent(r){let e=super.dispatchEvent(r),s=this.#r.get(r.type);return s==null||(s=s.filter(({once:o})=>!o),this.#r.set(r.type,s)),e}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};function O(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function lr(...t){let r=[];for(let e of t)O(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function ur(...t){let r=[];for(let e of t)O(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var mr=Symbol.for("@libp2p/service-capabilities"),xr=Symbol.for("@libp2p/service-dependencies");return Z(dr);})(); | ||
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},Z=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of W(r))!X.call(t,o)&&o!==e&&n(t,o,{get:()=>r[o],enumerable:!(s=V(r,o))||s.enumerable});return t};var $=t=>Z(n({},"__esModule",{value:!0}),t);var fr={};Y(fr,{AbortError:()=>c,AlreadyStartedError:()=>M,ConnectionClosedError:()=>E,ConnectionClosingError:()=>f,ConnectionFailedError:()=>h,DialError:()=>N,FaultTolerance:()=>i,InvalidCIDError:()=>P,InvalidCryptoExchangeError:()=>l,InvalidMessageError:()=>C,InvalidMultiaddrError:()=>g,InvalidMultihashError:()=>A,InvalidParametersError:()=>u,InvalidPeerIdError:()=>I,InvalidPrivateKeyError:()=>x,InvalidPublicKeyError:()=>m,KEEP_ALIVE:()=>nr,LimitedConnectionError:()=>K,ListenError:()=>U,MuxerClosedError:()=>b,NotFoundError:()=>v,NotImplementedError:()=>F,NotStartedError:()=>D,ProtocolError:()=>w,StreamResetError:()=>S,StreamStateError:()=>y,StrictNoSign:()=>ir,StrictSign:()=>ar,TimeoutError:()=>T,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>_,TopicValidatorResult:()=>a,TypedEventEmitter:()=>O,UnexpectedPeerError:()=>p,UnsupportedKeyTypeError:()=>B,UnsupportedOperationError:()=>d,UnsupportedProtocolError:()=>L,connectionSymbol:()=>q,contentRoutingSymbol:()=>rr,isConnection:()=>k,isPeerId:()=>or,isPrivateKey:()=>tr,isPubSub:()=>cr,isPublicKey:()=>z,isStartable:()=>j,isTransport:()=>pr,peerDiscoverySymbol:()=>er,peerIdSymbol:()=>G,peerRoutingSymbol:()=>sr,pubSubSymbol:()=>H,serviceCapabilities:()=>xr,serviceDependencies:()=>dr,setMaxListeners:()=>lr,start:()=>ur,stop:()=>mr,transportSymbol:()=>J});var q=Symbol.for("@libp2p/connection");function k(t){return t!=null&&!!t[q]}var rr=Symbol.for("@libp2p/content-routing");function z(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function tr(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&z(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var er=Symbol.for("@libp2p/peer-discovery");var G=Symbol.for("@libp2p/peer-id");function or(t){return!!t?.[G]}var sr=Symbol.for("@libp2p/peer-routing");var nr="keep-alive";var ar="StrictSign",ir="StrictNoSign",a;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(a||(a={}));var H=Symbol.for("@libp2p/pubsub");function cr(t){return!!t?.[H]}var J=Symbol.for("@libp2p/transport");function pr(t){return t!=null&&!!t[J]}var i;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(i||(i={}));var c=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},p=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},l=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},u=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},m=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},x=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},d=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},f=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},E=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},h=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},b=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},y=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},v=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},I=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},g=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},P=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},A=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},L=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},C=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},w=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},T=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},D=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},M=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},N=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},U=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},K=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},_=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},B=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},F=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};function lr(){}var O=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){super.addEventListener(r,e,s);let o=this.#r.get(r);o==null&&(o=[],this.#r.set(r,o)),o.push({callback:e,once:(s!==!0&&s!==!1&&s?.once)??!1})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:Q})=>Q!==e),this.#r.set(r,o))}dispatchEvent(r){let e=super.dispatchEvent(r),s=this.#r.get(r.type);return s==null||(s=s.filter(({once:o})=>!o),this.#r.set(r.type,s)),e}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};function j(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function ur(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function mr(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var xr=Symbol.for("@libp2p/service-capabilities"),dr=Symbol.for("@libp2p/service-dependencies");return $(fr);})(); | ||
return Libp2PInterface})); | ||
//# sourceMappingURL=index.min.js.map |
@@ -6,3 +6,3 @@ import type { RoutingOptions } from './index.js'; | ||
* Any object that implements this Symbol as a property should return a | ||
* ContentRouting instance as the property value, similar to how | ||
* Partial<ContentRouting> instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
@@ -30,3 +30,3 @@ * | ||
export interface ContentRoutingProvider { | ||
[contentRoutingSymbol]: ContentRouting; | ||
[contentRoutingSymbol]: Partial<ContentRouting>; | ||
} | ||
@@ -33,0 +33,0 @@ export interface ContentRouting { |
/** | ||
* Any object that implements this Symbol as a property should return a | ||
* ContentRouting instance as the property value, similar to how | ||
* Partial<ContentRouting> instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
@@ -5,0 +5,0 @@ * |
@@ -211,3 +211,3 @@ /** | ||
/** | ||
* Thrown when and attempt to operate on an unsupported key was made | ||
* Thrown when an attempt to operate on an unsupported key was made | ||
*/ | ||
@@ -218,2 +218,9 @@ export declare class UnsupportedKeyTypeError extends Error { | ||
} | ||
/** | ||
* Thrown when an operation has not been implemented | ||
*/ | ||
export declare class NotImplementedError extends Error { | ||
static name: string; | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=errors.d.ts.map |
@@ -298,3 +298,3 @@ /** | ||
/** | ||
* Thrown when and attempt to operate on an unsupported key was made | ||
* Thrown when an attempt to operate on an unsupported key was made | ||
*/ | ||
@@ -308,2 +308,12 @@ export class UnsupportedKeyTypeError extends Error { | ||
} | ||
/** | ||
* Thrown when an operation has not been implemented | ||
*/ | ||
export class NotImplementedError extends Error { | ||
static name = 'NotImplementedError'; | ||
constructor(message = 'Not implemented') { | ||
super(message); | ||
this.name = 'NotImplementedError'; | ||
} | ||
} | ||
//# sourceMappingURL=errors.js.map |
@@ -9,3 +9,4 @@ export interface EventCallback<EventType> { | ||
/** | ||
* Adds types to the EventTarget class. Hopefully this won't be necessary forever. | ||
* Adds types to the EventTarget class. Hopefully this won't be necessary | ||
* forever. | ||
* | ||
@@ -26,3 +27,2 @@ * https://github.com/microsoft/TypeScript/issues/28357 | ||
* An implementation of a typed event target | ||
* etc | ||
*/ | ||
@@ -29,0 +29,0 @@ export declare class TypedEventEmitter<EventMap extends Record<string, any>> extends EventTarget implements TypedEventTarget<EventMap> { |
import { setMaxListeners } from './events.js'; | ||
/** | ||
* An implementation of a typed event target | ||
* etc | ||
*/ | ||
@@ -6,0 +5,0 @@ export class TypedEventEmitter extends EventTarget { |
@@ -51,2 +51,5 @@ /** | ||
} | ||
/** | ||
* A certificate that can be used to secure connections | ||
*/ | ||
export interface TLSCertificate { | ||
@@ -117,5 +120,39 @@ /** | ||
/** | ||
* Peer logger component for libp2p | ||
* Peer logger component for libp2p. This can be used to create loggers that are | ||
* scoped to individual system components or services. | ||
* | ||
* To see logs, run your app with `DEBUG` set as an env var or for browsers, in | ||
* `localStorage`: | ||
* | ||
* ```console | ||
* $ DEBUG=libp2p* node index.js | ||
* libp2p:my-service hello +0ms | ||
* ``` | ||
*/ | ||
export interface ComponentLogger { | ||
/** | ||
* Returns a logger for the specified component. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { ComponentLogger, Logger } from '@libp2p/interface' | ||
* | ||
* interface MyServiceComponents { | ||
* logger: ComponentLogger | ||
* } | ||
* | ||
* class MyService { | ||
* private readonly log: Logger | ||
* | ||
* constructor (components) { | ||
* this.log = components.logger.forComponent('libp2p:my-service') | ||
* | ||
* this.log('hello') | ||
* // logs: | ||
* // libp2p:my-service hello +0ms | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
forComponent(name: string): Logger; | ||
@@ -122,0 +159,0 @@ } |
@@ -463,3 +463,3 @@ import type { MultiaddrConnection, Stream, Connection } from './connection.js'; | ||
*/ | ||
type YieldType<T extends AsyncIterator<any> | Iterator<any>> = T extends AsyncIterator<infer Y> ? Y : T extends Iterator<infer Y, any, any> ? Y : never; | ||
export type YieldType<T extends AsyncIterator<any> | Iterator<any>> = T extends AsyncIterator<infer Y> ? Y : T extends Iterator<infer Y, any, any> ? Y : never; | ||
export type TraceAttributes = Record<string, number | string | boolean | number[] | string[] | boolean[]>; | ||
@@ -495,3 +495,2 @@ export interface TraceFunctionOptions<A, B> { | ||
} | ||
export {}; | ||
//# sourceMappingURL=metrics.d.ts.map |
@@ -33,4 +33,9 @@ import type { TypedEventTarget } from './event-target.js'; | ||
} | ||
/** | ||
* A class that implements the `PeerDiscovery` interface uses an | ||
* implementation-specific method to discover peers. These peers are then added | ||
* to the peer store for use by other system components and services. | ||
*/ | ||
export interface PeerDiscovery extends TypedEventTarget<PeerDiscoveryEvents> { | ||
} | ||
//# sourceMappingURL=peer-discovery.d.ts.map |
@@ -6,4 +6,4 @@ import type { RoutingOptions } from './index.js'; | ||
* Any object that implements this Symbol as a property should return a | ||
* PeerRouting instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
* PeerRouting instance as the property value, similar to how `Symbol.Iterable` | ||
* can be used to return an `Iterable` from an `Iterator`. | ||
* | ||
@@ -30,3 +30,3 @@ * @example | ||
export interface PeerRoutingProvider { | ||
[peerRoutingSymbol]: PeerRouting; | ||
[peerRoutingSymbol]: Partial<PeerRouting>; | ||
} | ||
@@ -33,0 +33,0 @@ export interface PeerRouting { |
/** | ||
* Any object that implements this Symbol as a property should return a | ||
* PeerRouting instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
* PeerRouting instance as the property value, similar to how `Symbol.Iterable` | ||
* can be used to return an `Iterable` from an `Iterator`. | ||
* | ||
@@ -6,0 +6,0 @@ * @example |
import type { PublicKey } from './keys.js'; | ||
import type { PeerId } from './peer-id.js'; | ||
import type { PeerInfo } from './peer-info.js'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
@@ -209,2 +210,27 @@ /** | ||
/** | ||
* Returns a PeerInfo object for the passed peer id. This is similar to `get` | ||
* except the returned value contains fewer fields and is often used to | ||
* exchange peer information with other systems. | ||
* | ||
* The returned object can be passed to `JSON.stringify` without any | ||
* additional processing. | ||
* | ||
* @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* const peerInfo = await peerStore.getInfo(peerId) | ||
* | ||
* console.info(JSON.stringify(peerInfo)) | ||
* // { | ||
* // id: 'peerId' | ||
* // multiaddrs: [ | ||
* // '...' | ||
* // ] | ||
* // } | ||
* ``` | ||
*/ | ||
getInfo(peerId: PeerId): Promise<PeerInfo>; | ||
/** | ||
* Adds a peer to the peer store, overwriting any existing data | ||
@@ -211,0 +237,0 @@ * |
@@ -130,2 +130,5 @@ import type { Stream } from './connection.js'; | ||
} | ||
/** | ||
* @deprecated This will be removed from `@libp2p/interface` in a future release, pubsub implementations should declare their own types | ||
*/ | ||
export interface PubSub<Events extends Record<string, any> = PubSubEvents> extends TypedEventTarget<Events> { | ||
@@ -132,0 +135,0 @@ /** |
@@ -24,11 +24,35 @@ import type { PublicKey } from './keys.js'; | ||
} | ||
/** | ||
* A message with a signed payload. | ||
*/ | ||
export interface Envelope { | ||
/** | ||
* The public key of the keypair used to sign the payload | ||
*/ | ||
publicKey: PublicKey; | ||
/** | ||
* How the payload should be interpreted | ||
*/ | ||
payloadType: Uint8Array | Uint8ArrayList; | ||
/** | ||
* The contents of the envelope | ||
*/ | ||
payload: Uint8Array; | ||
/** | ||
* A signature that can be used to verify the payload is intact | ||
*/ | ||
signature: Uint8Array | Uint8ArrayList; | ||
/** | ||
* Serialize the envelope to a binary format | ||
*/ | ||
marshal(): Uint8Array; | ||
/** | ||
* Use the public key to validate that the payload is intact | ||
*/ | ||
validate(domain: string): Promise<boolean>; | ||
equals(other: Envelope): boolean; | ||
/** | ||
* Returns true if this envelope has equivalency with the passed object | ||
*/ | ||
equals(other?: Envelope): boolean; | ||
} | ||
//# sourceMappingURL=record.d.ts.map |
@@ -42,5 +42,56 @@ /** | ||
} | ||
export declare function isStartable(obj: any): obj is Startable; | ||
/** | ||
* Returns `true` if the object has type overlap with `Startable` | ||
*/ | ||
export declare function isStartable(obj?: any): obj is Startable; | ||
/** | ||
* A function that can be used to start and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { start } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await start( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export declare function start(...objs: any[]): Promise<void>; | ||
/** | ||
* A function that can be used to stop and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { stop } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await stop( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export declare function stop(...objs: any[]): Promise<void>; | ||
//# sourceMappingURL=startable.d.ts.map |
@@ -0,4 +1,31 @@ | ||
/** | ||
* Returns `true` if the object has type overlap with `Startable` | ||
*/ | ||
export function isStartable(obj) { | ||
return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function'; | ||
} | ||
/** | ||
* A function that can be used to start and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { start } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await start( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export async function start(...objs) { | ||
@@ -25,2 +52,26 @@ const startables = []; | ||
} | ||
/** | ||
* A function that can be used to stop and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { stop } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await stop( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export async function stop(...objs) { | ||
@@ -27,0 +78,0 @@ const startables = []; |
import type { Connection } from './connection.js'; | ||
import type { PeerId } from './peer-id.js'; | ||
/** | ||
* A topology filter | ||
* A topology filter - this can be used by topologies to ensure they do not | ||
* receive duplicate notifications of individual peers | ||
* | ||
@@ -6,0 +7,0 @@ * @see https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerFilter-1.html |
@@ -45,2 +45,5 @@ import type { Connection, ConnectionLimits, MultiaddrConnection } from './connection.js'; | ||
export declare const transportSymbol: unique symbol; | ||
/** | ||
* A filter that acts on a list of multiaddrs | ||
*/ | ||
export interface MultiaddrFilter { | ||
@@ -94,4 +97,7 @@ (multiaddrs: Multiaddr[]): Multiaddr[]; | ||
} | ||
export declare function isTransport(other: any): other is Transport; | ||
/** | ||
* Used to disambiguate transport implementations | ||
*/ | ||
export declare function isTransport(other?: any): other is Transport; | ||
/** | ||
* Enum Transport Manager Fault Tolerance values | ||
@@ -109,7 +115,37 @@ */ | ||
} | ||
/** | ||
* Options accepted by the upgrader during connection establishment | ||
*/ | ||
export interface UpgraderOptions<ConnectionUpgradeEvents extends ProgressEvent = ProgressEvent> extends ProgressOptions<ConnectionUpgradeEvents>, Required<AbortOptions> { | ||
/** | ||
* If true the invoking transport is expected to implement it's own encryption | ||
* and an encryption protocol will not attempted to be negotiated via | ||
* multi-stream select | ||
* | ||
* @default false | ||
*/ | ||
skipEncryption?: boolean; | ||
/** | ||
* If true no connection protection will be performed on the connection. | ||
*/ | ||
skipProtection?: boolean; | ||
/** | ||
* By default a stream muxer protocol will be negotiated via multi-stream | ||
* select after an encryption protocol has been agreed on. | ||
* | ||
* If a transport provides it's own stream muxing facility pass a muxer | ||
* factory instance here to skip muxer negotiation. | ||
*/ | ||
muxerFactory?: StreamMuxerFactory; | ||
/** | ||
* If the connection is to have limits applied to it, pass them here | ||
*/ | ||
limits?: ConnectionLimits; | ||
/** | ||
* Multi-stream select is a initiator/responder protocol. By default a | ||
* connection returned from `upgrader.upgradeOutbound` will be the initiator | ||
* and one returned from `upgrader.upgradeInbound` will be the responder. | ||
* | ||
* Pass a value here to override the default. | ||
*/ | ||
initiator?: boolean; | ||
@@ -116,0 +152,0 @@ } |
export const transportSymbol = Symbol.for('@libp2p/transport'); | ||
/** | ||
* Used to disambiguate transport implementations | ||
*/ | ||
export function isTransport(other) { | ||
@@ -3,0 +6,0 @@ return other != null && Boolean(other[transportSymbol]); |
@@ -23,2 +23,3 @@ { | ||
"NotFoundError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.NotFoundError.html", | ||
"NotImplementedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.NotImplementedError.html", | ||
"NotStartedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.NotStartedError.html", | ||
@@ -198,2 +199,3 @@ "ProtocolError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.ProtocolError.html", | ||
"WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.WriteStatus.html", | ||
"YieldType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.YieldType.html", | ||
"KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.KEEP_ALIVE.html", | ||
@@ -200,0 +202,0 @@ "StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.StrictNoSign.html", |
{ | ||
"name": "@libp2p/interface", | ||
"version": "2.9.0", | ||
"version": "2.10.0", | ||
"description": "The interface implemented by a libp2p node", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -7,3 +7,3 @@ import type { RoutingOptions } from './index.js' | ||
* Any object that implements this Symbol as a property should return a | ||
* ContentRouting instance as the property value, similar to how | ||
* Partial<ContentRouting> instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
@@ -32,3 +32,3 @@ * | ||
export interface ContentRoutingProvider { | ||
[contentRoutingSymbol]: ContentRouting | ||
[contentRoutingSymbol]: Partial<ContentRouting> | ||
} | ||
@@ -35,0 +35,0 @@ |
@@ -356,3 +356,3 @@ /** | ||
/** | ||
* Thrown when and attempt to operate on an unsupported key was made | ||
* Thrown when an attempt to operate on an unsupported key was made | ||
*/ | ||
@@ -367,1 +367,13 @@ export class UnsupportedKeyTypeError extends Error { | ||
} | ||
/** | ||
* Thrown when an operation has not been implemented | ||
*/ | ||
export class NotImplementedError extends Error { | ||
static name = 'NotImplementedError' | ||
constructor (message = 'Not implemented') { | ||
super(message) | ||
this.name = 'NotImplementedError' | ||
} | ||
} |
@@ -13,3 +13,4 @@ import { setMaxListeners } from './events.js' | ||
/** | ||
* Adds types to the EventTarget class. Hopefully this won't be necessary forever. | ||
* Adds types to the EventTarget class. Hopefully this won't be necessary | ||
* forever. | ||
* | ||
@@ -35,3 +36,2 @@ * https://github.com/microsoft/TypeScript/issues/28357 | ||
* An implementation of a typed event target | ||
* etc | ||
*/ | ||
@@ -38,0 +38,0 @@ export class TypedEventEmitter<EventMap extends Record<string, any>> extends EventTarget implements TypedEventTarget<EventMap> { |
@@ -56,2 +56,5 @@ /** | ||
/** | ||
* A certificate that can be used to secure connections | ||
*/ | ||
export interface TLSCertificate { | ||
@@ -134,5 +137,39 @@ /** | ||
/** | ||
* Peer logger component for libp2p | ||
* Peer logger component for libp2p. This can be used to create loggers that are | ||
* scoped to individual system components or services. | ||
* | ||
* To see logs, run your app with `DEBUG` set as an env var or for browsers, in | ||
* `localStorage`: | ||
* | ||
* ```console | ||
* $ DEBUG=libp2p* node index.js | ||
* libp2p:my-service hello +0ms | ||
* ``` | ||
*/ | ||
export interface ComponentLogger { | ||
/** | ||
* Returns a logger for the specified component. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { ComponentLogger, Logger } from '@libp2p/interface' | ||
* | ||
* interface MyServiceComponents { | ||
* logger: ComponentLogger | ||
* } | ||
* | ||
* class MyService { | ||
* private readonly log: Logger | ||
* | ||
* constructor (components) { | ||
* this.log = components.logger.forComponent('libp2p:my-service') | ||
* | ||
* this.log('hello') | ||
* // logs: | ||
* // libp2p:my-service hello +0ms | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
forComponent(name: string): Logger | ||
@@ -139,0 +176,0 @@ } |
@@ -513,3 +513,3 @@ import type { MultiaddrConnection, Stream, Connection } from './connection.js' | ||
*/ | ||
type YieldType<T extends AsyncIterator<any> | Iterator<any>> = T extends AsyncIterator<infer Y> ? Y : T extends Iterator<infer Y, any, any> ? Y : never | ||
export type YieldType<T extends AsyncIterator<any> | Iterator<any>> = T extends AsyncIterator<infer Y> ? Y : T extends Iterator<infer Y, any, any> ? Y : never | ||
@@ -516,0 +516,0 @@ export type TraceAttributes = Record<string, number | string | boolean | number[] | string[] | boolean[]> |
@@ -37,2 +37,7 @@ import type { TypedEventTarget } from './event-target.js' | ||
/** | ||
* A class that implements the `PeerDiscovery` interface uses an | ||
* implementation-specific method to discover peers. These peers are then added | ||
* to the peer store for use by other system components and services. | ||
*/ | ||
export interface PeerDiscovery extends TypedEventTarget<PeerDiscoveryEvents> {} |
@@ -7,4 +7,4 @@ import type { RoutingOptions } from './index.js' | ||
* Any object that implements this Symbol as a property should return a | ||
* PeerRouting instance as the property value, similar to how | ||
* `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. | ||
* PeerRouting instance as the property value, similar to how `Symbol.Iterable` | ||
* can be used to return an `Iterable` from an `Iterator`. | ||
* | ||
@@ -32,3 +32,3 @@ * @example | ||
export interface PeerRoutingProvider { | ||
[peerRoutingSymbol]: PeerRouting | ||
[peerRoutingSymbol]: Partial<PeerRouting> | ||
} | ||
@@ -35,0 +35,0 @@ |
import type { PublicKey } from './keys.js' | ||
import type { PeerId } from './peer-id.js' | ||
import type { PeerInfo } from './peer-info.js' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
@@ -233,2 +234,28 @@ | ||
/** | ||
* Returns a PeerInfo object for the passed peer id. This is similar to `get` | ||
* except the returned value contains fewer fields and is often used to | ||
* exchange peer information with other systems. | ||
* | ||
* The returned object can be passed to `JSON.stringify` without any | ||
* additional processing. | ||
* | ||
* @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* const peerInfo = await peerStore.getInfo(peerId) | ||
* | ||
* console.info(JSON.stringify(peerInfo)) | ||
* // { | ||
* // id: 'peerId' | ||
* // multiaddrs: [ | ||
* // '...' | ||
* // ] | ||
* // } | ||
* ``` | ||
*/ | ||
getInfo (peerId: PeerId): Promise<PeerInfo> | ||
/** | ||
* Adds a peer to the peer store, overwriting any existing data | ||
@@ -235,0 +262,0 @@ * |
@@ -156,2 +156,5 @@ import type { Stream } from './connection.js' | ||
/** | ||
* @deprecated This will be removed from `@libp2p/interface` in a future release, pubsub implementations should declare their own types | ||
*/ | ||
export interface PubSub<Events extends Record<string, any> = PubSubEvents> extends TypedEventTarget<Events> { | ||
@@ -158,0 +161,0 @@ /** |
@@ -26,11 +26,40 @@ import type { PublicKey } from './keys.js' | ||
/** | ||
* A message with a signed payload. | ||
*/ | ||
export interface Envelope { | ||
/** | ||
* The public key of the keypair used to sign the payload | ||
*/ | ||
publicKey: PublicKey | ||
/** | ||
* How the payload should be interpreted | ||
*/ | ||
payloadType: Uint8Array | Uint8ArrayList | ||
/** | ||
* The contents of the envelope | ||
*/ | ||
payload: Uint8Array | ||
/** | ||
* A signature that can be used to verify the payload is intact | ||
*/ | ||
signature: Uint8Array | Uint8ArrayList | ||
/** | ||
* Serialize the envelope to a binary format | ||
*/ | ||
marshal(): Uint8Array | ||
/** | ||
* Use the public key to validate that the payload is intact | ||
*/ | ||
validate(domain: string): Promise<boolean> | ||
equals(other: Envelope): boolean | ||
/** | ||
* Returns true if this envelope has equivalency with the passed object | ||
*/ | ||
equals(other?: Envelope): boolean | ||
} |
@@ -48,6 +48,33 @@ /** | ||
export function isStartable (obj: any): obj is Startable { | ||
/** | ||
* Returns `true` if the object has type overlap with `Startable` | ||
*/ | ||
export function isStartable (obj?: any): obj is Startable { | ||
return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function' | ||
} | ||
/** | ||
* A function that can be used to start and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { start } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await start( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export async function start (...objs: any[]): Promise<void> { | ||
@@ -85,2 +112,26 @@ const startables: Startable[] = [] | ||
/** | ||
* A function that can be used to stop and objects passed to it. This checks | ||
* that an object is startable before invoking its lifecycle methods so it is | ||
* safe to pass non-`Startable`s in. | ||
* | ||
* @example | ||
* | ||
* ```TypeScript | ||
* import { stop } from '@libp2p/interface' | ||
* import type { Startable } from '@libp2p/interface' | ||
* | ||
* const startable: Startable = { | ||
* start: () => {}, | ||
* stop: () => {} | ||
* } | ||
* | ||
* const notStartable = 5 | ||
* | ||
* await stop( | ||
* startable, | ||
* notStartable | ||
* ) | ||
* ``` | ||
*/ | ||
export async function stop (...objs: any[]): Promise<void> { | ||
@@ -87,0 +138,0 @@ const startables: Startable[] = [] |
@@ -5,3 +5,4 @@ import type { Connection } from './connection.js' | ||
/** | ||
* A topology filter | ||
* A topology filter - this can be used by topologies to ensure they do not | ||
* receive duplicate notifications of individual peers | ||
* | ||
@@ -8,0 +9,0 @@ * @see https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerFilter-1.html |
@@ -51,3 +51,8 @@ import type { Connection, ConnectionLimits, MultiaddrConnection } from './connection.js' | ||
export interface MultiaddrFilter { (multiaddrs: Multiaddr[]): Multiaddr[] } | ||
/** | ||
* A filter that acts on a list of multiaddrs | ||
*/ | ||
export interface MultiaddrFilter { | ||
(multiaddrs: Multiaddr[]): Multiaddr[] | ||
} | ||
@@ -107,3 +112,6 @@ export interface CreateListenerOptions { | ||
export function isTransport (other: any): other is Transport { | ||
/** | ||
* Used to disambiguate transport implementations | ||
*/ | ||
export function isTransport (other?: any): other is Transport { | ||
return other != null && Boolean(other[transportSymbol]) | ||
@@ -127,7 +135,41 @@ } | ||
/** | ||
* Options accepted by the upgrader during connection establishment | ||
*/ | ||
export interface UpgraderOptions<ConnectionUpgradeEvents extends ProgressEvent = ProgressEvent> extends ProgressOptions<ConnectionUpgradeEvents>, Required<AbortOptions> { | ||
/** | ||
* If true the invoking transport is expected to implement it's own encryption | ||
* and an encryption protocol will not attempted to be negotiated via | ||
* multi-stream select | ||
* | ||
* @default false | ||
*/ | ||
skipEncryption?: boolean | ||
/** | ||
* If true no connection protection will be performed on the connection. | ||
*/ | ||
skipProtection?: boolean | ||
/** | ||
* By default a stream muxer protocol will be negotiated via multi-stream | ||
* select after an encryption protocol has been agreed on. | ||
* | ||
* If a transport provides it's own stream muxing facility pass a muxer | ||
* factory instance here to skip muxer negotiation. | ||
*/ | ||
muxerFactory?: StreamMuxerFactory | ||
/** | ||
* If the connection is to have limits applied to it, pass them here | ||
*/ | ||
limits?: ConnectionLimits | ||
/** | ||
* Multi-stream select is a initiator/responder protocol. By default a | ||
* connection returned from `upgrader.upgradeOutbound` will be the initiator | ||
* and one returned from `upgrader.upgradeInbound` will be the responder. | ||
* | ||
* Pass a value here to override the default. | ||
*/ | ||
initiator?: boolean | ||
@@ -134,0 +176,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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
457926
33.5%120
0.84%8569
5.56%