protobufjs 4.1.1 → 5.0.1

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.
Files changed (72) hide show
  1. package/.travis.yml +2 -1
  2. package/README.md +17 -17
  3. package/bower.json +2 -2
  4. package/cli/pbjs/targets/json.js +3 -2
  5. package/cli/pbjs/targets/proto.js +48 -24
  6. package/cli/pbjs.js +8 -1
  7. package/dist/README.md +10 -10
  8. package/dist/{ProtoBuf-light.js → protobuf-light.js} +49 -43
  9. package/dist/protobuf-light.min.js +87 -0
  10. package/dist/protobuf-light.min.js.gz +0 -0
  11. package/dist/protobuf-light.min.map +8 -0
  12. package/dist/{ProtoBuf.js → protobuf.js} +103 -66
  13. package/dist/protobuf.min.js +108 -0
  14. package/dist/protobuf.min.js.gz +0 -0
  15. package/dist/protobuf.min.map +8 -0
  16. package/docs/ProtoBuf.Builder.Message.html +106 -37
  17. package/docs/ProtoBuf.Builder.Service.html +9 -9
  18. package/docs/ProtoBuf.Builder.html +22 -22
  19. package/docs/ProtoBuf.DotProto.Parser.html +7 -7
  20. package/docs/ProtoBuf.DotProto.Tokenizer.html +11 -11
  21. package/docs/ProtoBuf.DotProto.html +2 -2
  22. package/docs/ProtoBuf.Map.html +6 -6
  23. package/docs/ProtoBuf.Reflect.Element.html +7 -7
  24. package/docs/ProtoBuf.Reflect.Enum.Value.html +10 -10
  25. package/docs/ProtoBuf.Reflect.Enum.html +21 -21
  26. package/docs/ProtoBuf.Reflect.Extension.html +3 -3
  27. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +29 -29
  28. package/docs/ProtoBuf.Reflect.Message.Field.html +28 -28
  29. package/docs/ProtoBuf.Reflect.Message.OneOf.html +10 -10
  30. package/docs/ProtoBuf.Reflect.Message.html +31 -28
  31. package/docs/ProtoBuf.Reflect.Namespace.html +19 -19
  32. package/docs/ProtoBuf.Reflect.Service.Method.html +11 -11
  33. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +17 -17
  34. package/docs/ProtoBuf.Reflect.Service.html +20 -20
  35. package/docs/ProtoBuf.Reflect.T.html +9 -9
  36. package/docs/ProtoBuf.Reflect.html +2 -2
  37. package/docs/ProtoBuf.Util.html +2 -151
  38. package/docs/ProtoBuf.html +9 -9
  39. package/docs/ProtoBuf.js.html +104 -67
  40. package/docs/index.html +1 -1
  41. package/donate.png +0 -0
  42. package/externs/{ProtoBuf.js → protobuf.js} +933 -922
  43. package/index.js +1 -18
  44. package/package.json +12 -11
  45. package/protobuf.png +0 -0
  46. package/sandbox/issue347/index.js +27 -0
  47. package/sandbox/issue355/main.proto +15 -0
  48. package/scripts/build.js +4 -9
  49. package/src/ProtoBuf/Builder/Message.js +9 -4
  50. package/src/ProtoBuf/Builder/Service.js +3 -0
  51. package/src/ProtoBuf/Builder.js +17 -10
  52. package/src/ProtoBuf/DotProto/Parser.js +54 -23
  53. package/src/ProtoBuf/Reflect/Element.js +4 -3
  54. package/src/ProtoBuf/Reflect/Message/Field.js +4 -3
  55. package/src/ProtoBuf/Reflect/Message.js +3 -3
  56. package/src/ProtoBuf/Util.js +3 -14
  57. package/src/bower.json +1 -1
  58. package/src/google/protobuf/descriptor.json +28 -14
  59. package/src/{ProtoBuf.js → protobuf.js} +0 -0
  60. package/src/wrap.js +6 -6
  61. package/tests/imports-weak.proto +7 -0
  62. package/tests/suite.js +64 -81
  63. package/ProtoBuf.png +0 -0
  64. package/dist/ProtoBuf-light.min.js +0 -88
  65. package/dist/ProtoBuf-light.min.js.gz +0 -0
  66. package/dist/ProtoBuf-light.min.map +0 -8
  67. package/dist/ProtoBuf.min.js +0 -108
  68. package/dist/ProtoBuf.min.js.gz +0 -0
  69. package/dist/ProtoBuf.min.map +0 -8
  70. package/externs/ByteBuffer.js +0 -767
  71. package/externs/Long.js +0 -328
  72. package/tests/gtfs-realtime.proto +0 -552
