@libp2p/peer-store 1.0.6 → 1.0.9

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,222 +1,31 @@
1
- import * as $protobuf from "protobufjs";
2
- /** Properties of a Peer. */
3
- export interface IPeer {
4
-
5
- /** Peer addresses */
6
- addresses?: (IAddress[]|null);
7
-
8
- /** Peer protocols */
9
- protocols?: (string[]|null);
10
-
11
- /** Peer metadata */
12
- metadata?: (IMetadata[]|null);
13
-
14
- /** Peer pubKey */
15
- pubKey?: (Uint8Array|null);
16
-
17
- /** Peer peerRecordEnvelope */
18
- peerRecordEnvelope?: (Uint8Array|null);
1
+ export interface Peer {
2
+ addresses: Address[];
3
+ protocols: string[];
4
+ metadata: Metadata[];
5
+ pubKey?: Uint8Array;
6
+ peerRecordEnvelope?: Uint8Array;
19
7
  }
20
-
21
- /** Represents a Peer. */
22
- export class Peer implements IPeer {
23
-
24
- /**
25
- * Constructs a new Peer.
26
- * @param [p] Properties to set
27
- */
28
- constructor(p?: IPeer);
29
-
30
- /** Peer addresses. */
31
- public addresses: IAddress[];
32
-
33
- /** Peer protocols. */
34
- public protocols: string[];
35
-
36
- /** Peer metadata. */
37
- public metadata: IMetadata[];
38
-
39
- /** Peer pubKey. */
40
- public pubKey?: (Uint8Array|null);
41
-
42
- /** Peer peerRecordEnvelope. */
43
- public peerRecordEnvelope?: (Uint8Array|null);
44
-
45
- /** Peer _pubKey. */
46
- public _pubKey?: "pubKey";
47
-
48
- /** Peer _peerRecordEnvelope. */
49
- public _peerRecordEnvelope?: "peerRecordEnvelope";
50
-
51
- /**
52
- * Encodes the specified Peer message. Does not implicitly {@link Peer.verify|verify} messages.
53
- * @param m Peer message or plain object to encode
54
- * @param [w] Writer to encode to
55
- * @returns Writer
56
- */
57
- public static encode(m: IPeer, w?: $protobuf.Writer): $protobuf.Writer;
58
-
59
- /**
60
- * Decodes a Peer message from the specified reader or buffer.
61
- * @param r Reader or buffer to decode from
62
- * @param [l] Message length if known beforehand
63
- * @returns Peer
64
- * @throws {Error} If the payload is not a reader or valid buffer
65
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
66
- */
67
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Peer;
68
-
69
- /**
70
- * Creates a Peer message from a plain object. Also converts values to their respective internal types.
71
- * @param d Plain object
72
- * @returns Peer
73
- */
74
- public static fromObject(d: { [k: string]: any }): Peer;
75
-
76
- /**
77
- * Creates a plain object from a Peer message. Also converts values to other types if specified.
78
- * @param m Peer
79
- * @param [o] Conversion options
80
- * @returns Plain object
81
- */
82
- public static toObject(m: Peer, o?: $protobuf.IConversionOptions): { [k: string]: any };
83
-
84
- /**
85
- * Converts this Peer to JSON.
86
- * @returns JSON object
87
- */
88
- public toJSON(): { [k: string]: any };
8
+ export declare namespace Peer {
9
+ const codec: () => import("protons-runtime").Codec<Peer>;
10
+ const encode: (obj: Peer) => Uint8Array;
11
+ const decode: (buf: Uint8Array) => Peer;
89
12
  }
90
-
91
- /** Properties of an Address. */
92
- export interface IAddress {
93
-
94
- /** Address multiaddr */
95
- multiaddr?: (Uint8Array|null);
96
-
97
- /** Address isCertified */
98
- isCertified?: (boolean|null);
13
+ export interface Address {
14
+ multiaddr: Uint8Array;
15
+ isCertified?: boolean;
99
16
  }
100
-
101
- /** Represents an Address. */
102
- export class Address implements IAddress {
103
-
104
- /**
105
- * Constructs a new Address.
106
- * @param [p] Properties to set
107
- */
108
- constructor(p?: IAddress);
109
-
110
- /** Address multiaddr. */
111
- public multiaddr: Uint8Array;
112
-
113
- /** Address isCertified. */
114
- public isCertified?: (boolean|null);
115
-
116
- /** Address _isCertified. */
117
- public _isCertified?: "isCertified";
118
-
119
- /**
120
- * Encodes the specified Address message. Does not implicitly {@link Address.verify|verify} messages.
121
- * @param m Address message or plain object to encode
122
- * @param [w] Writer to encode to
123
- * @returns Writer
124
- */
125
- public static encode(m: IAddress, w?: $protobuf.Writer): $protobuf.Writer;
126
-
127
- /**
128
- * Decodes an Address message from the specified reader or buffer.
129
- * @param r Reader or buffer to decode from
130
- * @param [l] Message length if known beforehand
131
- * @returns Address
132
- * @throws {Error} If the payload is not a reader or valid buffer
133
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
134
- */
135
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Address;
136
-
137
- /**
138
- * Creates an Address message from a plain object. Also converts values to their respective internal types.
139
- * @param d Plain object
140
- * @returns Address
141
- */
142
- public static fromObject(d: { [k: string]: any }): Address;
143
-
144
- /**
145
- * Creates a plain object from an Address message. Also converts values to other types if specified.
146
- * @param m Address
147
- * @param [o] Conversion options
148
- * @returns Plain object
149
- */
150
- public static toObject(m: Address, o?: $protobuf.IConversionOptions): { [k: string]: any };
151
-
152
- /**
153
- * Converts this Address to JSON.
154
- * @returns JSON object
155
- */
156
- public toJSON(): { [k: string]: any };
17
+ export declare namespace Address {
18
+ const codec: () => import("protons-runtime").Codec<Address>;
19
+ const encode: (obj: Address) => Uint8Array;
20
+ const decode: (buf: Uint8Array) => Address;
157
21
  }
158
-
159
- /** Properties of a Metadata. */
160
- export interface IMetadata {
161
-
162
- /** Metadata key */
163
- key?: (string|null);
164
-
165
- /** Metadata value */
166
- value?: (Uint8Array|null);
22
+ export interface Metadata {
23
+ key: string;
24
+ value: Uint8Array;
167
25
  }
168
-
169
- /** Represents a Metadata. */
170
- export class Metadata implements IMetadata {
171
-
172
- /**
173
- * Constructs a new Metadata.
174
- * @param [p] Properties to set
175
- */
176
- constructor(p?: IMetadata);
177
-
178
- /** Metadata key. */
179
- public key: string;
180
-
181
- /** Metadata value. */
182
- public value: Uint8Array;
183
-
184
- /**
185
- * Encodes the specified Metadata message. Does not implicitly {@link Metadata.verify|verify} messages.
186
- * @param m Metadata message or plain object to encode
187
- * @param [w] Writer to encode to
188
- * @returns Writer
189
- */
190
- public static encode(m: IMetadata, w?: $protobuf.Writer): $protobuf.Writer;
191
-
192
- /**
193
- * Decodes a Metadata message from the specified reader or buffer.
194
- * @param r Reader or buffer to decode from
195
- * @param [l] Message length if known beforehand
196
- * @returns Metadata
197
- * @throws {Error} If the payload is not a reader or valid buffer
198
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
199
- */
200
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Metadata;
201
-
202
- /**
203
- * Creates a Metadata message from a plain object. Also converts values to their respective internal types.
204
- * @param d Plain object
205
- * @returns Metadata
206
- */
207
- public static fromObject(d: { [k: string]: any }): Metadata;
208
-
209
- /**
210
- * Creates a plain object from a Metadata message. Also converts values to other types if specified.
211
- * @param m Metadata
212
- * @param [o] Conversion options
213
- * @returns Plain object
214
- */
215
- public static toObject(m: Metadata, o?: $protobuf.IConversionOptions): { [k: string]: any };
216
-
217
- /**
218
- * Converts this Metadata to JSON.
219
- * @returns JSON object
220
- */
221
- public toJSON(): { [k: string]: any };
26
+ export declare namespace Metadata {
27
+ const codec: () => import("protons-runtime").Codec<Metadata>;
28
+ const encode: (obj: Metadata) => Uint8Array;
29
+ const decode: (buf: Uint8Array) => Metadata;
222
30
  }
31
+ //# sourceMappingURL=peer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../src/pb/peer.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,OAAO,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,QAAQ,EAAE,QAAQ,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,CAAC,EAAE,UAAU,CAAA;CAChC;AAED,yBAAiB,IAAI,CAAC;IACb,MAAM,KAAK,6CAQjB,CAAA;IAEM,MAAM,MAAM,QAAS,IAAI,KAAG,UAElC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,IAExC,CAAA;CACF;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,UAAU,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,yBAAiB,OAAO,CAAC;IAChB,MAAM,KAAK,gDAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,OAAO,KAAG,UAErC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,OAExC,CAAA;CACF;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,yBAAiB,QAAQ,CAAC;IACjB,MAAM,KAAK,iDAKjB,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,KAAG,UAEtC,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,KAAG,QAExC,CAAA;CACF"}