@libp2p/interface 1.7.0-3c8dd5bbf → 1.7.0-5214dec4a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/src/connection/index.d.ts +32 -8
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/connection-encrypter/index.d.ts +11 -2
- package/dist/src/connection-encrypter/index.d.ts.map +1 -1
- package/dist/src/errors.d.ts +88 -15
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +165 -23
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-target.d.ts +0 -4
- package/dist/src/event-target.d.ts.map +1 -1
- package/dist/src/event-target.js +0 -1
- package/dist/src/event-target.js.map +1 -1
- package/dist/src/index.d.ts +12 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/keys/index.d.ts +75 -24
- package/dist/src/keys/index.d.ts.map +1 -1
- package/dist/src/keys/index.js +1 -3
- package/dist/src/keys/index.js.map +1 -1
- package/dist/src/metrics/index.d.ts +8 -8
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/dist/src/peer-id/index.d.ts +120 -18
- package/dist/src/peer-id/index.d.ts.map +1 -1
- package/dist/src/peer-id/index.js +8 -1
- package/dist/src/peer-id/index.js.map +1 -1
- package/dist/src/peer-store/index.d.ts +5 -2
- package/dist/src/peer-store/index.d.ts.map +1 -1
- package/dist/src/pubsub/index.d.ts +2 -1
- package/dist/src/pubsub/index.d.ts.map +1 -1
- package/dist/src/pubsub/index.js.map +1 -1
- package/dist/src/record/index.d.ts +2 -2
- package/dist/src/record/index.d.ts.map +1 -1
- package/dist/src/stream-handler/index.d.ts +3 -3
- package/dist/src/stream-handler/index.d.ts.map +1 -1
- package/dist/src/topology/index.d.ts +4 -3
- package/dist/src/topology/index.d.ts.map +1 -1
- package/dist/src/transport/index.d.ts +3 -7
- package/dist/src/transport/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/connection/index.ts +34 -8
- package/src/connection-encrypter/index.ts +12 -2
- package/src/errors.ts +185 -29
- package/src/event-target.ts +0 -2
- package/src/index.ts +12 -4
- package/src/keys/index.ts +80 -25
- package/src/metrics/index.ts +8 -8
- package/src/peer-id/index.ts +140 -19
- package/src/peer-store/index.ts +5 -2
- package/src/pubsub/index.ts +2 -1
- package/src/record/index.ts +2 -2
- package/src/stream-handler/index.ts +3 -3
- package/src/topology/index.ts +4 -3
- package/src/transport/index.ts +3 -8
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var
|
|
2
|
+
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var W=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},X=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Q(r))!V.call(t,o)&&o!==e&&n(t,o,{get:()=>r[o],enumerable:!(s=J(r,o))||s.enumerable});return t};var Y=t=>X(n({},"__esModule",{value:!0}),t);var ur={};W(ur,{AbortError:()=>p,AggregateCodeError:()=>l,AlreadyStartedError:()=>N,CodeError:()=>i,ConnectionClosedError:()=>b,ConnectionClosingError:()=>E,ConnectionFailedError:()=>y,DialError:()=>k,FaultTolerance:()=>c,InvalidCIDError:()=>w,InvalidCryptoExchangeError:()=>x,InvalidMessageError:()=>T,InvalidMultiaddrError:()=>I,InvalidMultihashError:()=>A,InvalidParametersError:()=>m,InvalidPeerIdError:()=>L,InvalidPrivateKeyError:()=>f,InvalidPublicKeyError:()=>d,KEEP_ALIVE:()=>or,LimitedConnectionError:()=>U,ListenError:()=>_,NotFoundError:()=>g,NotStartedError:()=>M,ProtocolError:()=>C,StreamResetError:()=>S,StreamStateError:()=>v,StrictNoSign:()=>nr,StrictSign:()=>sr,TimeoutError:()=>D,TooManyInboundProtocolStreamsError:()=>B,TooManyOutboundProtocolStreamsError:()=>j,TopicValidatorResult:()=>a,TypedEventEmitter:()=>R,UnexpectedPeerError:()=>u,UnsupportedKeyTypeError:()=>F,UnsupportedOperationError:()=>h,UnsupportedProtocolError:()=>P,connectionSymbol:()=>q,contentRoutingSymbol:()=>$,isConnection:()=>Z,isPeerId:()=>tr,isStartable:()=>K,isTransport:()=>ar,peerDiscoverySymbol:()=>rr,peerIdSymbol:()=>z,peerRoutingSymbol:()=>er,serviceCapabilities:()=>ir,serviceDependencies:()=>lr,setMaxListeners:()=>O,start:()=>cr,stop:()=>pr,transportSymbol:()=>G});var q=Symbol.for("@libp2p/connection");function Z(t){return t!=null&&!!t[q]}var $=Symbol.for("@libp2p/content-routing");var rr=Symbol.for("@libp2p/peer-discovery");var z=Symbol.for("@libp2p/peer-id");function tr(t){return!!t?.[z]}var er=Symbol.for("@libp2p/peer-routing");var or="keep-alive";var sr="StrictSign",nr="StrictNoSign",a;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(a||(a={}));var G=Symbol.for("@libp2p/transport");function ar(t){return t!=null&&!!t[G]}var c;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(c||(c={}));var p=class extends Error{constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},i=class extends Error{code;props;constructor(r,e,s){super(r),this.code=e,this.name=s?.name??"CodeError",this.props=s??{}}},l=class extends AggregateError{code;props;constructor(r,e,s,o){super(r,e),this.code=s,this.name=o?.name??"AggregateCodeError",this.props=o??{}}},u=class extends Error{constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},x=class extends Error{constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},m=class extends Error{constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},d=class extends Error{constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},f=class extends Error{constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},h=class extends Error{constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},E=class extends Error{constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},b=class extends Error{constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},y=class extends Error{constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},S=class extends Error{constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},v=class extends Error{constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},g=class extends Error{constructor(r="Not found"){super(r),this.name="NotFoundError"}},L=class extends Error{constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},I=class extends Error{constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},w=class extends Error{constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},A=class extends Error{constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},P=class extends Error{constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},T=class extends Error{constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},C=class extends Error{constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},D=class extends Error{constructor(r="Timed out"){super(r),this.name="TimeoutError"}},M=class extends Error{constructor(r="Not started"){super(r),this.name="NotStartedError"}},N=class extends Error{constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},k=class extends Error{constructor(r="Dial error"){super(r),this.name="DialError"}},_=class extends Error{constructor(r="Listen error"){super(r),this.name="ListenError"}},U=class extends Error{constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},B=class extends Error{constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},j=class extends Error{constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},F=class extends Error{constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}};var O=(t,...r)=>{try{[...r]}catch{}};var R=class extends EventTarget{#r=new Map;constructor(){super(),O(1/0,this)}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:H})=>H!==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 K(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function cr(...t){let r=[];for(let e of t)K(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 pr(...t){let r=[];for(let e of t)K(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 ir=Symbol.for("@libp2p/service-capabilities"),lr=Symbol.for("@libp2p/service-dependencies");return Y(ur);})();
|
|
3
3
|
return Libp2PInterface}));
|
|
@@ -157,12 +157,16 @@ export interface NewStreamOptions extends AbortOptions {
|
|
|
157
157
|
*/
|
|
158
158
|
maxOutboundStreams?: number;
|
|
159
159
|
/**
|
|
160
|
-
* Opt-in to running over a
|
|
161
|
-
*
|
|
160
|
+
* Opt-in to running over a limited connection - one that has restrictions
|
|
161
|
+
* on the amount of data that may be transferred or how long it may be open for.
|
|
162
|
+
*
|
|
163
|
+
* These limits are typically enforced by a relay server, if the protocol
|
|
164
|
+
* will be transferring a lot of data or the stream will be open for a long time
|
|
165
|
+
* consider upgrading to a direct connection before opening the stream.
|
|
162
166
|
*
|
|
163
167
|
* @default false
|
|
164
168
|
*/
|
|
165
|
-
|
|
169
|
+
runOnLimitedConnection?: boolean;
|
|
166
170
|
/**
|
|
167
171
|
* By default when negotiating a protocol the dialer writes then protocol name
|
|
168
172
|
* then reads the response.
|
|
@@ -191,6 +195,27 @@ export interface NewStreamOptions extends AbortOptions {
|
|
|
191
195
|
negotiateFully?: boolean;
|
|
192
196
|
}
|
|
193
197
|
export type ConnectionStatus = 'open' | 'closing' | 'closed';
|
|
198
|
+
/**
|
|
199
|
+
* Connection limits are present on connections that are only allowed to
|
|
200
|
+
* transfer a certain amount of bytes or be open for a certain number
|
|
201
|
+
* of seconds.
|
|
202
|
+
*
|
|
203
|
+
* These limits are applied by Circuit Relay v2 servers, for example and
|
|
204
|
+
* the connection will normally be closed abruptly if the limits are
|
|
205
|
+
* exceeded.
|
|
206
|
+
*/
|
|
207
|
+
export interface ConnectionLimits {
|
|
208
|
+
/**
|
|
209
|
+
* If present this is the number of bytes remaining that may be
|
|
210
|
+
* transferred over this connection
|
|
211
|
+
*/
|
|
212
|
+
bytes?: bigint;
|
|
213
|
+
/**
|
|
214
|
+
* If present this is the number of seconds that this connection will
|
|
215
|
+
* remain open for
|
|
216
|
+
*/
|
|
217
|
+
seconds?: number;
|
|
218
|
+
}
|
|
194
219
|
/**
|
|
195
220
|
* A Connection is a high-level representation of a connection
|
|
196
221
|
* to a remote peer that may have been secured by encryption and
|
|
@@ -239,12 +264,11 @@ export interface Connection {
|
|
|
239
264
|
*/
|
|
240
265
|
status: ConnectionStatus;
|
|
241
266
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* over transient connections.
|
|
267
|
+
* If present, this connection has limits applied to it, perhaps by an
|
|
268
|
+
* intermediate relay. Once the limits have been reached the connection will
|
|
269
|
+
* be closed by the relay.
|
|
246
270
|
*/
|
|
247
|
-
|
|
271
|
+
limits?: ConnectionLimits;
|
|
248
272
|
/**
|
|
249
273
|
* The time in milliseconds it takes to make a round trip to the remote peer.
|
|
250
274
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE9C,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAA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E,wBAAgB,YAAY,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,UAAU,CAE7D;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACvE;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IAC9F;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAA;IAErB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAA;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAwVA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEhE,MAAM,UAAU,YAAY,CAAE,KAAU;IACtC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC1D,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { MultiaddrConnection } from '../connection/index.js';
|
|
2
|
+
import type { AbortOptions } from '../index.js';
|
|
2
3
|
import type { PeerId } from '../peer-id/index.js';
|
|
3
4
|
import type { Duplex } from 'it-stream-types';
|
|
4
5
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
6
|
+
/**
|
|
7
|
+
* If the remote PeerId is known and passed as an option, the securing operation
|
|
8
|
+
* will throw if the remote peer cannot prove it has the private key that
|
|
9
|
+
* corresponds to the public key the remote PeerId is derived from.
|
|
10
|
+
*/
|
|
11
|
+
export interface SecureConnectionOptions extends AbortOptions {
|
|
12
|
+
remotePeer?: PeerId;
|
|
13
|
+
}
|
|
5
14
|
/**
|
|
6
15
|
* A libp2p connection encrypter module must be compliant to this interface
|
|
7
16
|
* to ensure all exchanged data between two peers is encrypted.
|
|
@@ -13,13 +22,13 @@ export interface ConnectionEncrypter<Extension = unknown> {
|
|
|
13
22
|
* pass it for extra verification, otherwise it will be determined during
|
|
14
23
|
* the handshake.
|
|
15
24
|
*/
|
|
16
|
-
secureOutbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(
|
|
25
|
+
secureOutbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(connection: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream, Extension>>;
|
|
17
26
|
/**
|
|
18
27
|
* Decrypt incoming data. If the remote PeerId is known,
|
|
19
28
|
* pass it for extra verification, otherwise it will be determined during
|
|
20
29
|
* the handshake
|
|
21
30
|
*/
|
|
22
|
-
secureInbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(
|
|
31
|
+
secureInbound<Stream extends Duplex<AsyncGenerator<Uint8Array | Uint8ArrayList>> = MultiaddrConnection>(connection: Stream, options?: SecureConnectionOptions): Promise<SecuredConnection<Stream, Extension>>;
|
|
23
32
|
}
|
|
24
33
|
export interface SecuredConnection<Stream = any, Extension = unknown> {
|
|
25
34
|
conn: Stream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-encrypter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-encrypter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAEhN;;;;OAIG;IACH,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;CAChN;AAED,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -4,39 +4,112 @@
|
|
|
4
4
|
* AbortSignal.
|
|
5
5
|
*/
|
|
6
6
|
export declare class AbortError extends Error {
|
|
7
|
-
readonly code: string;
|
|
8
|
-
readonly type: string;
|
|
9
7
|
constructor(message?: string);
|
|
10
|
-
static readonly code = "ABORT_ERR";
|
|
11
|
-
static readonly type = "aborted";
|
|
12
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
13
12
|
export declare class CodeError<T extends Record<string, any> = Record<string, never>> extends Error {
|
|
14
13
|
readonly code: string;
|
|
15
14
|
readonly props: T;
|
|
16
15
|
constructor(message: string, code: string, props?: T);
|
|
17
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
18
20
|
export declare class AggregateCodeError<T extends Record<string, any> = Record<string, never>> extends AggregateError {
|
|
19
21
|
readonly code: string;
|
|
20
22
|
readonly props: T;
|
|
21
23
|
constructor(errors: Error[], message: string, code: string, props?: T);
|
|
22
24
|
}
|
|
23
25
|
export declare class UnexpectedPeerError extends Error {
|
|
24
|
-
code: string;
|
|
25
26
|
constructor(message?: string);
|
|
26
|
-
static readonly code = "ERR_UNEXPECTED_PEER";
|
|
27
27
|
}
|
|
28
28
|
export declare class InvalidCryptoExchangeError extends Error {
|
|
29
|
-
code: string;
|
|
30
29
|
constructor(message?: string);
|
|
31
|
-
static readonly code = "ERR_INVALID_CRYPTO_EXCHANGE";
|
|
32
30
|
}
|
|
33
|
-
export declare class
|
|
34
|
-
|
|
31
|
+
export declare class InvalidParametersError extends Error {
|
|
32
|
+
constructor(message?: string);
|
|
33
|
+
}
|
|
34
|
+
export declare class InvalidPublicKeyError extends Error {
|
|
35
|
+
constructor(message?: string);
|
|
36
|
+
}
|
|
37
|
+
export declare class InvalidPrivateKeyError extends Error {
|
|
38
|
+
constructor(message?: string);
|
|
39
|
+
}
|
|
40
|
+
export declare class UnsupportedOperationError extends Error {
|
|
41
|
+
constructor(message?: string);
|
|
42
|
+
}
|
|
43
|
+
export declare class ConnectionClosingError extends Error {
|
|
44
|
+
constructor(message?: string);
|
|
45
|
+
}
|
|
46
|
+
export declare class ConnectionClosedError extends Error {
|
|
47
|
+
constructor(message?: string);
|
|
48
|
+
}
|
|
49
|
+
export declare class ConnectionFailedError extends Error {
|
|
50
|
+
constructor(message?: string);
|
|
51
|
+
}
|
|
52
|
+
export declare class StreamResetError extends Error {
|
|
53
|
+
constructor(message?: string);
|
|
54
|
+
}
|
|
55
|
+
export declare class StreamStateError extends Error {
|
|
56
|
+
constructor(message?: string);
|
|
57
|
+
}
|
|
58
|
+
export declare class NotFoundError extends Error {
|
|
59
|
+
constructor(message?: string);
|
|
60
|
+
}
|
|
61
|
+
export declare class InvalidPeerIdError extends Error {
|
|
62
|
+
constructor(message?: string);
|
|
63
|
+
}
|
|
64
|
+
export declare class InvalidMultiaddrError extends Error {
|
|
65
|
+
constructor(message?: string);
|
|
66
|
+
}
|
|
67
|
+
export declare class InvalidCIDError extends Error {
|
|
68
|
+
constructor(message?: string);
|
|
69
|
+
}
|
|
70
|
+
export declare class InvalidMultihashError extends Error {
|
|
71
|
+
constructor(message?: string);
|
|
72
|
+
}
|
|
73
|
+
export declare class UnsupportedProtocolError extends Error {
|
|
74
|
+
constructor(message?: string);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* An invalid or malformed message was encountered during a protocol exchange
|
|
78
|
+
*/
|
|
79
|
+
export declare class InvalidMessageError extends Error {
|
|
80
|
+
constructor(message?: string);
|
|
81
|
+
}
|
|
82
|
+
export declare class ProtocolError extends Error {
|
|
83
|
+
constructor(message?: string);
|
|
84
|
+
}
|
|
85
|
+
export declare class TimeoutError extends Error {
|
|
86
|
+
constructor(message?: string);
|
|
87
|
+
}
|
|
88
|
+
export declare class NotStartedError extends Error {
|
|
89
|
+
constructor(message?: string);
|
|
90
|
+
}
|
|
91
|
+
export declare class AlreadyStartedError extends Error {
|
|
92
|
+
constructor(message?: string);
|
|
93
|
+
}
|
|
94
|
+
export declare class DialError extends Error {
|
|
95
|
+
constructor(message?: string);
|
|
96
|
+
}
|
|
97
|
+
export declare class ListenError extends Error {
|
|
98
|
+
constructor(message?: string);
|
|
99
|
+
}
|
|
100
|
+
export declare class LimitedConnectionError extends Error {
|
|
101
|
+
constructor(message?: string);
|
|
102
|
+
}
|
|
103
|
+
export declare class TooManyInboundProtocolStreamsError extends Error {
|
|
104
|
+
constructor(message?: string);
|
|
105
|
+
}
|
|
106
|
+
export declare class TooManyOutboundProtocolStreamsError extends Error {
|
|
107
|
+
constructor(message?: string);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Thrown when and attempt to operate on an unsupported key was made
|
|
111
|
+
*/
|
|
112
|
+
export declare class UnsupportedKeyTypeError extends Error {
|
|
35
113
|
constructor(message?: string);
|
|
36
|
-
static readonly code = "ERR_INVALID_CRYPTO_TRANSMISSION";
|
|
37
114
|
}
|
|
38
|
-
export declare const ERR_TIMEOUT = "ERR_TIMEOUT";
|
|
39
|
-
export declare const ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS";
|
|
40
|
-
export declare const ERR_NOT_FOUND = "ERR_NOT_FOUND";
|
|
41
|
-
export declare const ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE";
|
|
42
115
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;gBACtB,OAAO,GAAE,MAAoC;CAI3D;AAED;;GAEG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,KAAK;aAKvE,IAAI,EAAE,MAAM;IAJ9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED;;GAEG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,cAAc;aAMzF,IAAI,EAAE,MAAM;IAL9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAC/B,OAAO,SAAoB;CAIzC;AAED,qBAAa,0BAA2B,SA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,KAAK;gBAC/B,OAAO,SAAoB;CAIzC;AAED,qBAAa,SAAU,SAAQ,KAAK;gBACrB,OAAO,SAAe;CAIpC;AAED,qBAAa,WAAY,SAAQ,KAAK;gBACvB,OAAO,SAAiB;CAItC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBAClC,OAAO,SAAuB;CAI5C;AAED,qBAAa,kCAAmC,SAAQ,KAAK;gBAC9C,OAAO,SAAsC;CAI3D;AAED,qBAAa,mCAAoC,SAAQ,KAAK;gBAC/C,OAAO,SAAuC;CAI5D;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACnC,OAAO,SAAyB;CAI9C"}
|
package/dist/src/errors.js
CHANGED
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
* AbortSignal.
|
|
5
5
|
*/
|
|
6
6
|
export class AbortError extends Error {
|
|
7
|
-
code;
|
|
8
|
-
type;
|
|
9
7
|
constructor(message = 'The operation was aborted') {
|
|
10
8
|
super(message);
|
|
11
9
|
this.name = 'AbortError';
|
|
12
|
-
this.code = AbortError.code;
|
|
13
|
-
this.type = AbortError.type;
|
|
14
10
|
}
|
|
15
|
-
static code = 'ABORT_ERR';
|
|
16
|
-
static type = 'aborted';
|
|
17
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
18
15
|
export class CodeError extends Error {
|
|
19
16
|
code;
|
|
20
17
|
props;
|
|
@@ -25,6 +22,9 @@ export class CodeError extends Error {
|
|
|
25
22
|
this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions
|
|
26
23
|
}
|
|
27
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
28
|
export class AggregateCodeError extends AggregateError {
|
|
29
29
|
code;
|
|
30
30
|
props;
|
|
@@ -36,35 +36,177 @@ export class AggregateCodeError extends AggregateError {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export class UnexpectedPeerError extends Error {
|
|
39
|
-
code;
|
|
40
39
|
constructor(message = 'Unexpected Peer') {
|
|
41
40
|
super(message);
|
|
42
41
|
this.name = 'UnexpectedPeerError';
|
|
43
|
-
this.code = UnexpectedPeerError.code;
|
|
44
42
|
}
|
|
45
|
-
static code = 'ERR_UNEXPECTED_PEER';
|
|
46
43
|
}
|
|
47
44
|
export class InvalidCryptoExchangeError extends Error {
|
|
48
|
-
code;
|
|
49
45
|
constructor(message = 'Invalid crypto exchange') {
|
|
50
46
|
super(message);
|
|
51
47
|
this.name = 'InvalidCryptoExchangeError';
|
|
52
|
-
this.code = InvalidCryptoExchangeError.code;
|
|
53
48
|
}
|
|
54
|
-
static code = 'ERR_INVALID_CRYPTO_EXCHANGE';
|
|
55
49
|
}
|
|
56
|
-
export class
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
export class InvalidParametersError extends Error {
|
|
51
|
+
constructor(message = 'Invalid parameters') {
|
|
52
|
+
super(message);
|
|
53
|
+
this.name = 'InvalidParametersError';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class InvalidPublicKeyError extends Error {
|
|
57
|
+
constructor(message = 'Invalid public key') {
|
|
58
|
+
super(message);
|
|
59
|
+
this.name = 'InvalidPublicKeyError';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export class InvalidPrivateKeyError extends Error {
|
|
63
|
+
constructor(message = 'Invalid private key') {
|
|
64
|
+
super(message);
|
|
65
|
+
this.name = 'InvalidPrivateKeyError';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class UnsupportedOperationError extends Error {
|
|
69
|
+
constructor(message = 'Unsupported operation') {
|
|
70
|
+
super(message);
|
|
71
|
+
this.name = 'UnsupportedOperationError';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export class ConnectionClosingError extends Error {
|
|
75
|
+
constructor(message = 'The connection is closing') {
|
|
76
|
+
super(message);
|
|
77
|
+
this.name = 'ConnectionClosingError';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class ConnectionClosedError extends Error {
|
|
81
|
+
constructor(message = 'The connection is closed') {
|
|
82
|
+
super(message);
|
|
83
|
+
this.name = 'ConnectionClosedError';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export class ConnectionFailedError extends Error {
|
|
87
|
+
constructor(message = 'Connection failed') {
|
|
88
|
+
super(message);
|
|
89
|
+
this.name = 'ConnectionFailedError';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export class StreamResetError extends Error {
|
|
93
|
+
constructor(message = 'The stream has been reset') {
|
|
94
|
+
super(message);
|
|
95
|
+
this.name = 'StreamResetError';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export class StreamStateError extends Error {
|
|
99
|
+
constructor(message = 'The stream is in an invalid state') {
|
|
100
|
+
super(message);
|
|
101
|
+
this.name = 'StreamStateError';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export class NotFoundError extends Error {
|
|
105
|
+
constructor(message = 'Not found') {
|
|
106
|
+
super(message);
|
|
107
|
+
this.name = 'NotFoundError';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export class InvalidPeerIdError extends Error {
|
|
111
|
+
constructor(message = 'Invalid PeerID') {
|
|
112
|
+
super(message);
|
|
113
|
+
this.name = 'InvalidPeerIdError';
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export class InvalidMultiaddrError extends Error {
|
|
117
|
+
constructor(message = 'Invalid multiaddr') {
|
|
118
|
+
super(message);
|
|
119
|
+
this.name = 'InvalidMultiaddrError';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export class InvalidCIDError extends Error {
|
|
123
|
+
constructor(message = 'Invalid CID') {
|
|
124
|
+
super(message);
|
|
125
|
+
this.name = 'InvalidCIDError';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class InvalidMultihashError extends Error {
|
|
129
|
+
constructor(message = 'Invalid Multihash') {
|
|
130
|
+
super(message);
|
|
131
|
+
this.name = 'InvalidMultihashError';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export class UnsupportedProtocolError extends Error {
|
|
135
|
+
constructor(message = 'Unsupported protocol error') {
|
|
136
|
+
super(message);
|
|
137
|
+
this.name = 'UnsupportedProtocolError';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* An invalid or malformed message was encountered during a protocol exchange
|
|
142
|
+
*/
|
|
143
|
+
export class InvalidMessageError extends Error {
|
|
144
|
+
constructor(message = 'Invalid message') {
|
|
145
|
+
super(message);
|
|
146
|
+
this.name = 'InvalidMessageError';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export class ProtocolError extends Error {
|
|
150
|
+
constructor(message = 'Protocol error') {
|
|
151
|
+
super(message);
|
|
152
|
+
this.name = 'ProtocolError';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export class TimeoutError extends Error {
|
|
156
|
+
constructor(message = 'Timed out') {
|
|
157
|
+
super(message);
|
|
158
|
+
this.name = 'TimeoutError';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export class NotStartedError extends Error {
|
|
162
|
+
constructor(message = 'Not started') {
|
|
163
|
+
super(message);
|
|
164
|
+
this.name = 'NotStartedError';
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export class AlreadyStartedError extends Error {
|
|
168
|
+
constructor(message = 'Already started') {
|
|
169
|
+
super(message);
|
|
170
|
+
this.name = 'AlreadyStartedError';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export class DialError extends Error {
|
|
174
|
+
constructor(message = 'Dial error') {
|
|
175
|
+
super(message);
|
|
176
|
+
this.name = 'DialError';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
export class ListenError extends Error {
|
|
180
|
+
constructor(message = 'Listen error') {
|
|
181
|
+
super(message);
|
|
182
|
+
this.name = 'ListenError';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
export class LimitedConnectionError extends Error {
|
|
186
|
+
constructor(message = 'Limited connection') {
|
|
187
|
+
super(message);
|
|
188
|
+
this.name = 'LimitedConnectionError';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
export class TooManyInboundProtocolStreamsError extends Error {
|
|
192
|
+
constructor(message = 'Too many inbound protocol streams') {
|
|
193
|
+
super(message);
|
|
194
|
+
this.name = 'TooManyInboundProtocolStreamsError';
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
export class TooManyOutboundProtocolStreamsError extends Error {
|
|
198
|
+
constructor(message = 'Too many outbound protocol streams') {
|
|
199
|
+
super(message);
|
|
200
|
+
this.name = 'TooManyOutboundProtocolStreamsError';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Thrown when and attempt to operate on an unsupported key was made
|
|
205
|
+
*/
|
|
206
|
+
export class UnsupportedKeyTypeError extends Error {
|
|
207
|
+
constructor(message = 'Unsupported key type') {
|
|
59
208
|
super(message);
|
|
60
|
-
this.name = '
|
|
61
|
-
this.code = InvalidCryptoTransmissionError.code;
|
|
209
|
+
this.name = 'UnsupportedKeyTypeError';
|
|
62
210
|
}
|
|
63
|
-
static code = 'ERR_INVALID_CRYPTO_TRANSMISSION';
|
|
64
211
|
}
|
|
65
|
-
// Error codes
|
|
66
|
-
export const ERR_TIMEOUT = 'ERR_TIMEOUT';
|
|
67
|
-
export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS';
|
|
68
|
-
export const ERR_NOT_FOUND = 'ERR_NOT_FOUND';
|
|
69
|
-
export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE';
|
|
70
212
|
//# sourceMappingURL=errors.js.map
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MA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QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAa,OAAO,GAAG,oBAAoB;QACzC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;IACtC,CAAC;CACF;AAED,MAAM,OAAO,kCAAmC,SAAQ,KAAK;IAC3D,YAAa,OAAO,GAAG,mCAAmC;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAA;IAClD,CAAC;CACF;AAED,MAAM,OAAO,mCAAoC,SAAQ,KAAK;IAC5D,YAAa,OAAO,GAAG,oCAAoC;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,qCAAqC,CAAA;IACnD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAa,OAAO,GAAG,sBAAsB;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF"}
|
|
@@ -33,8 +33,4 @@ export declare class TypedEventEmitter<EventMap extends Record<string, any>> ext
|
|
|
33
33
|
dispatchEvent(event: Event): boolean;
|
|
34
34
|
safeDispatchEvent<Detail>(type: keyof EventMap, detail?: CustomEventInit<Detail>): boolean;
|
|
35
35
|
}
|
|
36
|
-
export declare const CustomEvent: {
|
|
37
|
-
new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): CustomEvent<T>;
|
|
38
|
-
prototype: CustomEvent<any>;
|
|
39
|
-
};
|
|
40
36
|
//# sourceMappingURL=event-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-target.d.ts","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa,CAAC,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