@@ -1,922 +1,933 @@
1
- /*
2
- * Copyright 2012 The Closure Compiler Authors.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- /**
18
- * @fileoverview Externs for ProtoBuf.js.
19
- * @see https://github.com/dcodeIO/ProtoBuf.js
20
- * @externs
21
- */
22
-
23
- /**
24
- BEGIN_NODE_INCLUDE
25
- var ProtoBuf = require('protobufjs');
26
- END_NODE_INCLUDE
27
- */
28
-
29
- /**
30
- * {@type object.<string.*>}
31
- */
32
- var ProtoBuf = {};
33
-
34
- /**
35
- * @type {string}
36
- * @const
37
- */
38
- ProtoBuf.VERSION;
39
-
40
- /**
41
- * @type {!object.<string,number>}
42
- * @const
43
- */
44
- ProtoBuf.WIRE_TYPES = {};
45
-
46
- /**
47
- * @type {number}
48
- * @const
49
- */
50
- ProtoBuf.WIRE_TYPES.VARINT;
51
-
52
- /**
53
- * @type {number}
54
- * @const
55
- */
56
- ProtoBuf.WIRE_TYPES.BITS64;
57
-
58
- /**
59
- * @type {number}
60
- * @const
61
- */
62
- ProtoBuf.WIRE_TYPES.LDELIM;
63
-
64
- /**
65
- * @type {number}
66
- * @const
67
- */
68
- ProtoBuf.WIRE_TYPES.STARTGROUP;
69
-
70
- /**
71
- * @type {number}
72
- * @const
73
- */
74
- ProtoBuf.WIRE_TYPES.ENDGROUP;
75
-
76
- /**
77
- * @type {number}
78
- * @const
79
- */
80
- ProtoBuf.WIRE_TYPES.BITS32;
81
-
82
- /**
83
- * @type {!Array.<number>}
84
- * @const
85
- */
86
- ProtoBuf.PACKABLE_WIRE_TYPES;
87
-
88
- /**
89
- * @type {boolean}
90
- */
91
- ProtoBuf.convertFieldsToCamelCase;
92
-
93
- /**
94
- * @type {boolean}
95
- */
96
- ProtoBuf.populateAccessors;
97
-
98
- /**
99
- * @dict
100
- * @type {!object.<string,{name: string, wireType: number}>}
101
- * @const
102
- */
103
- ProtoBuf.TYPES;
104
-
105
- /**
106
- * @type {number}
107
- */
108
- ProtoBuf.ID_MIN;
109
-
110
- /**
111
- * @type {number}
112
- */
113
- ProtoBuf.ID_MAX;
114
-
115
- /**
116
- * @type {!function(new: ByteBuffer, ...[*])}
117
- */
118
- ProtoBuf.ByteBuffer;
119
-
120
- /**
121
- * @type {?function(new: Long, ...[*])}
122
- */
123
- ProtoBuf.Long;
124
-
125
- /**
126
- * @type {!object.<string,string|RegExp>}
127
- */
128
- ProtoBuf.Lang;
129
-
130
- /**
131
- * @type {!object.<string,function>}
132
- */
133
- ProtoBuf.DotProto;
134
-
135
- /**
136
- * @param {string} proto
137
- * @constructor
138
- */
139
- ProtoBuf.DotProto.Tokenizer = function(proto) {};
140
-
141
- /**
142
- * @type {string}
143
- */
144
- ProtoBuf.DotProto.Tokenizer.prototype.source;
145
-
146
- /**
147
- * @type {number}
148
- */
149
- ProtoBuf.DotProto.Tokenizer.prototype.index;
150
-
151
- /**
152
- * @type {number}
153
- */
154
- ProtoBuf.DotProto.Tokenizer.prototype.line;
155
-
156
- /**
157
- * @type {array.<string>}
158
- */
159
- ProtoBuf.DotProto.Tokenizer.prototype.stack;
160
-
161
- /**
162
- * @type {boolean}
163
- */
164
- ProtoBuf.DotProto.Tokenizer.prototype.readingString;
165
-
166
- /**
167
- * @return {?string}
168
- * @throws {Error}
169
- */
170
- ProtoBuf.DotProto.Tokenizer.prototype.next = function() {};
171
-
172
- /**
173
- * @return {?string}
174
- * @thorws {Error}
175
- */
176
- ProtoBuf.DotProto.Tokenizer.prototype.peek = function() {};
177
-
178
- /**
179
- * @return {string}
180
- * @nosideeffects
181
- */
182
- ProtoBuf.DotProto.Tokenizer.prototype.toString = function() {};
183
-
184
- /**
185
- * @param {string} proto
186
- * @constructor
187
- */
188
- ProtoBuf.DotProto.Parser = function(proto) {};
189
-
190
- /**
191
- * @type {!ProtoBuf.DotProto.Tokenizer}
192
- */
193
- ProtoBuf.DotProto.Parser.prototype.tn;
194
-
195
- /**
196
- * @return {{package: string|null, messages: Array.<object>, enums: Array.<object>, imports: Array.<string>, options: object<string,*>}}
197
- * @throws {Error}
198
- */
199
- ProtoBuf.DotProto.Parser.prototype.parse = function() {};
200
-
201
- /**
202
- * @return {string}
203
- * @nosideeffects
204
- */
205
- ProtoBuf.DotProto.Parser.prototype.toString = function() {};
206
-
207
- /**
208
- * @type {Object.<string,function>}
209
- */
210
- ProtoBuf.Reflect.Reflect = {};
211
-
212
- /**
213
- * @constructor
214
- * @param {ProtoBuf.Reflect.T} parent
215
- * @param {string} name Object name
216
- */
217
- ProtoBuf.Reflect.T = function(parent, name) {};
218
-
219
- /**
220
- * @type {?ProtoBuf.Reflect.T}
221
- */
222
- ProtoBuf.Reflect.T.prototype.parent;
223
-
224
- /**
225
- * @type {string}
226
- */
227
- ProtoBuf.Reflect.T.prototype.name;
228
-
229
- /**
230
- * @returns {string}
231
- * @nosideeffects
232
- */
233
- ProtoBuf.Reflect.T.prototype.fqn = function() {};
234
-
235
- /**
236
- * @param {boolean=} includeClass
237
- * @returns {string}
238
- * @nosideeffects
239
- */
240
- ProtoBuf.Reflect.T.prototype.toString = function(includeClass) {};
241
-
242
- /**
243
- * @throws {Error}
244
- */
245
- ProtoBuf.Reflect.T.prototype.build = function() {};
246
-
247
- /**
248
- * @param {?ProtoBuf.Reflect.Namespace} parent
249
- * @param {string} name
250
- * @constructor
251
- * @extends ProtoBuf.Reflect.T
252
- */
253
- ProtoBuf.Reflect.Namespace = function(parent, name) {};
254
-
255
- /**
256
- * @type {Array.<ProtoBuf.Reflect.T>}
257
- */
258
- ProtoBuf.Reflect.Namespace.prototype.children;
259
-
260
- /**
261
- * @param {ProtoBuf.Reflect.T=} type
262
- * @return {Array.<ProtoBuf.Reflect.T>}
263
- * @nosideeffects
264
- */
265
- ProtoBuf.Reflect.Namespace.prototype.getChildren = function(type) {};
266
-
267
- /**
268
- * @param {ProtoBuf.Reflect.T} child
269
- * @throws {Error}
270
- */
271
- ProtoBuf.Reflect.Namespace.prototype.addChild = function(child) {};
272
-
273
- /**
274
- * @param {string|number} nameOrId
275
- * @returns {boolean}
276
- * @nosideeffects
277
- */
278
- ProtoBuf.Reflect.Namespace.prototype.hasChild = function(nameOrId) {};
279
-
280
- /**
281
- * @param {string|number} nameOrId
282
- * @return {?ProtoBuf.Reflect.T}
283
- * @nosideeffects
284
- */
285
- ProtoBuf.Reflect.Namespace.prototype.getChild = function(nameOrId) {};
286
-
287
- /**
288
- * @param {string} qn
289
- * @param {boolean=} excludeFields
290
- * @return {?ProtoBuf.Reflect.Namespace}
291
- * @nosideeffects
292
- */
293
- ProtoBuf.Reflect.Namespace.prototype.resolve = function(qn, excludeFields) {};
294
-
295
- /**
296
- * @return {Object.<string,Function|Object>}
297
- */
298
- ProtoBuf.Reflect.Namespace.prototype.build = function() {};
299
-
300
- /**
301
- * @param {!ProtoBuf.Reflect.Namespace} parent
302
- * @param {string} name
303
- * @constructor
304
- * @extends ProtoBuf.Reflect.Namespace
305
- */
306
- ProtoBuf.Reflect.Message = function(parent, name) {};
307
-
308
- /**
309
- * @type {?Array.<number>}
310
- */
311
- ProtoBuf.Reflect.Message.prototype.extensions;
312
-
313
- /**
314
- * @type {?ProtoBuf.Builder.Message}
315
- */
316
- ProtoBuf.Reflect.Message.prototype.clazz;
317
-
318
- /**
319
- * @return {!ProtoBuf.Builder.Message}
320
- * @throws {Error}
321
- */
322
- ProtoBuf.Reflect.Message.prototype.build = function() {};
323
-
324
- /**
325
- * @param {!ProtoBuf.Builder.Message} message
326
- * @param {!ByteBuffer} buffer
327
- * @return {!ByteBuffer}
328
- * @throws {Error}
329
- */
330
- ProtoBuf.Reflect.Message.prototype.encode = function(message, buffer) {};
331
-
332
- /**
333
- * @param {!ProtoBuf.Builder.Message} message
334
- * @return {number}
335
- * @throws {Error}
336
- */
337
- ProtoBuf.Reflect.Message.prototype.calculate = function(message) {};
338
-
339
- /**
340
- * @param {!ProtoBuf.Builder.Message} message
341
- * @param {!ByteBuffer} buffer
342
- * @return {!ByteBuffer}
343
- * @throws {Error}
344
- */
345
- ProtoBuf.Reflect.Message.prototype.encodeDelimited = function(message, buffer) {};
346
-
347
- /**
348
- * @param {!ByteBuffer} buffer
349
- * @param {number=} length
350
- * @return {!ProtoBuf.Builder.Message}
351
- * @throws {Error}
352
- */
353
- ProtoBuf.Reflect.Message.prototype.decode = function(buffer, length) {};
354
-
355
- /**
356
- * @param {!ByteBuffer} buffer
357
- * @param {number=} length
358
- * @return {!ProtoBuf.Builder.Message}
359
- * @throws {Error}
360
- */
361
- ProtoBuf.Reflect.Message.prototype.decodeDelimited = function(buffer, length) {};
362
-
363
- /**
364
- * @param {!ProtoBuf.Reflect.Message} message
365
- * @param {string} rule
366
- * @param {string} type
367
- * @param {string} name
368
- * @param {number} id
369
- * @param {Object.<string.*>=} options
370
- * @constructor
371
- * @extends ProtoBuf.Reflect.T
372
- */
373
- ProtoBuf.Reflect.Message.Field = function(message, rule, type, name, id, options) {};
374
-
375
- /**
376
- * @type {boolean}
377
- */
378
- ProtoBuf.Reflect.Message.Field.prototype.required;
379
-
380
- /**
381
- * @type {boolean}
382
- */
383
- ProtoBuf.Reflect.Message.Field.prototype.repeated;
384
-
385
- /**
386
- * @type {string|{name: string, wireType: number}}
387
- */
388
- ProtoBuf.Reflect.Message.Field.prototype.type;
389
-
390
- /**
391
- * @type {number}
392
- */
393
- ProtoBuf.Reflect.Message.Field.prototype.id;
394
-
395
- /**
396
- * @type {!Object.<string,*>}
397
- */
398
- ProtoBuf.Reflect.Message.Field.prototype.options;
399
-
400
- /**
401
- * @type {?ProtoBuf.Reflect.T}
402
- */
403
- ProtoBuf.Reflect.Message.Field.prototype.resolvedType;
404
-
405
- /**
406
- * @type {string}
407
- */
408
- ProtoBuf.Reflect.Message.Field.prototype.originalName;
409
-
410
- /**
411
- * @param {*} value
412
- * @param {boolean=} skipRepeated
413
- * @return {*}
414
- * @throws {Error}
415
- * @nosideeffects
416
- */
417
- ProtoBuf.Reflect.Message.Field.prototype.verifyValue = function(value, skipRepeated) {};
418
-
419
- /**
420
- * @param {*} value
421
- * @param {!ByteBuffer} buffer
422
- * @return {!ByteBuffer}
423
- * @throws {Error}
424
- */
425
- ProtoBuf.Reflect.Message.Field.prototype.encode = function(value, buffer) {};
426
-
427
- /**
428
- * @param {*} value
429
- * @return {number}
430
- * @throws {Error}
431
- * @nosideeffects
432
- */
433
- ProtoBuf.Reflect.Message.Field.prototype.calculate = function(value) {};
434
-
435
- /**
436
- * @param {number} wireType
437
- * @param {!ByteBuffer} buffer
438
- * @return {*}
439
- * @throws {Error}
440
- */
441
- ProtoBuf.Reflect.Message.Field.prototype.decode = function(wireType, buffer) {};
442
-
443
- /**
444
- * @param {*} value
445
- * @param {!ByteBuffer} buffer
446
- * @return {!ByteBuffer}
447
- * @throws {Error}
448
- */
449
- ProtoBuf.Reflect.Message.Field.prototype.encodeValue = function(value, buffer) {};
450
-
451
- /**
452
- * @param {!ProtoBuf.Reflect.T} parent
453
- * @param {string} name
454
- * @constructor
455
- * @extends ProtoBuf.Reflect.Namespace
456
- */
457
- ProtoBuf.Reflect.Enum = function(parent, name) {};
458
-
459
- /**
460
- * @return {Object<string,*>}
461
- */
462
- ProtoBuf.Reflect.Enum.prototype.build = function() {};
463
-
464
- /**
465
- * @type {?Object.<string,number>}
466
- */
467
- ProtoBuf.Reflect.Enum.prototype.object;
468
-
469
- /**
470
- * @param {!ProtoBuf.Reflect.Enum} enm
471
- * @param {string} name
472
- * @param {number} id
473
- * @constructor
474
- * @extends ProtoBuf.Reflect.T
475
- */
476
- ProtoBuf.Reflect.Enum.Value = function(enm, name, id) {};
477
-
478
- /**
479
- * @type {number}
480
- */
481
- ProtoBuf.Reflect.Enum.Value.prototype.id;
482
-
483
- /**
484
- * @param {!ProtoBuf.Reflect.Namespace} root
485
- * @param {string} name Service name
486
- * @param {Object.<string,*>=} options
487
- * @constructor
488
- * @extends ProtoBuf.Reflect.Namespace
489
- */
490
- ProtoBuf.Reflect.Service = function(root, name, options) {};
491
-
492
- /**
493
- * @type {ProtoBuf.Builder.Service}
494
- */
495
- ProtoBuf.Reflect.Service.prototype.clazz;
496
-
497
- /**
498
- * @return {!ProtoBuf.Builder.Service}
499
- * @throws {Error}
500
- */
501
- ProtoBuf.Reflect.Service.prototype.build = function() {};
502
-
503
- /**
504
- * @param {!ProtoBuf.Reflect.Service} svc
505
- * @param {string} name
506
- * @param {Object.<string,*>=} options
507
- * @constructor
508
- * @extends ProtoBuf.Reflect.T
509
- */
510
- ProtoBuf.Reflect.Service.Method = function(svc, name, options) {};
511
-
512
- /**
513
- * @return {Object.<string,*>}
514
- */
515
- ProtoBuf.Reflect.Service.Method.prototype.buildOpt = function() {};
516
-
517
- /**
518
- * @param {!ProtoBuf.Reflect.Service} svc
519
- * @param {string} name
520
- * @param {string} request
521
- * @param {string} response
522
- * @param {Object.<string,*>=} options
523
- * @constructor
524
- * @extends ProtoBuf.Reflect.Service.Method
525
- */
526
- ProtoBuf.Reflect.Service.RPCMethod = function(svc, name, request, response, options) {};
527
-
528
- /**
529
- * @type {string}
530
- */
531
- ProtoBuf.Reflect.Service.RPCMethod.prototype.requestName;
532
-
533
- /**
534
- * @type {string}
535
- */
536
- ProtoBuf.Reflect.Service.RPCMethod.prototype.responseName;
537
-
538
- /**
539
- * @type {ProtoBuf.Reflect.Message}
540
- */
541
- ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedRequestType;
542
-
543
- /**
544
- * @type {ProtoBuf.Reflect.Message}
545
- */
546
- ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedResponseType;
547
-
548
- /**
549
- * @constructor
550
- */
551
- ProtoBuf.Builder = function() {};
552
-
553
- /**
554
- * @type {!ProtoBuf.Reflect.Namespace}
555
- */
556
- ProtoBuf.Builder.prototype.ns;
557
-
558
- /**
559
- * @type {?ProtoBuf.Reflect.T}
560
- */
561
- ProtoBuf.Builder.prototype.ptr;
562
-
563
- /**
564
- * @type {boolean}
565
- */
566
- ProtoBuf.Builder.prototype.resolved;
567
-
568
- /**
569
- * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
570
- */
571
- ProtoBuf.Builder.prototype.result;
572
-
573
- /**
574
- * @type {Array.<string>}
575
- */
576
- ProtoBuf.Builder.prototype.files;
577
-
578
- /**
579
- * @type {?string}
580
- */
581
- ProtoBuf.Builder.prototype.importRoot;
582
-
583
- /**
584
- */
585
- ProtoBuf.Builder.prototype.reset = function() {};
586
-
587
- /**
588
- * @param {string} pkg
589
- * @return {!ProtoBuf.Builder}
590
- * @throws {Error}
591
- */
592
- ProtoBuf.Builder.prototype.define = function(pkg) {};
593
-
594
- /**
595
- * @param {Object.<string,*>} def
596
- * @return {boolean}
597
- * @nosideeffects
598
- */
599
- ProtoBuf.Builder.isValidMessage = function(def) {};
600
-
601
- /**
602
- * @param {Object.<string,*>} def
603
- * @return {boolean}
604
- * @nosideeffects
605
- */
606
- ProtoBuf.Builder.isValidMessageField = function(def) {};
607
-
608
- /**
609
- * @param {Object.<string,*>} def
610
- * @return {boolean}
611
- */
612
- ProtoBuf.Builder.isValidEnum = function(def) {};
613
-
614
- /**
615
- * @param {Object.<string,*>} def
616
- * @return {boolean}
617
- */
618
- ProtoBuf.Builder.isValidService = function(def) {};
619
-
620
- /**
621
- * @param {Object.<string,*>} def
622
- * @return {boolean}
623
- */
624
- ProtoBuf.Builder.isValidExtend = function(def) {};
625
-
626
- /**
627
- * @param {Array.<Object.<string,*>>} messages
628
- * @return {ProtoBuf.Builder}
629
- * @throws {Error}
630
- */
631
- ProtoBuf.Builder.prototype.create = function(messages) {};
632
-
633
- /**
634
- * @name ProtoBuf.Builder.prototype.import
635
- * @function
636
- * @param {ProtoBuf.Builder} builder
637
- * @param {(string|{root: string, file: string})=} filename
638
- * @return {!ProtoBuf.Builder}
639
- * @throws {Error}
640
- */
641
- ProtoBuf.Builder.prototype["import"] = function(builder, filename) {};
642
-
643
- /**
644
- * @throws {Error}
645
- */
646
- ProtoBuf.Builder.prototype.resolveAll = function() {};
647
-
648
- /**
649
- * @param {string=} path
650
- * @return {ProtoBuf.Builder.Message|Object.<string,*>}
651
- * @throws {Error}
652
- */
653
- ProtoBuf.Builder.prototype.build = function(path) {};
654
-
655
- /**
656
- * @param {string=} path
657
- * @return {?ProtoBuf.Reflect.T}
658
- */
659
- ProtoBuf.Builder.prototype.lookup = function(path) {};
660
-
661
- /**
662
- * @return {string}
663
- * @nosideeffects
664
- */
665
- ProtoBuf.Builder.prototype.toString = function() {};
666
-
667
- /**
668
- * @param {Object.<string,*>} values
669
- * @constructor
670
- * @throws {Error}
671
- */
672
- ProtoBuf.Builder.Message = function(values) {};
673
-
674
- /**
675
- * @param {string} key
676
- * @param {*} value
677
- * @param {boolean=} noAssert
678
- * @throws {Error}
679
- */
680
- ProtoBuf.Builder.Message.prototype.add = function(key, value, noAssert) {};
681
-
682
- /**
683
- * @param {string} key
684
- * @param {*} value
685
- * @param {boolean=} noAssert
686
- * @throws {Error}
687
- */
688
- ProtoBuf.Builder.Message.prototype.$add = function(key, value, noAssert) {};
689
-
690
- /**
691
- * @param {string} key
692
- * @param {*} value
693
- * @param {boolean=} noAssert
694
- * @throws {Error}
695
- */
696
- ProtoBuf.Builder.Message.prototype.set = function(key, value, noAssert) {};
697
-
698
- /**
699
- * @param {string} key
700
- * @param {*} value
701
- * @param {boolean=} noAssert
702
- * @throws {Error}
703
- */
704
- ProtoBuf.Builder.Message.prototype.$set = function(key, value, noAssert) {};
705
-
706
- /**
707
- * @param {string} key
708
- * @return {*}
709
- * @throws {Error}
710
- * @nosideeffects
711
- */
712
- ProtoBuf.Builder.Message.prototype.get = function(key) {};
713
-
714
- /**
715
- * @param {string} key
716
- * @return {*}
717
- * @throws {Error}
718
- * @nosideeffects
719
- */
720
- ProtoBuf.Builder.Message.prototype.$get = function(key) {};
721
-
722
- /**
723
- * @param {ByteBuffer=} buffer
724
- * @return {!ByteBuffer}
725
- * @throws {Error}
726
- */
727
- ProtoBuf.Builder.Message.prototype.encode = function(buffer) {};
728
-
729
- /**
730
- * @return {number}
731
- * @throws {Error}
732
- * @nosideeffects
733
- */
734
- ProtoBuf.Builder.Message.prototype.calculate = function() {};
735
-
736
- /**
737
- * @return {!ArrayBuffer}
738
- * @throws {Error}
739
- */
740
- ProtoBuf.Builder.Message.prototype.encodeAB = function() {};
741
-
742
- /**
743
- * @return {!ArrayBuffer}
744
- * @throws {Error}
745
- * @nosideeffects
746
- */
747
- ProtoBuf.Builder.Message.prototype.toArrayBuffer = function() {};
748
-
749
- /**
750
- * @return {!Buffer}
751
- * @throws {Error}
752
- */
753
- ProtoBuf.Builder.Message.prototype.encodeNB = function() {};
754
-
755
- /**
756
- * @return {!Buffer}
757
- * @throws {Error}
758
- * @nosideeffects
759
- */
760
- ProtoBuf.Builder.Message.prototype.toBuffer = function() {};
761
-
762
- /**
763
- * @return {string}
764
- * @throws {Error}
765
- * @nosideeffects
766
- */
767
- ProtoBuf.Builder.Message.prototype.encode64 = function() {};
768
-
769
- /**
770
- * @return {string}
771
- * @throws {Error}
772
- * @nosideeffects
773
- */
774
- ProtoBuf.Builder.Message.prototype.toBase64 = function() {};
775
-
776
- /**
777
- * @return {string}
778
- * @throws {Error}
779
- * @nosideeffects
780
- */
781
- ProtoBuf.Builder.Message.prototype.encodeHex = function() {};
782
-
783
- /**
784
- * @return {string}
785
- * @throws {Error}
786
- * @nosideeffects
787
- */
788
- ProtoBuf.Builder.Message.prototype.toHex = function() {};
789
-
790
- /**
791
- * @param {boolean=} includeBuffers
792
- * @return {Object.<string,*>}
793
- * @nosideeffects
794
- */
795
- ProtoBuf.Builder.Message.prototype.toRaw = function(includeBuffers) {};
796
-
797
- /**
798
- * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer
799
- * @param {string=} enc
800
- * @return {!ProtoBuf.Builder.Message}
801
- * @throws {Error}
802
- * @nosideeffects
803
- */
804
- ProtoBuf.Builder.Message.decode = function(buffer, enc) {};
805
-
806
- /**
807
- * @param {string} str
808
- * @return {!ProtoBuf.Builder.Message}
809
- * @throws {Error}
810
- * @nosideeffects
811
- */
812
- ProtoBuf.Builder.Message.decode64 = function(str) {};
813
-
814
- /**
815
- * @param {string} str
816
- * @return {!ProtoBuf.Builder.Message}
817
- * @throws {Error}
818
- * @nosideeffects
819
- */
820
- ProtoBuf.Builder.Message.decodeHex = function(str) {};
821
-
822
- /**
823
- * @return {string}
824
- * @nosideeffects
825
- */
826
- ProtoBuf.Builder.Message.prototype.toString = function() {};
827
-
828
- /**
829
- * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl
830
- * @constructor
831
- */
832
- ProtoBuf.Builder.Service = function(rpcImpl) {};
833
-
834
- /**
835
- * @type {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}
836
- */
837
- ProtoBuf.Builder.prototype.rpcImpl;
838
-
839
- /**
840
- * @param {string} proto
841
- * @param {(ProtoBuf.Builder|string)=} builder
842
- * @param {(string|{root: string, file: string})=} filename
843
- * @return {!ProtoBuf.Builder}
844
- * @throws {Error}
845
- */
846
- ProtoBuf.loadProto = function(proto, builder, filename) {};
847
-
848
- /**
849
- * @param {string} proto
850
- * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
851
- * @param {(string|{root: string, file: string})=} filename
852
- * @return {!ProtoBuf.Builder}
853
- * @throws {Error}
854
- */
855
- ProtoBuf.protoFromString = function(proto, builder, filename) {};
856
-
857
- /**
858
- * @param {string|{root: string, file: string}} filename
859
- * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
860
- * @param {ProtoBuf.Builder=} builder
861
- * @return {ProtoBuf.Builder|undefined}
862
- * @throws {Error}
863
- */
864
- ProtoBuf.loadProtoFile = function(filename, callback, builder) {};
865
-
866
- /**
867
- * @param {string|{root: string, file: string}} filename
868
- * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
869
- * @param {ProtoBuf.Builder=} builder
870
- * @return {ProtoBuf.Builder|undefined}
871
- * @throws {Error}
872
- */
873
- ProtoBuf.protoFromFile = function(filename, callback, builder) {};
874
-
875
- /**
876
- * @param {!*|string} proto
877
- * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
878
- * @param {(string|{root: string, file: string})=} filename
879
- * @return {!ProtoBuf.Builder}
880
- * @throws {Error}
881
- */
882
- ProtoBuf.loadJson = function(json, builder, filename) {};
883
-
884
- /**
885
- * @param {string|{root: string, file: string}} filename
886
- * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
887
- * @param {ProtoBuf.Builder=} builder
888
- * @return {ProtoBuf.Builder|undefined}
889
- * @throws {Error}
890
- */
891
- ProtoBuf.loadJsonFile = function(filename, callback, builder) {};
892
-
893
- /**
894
- * @param {string=} pkg
895
- * @return {!ProtoBuf.Builder}
896
- */
897
- ProtoBuf.newBuilder = function(pkg) {};
898
-
899
- ProtoBuf.Util = {};
900
-
901
- /**
902
- * @type {boolean}
903
- */
904
- ProtoBuf.Util.IS_NODE;
905
-
906
- /**
907
- * @return {XMLHttpRequest}
908
- */
909
- ProtoBuf.Util.XHR = function() {};
910
-
911
- /**
912
- * @param {string} path
913
- * @param {function(?string)=} callback
914
- * @return {?string|undefined}
915
- */
916
- ProtoBuf.Util.fetch = function(path, callback) {};
917
-
918
- /**
919
- * @param {*} obj
920
- * @return {boolean}
921
- */
922
- ProtoBuf.Util.isArray = function(obj) {};
1
+ /*
2
+ * Copyright 2012 The Closure Compiler Authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * @fileoverview Externs for ProtoBuf.js.
19
+ * @see https://github.com/dcodeIO/ProtoBuf.js
20
+ * @externs
21
+ */
22
+
23
+ /**
24
+ BEGIN_NODE_INCLUDE
25
+ var ProtoBuf = require('protobufjs');
26
+ END_NODE_INCLUDE
27
+ */
28
+
29
+ /**
30
+ * @typedef {Array}
31
+ */
32
+ var Buffer;
33
+
34
+ /**
35
+ * @typedef {Object}
36
+ */
37
+ var dcodeIO;
38
+
39
+ /**
40
+ * {@type Object.<string.*>}
41
+ */
42
+ var ProtoBuf = {};
43
+
44
+ /**
45
+ * @type {string}
46
+ * @const
47
+ */
48
+ ProtoBuf.VERSION;
49
+
50
+ /**
51
+ * @type {!Object.<string,number>}
52
+ * @const
53
+ */
54
+ ProtoBuf.WIRE_TYPES = {};
55
+
56
+ /**
57
+ * @type {number}
58
+ * @const
59
+ */
60
+ ProtoBuf.WIRE_TYPES.VARINT;
61
+
62
+ /**
63
+ * @type {number}
64
+ * @const
65
+ */
66
+ ProtoBuf.WIRE_TYPES.BITS64;
67
+
68
+ /**
69
+ * @type {number}
70
+ * @const
71
+ */
72
+ ProtoBuf.WIRE_TYPES.LDELIM;
73
+
74
+ /**
75
+ * @type {number}
76
+ * @const
77
+ */
78
+ ProtoBuf.WIRE_TYPES.STARTGROUP;
79
+
80
+ /**
81
+ * @type {number}
82
+ * @const
83
+ */
84
+ ProtoBuf.WIRE_TYPES.ENDGROUP;
85
+
86
+ /**
87
+ * @type {number}
88
+ * @const
89
+ */
90
+ ProtoBuf.WIRE_TYPES.BITS32;
91
+
92
+ /**
93
+ * @type {!Array.<number>}
94
+ * @const
95
+ */
96
+ ProtoBuf.PACKABLE_WIRE_TYPES;
97
+
98
+ /**
99
+ * @type {boolean}
100
+ */
101
+ ProtoBuf.convertFieldsToCamelCase;
102
+
103
+ /**
104
+ * @type {boolean}
105
+ */
106
+ ProtoBuf.populateAccessors;
107
+
108
+ /**
109
+ * @dict
110
+ * @type {!Object<string,{name: string, wireType: number}>}
111
+ * @const
112
+ */
113
+ ProtoBuf.TYPES;
114
+
115
+ /**
116
+ * @type {number}
117
+ */
118
+ ProtoBuf.ID_MIN;
119
+
120
+ /**
121
+ * @type {number}
122
+ */
123
+ ProtoBuf.ID_MAX;
124
+
125
+ /**
126
+ * @type {!function(new: ByteBuffer, ...*)}
127
+ */
128
+ ProtoBuf.ByteBuffer;
129
+
130
+ /**
131
+ * @type {?function(new: Long, ...*)}
132
+ */
133
+ ProtoBuf.Long;
134
+
135
+ /**
136
+ * @type {!Object<string,string|RegExp>}
137
+ */
138
+ ProtoBuf.Lang;
139
+
140
+ /**
141
+ * @type {Object<string, function(*)>}
142
+ */
143
+ ProtoBuf.DotProto;
144
+
145
+ /**
146
+ * @param {string} proto
147
+ * @constructor
148
+ */
149
+ ProtoBuf.DotProto.Tokenizer = function(proto) {};
150
+
151
+ /**
152
+ * @type {string}
153
+ */
154
+ ProtoBuf.DotProto.Tokenizer.prototype.source;
155
+
156
+ /**
157
+ * @type {number}
158
+ */
159
+ ProtoBuf.DotProto.Tokenizer.prototype.index;
160
+
161
+ /**
162
+ * @type {number}
163
+ */
164
+ ProtoBuf.DotProto.Tokenizer.prototype.line;
165
+
166
+ /**
167
+ * @type {Array.<string>}
168
+ */
169
+ ProtoBuf.DotProto.Tokenizer.prototype.stack;
170
+
171
+ /**
172
+ * @type {boolean}
173
+ */
174
+ ProtoBuf.DotProto.Tokenizer.prototype.readingString;
175
+
176
+ /**
177
+ * @return {?string}
178
+ * @throws {Error}
179
+ */
180
+ ProtoBuf.DotProto.Tokenizer.prototype.next = function() {};
181
+
182
+ /**
183
+ * @return {?string}
184
+ * @throws {Error}
185
+ */
186
+ ProtoBuf.DotProto.Tokenizer.prototype.peek = function() {};
187
+
188
+ /**
189
+ * @return {string}
190
+ * @nosideeffects
191
+ */
192
+ ProtoBuf.DotProto.Tokenizer.prototype.toString = function() {};
193
+
194
+ /**
195
+ * @param {string} proto
196
+ * @constructor
197
+ */
198
+ ProtoBuf.DotProto.Parser = function(proto) {};
199
+
200
+ /**
201
+ * @type {!ProtoBuf.DotProto.Tokenizer}
202
+ */
203
+ ProtoBuf.DotProto.Parser.prototype.tn;
204
+
205
+ /**
206
+ * @return {{package: (string|null), messages: Array.<Object>, enums: Array.<Object>, imports: Array.<string>, options: Object<string,*>}}
207
+ * @throws {Error}
208
+ */
209
+ ProtoBuf.DotProto.Parser.prototype.parse = function() {};
210
+
211
+ /**
212
+ * @return {string}
213
+ * @nosideeffects
214
+ */
215
+ ProtoBuf.DotProto.Parser.prototype.toString = function() {};
216
+
217
+ /**
218
+ * @type {Object<string, function(*)>}
219
+ */
220
+ ProtoBuf.Reflect.Reflect = {};
221
+
222
+ /**
223
+ * @constructor
224
+ * @param {ProtoBuf.Reflect.T} parent
225
+ * @param {string} name Object name
226
+ */
227
+ ProtoBuf.Reflect.T = function(parent, name) {};
228
+
229
+ /**
230
+ * @type {?ProtoBuf.Reflect.T}
231
+ */
232
+ ProtoBuf.Reflect.T.prototype.parent;
233
+
234
+ /**
235
+ * @type {string}
236
+ */
237
+ ProtoBuf.Reflect.T.prototype.name;
238
+
239
+ /**
240
+ * @returns {string}
241
+ * @nosideeffects
242
+ */
243
+ ProtoBuf.Reflect.T.prototype.fqn = function() {};
244
+
245
+ /**
246
+ * @param {boolean=} includeClass
247
+ * @returns {string}
248
+ * @nosideeffects
249
+ */
250
+ ProtoBuf.Reflect.T.prototype.toString = function(includeClass) {};
251
+
252
+ /**
253
+ * @throws {Error}
254
+ */
255
+ ProtoBuf.Reflect.T.prototype.build = function() {};
256
+
257
+ /**
258
+ * @param {?ProtoBuf.Reflect.Namespace} parent
259
+ * @param {string} name
260
+ * @constructor
261
+ * @extends ProtoBuf.Reflect.T
262
+ */
263
+ ProtoBuf.Reflect.Namespace = function(parent, name) {};
264
+
265
+ /**
266
+ * @type {Array.<ProtoBuf.Reflect.T>}
267
+ */
268
+ ProtoBuf.Reflect.Namespace.prototype.children;
269
+
270
+ /**
271
+ * @param {ProtoBuf.Reflect.T=} type
272
+ * @return {Array.<ProtoBuf.Reflect.T>}
273
+ * @nosideeffects
274
+ */
275
+ ProtoBuf.Reflect.Namespace.prototype.getChildren = function(type) {};
276
+
277
+ /**
278
+ * @param {ProtoBuf.Reflect.T} child
279
+ * @throws {Error}
280
+ */
281
+ ProtoBuf.Reflect.Namespace.prototype.addChild = function(child) {};
282
+
283
+ /**
284
+ * @param {string|number} nameOrId
285
+ * @returns {boolean}
286
+ * @nosideeffects
287
+ */
288
+ ProtoBuf.Reflect.Namespace.prototype.hasChild = function(nameOrId) {};
289
+
290
+ /**
291
+ * @param {string|number} nameOrId
292
+ * @return {?ProtoBuf.Reflect.T}
293
+ * @nosideeffects
294
+ */
295
+ ProtoBuf.Reflect.Namespace.prototype.getChild = function(nameOrId) {};
296
+
297
+ /**
298
+ * @param {string} qn
299
+ * @param {boolean=} excludeFields
300
+ * @return {?ProtoBuf.Reflect.Namespace}
301
+ * @nosideeffects
302
+ */
303
+ ProtoBuf.Reflect.Namespace.prototype.resolve = function(qn, excludeFields) {};
304
+
305
+ /**
306
+ * @return {Object.<string,Function|Object>}
307
+ */
308
+ ProtoBuf.Reflect.Namespace.prototype.build = function() {};
309
+
310
+ /**
311
+ * @param {!ProtoBuf.Reflect.Namespace} parent
312
+ * @param {string} name
313
+ * @constructor
314
+ * @extends ProtoBuf.Reflect.Namespace
315
+ */
316
+ ProtoBuf.Reflect.Message = function(parent, name) {};
317
+
318
+ /**
319
+ * @type {?Array.<number>}
320
+ */
321
+ ProtoBuf.Reflect.Message.prototype.extensions;
322
+
323
+ /**
324
+ * @type {?ProtoBuf.Builder.Message}
325
+ */
326
+ ProtoBuf.Reflect.Message.prototype.clazz;
327
+
328
+ /**
329
+ * @return {!ProtoBuf.Builder.Message}
330
+ * @throws {Error}
331
+ */
332
+ ProtoBuf.Reflect.Message.prototype.build = function() {};
333
+
334
+ /**
335
+ * @param {!ProtoBuf.Builder.Message} message
336
+ * @param {!ByteBuffer} buffer
337
+ * @return {!ByteBuffer}
338
+ * @throws {Error}
339
+ */
340
+ ProtoBuf.Reflect.Message.prototype.encode = function(message, buffer) {};
341
+
342
+ /**
343
+ * @param {!ProtoBuf.Builder.Message} message
344
+ * @return {number}
345
+ * @throws {Error}
346
+ */
347
+ ProtoBuf.Reflect.Message.prototype.calculate = function(message) {};
348
+
349
+ /**
350
+ * @param {!ProtoBuf.Builder.Message} message
351
+ * @param {!ByteBuffer} buffer
352
+ * @param {bool} noVerify
353
+ * @return {!ByteBuffer}
354
+ * @throws {Error}
355
+ */
356
+ ProtoBuf.Reflect.Message.prototype.encodeDelimited = function(message, buffer, noVerify) {};
357
+
358
+ /**
359
+ * @param {!ByteBuffer} buffer
360
+ * @param {number=} length
361
+ * @return {!ProtoBuf.Builder.Message}
362
+ * @throws {Error}
363
+ */
364
+ ProtoBuf.Reflect.Message.prototype.decode = function(buffer, length) {};
365
+
366
+ /**
367
+ * @param {!ByteBuffer} buffer
368
+ * @param {number=} length
369
+ * @return {!ProtoBuf.Builder.Message}
370
+ * @throws {Error}
371
+ */
372
+ ProtoBuf.Reflect.Message.prototype.decodeDelimited = function(buffer, length) {};
373
+
374
+ /**
375
+ * @param {!ProtoBuf.Reflect.Message} message
376
+ * @param {string} rule
377
+ * @param {string} type
378
+ * @param {string} name
379
+ * @param {number} id
380
+ * @param {Object<string>=} options
381
+ * @constructor
382
+ * @extends ProtoBuf.Reflect.T
383
+ */
384
+ ProtoBuf.Reflect.Message.Field = function(message, rule, type, name, id, options) {};
385
+
386
+ /**
387
+ * @type {boolean}
388
+ */
389
+ ProtoBuf.Reflect.Message.Field.prototype.required;
390
+
391
+ /**
392
+ * @type {boolean}
393
+ */
394
+ ProtoBuf.Reflect.Message.Field.prototype.repeated;
395
+
396
+ /**
397
+ * @type {string|{name: string, wireType: number}}
398
+ */
399
+ ProtoBuf.Reflect.Message.Field.prototype.type;
400
+
401
+ /**
402
+ * @type {number}
403
+ */
404
+ ProtoBuf.Reflect.Message.Field.prototype.id;
405
+
406
+ /**
407
+ * @type {!Object.<string,*>}
408
+ */
409
+ ProtoBuf.Reflect.Message.Field.prototype.options;
410
+
411
+ /**
412
+ * @type {?ProtoBuf.Reflect.T}
413
+ */
414
+ ProtoBuf.Reflect.Message.Field.prototype.resolvedType;
415
+
416
+ /**
417
+ * @type {string}
418
+ */
419
+ ProtoBuf.Reflect.Message.Field.prototype.originalName;
420
+
421
+ /**
422
+ * @param {*} value
423
+ * @param {boolean=} skipRepeated
424
+ * @return {*}
425
+ * @throws {Error}
426
+ * @nosideeffects
427
+ */
428
+ ProtoBuf.Reflect.Message.Field.prototype.verifyValue = function(value, skipRepeated) {};
429
+
430
+ /**
431
+ * @param {*} value
432
+ * @param {!ByteBuffer} buffer
433
+ * @return {!ByteBuffer}
434
+ * @throws {Error}
435
+ */
436
+ ProtoBuf.Reflect.Message.Field.prototype.encode = function(value, buffer) {};
437
+
438
+ /**
439
+ * @param {*} value
440
+ * @return {number}
441
+ * @throws {Error}
442
+ * @nosideeffects
443
+ */
444
+ ProtoBuf.Reflect.Message.Field.prototype.calculate = function(value) {};
445
+
446
+ /**
447
+ * @param {number} wireType
448
+ * @param {!ByteBuffer} buffer
449
+ * @return {*}
450
+ * @throws {Error}
451
+ */
452
+ ProtoBuf.Reflect.Message.Field.prototype.decode = function(wireType, buffer) {};
453
+
454
+ /**
455
+ * @param {*} value
456
+ * @param {!ByteBuffer} buffer
457
+ * @return {!ByteBuffer}
458
+ * @throws {Error}
459
+ */
460
+ ProtoBuf.Reflect.Message.Field.prototype.encodeValue = function(value, buffer) {};
461
+
462
+ /**
463
+ * @param {!ProtoBuf.Reflect.T} parent
464
+ * @param {string} name
465
+ * @constructor
466
+ * @extends ProtoBuf.Reflect.Namespace
467
+ */
468
+ ProtoBuf.Reflect.Enum = function(parent, name) {};
469
+
470
+ /**
471
+ * @return {Object<string,*>}
472
+ */
473
+ ProtoBuf.Reflect.Enum.prototype.build = function() {};
474
+
475
+ /**
476
+ * @type {?Object.<string,number>}
477
+ */
478
+ ProtoBuf.Reflect.Enum.prototype.object;
479
+
480
+ /**
481
+ * @param {!ProtoBuf.Reflect.Enum} enm
482
+ * @param {string} name
483
+ * @param {number} id
484
+ * @constructor
485
+ * @extends ProtoBuf.Reflect.T
486
+ */
487
+ ProtoBuf.Reflect.Enum.Value = function(enm, name, id) {};
488
+
489
+ /**
490
+ * @type {number}
491
+ */
492
+ ProtoBuf.Reflect.Enum.Value.prototype.id;
493
+
494
+ /**
495
+ * @param {!ProtoBuf.Reflect.Namespace} root
496
+ * @param {string} name Service name
497
+ * @param {Object.<string,*>=} options
498
+ * @constructor
499
+ * @extends ProtoBuf.Reflect.Namespace
500
+ */
501
+ ProtoBuf.Reflect.Service = function(root, name, options) {};
502
+
503
+ /**
504
+ * @type {ProtoBuf.Builder.Service}
505
+ */
506
+ ProtoBuf.Reflect.Service.prototype.clazz;
507
+
508
+ /**
509
+ * @return {!ProtoBuf.Builder.Service}
510
+ * @throws {Error}
511
+ */
512
+ ProtoBuf.Reflect.Service.prototype.build = function() {};
513
+
514
+ /**
515
+ * @param {!ProtoBuf.Reflect.Service} svc
516
+ * @param {string} name
517
+ * @param {Object.<string,*>=} options
518
+ * @constructor
519
+ * @extends ProtoBuf.Reflect.T
520
+ */
521
+ ProtoBuf.Reflect.Service.Method = function(svc, name, options) {};
522
+
523
+ /**
524
+ * @return {Object.<string,*>}
525
+ */
526
+ ProtoBuf.Reflect.Service.Method.prototype.buildOpt = function() {};
527
+
528
+ /**
529
+ * @param {!ProtoBuf.Reflect.Service} svc
530
+ * @param {string} name
531
+ * @param {string} request
532
+ * @param {string} response
533
+ * @param {Object.<string,*>=} options
534
+ * @constructor
535
+ * @extends ProtoBuf.Reflect.Service.Method
536
+ */
537
+ ProtoBuf.Reflect.Service.RPCMethod = function(svc, name, request, response, options) {};
538
+
539
+ /**
540
+ * @type {string}
541
+ */
542
+ ProtoBuf.Reflect.Service.RPCMethod.prototype.requestName;
543
+
544
+ /**
545
+ * @type {string}
546
+ */
547
+ ProtoBuf.Reflect.Service.RPCMethod.prototype.responseName;
548
+
549
+ /**
550
+ * @type {ProtoBuf.Reflect.Message}
551
+ */
552
+ ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedRequestType;
553
+
554
+ /**
555
+ * @type {ProtoBuf.Reflect.Message}
556
+ */
557
+ ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedResponseType;
558
+
559
+ /**
560
+ * @constructor
561
+ */
562
+ ProtoBuf.Builder = function() {};
563
+
564
+ /**
565
+ * @type {!ProtoBuf.Reflect.Namespace}
566
+ */
567
+ ProtoBuf.Builder.prototype.ns;
568
+
569
+ /**
570
+ * @type {?ProtoBuf.Reflect.T}
571
+ */
572
+ ProtoBuf.Builder.prototype.ptr;
573
+
574
+ /**
575
+ * @type {boolean}
576
+ */
577
+ ProtoBuf.Builder.prototype.resolved;
578
+
579
+ /**
580
+ * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
581
+ */
582
+ ProtoBuf.Builder.prototype.result;
583
+
584
+ /**
585
+ * @type {Array.<string>}
586
+ */
587
+ ProtoBuf.Builder.prototype.files;
588
+
589
+ /**
590
+ * @type {?string}
591
+ */
592
+ ProtoBuf.Builder.prototype.importRoot;
593
+
594
+ /**
595
+ */
596
+ ProtoBuf.Builder.prototype.reset = function() {};
597
+
598
+ /**
599
+ * @param {string} pkg
600
+ * @return {!ProtoBuf.Builder}
601
+ * @throws {Error}
602
+ */
603
+ ProtoBuf.Builder.prototype.define = function(pkg) {};
604
+
605
+ /**
606
+ * @param {Object.<string,*>} def
607
+ * @return {boolean}
608
+ * @nosideeffects
609
+ */
610
+ ProtoBuf.Builder.isValidMessage = function(def) {};
611
+
612
+ /**
613
+ * @param {Object.<string,*>} def
614
+ * @return {boolean}
615
+ * @nosideeffects
616
+ */
617
+ ProtoBuf.Builder.isValidMessageField = function(def) {};
618
+
619
+ /**
620
+ * @param {Object.<string,*>} def
621
+ * @return {boolean}
622
+ */
623
+ ProtoBuf.Builder.isValidEnum = function(def) {};
624
+
625
+ /**
626
+ * @param {Object.<string,*>} def
627
+ * @return {boolean}
628
+ */
629
+ ProtoBuf.Builder.isValidService = function(def) {};
630
+
631
+ /**
632
+ * @param {Object.<string,*>} def
633
+ * @return {boolean}
634
+ */
635
+ ProtoBuf.Builder.isValidExtend = function(def) {};
636
+
637
+ /**
638
+ * @param {Array.<Object.<string,*>>} messages
639
+ * @return {ProtoBuf.Builder}
640
+ * @throws {Error}
641
+ */
642
+ ProtoBuf.Builder.prototype.create = function(messages) {};
643
+
644
+ /**
645
+ * @name ProtoBuf.Builder.prototype.import
646
+ * @function
647
+ * @param {ProtoBuf.Builder} builder
648
+ * @param {(string|{root: string, file: string})=} filename
649
+ * @return {!ProtoBuf.Builder}
650
+ * @throws {Error}
651
+ */
652
+ ProtoBuf.Builder.prototype["import"] = function(builder, filename) {};
653
+
654
+ /**
655
+ * @throws {Error}
656
+ */
657
+ ProtoBuf.Builder.prototype.resolveAll = function() {};
658
+
659
+ /**
660
+ * @param {string=} path
661
+ * @return {ProtoBuf.Builder.Message|Object.<string,*>}
662
+ * @throws {Error}
663
+ */
664
+ ProtoBuf.Builder.prototype.build = function(path) {};
665
+
666
+ /**
667
+ * @param {string=} path
668
+ * @return {?ProtoBuf.Reflect.T}
669
+ */
670
+ ProtoBuf.Builder.prototype.lookup = function(path) {};
671
+
672
+ /**
673
+ * @return {string}
674
+ * @nosideeffects
675
+ */
676
+ ProtoBuf.Builder.prototype.toString = function() {};
677
+
678
+ /**
679
+ * @param {Object.<string,*>} values
680
+ * @constructor
681
+ * @throws {Error}
682
+ */
683
+ ProtoBuf.Builder.Message = function(values) {};
684
+
685
+ /**
686
+ * @param {string} key
687
+ * @param {*} value
688
+ * @param {boolean=} noAssert
689
+ * @throws {Error}
690
+ */
691
+ ProtoBuf.Builder.Message.prototype.add = function(key, value, noAssert) {};
692
+
693
+ /**
694
+ * @param {string} key
695
+ * @param {*} value
696
+ * @param {boolean=} noAssert
697
+ * @throws {Error}
698
+ */
699
+ ProtoBuf.Builder.Message.prototype.$add = function(key, value, noAssert) {};
700
+
701
+ /**
702
+ * @param {string} key
703
+ * @param {*} value
704
+ * @param {boolean=} noAssert
705
+ * @throws {Error}
706
+ */
707
+ ProtoBuf.Builder.Message.prototype.set = function(key, value, noAssert) {};
708
+
709
+ /**
710
+ * @param {string} key
711
+ * @param {*} value
712
+ * @param {boolean=} noAssert
713
+ * @throws {Error}
714
+ */
715
+ ProtoBuf.Builder.Message.prototype.$set = function(key, value, noAssert) {};
716
+
717
+ /**
718
+ * @param {string} key
719
+ * @return {*}
720
+ * @throws {Error}
721
+ * @nosideeffects
722
+ */
723
+ ProtoBuf.Builder.Message.prototype.get = function(key) {};
724
+
725
+ /**
726
+ * @param {string} key
727
+ * @return {*}
728
+ * @throws {Error}
729
+ * @nosideeffects
730
+ */
731
+ ProtoBuf.Builder.Message.prototype.$get = function(key) {};
732
+
733
+ /**
734
+ * @param {ByteBuffer=} buffer
735
+ * @return {!ByteBuffer}
736
+ * @throws {Error}
737
+ */
738
+ ProtoBuf.Builder.Message.prototype.encode = function(buffer) {};
739
+
740
+ /**
741
+ * @return {number}
742
+ * @throws {Error}
743
+ * @nosideeffects
744
+ */
745
+ ProtoBuf.Builder.Message.prototype.calculate = function() {};
746
+
747
+ /**
748
+ * @return {!ArrayBuffer}
749
+ * @throws {Error}
750
+ */
751
+ ProtoBuf.Builder.Message.prototype.encodeAB = function() {};
752
+
753
+ /**
754
+ * @return {!ArrayBuffer}
755
+ * @throws {Error}
756
+ * @nosideeffects
757
+ */
758
+ ProtoBuf.Builder.Message.prototype.toArrayBuffer = function() {};
759
+
760
+ /**
761
+ * @return {!Buffer}
762
+ * @throws {Error}
763
+ */
764
+ ProtoBuf.Builder.Message.prototype.encodeNB = function() {};
765
+
766
+ /**
767
+ * @return {!Buffer}
768
+ * @throws {Error}
769
+ * @nosideeffects
770
+ */
771
+ ProtoBuf.Builder.Message.prototype.toBuffer = function() {};
772
+
773
+ /**
774
+ * @return {string}
775
+ * @throws {Error}
776
+ * @nosideeffects
777
+ */
778
+ ProtoBuf.Builder.Message.prototype.encode64 = function() {};
779
+
780
+ /**
781
+ * @return {string}
782
+ * @throws {Error}
783
+ * @nosideeffects
784
+ */
785
+ ProtoBuf.Builder.Message.prototype.toBase64 = function() {};
786
+
787
+ /**
788
+ * @return {string}
789
+ * @throws {Error}
790
+ * @nosideeffects
791
+ */
792
+ ProtoBuf.Builder.Message.prototype.encodeHex = function() {};
793
+
794
+ /**
795
+ * @return {string}
796
+ * @throws {Error}
797
+ * @nosideeffects
798
+ */
799
+ ProtoBuf.Builder.Message.prototype.toHex = function() {};
800
+
801
+ /**
802
+ * @param {boolean=} includeBuffers
803
+ * @return {Object.<string,*>}
804
+ * @nosideeffects
805
+ */
806
+ ProtoBuf.Builder.Message.prototype.toRaw = function(includeBuffers) {};
807
+
808
+ /**
809
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer
810
+ * @param {string=} enc
811
+ * @return {!ProtoBuf.Builder.Message}
812
+ * @throws {Error}
813
+ * @nosideeffects
814
+ */
815
+ ProtoBuf.Builder.Message.decode = function(buffer, enc) {};
816
+
817
+ /**
818
+ * @param {string} str
819
+ * @return {!ProtoBuf.Builder.Message}
820
+ * @throws {Error}
821
+ * @nosideeffects
822
+ */
823
+ ProtoBuf.Builder.Message.decode64 = function(str) {};
824
+
825
+ /**
826
+ * @param {string} str
827
+ * @return {!ProtoBuf.Builder.Message}
828
+ * @throws {Error}
829
+ * @nosideeffects
830
+ */
831
+ ProtoBuf.Builder.Message.decodeHex = function(str) {};
832
+
833
+ /**
834
+ * @return {string}
835
+ * @nosideeffects
836
+ */
837
+ ProtoBuf.Builder.Message.prototype.toString = function() {};
838
+
839
+ /**
840
+ * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl
841
+ * @constructor
842
+ */
843
+ ProtoBuf.Builder.Service = function(rpcImpl) {};
844
+
845
+ /**
846
+ * @type {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}
847
+ */
848
+ ProtoBuf.Builder.prototype.rpcImpl;
849
+
850
+ /**
851
+ * @param {string} proto
852
+ * @param {(ProtoBuf.Builder|string)=} builder
853
+ * @param {(string|{root: string, file: string})=} filename
854
+ * @return {!ProtoBuf.Builder}
855
+ * @throws {Error}
856
+ */
857
+ ProtoBuf.loadProto = function(proto, builder, filename) {};
858
+
859
+ /**
860
+ * @param {string} proto
861
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
862
+ * @param {(string|{root: string, file: string})=} filename
863
+ * @return {!ProtoBuf.Builder}
864
+ * @throws {Error}
865
+ */
866
+ ProtoBuf.protoFromString = function(proto, builder, filename) {};
867
+
868
+ /**
869
+ * @param {string|{root: string, file: string}} filename
870
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
871
+ * @param {ProtoBuf.Builder=} builder
872
+ * @return {ProtoBuf.Builder|undefined}
873
+ * @throws {Error}
874
+ */
875
+ ProtoBuf.loadProtoFile = function(filename, callback, builder) {};
876
+
877
+ /**
878
+ * @param {string|{root: string, file: string}} filename
879
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
880
+ * @param {ProtoBuf.Builder=} builder
881
+ * @return {ProtoBuf.Builder|undefined}
882
+ * @throws {Error}
883
+ */
884
+ ProtoBuf.protoFromFile = function(filename, callback, builder) {};
885
+
886
+ /**
887
+ * @param {!*|string} json
888
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder
889
+ * @param {(string|{root: string, file: string})=} filename
890
+ * @return {!ProtoBuf.Builder}
891
+ * @throws {Error}
892
+ */
893
+ ProtoBuf.loadJson = function(json, builder, filename) {};
894
+
895
+ /**
896
+ * @param {string|{root: string, file: string}} filename
897
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback
898
+ * @param {ProtoBuf.Builder=} builder
899
+ * @return {ProtoBuf.Builder|undefined}
900
+ * @throws {Error}
901
+ */
902
+ ProtoBuf.loadJsonFile = function(filename, callback, builder) {};
903
+
904
+ /**
905
+ * @param {string=} pkg
906
+ * @return {!ProtoBuf.Builder}
907
+ */
908
+ ProtoBuf.newBuilder = function(pkg) {};
909
+
910
+ ProtoBuf.Util = {};
911
+
912
+ /**
913
+ * @type {boolean}
914
+ */
915
+ ProtoBuf.Util.IS_NODE;
916
+
917
+ /**
918
+ * @return {XMLHttpRequest}
919
+ */
920
+ ProtoBuf.Util.XHR = function() {};
921
+
922
+ /**
923
+ * @param {string} path
924
+ * @param {function(?string)=} callback
925
+ * @return {?string|undefined}
926
+ */
927
+ ProtoBuf.Util.fetch = function(path, callback) {};
928
+
929
+ /**
930
+ * @param {*} obj
931
+ * @return {boolean}
932
+ */
933
+ ProtoBuf.Util.isArray = function(obj) {};