@helia/interface 0.0.0-270bb98 → 0.0.0-5330188
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/index.d.ts +1 -43
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -50
package/dist/src/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ import type { Libp2p } from '@libp2p/interface-libp2p';
|
|
|
17
17
|
import type { Blockstore } from 'interface-blockstore';
|
|
18
18
|
import type { AbortOptions } from '@libp2p/interfaces';
|
|
19
19
|
import type { PeerId } from '@libp2p/interface-peer-id';
|
|
20
|
-
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
21
20
|
import type { Datastore } from 'interface-datastore';
|
|
22
21
|
import type { Pins } from './pins.js';
|
|
23
22
|
import type { ProgressEvent, ProgressOptions } from 'progress-events';
|
|
@@ -42,21 +41,6 @@ export interface Helia {
|
|
|
42
41
|
* Pinning operations for blocks in the blockstore
|
|
43
42
|
*/
|
|
44
43
|
pins: Pins;
|
|
45
|
-
/**
|
|
46
|
-
* Returns information about this node
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* ```typescript
|
|
51
|
-
* import { createHelia } from 'helia'
|
|
52
|
-
*
|
|
53
|
-
* const node = await createHelia()
|
|
54
|
-
* const id = await node.info()
|
|
55
|
-
* console.info(id)
|
|
56
|
-
* // { peerId: PeerId(12D3Foo), ... }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
info: (options?: InfoOptions) => Promise<InfoResponse>;
|
|
60
44
|
/**
|
|
61
45
|
* Starts the Helia node
|
|
62
46
|
*/
|
|
@@ -70,7 +54,7 @@ export interface Helia {
|
|
|
70
54
|
*/
|
|
71
55
|
gc: (options?: GCOptions) => Promise<void>;
|
|
72
56
|
}
|
|
73
|
-
export type GcEvents = ProgressEvent<'helia:gc:deleted', CID>;
|
|
57
|
+
export type GcEvents = ProgressEvent<'helia:gc:deleted', CID> | ProgressEvent<'helia:gc:error', Error>;
|
|
74
58
|
export interface GCOptions extends AbortOptions, ProgressOptions<GcEvents> {
|
|
75
59
|
}
|
|
76
60
|
export interface InfoOptions extends AbortOptions {
|
|
@@ -80,30 +64,4 @@ export interface InfoOptions extends AbortOptions {
|
|
|
80
64
|
*/
|
|
81
65
|
peerId?: PeerId;
|
|
82
66
|
}
|
|
83
|
-
export interface InfoResponse {
|
|
84
|
-
/**
|
|
85
|
-
* The ID of the peer this info is about
|
|
86
|
-
*/
|
|
87
|
-
peerId: PeerId;
|
|
88
|
-
/**
|
|
89
|
-
* The multiaddrs the peer is listening on
|
|
90
|
-
*/
|
|
91
|
-
multiaddrs: Multiaddr[];
|
|
92
|
-
/**
|
|
93
|
-
* The peer's reported agent version
|
|
94
|
-
*/
|
|
95
|
-
agentVersion: string;
|
|
96
|
-
/**
|
|
97
|
-
* The peer's reported protocol version
|
|
98
|
-
*/
|
|
99
|
-
protocolVersion: string;
|
|
100
|
-
/**
|
|
101
|
-
* The protocols the peer supports
|
|
102
|
-
*/
|
|
103
|
-
protocols: string[];
|
|
104
|
-
/**
|
|
105
|
-
* The status of the node
|
|
106
|
-
*/
|
|
107
|
-
status: 'running' | 'stopped';
|
|
108
|
-
}
|
|
109
67
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,S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,WAAW,WAAY,SAAQ,YAAY;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -18,7 +18,6 @@ import type { Libp2p } from '@libp2p/interface-libp2p'
|
|
|
18
18
|
import type { Blockstore } from 'interface-blockstore'
|
|
19
19
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
20
20
|
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
21
|
-
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
22
21
|
import type { Datastore } from 'interface-datastore'
|
|
23
22
|
import type { Pins } from './pins.js'
|
|
24
23
|
import type { ProgressEvent, ProgressOptions } from 'progress-events'
|
|
@@ -48,22 +47,6 @@ export interface Helia {
|
|
|
48
47
|
*/
|
|
49
48
|
pins: Pins
|
|
50
49
|
|
|
51
|
-
/**
|
|
52
|
-
* Returns information about this node
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
*
|
|
56
|
-
* ```typescript
|
|
57
|
-
* import { createHelia } from 'helia'
|
|
58
|
-
*
|
|
59
|
-
* const node = await createHelia()
|
|
60
|
-
* const id = await node.info()
|
|
61
|
-
* console.info(id)
|
|
62
|
-
* // { peerId: PeerId(12D3Foo), ... }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
info: (options?: InfoOptions) => Promise<InfoResponse>
|
|
66
|
-
|
|
67
50
|
/**
|
|
68
51
|
* Starts the Helia node
|
|
69
52
|
*/
|
|
@@ -81,7 +64,8 @@ export interface Helia {
|
|
|
81
64
|
}
|
|
82
65
|
|
|
83
66
|
export type GcEvents =
|
|
84
|
-
ProgressEvent<'helia:gc:deleted', CID>
|
|
67
|
+
ProgressEvent<'helia:gc:deleted', CID> |
|
|
68
|
+
ProgressEvent<'helia:gc:error', Error>
|
|
85
69
|
|
|
86
70
|
export interface GCOptions extends AbortOptions, ProgressOptions<GcEvents> {
|
|
87
71
|
|
|
@@ -94,35 +78,3 @@ export interface InfoOptions extends AbortOptions {
|
|
|
94
78
|
*/
|
|
95
79
|
peerId?: PeerId
|
|
96
80
|
}
|
|
97
|
-
|
|
98
|
-
export interface InfoResponse {
|
|
99
|
-
/**
|
|
100
|
-
* The ID of the peer this info is about
|
|
101
|
-
*/
|
|
102
|
-
peerId: PeerId
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The multiaddrs the peer is listening on
|
|
106
|
-
*/
|
|
107
|
-
multiaddrs: Multiaddr[]
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The peer's reported agent version
|
|
111
|
-
*/
|
|
112
|
-
agentVersion: string
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The peer's reported protocol version
|
|
116
|
-
*/
|
|
117
|
-
protocolVersion: string
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The protocols the peer supports
|
|
121
|
-
*/
|
|
122
|
-
protocols: string[]
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The status of the node
|
|
126
|
-
*/
|
|
127
|
-
status: 'running' | 'stopped'
|
|
128
|
-
}
|