@libp2p/interface-internal 2.3.19-0f07e3df5 → 2.3.19-6059227cb
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 +22 -14
- package/dist/src/registrar.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/registrar.ts +25 -18
package/dist/src/registrar.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, AbortOptions } from '@libp2p/interface';
|
|
2
|
-
export type {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
5
|
-
*/
|
|
6
|
-
StreamHandler,
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
9
|
-
*/
|
|
10
|
-
StreamHandlerOptions,
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
13
|
-
*/
|
|
14
|
-
StreamHandlerRecord };
|
|
1
|
+
import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, StreamMiddleware, AbortOptions } from '@libp2p/interface';
|
|
15
2
|
/**
|
|
16
3
|
* The `Registrar` provides an interface for registering protocol handlers -
|
|
17
4
|
* these are invoked when remote peers open streams on the local node with the
|
|
@@ -54,6 +41,27 @@ export interface Registrar {
|
|
|
54
41
|
* @returns A `StreamHandlerRecord` containing the handler and options.
|
|
55
42
|
*/
|
|
56
43
|
getHandler(protocol: string): StreamHandlerRecord;
|
|
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
|
|
49
|
+
*/
|
|
50
|
+
use(protocol: string, middleware: StreamMiddleware[]): void;
|
|
51
|
+
/**
|
|
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
|
|
56
|
+
*/
|
|
57
|
+
unuse(protocol: string): void;
|
|
58
|
+
/**
|
|
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
|
|
63
|
+
*/
|
|
64
|
+
getMiddleware(protocol: string): StreamMiddleware[];
|
|
57
65
|
/**
|
|
58
66
|
* Register a topology handler for a protocol - the topology will be
|
|
59
67
|
* invoked when peers are discovered on the network that support the
|
|
@@ -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,
|
|
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;;;;;;;OAOG;IACH,MAAM,CAAC,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;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;IAE3D;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAE7B;;;;;OAKG;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": "2.3.19-
|
|
3
|
+
"version": "2.3.19-6059227cb",
|
|
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",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"build": "aegir build"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@libp2p/interface": "2.11.0-
|
|
45
|
-
"@libp2p/peer-collections": "6.0.35-
|
|
44
|
+
"@libp2p/interface": "2.11.0-6059227cb",
|
|
45
|
+
"@libp2p/peer-collections": "6.0.35-6059227cb",
|
|
46
46
|
"@multiformats/multiaddr": "^13.0.1",
|
|
47
47
|
"progress-events": "^1.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"aegir": "^47.0.
|
|
50
|
+
"aegir": "^47.0.22"
|
|
51
51
|
},
|
|
52
52
|
"sideEffects": false
|
|
53
53
|
}
|
package/src/registrar.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, AbortOptions } from '@libp2p/interface'
|
|
2
|
-
|
|
3
|
-
export type {
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
6
|
-
*/
|
|
7
|
-
StreamHandler,
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
11
|
-
*/
|
|
12
|
-
StreamHandlerOptions,
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated This type should be imported from @libp2p/interface directly
|
|
16
|
-
*/
|
|
17
|
-
StreamHandlerRecord
|
|
18
|
-
}
|
|
1
|
+
import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, StreamMiddleware, AbortOptions } from '@libp2p/interface'
|
|
19
2
|
|
|
20
3
|
/**
|
|
21
4
|
* The `Registrar` provides an interface for registering protocol handlers -
|
|
@@ -63,6 +46,30 @@ export interface Registrar {
|
|
|
63
46
|
*/
|
|
64
47
|
getHandler(protocol: string): StreamHandlerRecord
|
|
65
48
|
|
|
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
|
|
54
|
+
*/
|
|
55
|
+
use(protocol: string, middleware: StreamMiddleware[]): void
|
|
56
|
+
|
|
57
|
+
/**
|
|
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
|
|
62
|
+
*/
|
|
63
|
+
unuse(protocol: string): void
|
|
64
|
+
|
|
65
|
+
/**
|
|
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
|
|
70
|
+
*/
|
|
71
|
+
getMiddleware(protocol: string): StreamMiddleware[]
|
|
72
|
+
|
|
66
73
|
/**
|
|
67
74
|
* Register a topology handler for a protocol - the topology will be
|
|
68
75
|
* invoked when peers are discovered on the network that support the
|