@libp2p/interface 3.2.0 → 3.2.2-5917715d0

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.
@@ -1,5 +1,5 @@
1
- import type { RoutingOptions } from './index.js';
2
- import type { PeerInfo } from './peer-info.js';
1
+ import type { RoutingOptions } from './index.ts';
2
+ import type { PeerInfo } from './peer-info.ts';
3
3
  import type { CID } from 'multiformats/cid';
4
4
  export interface Provider extends PeerInfo {
5
5
  /**
@@ -13,19 +13,19 @@
13
13
  * }
14
14
  * ```
15
15
  */
16
- import type { Connection, NewStreamOptions, NewStreamProgressEvents } from './connection.js';
17
- import type { ContentRouting } from './content-routing.js';
18
- import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.js';
19
- import type { Metrics } from './metrics.js';
20
- import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id.js';
21
- import type { PeerInfo } from './peer-info.js';
22
- import type { PeerRouting } from './peer-routing.js';
23
- import type { Address, Peer, PeerStore } from './peer-store.js';
24
- import type { Startable } from './startable.js';
25
- import type { StreamHandler, StreamHandlerOptions, StreamMiddleware } from './stream-handler.js';
26
- import type { Stream } from './stream.js';
27
- import type { Topology } from './topology.js';
28
- import type { Listener, OutboundConnectionUpgradeEvents } from './transport.js';
16
+ import type { Connection, NewStreamOptions, NewStreamProgressEvents } from './connection.ts';
17
+ import type { ContentRouting } from './content-routing.ts';
18
+ import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.ts';
19
+ import type { Metrics } from './metrics.ts';
20
+ import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id.ts';
21
+ import type { PeerInfo } from './peer-info.ts';
22
+ import type { PeerRouting } from './peer-routing.ts';
23
+ import type { Address, Peer, PeerStore } from './peer-store.ts';
24
+ import type { Startable } from './startable.ts';
25
+ import type { StreamHandler, StreamHandlerOptions, StreamMiddleware } from './stream-handler.ts';
26
+ import type { Stream } from './stream.ts';
27
+ import type { Topology } from './topology.ts';
28
+ import type { Listener, OutboundConnectionUpgradeEvents } from './transport.ts';
29
29
  import type { DNS } from '@multiformats/dns';
30
30
  import type { Multiaddr } from '@multiformats/multiaddr';
31
31
  import type { TypedEventTarget } from 'main-event';
@@ -847,28 +847,28 @@ export declare const serviceCapabilities: unique symbol;
847
847
  * value should be a string array of required capabilities.
848
848
  */
849
849
  export declare const serviceDependencies: unique symbol;
850
- export * from './connection.js';
851
- export * from './connection-encrypter.js';
852
- export * from './connection-gater.js';
853
- export * from './connection-protector.js';
854
- export * from './content-routing.js';
855
- export * from './errors.js';
856
- export * from './events.js';
857
- export * from './keys.js';
858
- export * from './message-stream.js';
859
- export * from './metrics.js';
860
- export * from './multiaddr-connection.js';
861
- export * from './peer-discovery.js';
862
- export * from './peer-id.js';
863
- export * from './peer-info.js';
864
- export * from './peer-routing.js';
865
- export * from './peer-store.js';
866
- export * from './record.js';
867
- export * from './startable.js';
868
- export * from './stream-handler.js';
869
- export * from './stream-muxer.js';
870
- export * from './stream.js';
871
- export * from './topology.js';
872
- export * from './transport.js';
850
+ export * from './connection.ts';
851
+ export * from './connection-encrypter.ts';
852
+ export * from './connection-gater.ts';
853
+ export * from './connection-protector.ts';
854
+ export * from './content-routing.ts';
855
+ export * from './errors.ts';
856
+ export * from './events.ts';
857
+ export * from './keys.ts';
858
+ export * from './message-stream.ts';
859
+ export * from './metrics.ts';
860
+ export * from './multiaddr-connection.ts';
861
+ export * from './peer-discovery.ts';
862
+ export * from './peer-id.ts';
863
+ export * from './peer-info.ts';
864
+ export * from './peer-routing.ts';
865
+ export * from './peer-store.ts';
866
+ export * from './record.ts';
867
+ export * from './startable.ts';
868
+ export * from './stream-handler.ts';
869
+ export * from './stream-muxer.ts';
870
+ export * from './stream.ts';
871
+ export * from './topology.ts';
872
+ export * from './transport.ts';
873
873
  export * from 'main-event';
874
874
  //# sourceMappingURL=index.d.ts.map
package/dist/src/index.js CHANGED
@@ -29,28 +29,28 @@ export const serviceCapabilities = Symbol.for('@libp2p/service-capabilities');
29
29
  * value should be a string array of required capabilities.
30
30
  */
31
31
  export const serviceDependencies = Symbol.for('@libp2p/service-dependencies');
32
- export * from './connection.js';
33
- export * from './connection-encrypter.js';
34
- export * from './connection-gater.js';
35
- export * from './connection-protector.js';
36
- export * from './content-routing.js';
37
- export * from './errors.js';
38
- export * from './events.js';
39
- export * from './keys.js';
40
- export * from './message-stream.js';
41
- export * from './metrics.js';
42
- export * from './multiaddr-connection.js';
43
- export * from './peer-discovery.js';
44
- export * from './peer-id.js';
45
- export * from './peer-info.js';
46
- export * from './peer-routing.js';
47
- export * from './peer-store.js';
48
- export * from './record.js';
49
- export * from './startable.js';
50
- export * from './stream-handler.js';
51
- export * from './stream-muxer.js';
52
- export * from './stream.js';
53
- export * from './topology.js';
54
- export * from './transport.js';
32
+ export * from "./connection.js";
33
+ export * from "./connection-encrypter.js";
34
+ export * from "./connection-gater.js";
35
+ export * from "./connection-protector.js";
36
+ export * from "./content-routing.js";
37
+ export * from "./errors.js";
38
+ export * from "./events.js";
39
+ export * from "./keys.js";
40
+ export * from "./message-stream.js";
41
+ export * from "./metrics.js";
42
+ export * from "./multiaddr-connection.js";
43
+ export * from "./peer-discovery.js";
44
+ export * from "./peer-id.js";
45
+ export * from "./peer-info.js";
46
+ export * from "./peer-routing.js";
47
+ export * from "./peer-store.js";
48
+ export * from "./record.js";
49
+ export * from "./startable.js";
50
+ export * from "./stream-handler.js";
51
+ export * from "./stream-muxer.js";
52
+ export * from "./stream.js";
53
+ export * from "./topology.js";
54
+ export * from "./transport.js";
55
55
  export * from 'main-event';
56
56
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.js';
1
+ import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.ts';
2
2
  import type { Uint8ArrayList } from 'uint8arraylist';
3
3
  /**
4
4
  * The direction of the message stream
@@ -1,4 +1,4 @@
1
- import type { MultiaddrConnection, Stream } from './index.js';
1
+ import type { MultiaddrConnection, Stream } from './index.ts';
2
2
  /**
3
3
  * Create tracked metrics with these options. Loosely based on the
4
4
  * interfaces exposed by the prom-client module
@@ -1,4 +1,4 @@
1
- import type { PeerInfo } from './peer-info.js';
1
+ import type { PeerInfo } from './peer-info.ts';
2
2
  import type { TypedEventTarget } from 'main-event';
3
3
  /**
4
4
  * Any object that implements this Symbol as a property should return a
@@ -1,4 +1,4 @@
1
- import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from './keys.js';
1
+ import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from './keys.ts';
2
2
  import type { CID } from 'multiformats/cid';
3
3
  import type { MultihashDigest } from 'multiformats/hashes/interface';
4
4
  export type PeerIdType = KeyType | string;
@@ -1,4 +1,4 @@
1
- import type { PeerId } from './peer-id.js';
1
+ import type { PeerId } from './peer-id.ts';
2
2
  import type { Multiaddr } from '@multiformats/multiaddr';
3
3
  /**
4
4
  * A `PeerInfo` is a lightweight object that represents a remote peer, it can be
@@ -1,6 +1,6 @@
1
- import type { RoutingOptions } from './index.js';
2
- import type { PeerId } from './peer-id.js';
3
- import type { PeerInfo } from './peer-info.js';
1
+ import type { RoutingOptions } from './index.ts';
2
+ import type { PeerId } from './peer-id.ts';
3
+ import type { PeerInfo } from './peer-info.ts';
4
4
  /**
5
5
  * Any object that implements this Symbol as a property should return a
6
6
  * PeerRouting instance as the property value, similar to how `Symbol.Iterable`
@@ -1,7 +1,7 @@
1
1
  import type { AbortOptions } from './index.ts';
2
- import type { PublicKey } from './keys.js';
3
- import type { PeerId } from './peer-id.js';
4
- import type { PeerInfo } from './peer-info.js';
2
+ import type { PublicKey } from './keys.ts';
3
+ import type { PeerId } from './peer-id.ts';
4
+ import type { PeerInfo } from './peer-info.ts';
5
5
  import type { Multiaddr } from '@multiformats/multiaddr';
6
6
  /**
7
7
  * When a peer that is tagged with this prefix disconnects, we will attempt to
@@ -1,4 +1,4 @@
1
- import type { PublicKey } from './keys.js';
1
+ import type { PublicKey } from './keys.ts';
2
2
  import type { Uint8ArrayList } from 'uint8arraylist';
3
3
  /**
4
4
  * Record is the base implementation of a record that can be used as the payload of a libp2p envelope.
@@ -1,4 +1,4 @@
1
- import type { Stream, TypedEventTarget, MessageStream, AbortOptions } from './index.js';
1
+ import type { Stream, TypedEventTarget, MessageStream, AbortOptions } from './index.ts';
2
2
  /**
3
3
  * User-facing message stream muxer options
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import type { AbortOptions } from './index.ts';
2
- import type { MessageStream, MessageStreamReadStatus, MessageStreamWriteStatus } from './message-stream.js';
2
+ import type { MessageStream, MessageStreamReadStatus, MessageStreamWriteStatus } from './message-stream.ts';
3
3
  /**
4
4
  * A Stream is a lightweight data channel between two peers that can be written
5
5
  * to and read from at both ends.
@@ -1,5 +1,5 @@
1
- import type { Connection } from './connection.js';
2
- import type { PeerId } from './peer-id.js';
1
+ import type { Connection } from './connection.ts';
2
+ import type { PeerId } from './peer-id.ts';
3
3
  /**
4
4
  * A topology filter - this can be used by topologies to ensure they do not
5
5
  * receive duplicate notifications of individual peers
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, ClearableSignal, ConnectionEncrypter, MultiaddrConnection, Connection, ConnectionLimits, StreamMuxerFactory, PeerId } from './index.js';
1
+ import type { AbortOptions, ClearableSignal, ConnectionEncrypter, MultiaddrConnection, Connection, ConnectionLimits, StreamMuxerFactory, PeerId } from './index.ts';
2
2
  import type { Multiaddr } from '@multiformats/multiaddr';
3
3
  import type { TypedEventTarget } from 'main-event';
4
4
  import type { ProgressOptions, ProgressEvent } from 'progress-events';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface",
3
- "version": "3.2.0",
3
+ "version": "3.2.2-5917715d0",
4
4
  "description": "The interface implemented by a libp2p node",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
@@ -30,7 +30,8 @@
30
30
  "exports": {
31
31
  ".": {
32
32
  "types": "./dist/src/index.d.ts",
33
- "import": "./dist/src/index.js"
33
+ "import": "./dist/src/index.js",
34
+ "module-sync": "./dist/src/index.js"
34
35
  }
35
36
  },
36
37
  "scripts": {
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, StreamMuxerFactory, PeerId, MessageStream } from './index.js'
1
+ import type { AbortOptions, StreamMuxerFactory, PeerId, MessageStream } from './index.ts'
2
2
 
3
3
  /**
4
4
  * If the remote PeerId is known and passed as an option, the securing operation
@@ -1,4 +1,4 @@
1
- import type { MultiaddrConnection, PeerId } from './index.js'
1
+ import type { MultiaddrConnection, PeerId } from './index.ts'
2
2
  import type { Multiaddr } from '@multiformats/multiaddr'
3
3
 
4
4
  export interface ConnectionGater {
package/src/connection.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, Logger, TypedEventTarget, Stream, MessageStreamEvents, PeerId, MultiaddrConnectionTimeline, MessageStreamStatus, MessageStreamDirection } from './index.js'
1
+ import type { AbortOptions, Logger, TypedEventTarget, Stream, MessageStreamEvents, PeerId, MultiaddrConnectionTimeline, MessageStreamStatus, MessageStreamDirection } from './index.ts'
2
2
  import type { Multiaddr } from '@multiformats/multiaddr'
3
3
  import type { ProgressEvent, ProgressOptions } from 'progress-events'
4
4
 
@@ -1,5 +1,5 @@
1
- import type { RoutingOptions } from './index.js'
2
- import type { PeerInfo } from './peer-info.js'
1
+ import type { RoutingOptions } from './index.ts'
2
+ import type { PeerInfo } from './peer-info.ts'
3
3
  import type { CID } from 'multiformats/cid'
4
4
 
5
5
  export interface Provider extends PeerInfo {
package/src/index.ts CHANGED
@@ -14,19 +14,19 @@
14
14
  * ```
15
15
  */
16
16
 
17
- import type { Connection, NewStreamOptions, NewStreamProgressEvents } from './connection.js'
18
- import type { ContentRouting } from './content-routing.js'
19
- import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.js'
20
- import type { Metrics } from './metrics.js'
21
- import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id.js'
22
- import type { PeerInfo } from './peer-info.js'
23
- import type { PeerRouting } from './peer-routing.js'
24
- import type { Address, Peer, PeerStore } from './peer-store.js'
25
- import type { Startable } from './startable.js'
26
- import type { StreamHandler, StreamHandlerOptions, StreamMiddleware } from './stream-handler.js'
27
- import type { Stream } from './stream.js'
28
- import type { Topology } from './topology.js'
29
- import type { Listener, OutboundConnectionUpgradeEvents } from './transport.js'
17
+ import type { Connection, NewStreamOptions, NewStreamProgressEvents } from './connection.ts'
18
+ import type { ContentRouting } from './content-routing.ts'
19
+ import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.ts'
20
+ import type { Metrics } from './metrics.ts'
21
+ import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id.ts'
22
+ import type { PeerInfo } from './peer-info.ts'
23
+ import type { PeerRouting } from './peer-routing.ts'
24
+ import type { Address, Peer, PeerStore } from './peer-store.ts'
25
+ import type { Startable } from './startable.ts'
26
+ import type { StreamHandler, StreamHandlerOptions, StreamMiddleware } from './stream-handler.ts'
27
+ import type { Stream } from './stream.ts'
28
+ import type { Topology } from './topology.ts'
29
+ import type { Listener, OutboundConnectionUpgradeEvents } from './transport.ts'
30
30
  import type { DNS } from '@multiformats/dns'
31
31
  import type { Multiaddr } from '@multiformats/multiaddr'
32
32
  import type { TypedEventTarget } from 'main-event'
@@ -947,28 +947,28 @@ export const serviceCapabilities = Symbol.for('@libp2p/service-capabilities')
947
947
  */
948
948
  export const serviceDependencies = Symbol.for('@libp2p/service-dependencies')
949
949
 
950
- export * from './connection.js'
951
- export * from './connection-encrypter.js'
952
- export * from './connection-gater.js'
953
- export * from './connection-protector.js'
954
- export * from './content-routing.js'
955
- export * from './errors.js'
956
- export * from './events.js'
957
- export * from './keys.js'
958
- export * from './message-stream.js'
959
- export * from './metrics.js'
960
- export * from './multiaddr-connection.js'
961
- export * from './peer-discovery.js'
962
- export * from './peer-id.js'
963
- export * from './peer-info.js'
964
- export * from './peer-routing.js'
965
- export * from './peer-store.js'
966
- export * from './record.js'
967
- export * from './startable.js'
968
- export * from './stream-handler.js'
969
- export * from './stream-muxer.js'
970
- export * from './stream.js'
971
- export * from './topology.js'
972
- export * from './transport.js'
950
+ export * from './connection.ts'
951
+ export * from './connection-encrypter.ts'
952
+ export * from './connection-gater.ts'
953
+ export * from './connection-protector.ts'
954
+ export * from './content-routing.ts'
955
+ export * from './errors.ts'
956
+ export * from './events.ts'
957
+ export * from './keys.ts'
958
+ export * from './message-stream.ts'
959
+ export * from './metrics.ts'
960
+ export * from './multiaddr-connection.ts'
961
+ export * from './peer-discovery.ts'
962
+ export * from './peer-id.ts'
963
+ export * from './peer-info.ts'
964
+ export * from './peer-routing.ts'
965
+ export * from './peer-store.ts'
966
+ export * from './record.ts'
967
+ export * from './startable.ts'
968
+ export * from './stream-handler.ts'
969
+ export * from './stream-muxer.ts'
970
+ export * from './stream.ts'
971
+ export * from './topology.ts'
972
+ export * from './transport.ts'
973
973
 
974
974
  export * from 'main-event'
@@ -1,4 +1,4 @@
1
- import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.js'
1
+ import type { Logger, StreamCloseEvent, StreamMessageEvent, TypedEventTarget, AbortOptions } from './index.ts'
2
2
  import type { Uint8ArrayList } from 'uint8arraylist'
3
3
 
4
4
  /**
package/src/metrics.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MultiaddrConnection, Stream } from './index.js'
1
+ import type { MultiaddrConnection, Stream } from './index.ts'
2
2
 
3
3
  /**
4
4
  * Create tracked metrics with these options. Loosely based on the
@@ -1,4 +1,4 @@
1
- import type { PeerInfo } from './peer-info.js'
1
+ import type { PeerInfo } from './peer-info.ts'
2
2
  import type { TypedEventTarget } from 'main-event'
3
3
 
4
4
  /**
package/src/peer-id.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from './keys.js'
1
+ import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from './keys.ts'
2
2
  import type { CID } from 'multiformats/cid'
3
3
  import type { MultihashDigest } from 'multiformats/hashes/interface'
4
4
 
package/src/peer-info.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PeerId } from './peer-id.js'
1
+ import type { PeerId } from './peer-id.ts'
2
2
  import type { Multiaddr } from '@multiformats/multiaddr'
3
3
 
4
4
  /**
@@ -1,6 +1,6 @@
1
- import type { RoutingOptions } from './index.js'
2
- import type { PeerId } from './peer-id.js'
3
- import type { PeerInfo } from './peer-info.js'
1
+ import type { RoutingOptions } from './index.ts'
2
+ import type { PeerId } from './peer-id.ts'
3
+ import type { PeerInfo } from './peer-info.ts'
4
4
 
5
5
  /**
6
6
  * Any object that implements this Symbol as a property should return a
package/src/peer-store.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { AbortOptions } from './index.ts'
2
- import type { PublicKey } from './keys.js'
3
- import type { PeerId } from './peer-id.js'
4
- import type { PeerInfo } from './peer-info.js'
2
+ import type { PublicKey } from './keys.ts'
3
+ import type { PeerId } from './peer-id.ts'
4
+ import type { PeerInfo } from './peer-info.ts'
5
5
  import type { Multiaddr } from '@multiformats/multiaddr'
6
6
 
7
7
  /**
package/src/record.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PublicKey } from './keys.js'
1
+ import type { PublicKey } from './keys.ts'
2
2
  import type { Uint8ArrayList } from 'uint8arraylist'
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { Stream, TypedEventTarget, MessageStream, AbortOptions } from './index.js'
1
+ import type { Stream, TypedEventTarget, MessageStream, AbortOptions } from './index.ts'
2
2
 
3
3
  /**
4
4
  * User-facing message stream muxer options
package/src/stream.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AbortOptions } from './index.ts'
2
- import type { MessageStream, MessageStreamReadStatus, MessageStreamWriteStatus } from './message-stream.js'
2
+ import type { MessageStream, MessageStreamReadStatus, MessageStreamWriteStatus } from './message-stream.ts'
3
3
 
4
4
  /**
5
5
  * A Stream is a lightweight data channel between two peers that can be written
package/src/topology.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Connection } from './connection.js'
2
- import type { PeerId } from './peer-id.js'
1
+ import type { Connection } from './connection.ts'
2
+ import type { PeerId } from './peer-id.ts'
3
3
 
4
4
  /**
5
5
  * A topology filter - this can be used by topologies to ensure they do not
package/src/transport.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, ClearableSignal, ConnectionEncrypter, MultiaddrConnection, Connection, ConnectionLimits, StreamMuxerFactory, PeerId } from './index.js'
1
+ import type { AbortOptions, ClearableSignal, ConnectionEncrypter, MultiaddrConnection, Connection, ConnectionLimits, StreamMuxerFactory, PeerId } from './index.ts'
2
2
  import type { Multiaddr } from '@multiformats/multiaddr'
3
3
  import type { TypedEventTarget } from 'main-event'
4
4
  import type { ProgressOptions, ProgressEvent } from 'progress-events'