@libp2p/interface-internal 3.1.14-974e63f20 → 3.1.14-e48eabf67

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.
@@ -42,24 +42,25 @@ export interface Registrar {
42
42
  */
43
43
  getHandler(protocol: string): StreamHandlerRecord;
44
44
  /**
45
- * Retrieve any registered middleware for a given protocol.
46
- *
47
- * @param protocol - The protocol to fetch middleware for
48
- * @returns A list of `StreamMiddleware` implementations
45
+ * Append global middleware, invoked before protocol-specific middleware.
46
+ * This does not register a handler or advertise protocol support.
47
+ */
48
+ use(middleware: StreamMiddleware): void;
49
+ /**
50
+ * Replace the middleware registered for a protocol.
49
51
  */
50
52
  use(protocol: string, middleware: StreamMiddleware[]): void;
51
53
  /**
52
- * Retrieve any registered middleware for a given protocol.
53
- *
54
- * @param protocol - The protocol to fetch middleware for
55
- * @returns A list of `StreamMiddleware` implementations
54
+ * Remove all global registrations of the given middleware.
55
+ */
56
+ unuse(middleware: StreamMiddleware): void;
57
+ /**
58
+ * Remove the middleware registered for a protocol.
56
59
  */
57
60
  unuse(protocol: string): void;
58
61
  /**
59
- * Retrieve any registered middleware for a given protocol.
60
- *
61
- * @param protocol - The protocol to fetch middleware for
62
- * @returns A list of `StreamMiddleware` implementations
62
+ * Return a fresh chain with global middleware before protocol-specific middleware.
63
+ * Mutating the result does not change registered middleware.
63
64
  */
64
65
  getMiddleware(protocol: string): StreamMiddleware[];
65
66
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE3I;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,YAAY,IAAI,MAAM,EAAE,CAAA;IAExB;;;;;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AAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/F;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjE;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;IAEjD;;;OAGG;IACH,GAAG,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAEvC;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;IAE3D;;OAEG;IACH,KAAK,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAEzC;;OAEG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAE7B;;;OAGG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;IAEnD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvF;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B;;;;;;OAMG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAC5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-internal",
3
- "version": "3.1.14-974e63f20",
3
+ "version": "3.1.14-e48eabf67",
4
4
  "description": "Interfaces implemented by internal libp2p components",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme",
@@ -42,8 +42,8 @@
42
42
  "build": "aegir build"
43
43
  },
44
44
  "dependencies": {
45
- "@libp2p/interface": "3.3.1-974e63f20",
46
- "@libp2p/peer-collections": "7.0.29-974e63f20",
45
+ "@libp2p/interface": "3.3.1-e48eabf67",
46
+ "@libp2p/peer-collections": "7.0.29-e48eabf67",
47
47
  "@multiformats/multiaddr": "^13.0.3",
48
48
  "progress-events": "^1.0.1"
49
49
  },
package/src/registrar.ts CHANGED
@@ -47,26 +47,29 @@ export interface Registrar {
47
47
  getHandler(protocol: string): StreamHandlerRecord
48
48
 
49
49
  /**
50
- * Retrieve any registered middleware for a given protocol.
51
- *
52
- * @param protocol - The protocol to fetch middleware for
53
- * @returns A list of `StreamMiddleware` implementations
50
+ * Append global middleware, invoked before protocol-specific middleware.
51
+ * This does not register a handler or advertise protocol support.
52
+ */
53
+ use(middleware: StreamMiddleware): void
54
+
55
+ /**
56
+ * Replace the middleware registered for a protocol.
54
57
  */
55
58
  use(protocol: string, middleware: StreamMiddleware[]): void
56
59
 
57
60
  /**
58
- * Retrieve any registered middleware for a given protocol.
59
- *
60
- * @param protocol - The protocol to fetch middleware for
61
- * @returns A list of `StreamMiddleware` implementations
61
+ * Remove all global registrations of the given middleware.
62
+ */
63
+ unuse(middleware: StreamMiddleware): void
64
+
65
+ /**
66
+ * Remove the middleware registered for a protocol.
62
67
  */
63
68
  unuse(protocol: string): void
64
69
 
65
70
  /**
66
- * Retrieve any registered middleware for a given protocol.
67
- *
68
- * @param protocol - The protocol to fetch middleware for
69
- * @returns A list of `StreamMiddleware` implementations
71
+ * Return a fresh chain with global middleware before protocol-specific middleware.
72
+ * Mutating the result does not change registered middleware.
70
73
  */
71
74
  getMiddleware(protocol: string): StreamMiddleware[]
72
75