@libp2p/pubsub 1.2.9 → 1.2.12

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,669 +0,0 @@
1
- import * as $protobuf from "protobufjs";
2
- /** Properties of a RPC. */
3
- export interface IRPC {
4
-
5
- /** RPC subscriptions */
6
- subscriptions?: (RPC.ISubOpts[]|null);
7
-
8
- /** RPC messages */
9
- messages?: (RPC.IMessage[]|null);
10
-
11
- /** RPC control */
12
- control?: (IControlMessage|null);
13
- }
14
-
15
- /** Represents a RPC. */
16
- export class RPC implements IRPC {
17
-
18
- /**
19
- * Constructs a new RPC.
20
- * @param [p] Properties to set
21
- */
22
- constructor(p?: IRPC);
23
-
24
- /** RPC subscriptions. */
25
- public subscriptions: RPC.ISubOpts[];
26
-
27
- /** RPC messages. */
28
- public messages: RPC.IMessage[];
29
-
30
- /** RPC control. */
31
- public control?: (IControlMessage|null);
32
-
33
- /** RPC _control. */
34
- public _control?: "control";
35
-
36
- /**
37
- * Encodes the specified RPC message. Does not implicitly {@link RPC.verify|verify} messages.
38
- * @param m RPC message or plain object to encode
39
- * @param [w] Writer to encode to
40
- * @returns Writer
41
- */
42
- public static encode(m: IRPC, w?: $protobuf.Writer): $protobuf.Writer;
43
-
44
- /**
45
- * Decodes a RPC message from the specified reader or buffer.
46
- * @param r Reader or buffer to decode from
47
- * @param [l] Message length if known beforehand
48
- * @returns RPC
49
- * @throws {Error} If the payload is not a reader or valid buffer
50
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
51
- */
52
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC;
53
-
54
- /**
55
- * Creates a RPC message from a plain object. Also converts values to their respective internal types.
56
- * @param d Plain object
57
- * @returns RPC
58
- */
59
- public static fromObject(d: { [k: string]: any }): RPC;
60
-
61
- /**
62
- * Creates a plain object from a RPC message. Also converts values to other types if specified.
63
- * @param m RPC
64
- * @param [o] Conversion options
65
- * @returns Plain object
66
- */
67
- public static toObject(m: RPC, o?: $protobuf.IConversionOptions): { [k: string]: any };
68
-
69
- /**
70
- * Converts this RPC to JSON.
71
- * @returns JSON object
72
- */
73
- public toJSON(): { [k: string]: any };
74
- }
75
-
76
- export namespace RPC {
77
-
78
- /** Properties of a SubOpts. */
79
- interface ISubOpts {
80
-
81
- /** SubOpts subscribe */
82
- subscribe?: (boolean|null);
83
-
84
- /** SubOpts topic */
85
- topic?: (string|null);
86
- }
87
-
88
- /** Represents a SubOpts. */
89
- class SubOpts implements ISubOpts {
90
-
91
- /**
92
- * Constructs a new SubOpts.
93
- * @param [p] Properties to set
94
- */
95
- constructor(p?: RPC.ISubOpts);
96
-
97
- /** SubOpts subscribe. */
98
- public subscribe?: (boolean|null);
99
-
100
- /** SubOpts topic. */
101
- public topic?: (string|null);
102
-
103
- /** SubOpts _subscribe. */
104
- public _subscribe?: "subscribe";
105
-
106
- /** SubOpts _topic. */
107
- public _topic?: "topic";
108
-
109
- /**
110
- * Encodes the specified SubOpts message. Does not implicitly {@link RPC.SubOpts.verify|verify} messages.
111
- * @param m SubOpts message or plain object to encode
112
- * @param [w] Writer to encode to
113
- * @returns Writer
114
- */
115
- public static encode(m: RPC.ISubOpts, w?: $protobuf.Writer): $protobuf.Writer;
116
-
117
- /**
118
- * Decodes a SubOpts message from the specified reader or buffer.
119
- * @param r Reader or buffer to decode from
120
- * @param [l] Message length if known beforehand
121
- * @returns SubOpts
122
- * @throws {Error} If the payload is not a reader or valid buffer
123
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
124
- */
125
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC.SubOpts;
126
-
127
- /**
128
- * Creates a SubOpts message from a plain object. Also converts values to their respective internal types.
129
- * @param d Plain object
130
- * @returns SubOpts
131
- */
132
- public static fromObject(d: { [k: string]: any }): RPC.SubOpts;
133
-
134
- /**
135
- * Creates a plain object from a SubOpts message. Also converts values to other types if specified.
136
- * @param m SubOpts
137
- * @param [o] Conversion options
138
- * @returns Plain object
139
- */
140
- public static toObject(m: RPC.SubOpts, o?: $protobuf.IConversionOptions): { [k: string]: any };
141
-
142
- /**
143
- * Converts this SubOpts to JSON.
144
- * @returns JSON object
145
- */
146
- public toJSON(): { [k: string]: any };
147
- }
148
-
149
- /** Properties of a Message. */
150
- interface IMessage {
151
-
152
- /** Message from */
153
- from?: (Uint8Array|null);
154
-
155
- /** Message data */
156
- data?: (Uint8Array|null);
157
-
158
- /** Message seqno */
159
- seqno?: (Uint8Array|null);
160
-
161
- /** Message topic */
162
- topic?: (string|null);
163
-
164
- /** Message signature */
165
- signature?: (Uint8Array|null);
166
-
167
- /** Message key */
168
- key?: (Uint8Array|null);
169
- }
170
-
171
- /** Represents a Message. */
172
- class Message implements IMessage {
173
-
174
- /**
175
- * Constructs a new Message.
176
- * @param [p] Properties to set
177
- */
178
- constructor(p?: RPC.IMessage);
179
-
180
- /** Message from. */
181
- public from?: (Uint8Array|null);
182
-
183
- /** Message data. */
184
- public data?: (Uint8Array|null);
185
-
186
- /** Message seqno. */
187
- public seqno?: (Uint8Array|null);
188
-
189
- /** Message topic. */
190
- public topic?: (string|null);
191
-
192
- /** Message signature. */
193
- public signature?: (Uint8Array|null);
194
-
195
- /** Message key. */
196
- public key?: (Uint8Array|null);
197
-
198
- /** Message _from. */
199
- public _from?: "from";
200
-
201
- /** Message _data. */
202
- public _data?: "data";
203
-
204
- /** Message _seqno. */
205
- public _seqno?: "seqno";
206
-
207
- /** Message _topic. */
208
- public _topic?: "topic";
209
-
210
- /** Message _signature. */
211
- public _signature?: "signature";
212
-
213
- /** Message _key. */
214
- public _key?: "key";
215
-
216
- /**
217
- * Encodes the specified Message message. Does not implicitly {@link RPC.Message.verify|verify} messages.
218
- * @param m Message message or plain object to encode
219
- * @param [w] Writer to encode to
220
- * @returns Writer
221
- */
222
- public static encode(m: RPC.IMessage, w?: $protobuf.Writer): $protobuf.Writer;
223
-
224
- /**
225
- * Decodes a Message message from the specified reader or buffer.
226
- * @param r Reader or buffer to decode from
227
- * @param [l] Message length if known beforehand
228
- * @returns Message
229
- * @throws {Error} If the payload is not a reader or valid buffer
230
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
231
- */
232
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC.Message;
233
-
234
- /**
235
- * Creates a Message message from a plain object. Also converts values to their respective internal types.
236
- * @param d Plain object
237
- * @returns Message
238
- */
239
- public static fromObject(d: { [k: string]: any }): RPC.Message;
240
-
241
- /**
242
- * Creates a plain object from a Message message. Also converts values to other types if specified.
243
- * @param m Message
244
- * @param [o] Conversion options
245
- * @returns Plain object
246
- */
247
- public static toObject(m: RPC.Message, o?: $protobuf.IConversionOptions): { [k: string]: any };
248
-
249
- /**
250
- * Converts this Message to JSON.
251
- * @returns JSON object
252
- */
253
- public toJSON(): { [k: string]: any };
254
- }
255
- }
256
-
257
- /** Properties of a ControlMessage. */
258
- export interface IControlMessage {
259
-
260
- /** ControlMessage ihave */
261
- ihave?: (IControlIHave[]|null);
262
-
263
- /** ControlMessage iwant */
264
- iwant?: (IControlIWant[]|null);
265
-
266
- /** ControlMessage graft */
267
- graft?: (IControlGraft[]|null);
268
-
269
- /** ControlMessage prune */
270
- prune?: (IControlPrune[]|null);
271
- }
272
-
273
- /** Represents a ControlMessage. */
274
- export class ControlMessage implements IControlMessage {
275
-
276
- /**
277
- * Constructs a new ControlMessage.
278
- * @param [p] Properties to set
279
- */
280
- constructor(p?: IControlMessage);
281
-
282
- /** ControlMessage ihave. */
283
- public ihave: IControlIHave[];
284
-
285
- /** ControlMessage iwant. */
286
- public iwant: IControlIWant[];
287
-
288
- /** ControlMessage graft. */
289
- public graft: IControlGraft[];
290
-
291
- /** ControlMessage prune. */
292
- public prune: IControlPrune[];
293
-
294
- /**
295
- * Encodes the specified ControlMessage message. Does not implicitly {@link ControlMessage.verify|verify} messages.
296
- * @param m ControlMessage message or plain object to encode
297
- * @param [w] Writer to encode to
298
- * @returns Writer
299
- */
300
- public static encode(m: IControlMessage, w?: $protobuf.Writer): $protobuf.Writer;
301
-
302
- /**
303
- * Decodes a ControlMessage message from the specified reader or buffer.
304
- * @param r Reader or buffer to decode from
305
- * @param [l] Message length if known beforehand
306
- * @returns ControlMessage
307
- * @throws {Error} If the payload is not a reader or valid buffer
308
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
309
- */
310
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlMessage;
311
-
312
- /**
313
- * Creates a ControlMessage message from a plain object. Also converts values to their respective internal types.
314
- * @param d Plain object
315
- * @returns ControlMessage
316
- */
317
- public static fromObject(d: { [k: string]: any }): ControlMessage;
318
-
319
- /**
320
- * Creates a plain object from a ControlMessage message. Also converts values to other types if specified.
321
- * @param m ControlMessage
322
- * @param [o] Conversion options
323
- * @returns Plain object
324
- */
325
- public static toObject(m: ControlMessage, o?: $protobuf.IConversionOptions): { [k: string]: any };
326
-
327
- /**
328
- * Converts this ControlMessage to JSON.
329
- * @returns JSON object
330
- */
331
- public toJSON(): { [k: string]: any };
332
- }
333
-
334
- /** Properties of a ControlIHave. */
335
- export interface IControlIHave {
336
-
337
- /** ControlIHave topicID */
338
- topicID?: (string|null);
339
-
340
- /** ControlIHave messageIDs */
341
- messageIDs?: (string[]|null);
342
- }
343
-
344
- /** Represents a ControlIHave. */
345
- export class ControlIHave implements IControlIHave {
346
-
347
- /**
348
- * Constructs a new ControlIHave.
349
- * @param [p] Properties to set
350
- */
351
- constructor(p?: IControlIHave);
352
-
353
- /** ControlIHave topicID. */
354
- public topicID?: (string|null);
355
-
356
- /** ControlIHave messageIDs. */
357
- public messageIDs: string[];
358
-
359
- /** ControlIHave _topicID. */
360
- public _topicID?: "topicID";
361
-
362
- /**
363
- * Encodes the specified ControlIHave message. Does not implicitly {@link ControlIHave.verify|verify} messages.
364
- * @param m ControlIHave message or plain object to encode
365
- * @param [w] Writer to encode to
366
- * @returns Writer
367
- */
368
- public static encode(m: IControlIHave, w?: $protobuf.Writer): $protobuf.Writer;
369
-
370
- /**
371
- * Decodes a ControlIHave message from the specified reader or buffer.
372
- * @param r Reader or buffer to decode from
373
- * @param [l] Message length if known beforehand
374
- * @returns ControlIHave
375
- * @throws {Error} If the payload is not a reader or valid buffer
376
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
377
- */
378
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlIHave;
379
-
380
- /**
381
- * Creates a ControlIHave message from a plain object. Also converts values to their respective internal types.
382
- * @param d Plain object
383
- * @returns ControlIHave
384
- */
385
- public static fromObject(d: { [k: string]: any }): ControlIHave;
386
-
387
- /**
388
- * Creates a plain object from a ControlIHave message. Also converts values to other types if specified.
389
- * @param m ControlIHave
390
- * @param [o] Conversion options
391
- * @returns Plain object
392
- */
393
- public static toObject(m: ControlIHave, o?: $protobuf.IConversionOptions): { [k: string]: any };
394
-
395
- /**
396
- * Converts this ControlIHave to JSON.
397
- * @returns JSON object
398
- */
399
- public toJSON(): { [k: string]: any };
400
- }
401
-
402
- /** Properties of a ControlIWant. */
403
- export interface IControlIWant {
404
-
405
- /** ControlIWant messageIDs */
406
- messageIDs?: (string[]|null);
407
- }
408
-
409
- /** Represents a ControlIWant. */
410
- export class ControlIWant implements IControlIWant {
411
-
412
- /**
413
- * Constructs a new ControlIWant.
414
- * @param [p] Properties to set
415
- */
416
- constructor(p?: IControlIWant);
417
-
418
- /** ControlIWant messageIDs. */
419
- public messageIDs: string[];
420
-
421
- /**
422
- * Encodes the specified ControlIWant message. Does not implicitly {@link ControlIWant.verify|verify} messages.
423
- * @param m ControlIWant message or plain object to encode
424
- * @param [w] Writer to encode to
425
- * @returns Writer
426
- */
427
- public static encode(m: IControlIWant, w?: $protobuf.Writer): $protobuf.Writer;
428
-
429
- /**
430
- * Decodes a ControlIWant message from the specified reader or buffer.
431
- * @param r Reader or buffer to decode from
432
- * @param [l] Message length if known beforehand
433
- * @returns ControlIWant
434
- * @throws {Error} If the payload is not a reader or valid buffer
435
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
436
- */
437
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlIWant;
438
-
439
- /**
440
- * Creates a ControlIWant message from a plain object. Also converts values to their respective internal types.
441
- * @param d Plain object
442
- * @returns ControlIWant
443
- */
444
- public static fromObject(d: { [k: string]: any }): ControlIWant;
445
-
446
- /**
447
- * Creates a plain object from a ControlIWant message. Also converts values to other types if specified.
448
- * @param m ControlIWant
449
- * @param [o] Conversion options
450
- * @returns Plain object
451
- */
452
- public static toObject(m: ControlIWant, o?: $protobuf.IConversionOptions): { [k: string]: any };
453
-
454
- /**
455
- * Converts this ControlIWant to JSON.
456
- * @returns JSON object
457
- */
458
- public toJSON(): { [k: string]: any };
459
- }
460
-
461
- /** Properties of a ControlGraft. */
462
- export interface IControlGraft {
463
-
464
- /** ControlGraft topicID */
465
- topicID?: (string|null);
466
- }
467
-
468
- /** Represents a ControlGraft. */
469
- export class ControlGraft implements IControlGraft {
470
-
471
- /**
472
- * Constructs a new ControlGraft.
473
- * @param [p] Properties to set
474
- */
475
- constructor(p?: IControlGraft);
476
-
477
- /** ControlGraft topicID. */
478
- public topicID?: (string|null);
479
-
480
- /** ControlGraft _topicID. */
481
- public _topicID?: "topicID";
482
-
483
- /**
484
- * Encodes the specified ControlGraft message. Does not implicitly {@link ControlGraft.verify|verify} messages.
485
- * @param m ControlGraft message or plain object to encode
486
- * @param [w] Writer to encode to
487
- * @returns Writer
488
- */
489
- public static encode(m: IControlGraft, w?: $protobuf.Writer): $protobuf.Writer;
490
-
491
- /**
492
- * Decodes a ControlGraft message from the specified reader or buffer.
493
- * @param r Reader or buffer to decode from
494
- * @param [l] Message length if known beforehand
495
- * @returns ControlGraft
496
- * @throws {Error} If the payload is not a reader or valid buffer
497
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
498
- */
499
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlGraft;
500
-
501
- /**
502
- * Creates a ControlGraft message from a plain object. Also converts values to their respective internal types.
503
- * @param d Plain object
504
- * @returns ControlGraft
505
- */
506
- public static fromObject(d: { [k: string]: any }): ControlGraft;
507
-
508
- /**
509
- * Creates a plain object from a ControlGraft message. Also converts values to other types if specified.
510
- * @param m ControlGraft
511
- * @param [o] Conversion options
512
- * @returns Plain object
513
- */
514
- public static toObject(m: ControlGraft, o?: $protobuf.IConversionOptions): { [k: string]: any };
515
-
516
- /**
517
- * Converts this ControlGraft to JSON.
518
- * @returns JSON object
519
- */
520
- public toJSON(): { [k: string]: any };
521
- }
522
-
523
- /** Properties of a ControlPrune. */
524
- export interface IControlPrune {
525
-
526
- /** ControlPrune topicID */
527
- topicID?: (string|null);
528
-
529
- /** ControlPrune peers */
530
- peers?: (IPeerInfo[]|null);
531
-
532
- /** ControlPrune backoff */
533
- backoff?: (number|null);
534
- }
535
-
536
- /** Represents a ControlPrune. */
537
- export class ControlPrune implements IControlPrune {
538
-
539
- /**
540
- * Constructs a new ControlPrune.
541
- * @param [p] Properties to set
542
- */
543
- constructor(p?: IControlPrune);
544
-
545
- /** ControlPrune topicID. */
546
- public topicID?: (string|null);
547
-
548
- /** ControlPrune peers. */
549
- public peers: IPeerInfo[];
550
-
551
- /** ControlPrune backoff. */
552
- public backoff?: (number|null);
553
-
554
- /** ControlPrune _topicID. */
555
- public _topicID?: "topicID";
556
-
557
- /** ControlPrune _backoff. */
558
- public _backoff?: "backoff";
559
-
560
- /**
561
- * Encodes the specified ControlPrune message. Does not implicitly {@link ControlPrune.verify|verify} messages.
562
- * @param m ControlPrune message or plain object to encode
563
- * @param [w] Writer to encode to
564
- * @returns Writer
565
- */
566
- public static encode(m: IControlPrune, w?: $protobuf.Writer): $protobuf.Writer;
567
-
568
- /**
569
- * Decodes a ControlPrune message from the specified reader or buffer.
570
- * @param r Reader or buffer to decode from
571
- * @param [l] Message length if known beforehand
572
- * @returns ControlPrune
573
- * @throws {Error} If the payload is not a reader or valid buffer
574
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
575
- */
576
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlPrune;
577
-
578
- /**
579
- * Creates a ControlPrune message from a plain object. Also converts values to their respective internal types.
580
- * @param d Plain object
581
- * @returns ControlPrune
582
- */
583
- public static fromObject(d: { [k: string]: any }): ControlPrune;
584
-
585
- /**
586
- * Creates a plain object from a ControlPrune message. Also converts values to other types if specified.
587
- * @param m ControlPrune
588
- * @param [o] Conversion options
589
- * @returns Plain object
590
- */
591
- public static toObject(m: ControlPrune, o?: $protobuf.IConversionOptions): { [k: string]: any };
592
-
593
- /**
594
- * Converts this ControlPrune to JSON.
595
- * @returns JSON object
596
- */
597
- public toJSON(): { [k: string]: any };
598
- }
599
-
600
- /** Properties of a PeerInfo. */
601
- export interface IPeerInfo {
602
-
603
- /** PeerInfo peerID */
604
- peerID?: (Uint8Array|null);
605
-
606
- /** PeerInfo signedPeerRecord */
607
- signedPeerRecord?: (Uint8Array|null);
608
- }
609
-
610
- /** Represents a PeerInfo. */
611
- export class PeerInfo implements IPeerInfo {
612
-
613
- /**
614
- * Constructs a new PeerInfo.
615
- * @param [p] Properties to set
616
- */
617
- constructor(p?: IPeerInfo);
618
-
619
- /** PeerInfo peerID. */
620
- public peerID?: (Uint8Array|null);
621
-
622
- /** PeerInfo signedPeerRecord. */
623
- public signedPeerRecord?: (Uint8Array|null);
624
-
625
- /** PeerInfo _peerID. */
626
- public _peerID?: "peerID";
627
-
628
- /** PeerInfo _signedPeerRecord. */
629
- public _signedPeerRecord?: "signedPeerRecord";
630
-
631
- /**
632
- * Encodes the specified PeerInfo message. Does not implicitly {@link PeerInfo.verify|verify} messages.
633
- * @param m PeerInfo message or plain object to encode
634
- * @param [w] Writer to encode to
635
- * @returns Writer
636
- */
637
- public static encode(m: IPeerInfo, w?: $protobuf.Writer): $protobuf.Writer;
638
-
639
- /**
640
- * Decodes a PeerInfo message from the specified reader or buffer.
641
- * @param r Reader or buffer to decode from
642
- * @param [l] Message length if known beforehand
643
- * @returns PeerInfo
644
- * @throws {Error} If the payload is not a reader or valid buffer
645
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
646
- */
647
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PeerInfo;
648
-
649
- /**
650
- * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types.
651
- * @param d Plain object
652
- * @returns PeerInfo
653
- */
654
- public static fromObject(d: { [k: string]: any }): PeerInfo;
655
-
656
- /**
657
- * Creates a plain object from a PeerInfo message. Also converts values to other types if specified.
658
- * @param m PeerInfo
659
- * @param [o] Conversion options
660
- * @returns Plain object
661
- */
662
- public static toObject(m: PeerInfo, o?: $protobuf.IConversionOptions): { [k: string]: any };
663
-
664
- /**
665
- * Converts this PeerInfo to JSON.
666
- * @returns JSON object
667
- */
668
- public toJSON(): { [k: string]: any };
669
- }