@libp2p/interface
Advanced tools
| (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 p=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var or=Object.prototype.hasOwnProperty;var sr=(t,r)=>{for(var e in r)p(t,e,{get:r[e],enumerable:!0})},nr=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of er(r))!or.call(t,o)&&o!==e&&p(t,o,{get:()=>r[o],enumerable:!(s=tr(r,o))||s.enumerable});return t};var ar=t=>nr(p({},"__esModule",{value:!0}),t);var Sr={};sr(Sr,{AbortError:()=>l,AlreadyStartedError:()=>O,ConnectionClosedError:()=>b,ConnectionClosingError:()=>h,ConnectionFailedError:()=>y,DialError:()=>_,FaultTolerance:()=>Q,InvalidCIDError:()=>T,InvalidCryptoExchangeError:()=>m,InvalidMessageError:()=>M,InvalidMultiaddrError:()=>w,InvalidMultihashError:()=>C,InvalidParametersError:()=>x,InvalidPeerIdError:()=>g,InvalidPrivateKeyError:()=>f,InvalidPublicKeyError:()=>d,KEEP_ALIVE:()=>xr,LimitedConnectionError:()=>F,ListenError:()=>B,MuxerClosedError:()=>v,NotFoundError:()=>L,NotImplementedError:()=>V,NotStartedError:()=>K,ProtocolError:()=>U,StreamAbortEvent:()=>G,StreamAbortedError:()=>I,StreamBufferError:()=>A,StreamCloseEvent:()=>a,StreamMessageEvent:()=>z,StreamResetError:()=>S,StreamResetEvent:()=>H,StreamStateError:()=>P,TimeoutError:()=>N,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>q,TypedEventEmitter:()=>W,UnexpectedPeerError:()=>u,UnsupportedKeyTypeError:()=>j,UnsupportedOperationError:()=>E,UnsupportedProtocolError:()=>D,connectionSymbol:()=>X,contentRoutingSymbol:()=>ir,isConnection:()=>cr,isPeerId:()=>ur,isPrivateKey:()=>pr,isPublicKey:()=>Y,isStartable:()=>J,isTransport:()=>Er,peerDiscoverySymbol:()=>lr,peerIdSymbol:()=>Z,peerRoutingSymbol:()=>mr,serviceCapabilities:()=>yr,serviceDependencies:()=>vr,setMaxListeners:()=>k,start:()=>dr,stop:()=>fr,transportSymbol:()=>$});var X=Symbol.for("@libp2p/connection");function cr(t){return t!=null&&!!t[X]}var ir=Symbol.for("@libp2p/content-routing");var l=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},u=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},m=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},x=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},d=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},f=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},E=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},h=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},b=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},y=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},v=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"}},I=class extends Error{static name="StreamAbortedError";constructor(r="The stream has been aborted"){super(r),this.name="StreamAbortedError"}},P=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},A=class extends Error{static name="StreamBufferError";constructor(r="The stream buffer was full"){super(r),this.name="StreamBufferError"}},L=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},g=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},w=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},T=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},C=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},D=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},M=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},U=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},N=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},K=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},O=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},_=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},B=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},F=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"}},q=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},j=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},V=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};var z=class extends Event{data;constructor(r,e){super("message",e),this.data=r}},a=class extends Event{error;local;constructor(r,e,s){super("close",s),this.error=e,this.local=r}},G=class extends a{constructor(r,e){super(!0,r,e)}},H=class extends a{constructor(r,e){super(!1,r,e)}};function Y(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 pr(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&Y(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var lr=Symbol.for("@libp2p/peer-discovery");var Z=Symbol.for("@libp2p/peer-id");function ur(t){return!!t?.[Z]}var mr=Symbol.for("@libp2p/peer-routing");var xr="keep-alive";function J(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function dr(...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 fr(...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 $=Symbol.for("@libp2p/transport");function Er(t){return t!=null&&!!t[$]}var Q;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Q||(Q={}));function k(){}function hr(t){return typeof t?.handleEvent=="function"}function br(t){return(t!==!0&&t!==!1&&t?.once)??!1}var W=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){let o=br(s);super.addEventListener(r,c=>{if(o){let i=this.#r.get(c.type);i!=null&&(i=i.filter(({callback:rr})=>rr!==e),this.#r.set(c.type,i))}hr(e)?e.handleEvent(c):e(c)},s);let n=this.#r.get(r);n==null&&(n=[],this.#r.set(r,n)),n.push({callback:e,once:o})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:n})=>n!==e),this.#r.set(r,o))}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};var yr=Symbol.for("@libp2p/service-capabilities"),vr=Symbol.for("@libp2p/service-dependencies");return ar(Sr);})(); | ||
| "use strict";var Libp2PInterface=(()=>{var p=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var nr=Object.prototype.hasOwnProperty;var ar=(t,r)=>{for(var e in r)p(t,e,{get:r[e],enumerable:!0})},ir=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of sr(r))!nr.call(t,o)&&o!==e&&p(t,o,{get:()=>r[o],enumerable:!(s=or(r,o))||s.enumerable});return t};var cr=t=>ir(p({},"__esModule",{value:!0}),t);var gr={};ar(gr,{AbortError:()=>l,AlreadyStartedError:()=>O,ConnectionClosedError:()=>b,ConnectionClosingError:()=>h,ConnectionFailedError:()=>v,DialError:()=>B,FaultTolerance:()=>Q,InvalidCIDError:()=>T,InvalidCryptoExchangeError:()=>m,InvalidMessageError:()=>M,InvalidMultiaddrError:()=>w,InvalidMultihashError:()=>C,InvalidParametersError:()=>x,InvalidPeerIdError:()=>P,InvalidPrivateKeyError:()=>d,InvalidPublicKeyError:()=>f,KEEP_ALIVE:()=>dr,LimitedConnectionError:()=>F,ListenError:()=>_,MuxerClosedError:()=>y,NotFoundError:()=>A,NotImplementedError:()=>j,NotStartedError:()=>K,ProtocolError:()=>U,StreamAbortEvent:()=>G,StreamAbortedError:()=>I,StreamBufferError:()=>g,StreamCloseEvent:()=>c,StreamMessageEvent:()=>z,StreamResetError:()=>S,StreamResetEvent:()=>H,StreamStateError:()=>L,TimeoutError:()=>N,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>q,TypedEventEmitter:()=>X,UnexpectedPeerError:()=>u,UnsupportedKeyTypeError:()=>V,UnsupportedOperationError:()=>E,UnsupportedProtocolError:()=>D,connectionSymbol:()=>Z,contentRoutingSymbol:()=>lr,isConnection:()=>pr,isPeerId:()=>xr,isPrivateKey:()=>ur,isPublicKey:()=>$,isStartable:()=>J,isTransport:()=>br,peerDiscoverySymbol:()=>mr,peerIdSymbol:()=>k,peerRoutingSymbol:()=>fr,serviceCapabilities:()=>Ir,serviceDependencies:()=>Lr,setMaxListeners:()=>tr,start:()=>Er,stop:()=>hr,transportSymbol:()=>rr});var Z=Symbol.for("@libp2p/connection");function pr(t){return t!=null&&!!t[Z]}var lr=Symbol.for("@libp2p/content-routing");var l=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},u=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},m=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},x=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},f=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},d=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},E=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},h=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},b=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},v=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},y=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"}},I=class extends Error{static name="StreamAbortedError";constructor(r="The stream has been aborted"){super(r),this.name="StreamAbortedError"}},L=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},g=class extends Error{static name="StreamBufferError";constructor(r="The stream buffer was full"){super(r),this.name="StreamBufferError"}},A=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},P=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},w=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},T=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},C=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},D=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},M=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},U=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},N=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},K=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},O=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},B=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},_=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},F=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"}},q=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},V=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},j=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};var z=class extends Event{data;constructor(r,e){super("message",e),this.data=r}},c=class extends Event{error;local;constructor(r,e,s){super("close",s),this.error=e,this.local=r}},G=class extends c{constructor(r,e){super(!0,r,e)}},H=class extends c{constructor(r,e){super(!1,r,e)}};function $(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 ur(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&$(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var mr=Symbol.for("@libp2p/peer-discovery");var k=Symbol.for("@libp2p/peer-id");function xr(t){return!!t?.[k]}var fr=Symbol.for("@libp2p/peer-routing");var dr="keep-alive";function J(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function Er(...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 hr(...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 rr=Symbol.for("@libp2p/transport");function br(t){return t!=null&&!!t[rr]}var Q;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Q||(Q={}));function tr(){}function vr(t){return typeof t?.handleEvent=="function"}function yr(t){return t===!0||t===!1}function Sr(t){return yr(t)?t:t?.capture??!1}function W(t){let r={capture:Sr(t),once:!!t?.once};return t?.passive!=null&&(r.passive=t?.passive),t?.signal!=null&&(r.signal=t?.signal),r}function er(t,r){return W(t).capture===W(r).capture}var X=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){let o=W(s);if(o?.signal?.aborted===!0)return;let n=i=>{o.once&&this.removeEventListener(r,e,o),vr(e)?e.handleEvent(i):e(i)},a=this.#r.get(r);if(a==null&&(a=[],this.#r.set(r,a)),a.some(i=>i.callback!==e?!1:er(i.options,o)))return;super.addEventListener(r,n,o);let Y=()=>{this.removeEventListener(r,e,o)};o.signal?.addEventListener("abort",Y),a.push({callback:e,wrapper:n,options:o,onAbort:Y})}removeEventListener(r,e,s){let o=this.#r.get(r);if(o==null){super.removeEventListener(r,e??null,s);return}this.#r.set(r,o.filter(n=>n.callback===e&&er(n.options,s)?(super.removeEventListener(r,n.wrapper,s),n.options?.signal?.removeEventListener("abort",n.onAbort),!1):!0))}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};var Ir=Symbol.for("@libp2p/service-capabilities"),Lr=Symbol.for("@libp2p/service-dependencies");return cr(gr);})(); | ||
| return Libp2PInterface})); | ||
| //# sourceMappingURL=index.min.js.map |
@@ -87,3 +87,3 @@ import type { AbortOptions, Logger, TypedEventTarget, Stream, MessageStreamEvents, PeerId, MultiaddrConnectionTimeline, MessageStreamStatus, MessageStreamDirection } from './index.ts'; | ||
| */ | ||
| export interface Connection extends TypedEventTarget<Omit<MessageStreamEvents, 'drain' | 'message'>> { | ||
| export interface Connection extends TypedEventTarget<Omit<MessageStreamEvents, 'drain' | 'message' | 'end'>> { | ||
| /** | ||
@@ -90,0 +90,0 @@ * The unique identifier for this connection |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACvL,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAErE,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAA;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,uBAAuB,GACjC,aAAa,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,aAAa,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,CAAA;AAEhE,MAAM,WAAW,gBAAiB,SAAQ,YAAY,EAAE,eAAe,CAAC,uBAAuB,CAAC;IAC9F;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,MAAM,W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B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG;IACH,SAAS,EAAE,sBAAsB,CAAA;IAEjC;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAA;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAA;IAExB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IAEf;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IAEzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEpF;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CACxB;AAED,eAAO,MAAM,gBAAgB,eAAmC,CAAA;AAEhE,wBAAgB,YAAY,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,UAAU,CAE7D"} |
@@ -12,3 +12,3 @@ import type { Uint8ArrayList } from 'uint8arraylist'; | ||
| * An event dispatched when the stream is closed. The `error` property can be | ||
| * inspected to discover if the closing was graceful or not, and the `remote` | ||
| * inspected to discover if the closing was graceful or not, and the `local` | ||
| * property shows which end of the stream initiated the closure | ||
@@ -15,0 +15,0 @@ */ |
@@ -14,3 +14,3 @@ /** | ||
| * An event dispatched when the stream is closed. The `error` property can be | ||
| * inspected to discover if the closing was graceful or not, and the `remote` | ||
| * inspected to discover if the closing was graceful or not, and the `local` | ||
| * property shows which end of the stream initiated the closure | ||
@@ -17,0 +17,0 @@ */ |
@@ -44,4 +44,4 @@ import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.ts'; | ||
| /** | ||
| * The underlying resource is closed - no further events will be emitted and | ||
| * the stream cannot be used to send or receive any more data. | ||
| * The underlying resource is closed and the stream cannot be used to send any | ||
| * more data. | ||
| * | ||
@@ -57,8 +57,20 @@ * When the `.error` field is set, the `local` property of the event will be | ||
| * | ||
| * After this event is received no further 'message' events will be emitted | ||
| * though the stream can still be written to, if it has not been closed at | ||
| * this end. | ||
| * The stream can still be written to, if it has not been closed at this end. | ||
| */ | ||
| remoteCloseWrite: Event; | ||
| /** | ||
| * No more data from the remote will be delivered, so resources tied to | ||
| * reading can be released. | ||
| * | ||
| * Emitted at most once, when the read buffer empties after the remote closes | ||
| * their writable end, or when `.abort` or `Stream.closeRead` close the | ||
| * readable end, discarding anything unread. Consumers that may attach after | ||
| * it has fired should read `readableEnded` rather than wait for it. | ||
| * | ||
| * Unread data defers it, so a stream with no 'message' listener, or one left | ||
| * paused, may close without ever emitting it. Use 'close' as the | ||
| * unconditional signal that a stream is finished. | ||
| */ | ||
| end: Event; | ||
| /** | ||
| * The outgoing write queue emptied - there are no more bytes queued for | ||
@@ -120,2 +132,11 @@ * sending to the remote end of the stream. | ||
| /** | ||
| * True once 'end' has been emitted. Read this instead of waiting for the | ||
| * event, which fires only once and may already have passed. | ||
| * | ||
| * It does not mean the readable end is closed, or that the read buffer is | ||
| * empty. Where the readable end is still open, data can be pushed back | ||
| * after 'end', for example by unwrapping a byte stream that read ahead. | ||
| */ | ||
| readonly readableEnded: boolean; | ||
| /** | ||
| * Returns the number of bytes that are queued to be read | ||
@@ -122,0 +143,0 @@ */ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"message-stream.d.ts","sourceRoot":"","sources":["../../src/message-stream.ts"],"names":[],"mappings":"AAAA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;OAMG;IACH,kBAAkB,EAAE,OAAO,CAAA;IAE3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAE/B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;;;;;;OAQG;IACH,IAAI,CAAE,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAA;IAEjD;;;OAGG;IACH,KAAK,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;;OAGG;IACH,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAExB;;;;;;;OAOG;IACH,KAAK,IAAK,IAAI,CAAA;IAEd;;;;;OAKG;IACH,MAAM,IAAK,IAAI,CAAA;IAEf;;;OAGG;IACH,IAAI,CAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,IAAI,CAAA;IAE7C;;;OAGG;IACH,OAAO,CAAE,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,IAAI,CAAA;IAEjD;;;OAGG;IACH,OAAO,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChD"} |
+1
-1
| { | ||
| "name": "@libp2p/interface", | ||
| "version": "3.2.5-89335e39f", | ||
| "version": "3.2.5-947d304ed", | ||
| "description": "The interface implemented by a libp2p node", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -99,3 +99,3 @@ import type { AbortOptions, Logger, TypedEventTarget, Stream, MessageStreamEvents, PeerId, MultiaddrConnectionTimeline, MessageStreamStatus, MessageStreamDirection } from './index.ts' | ||
| */ | ||
| export interface Connection extends TypedEventTarget<Omit<MessageStreamEvents, 'drain' | 'message'>> { | ||
| export interface Connection extends TypedEventTarget<Omit<MessageStreamEvents, 'drain' | 'message' | 'end'>> { | ||
| /** | ||
@@ -102,0 +102,0 @@ * The unique identifier for this connection |
+1
-1
@@ -19,3 +19,3 @@ import type { Uint8ArrayList } from 'uint8arraylist' | ||
| * An event dispatched when the stream is closed. The `error` property can be | ||
| * inspected to discover if the closing was graceful or not, and the `remote` | ||
| * inspected to discover if the closing was graceful or not, and the `local` | ||
| * property shows which end of the stream initiated the closure | ||
@@ -22,0 +22,0 @@ */ |
@@ -53,4 +53,4 @@ import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.ts' | ||
| /** | ||
| * The underlying resource is closed - no further events will be emitted and | ||
| * the stream cannot be used to send or receive any more data. | ||
| * The underlying resource is closed and the stream cannot be used to send any | ||
| * more data. | ||
| * | ||
@@ -67,5 +67,3 @@ * When the `.error` field is set, the `local` property of the event will be | ||
| * | ||
| * After this event is received no further 'message' events will be emitted | ||
| * though the stream can still be written to, if it has not been closed at | ||
| * this end. | ||
| * The stream can still be written to, if it has not been closed at this end. | ||
| */ | ||
@@ -75,2 +73,17 @@ remoteCloseWrite: Event | ||
| /** | ||
| * No more data from the remote will be delivered, so resources tied to | ||
| * reading can be released. | ||
| * | ||
| * Emitted at most once, when the read buffer empties after the remote closes | ||
| * their writable end, or when `.abort` or `Stream.closeRead` close the | ||
| * readable end, discarding anything unread. Consumers that may attach after | ||
| * it has fired should read `readableEnded` rather than wait for it. | ||
| * | ||
| * Unread data defers it, so a stream with no 'message' listener, or one left | ||
| * paused, may close without ever emitting it. Use 'close' as the | ||
| * unconditional signal that a stream is finished. | ||
| */ | ||
| end: Event | ||
| /** | ||
| * The outgoing write queue emptied - there are no more bytes queued for | ||
@@ -141,2 +154,12 @@ * sending to the remote end of the stream. | ||
| /** | ||
| * True once 'end' has been emitted. Read this instead of waiting for the | ||
| * event, which fires only once and may already have passed. | ||
| * | ||
| * It does not mean the readable end is closed, or that the read buffer is | ||
| * empty. Where the readable end is still open, data can be pushed back | ||
| * after 'end', for example by unwrapping a byte stream that read ahead. | ||
| */ | ||
| readonly readableEnded: boolean | ||
| /** | ||
| * Returns the number of bytes that are queued to be read | ||
@@ -143,0 +166,0 @@ */ |
Sorry, the diff of this file is too big to display
435993
1.47%8365
0.53%