protobufjs 3.6.0 → 3.8.2

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 (99) hide show
  1. package/bin/proto2js +16 -4
  2. package/bower.json +1 -1
  3. package/dist/ProtoBuf.js +645 -441
  4. package/dist/ProtoBuf.min.js +96 -96
  5. package/dist/ProtoBuf.min.js.gz +0 -0
  6. package/dist/ProtoBuf.min.map +2 -2
  7. package/dist/ProtoBuf.noparse.js +520 -357
  8. package/dist/ProtoBuf.noparse.min.js +68 -66
  9. package/dist/ProtoBuf.noparse.min.js.gz +0 -0
  10. package/dist/ProtoBuf.noparse.min.map +3 -3
  11. package/docs/ProtoBuf.Builder.Message.html +673 -135
  12. package/docs/ProtoBuf.Builder.Service.html +58 -19
  13. package/docs/ProtoBuf.Builder.html +374 -46
  14. package/docs/ProtoBuf.DotProto.Parser.html +58 -19
  15. package/docs/ProtoBuf.DotProto.Tokenizer.html +104 -19
  16. package/docs/ProtoBuf.DotProto.html +16 -10
  17. package/docs/ProtoBuf.Reflect.Enum.Value.html +207 -33
  18. package/docs/ProtoBuf.Reflect.Enum.html +318 -56
  19. package/docs/ProtoBuf.Reflect.Extension.html +53 -13
  20. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +450 -68
  21. package/docs/ProtoBuf.Reflect.Message.Field.html +454 -51
  22. package/docs/ProtoBuf.Reflect.Message.OneOf.html +1044 -0
  23. package/docs/ProtoBuf.Reflect.Message.html +378 -64
  24. package/docs/ProtoBuf.Reflect.Namespace.html +333 -51
  25. package/docs/ProtoBuf.Reflect.Service.Method.html +228 -35
  26. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +262 -41
  27. package/docs/ProtoBuf.Reflect.Service.html +318 -56
  28. package/docs/ProtoBuf.Reflect.T.html +210 -25
  29. package/docs/ProtoBuf.Reflect.html +17 -11
  30. package/docs/ProtoBuf.Util.html +59 -13
  31. package/docs/ProtoBuf.html +235 -67
  32. package/docs/ProtoBuf.js.html +648 -443
  33. package/docs/index.html +4 -2
  34. package/docs/styles/jsdoc-default.css +2 -2
  35. package/examples/protoify/.npmignore +2 -0
  36. package/examples/protoify/README.md +28 -0
  37. package/examples/protoify/index.js +147 -0
  38. package/examples/protoify/json.js +123 -0
  39. package/examples/protoify/json.json +123 -0
  40. package/examples/protoify/json.proto +30 -0
  41. package/examples/protoify/package.json +15 -0
  42. package/examples/protoify/test.js +56 -0
  43. package/examples/websocket/README.md +1 -0
  44. package/examples/websocket/package.json +1 -1
  45. package/externs/ProtoBuf.js +922 -922
  46. package/package.json +3 -3
  47. package/scripts/build.js +58 -58
  48. package/src/ProtoBuf/Builder/Message.js +107 -77
  49. package/src/ProtoBuf/Builder/Service.js +8 -5
  50. package/src/ProtoBuf/Builder.js +71 -37
  51. package/src/ProtoBuf/DotProto/Parser.js +108 -72
  52. package/src/ProtoBuf/DotProto/Tokenizer.js +17 -11
  53. package/src/ProtoBuf/Lang.js +1 -1
  54. package/src/ProtoBuf/Reflect/Enum/Value.js +3 -2
  55. package/src/ProtoBuf/Reflect/Enum.js +9 -5
  56. package/src/ProtoBuf/Reflect/Extension.js +4 -3
  57. package/src/ProtoBuf/Reflect/Message/ExtensionField.js +4 -3
  58. package/src/ProtoBuf/Reflect/Message/Field.js +45 -26
  59. package/src/ProtoBuf/Reflect/Message/OneOf.js +19 -0
  60. package/src/ProtoBuf/Reflect/Message.js +36 -19
  61. package/src/ProtoBuf/Reflect/Namespace.js +19 -15
  62. package/src/ProtoBuf/Reflect/Service/Method.js +9 -5
  63. package/src/ProtoBuf/Reflect/Service/RPCMethod.js +3 -2
  64. package/src/ProtoBuf/Reflect/Service.js +9 -5
  65. package/src/ProtoBuf/Reflect/T.js +20 -6
  66. package/src/ProtoBuf/Reflect.js +9 -0
  67. package/src/ProtoBuf/Util.js +132 -132
  68. package/src/ProtoBuf.js +15 -17
  69. package/src/google/protobuf/descriptor.json +33 -13
  70. package/tests/bench.txt +373 -373
  71. package/tests/complex.json +8 -4
  72. package/tests/custom-options.json +169 -169
  73. package/tests/extend.json +71 -71
  74. package/tests/nodeunit-browser/nodeunit.css +70 -70
  75. package/tests/nodeunit-browser/nodeunit.js +2108 -2108
  76. package/tests/oneof.proto +6 -0
  77. package/tests/options.json +32 -32
  78. package/tests/options.proto +2 -0
  79. package/tests/proto2js/Bar.json +46 -46
  80. package/tests/suite.js +83 -12
  81. package/.idea/.name +0 -1
  82. package/.idea/ProtoBuf.iml +0 -9
  83. package/.idea/dictionaries/Daniel.xml +0 -7
  84. package/.idea/encodings.xml +0 -5
  85. package/.idea/misc.xml +0 -5
  86. package/.idea/modules.xml +0 -9
  87. package/.idea/scopes/scope_settings.xml +0 -5
  88. package/.idea/vcs.xml +0 -7
  89. package/.idea/workspace.xml +0 -551
  90. package/NOTICE +0 -2
  91. package/sandbox/issue146/MyOptions.proto +0 -28
  92. package/sandbox/issue146/Sample.proto +0 -21
  93. package/sandbox/issue146/main.js +0 -3
  94. package/sandbox/issue147/enum.proto +0 -8
  95. package/sandbox/issue147/main.js +0 -3
  96. package/sandbox/issue42/innerextend.proto +0 -18
  97. package/sandbox/issue42/main.js +0 -8
  98. package/sandbox/issue42/outerextend.proto +0 -17
  99. package/v8.log +0 -3828
@@ -1,922 +1,922 @@
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
+ * {@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) {};