@libp2p/interface-internal 3.1.14-974e63f20 → 3.1.14-e073d373d
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/src/registrar.d.ts +13 -12
- package/dist/src/registrar.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/registrar.ts +15 -12
package/dist/src/registrar.d.ts
CHANGED
|
@@ -42,24 +42,25 @@ export interface Registrar {
|
|
|
42
42
|
*/
|
|
43
43
|
getHandler(protocol: string): StreamHandlerRecord;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
*
|
|
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":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AEjD;;;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-
|
|
3
|
+
"version": "3.1.14-e073d373d",
|
|
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-
|
|
46
|
-
"@libp2p/peer-collections": "7.0.29-
|
|
45
|
+
"@libp2p/interface": "3.3.1-e073d373d",
|
|
46
|
+
"@libp2p/peer-collections": "7.0.29-e073d373d",
|
|
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
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
*
|
|
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
|
|