protobufjs 4.1.3 → 5.0.3

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 (80) hide show
  1. package/.travis.yml +3 -1
  2. package/README.md +147 -25
  3. package/bin/pbjs +2 -2
  4. package/bower.json +3 -3
  5. package/cli/pbjs/targets/amd.js +1 -1
  6. package/cli/pbjs/targets/json.js +9 -1
  7. package/cli/pbjs/targets/proto.js +48 -24
  8. package/cli/pbjs/util.js +1 -1
  9. package/cli/pbjs.js +9 -2
  10. package/dist/README.md +10 -10
  11. package/dist/{ProtoBuf-light.js → protobuf-light.js} +92 -37
  12. package/dist/protobuf-light.min.js +94 -0
  13. package/dist/protobuf-light.min.js.gz +0 -0
  14. package/dist/protobuf-light.min.map +8 -0
  15. package/dist/{ProtoBuf.js → protobuf.js} +150 -60
  16. package/dist/protobuf.min.js +116 -0
  17. package/dist/protobuf.min.js.gz +0 -0
  18. package/dist/protobuf.min.map +8 -0
  19. package/docs/ProtoBuf.Builder.Message.html +106 -37
  20. package/docs/ProtoBuf.Builder.Service.html +9 -9
  21. package/docs/ProtoBuf.Builder.html +22 -22
  22. package/docs/ProtoBuf.DotProto.Parser.html +7 -7
  23. package/docs/ProtoBuf.DotProto.Tokenizer.html +11 -11
  24. package/docs/ProtoBuf.DotProto.html +2 -2
  25. package/docs/ProtoBuf.Map.html +6 -6
  26. package/docs/ProtoBuf.Reflect.Element.html +104 -8
  27. package/docs/ProtoBuf.Reflect.Enum.Value.html +10 -10
  28. package/docs/ProtoBuf.Reflect.Enum.html +21 -21
  29. package/docs/ProtoBuf.Reflect.Extension.html +3 -3
  30. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +29 -29
  31. package/docs/ProtoBuf.Reflect.Message.Field.html +28 -28
  32. package/docs/ProtoBuf.Reflect.Message.OneOf.html +10 -10
  33. package/docs/ProtoBuf.Reflect.Message.html +31 -28
  34. package/docs/ProtoBuf.Reflect.Namespace.html +19 -19
  35. package/docs/ProtoBuf.Reflect.Service.Method.html +11 -11
  36. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +17 -17
  37. package/docs/ProtoBuf.Reflect.Service.html +20 -20
  38. package/docs/ProtoBuf.Reflect.T.html +9 -9
  39. package/docs/ProtoBuf.Reflect.html +2 -2
  40. package/docs/ProtoBuf.Util.html +6 -6
  41. package/docs/ProtoBuf.html +28 -28
  42. package/docs/ProtoBuf.js.html +151 -61
  43. package/docs/index.html +1 -1
  44. package/donate.png +0 -0
  45. package/examples/websocket/server.js +4 -4
  46. package/externs/{ProtoBuf.js → protobuf.js} +25 -14
  47. package/index.js +1 -18
  48. package/jsdoc.json +1 -1
  49. package/package.json +11 -11
  50. package/protobuf.png +0 -0
  51. package/scripts/build.js +5 -10
  52. package/src/ProtoBuf/Builder/Message.js +17 -8
  53. package/src/ProtoBuf/Builder/Service.js +3 -0
  54. package/src/ProtoBuf/Builder.js +34 -10
  55. package/src/ProtoBuf/DotProto/Parser.js +58 -23
  56. package/src/ProtoBuf/Lang.js +2 -2
  57. package/src/ProtoBuf/Reflect/Element.js +17 -4
  58. package/src/ProtoBuf/Reflect/Message/Field.js +6 -5
  59. package/src/ProtoBuf/Reflect/Message.js +9 -4
  60. package/src/{bower.json → bower.json.in} +2 -2
  61. package/src/google/protobuf/descriptor.json +55 -15
  62. package/src/{ProtoBuf.js → protobuf.js} +0 -0
  63. package/src/wrap.js +4 -4
  64. package/tests/complex.json +8 -1
  65. package/tests/imports-weak.proto +7 -0
  66. package/tests/suite.js +107 -82
  67. package/.npmignore +0 -3
  68. package/ProtoBuf.png +0 -0
  69. package/dist/ProtoBuf-light.min.js +0 -87
  70. package/dist/ProtoBuf-light.min.js.gz +0 -0
  71. package/dist/ProtoBuf-light.min.map +0 -8
  72. package/dist/ProtoBuf.min.js +0 -108
  73. package/dist/ProtoBuf.min.js.gz +0 -0
  74. package/dist/ProtoBuf.min.map +0 -8
  75. package/examples/protoify/.npmignore +0 -2
  76. package/examples/websocket/.npmignore +0 -3
  77. package/externs/ByteBuffer.js +0 -767
  78. package/externs/Long.js +0 -328
  79. package/tests/gtfs-realtime.proto +0 -552
  80. package/webpack.config.js +0 -9
@@ -1,767 +0,0 @@
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 ByteBuffer.js.
19
- * @see https://github.com/dcodeIO/ByteBuffer.js
20
- * @externs
21
- */
22
-
23
- /**
24
- BEGIN_NODE_INCLUDE
25
- var ByteBuffer = require('bytebuffer');
26
- END_NODE_INCLUDE
27
- */
28
-
29
- /**
30
- * @param {number=} capacity
31
- * @param {boolean=} littleEndian
32
- * @constructor
33
- */
34
- function ByteBuffer(capacity, littleEndian) {};
35
-
36
- /**
37
- * @type {?ArrayBuffer}
38
- */
39
- ByteBuffer.prototype.array;
40
-
41
- /**
42
- * @type {number}
43
- */
44
- ByteBuffer.prototype.offset;
45
-
46
- /**
47
- * @type {number}
48
- */
49
- ByteBuffer.prototype.markedOffset;
50
-
51
- /**
52
- * @type {number}
53
- */
54
- ByteBuffer.prototype.length;
55
-
56
- /**
57
- * @type {boolean}
58
- */
59
- ByteBuffer.prototype.littleEndian;
60
-
61
- /**
62
- * @type {string}
63
- * @const
64
- */
65
- ByteBuffer.VERSION;
66
-
67
- /**
68
- * @type {number}
69
- * @const
70
- */
71
- ByteBuffer.DEFAULT_CAPACITY = 32;
72
-
73
- /**
74
- * @type {boolean}
75
- * @const
76
- */
77
- ByteBuffer.LITTLE_ENDIAN = true;
78
-
79
- /**
80
- * @type {boolean}
81
- * @const
82
- */
83
- ByteBuffer.BIG_ENDIAN = false;
84
-
85
- /**
86
- * @param {number=} capacity
87
- * @param {boolean=} littleEndian
88
- * @returns {!ByteBuffer}
89
- * @nosideeffects
90
- */
91
- ByteBuffer.allocate = function(capacity, littleEndian) {};
92
-
93
- /**
94
- * @param {!ArrayBuffer|!Buffer|!{array: ArrayBuffer}|!{buffer: ArrayBuffer}|string} buffer
95
- * @param {(string|boolean)=} enc
96
- * @param {boolean=} littleEndian
97
- * @returns {!ByteBuffer}
98
- * @throws {Error}
99
- * @nosideeffects
100
- */
101
- ByteBuffer.wrap = function(buffer, enc, littleEndian) {};
102
-
103
- /**
104
- * @param {*} bb
105
- * @returns {boolean}
106
- * @nosideeffects
107
- */
108
- ByteBuffer.isByteBuffer = function(bb) {};
109
-
110
- /**
111
- * @param {boolean=} littleEndian
112
- * @returns {!ByteBuffer}
113
- */
114
- ByteBuffer.prototype.LE = function(littleEndian) {};
115
-
116
- /**
117
- * @param {boolean=} bigEndian
118
- * @returns {!ByteBuffer}
119
- */
120
- ByteBuffer.prototype.BE = function(bigEndian) {};
121
-
122
- /**
123
- * @param {number} capacity
124
- * @returns {boolean}
125
- */
126
- ByteBuffer.prototype.resize = function(capacity) {};
127
-
128
- /**
129
- * @param {number} begin
130
- * @param {number} end
131
- * @returns {!ByteBuffer}
132
- * @throws {Error}
133
- * @nosideeffects
134
- */
135
- ByteBuffer.prototype.slice = function(begin, end) {};
136
-
137
- /**
138
- * @param {number} begin
139
- * @param {number} end
140
- * @returns {!ByteBuffer}
141
- * @throws {Error}
142
- * @nosideeffects
143
- */
144
- ByteBuffer.prototype.sliceAndCompact = function(begin, end) {};
145
-
146
- /**
147
- * @param {number} capacity
148
- * @returns {boolean}
149
- */
150
- ByteBuffer.prototype.ensureCapacity = function(capacity) {};
151
-
152
- /**
153
- * @returns {!ByteBuffer}
154
- */
155
- ByteBuffer.prototype.flip = function() {};
156
-
157
- /**
158
- * @param {number=} offset
159
- * @returns {!ByteBuffer}
160
- * @throws {Error}
161
- */
162
- ByteBuffer.prototype.mark = function(offset) {};
163
-
164
- /**
165
- * @returns {!ByteBuffer} this
166
- */
167
- ByteBuffer.prototype.reset = function() {};
168
-
169
- /**
170
- * @returns {!ByteBuffer}
171
- * @nosideeffects
172
- */
173
- ByteBuffer.prototype.clone = function() {};
174
-
175
- /**
176
- * @returns {!ByteBuffer}
177
- * @nosideeffects
178
- */
179
- ByteBuffer.prototype.copy = function() {};
180
-
181
- /**
182
- * @returns {number}
183
- * @nosideeffects
184
- */
185
- ByteBuffer.prototype.remaining = function() {};
186
-
187
- /**
188
- * @returns {number}
189
- * @nosideeffects
190
- */
191
- ByteBuffer.prototype.capacity = function() {};
192
-
193
- /**
194
- * @returns {!ByteBuffer}
195
- * @throws {Error}
196
- */
197
- ByteBuffer.prototype.compact = function() {};
198
-
199
- /**
200
- * @returns {!ByteBuffer}
201
- */
202
- ByteBuffer.prototype.destroy = function() {};
203
-
204
- /**
205
- * @returns {!ByteBuffer}
206
- * @throws {Error}
207
- */
208
- ByteBuffer.prototype.reverse = function() {};
209
-
210
- /**
211
- * @param {!ByteBuffer} src
212
- * @param {number=} offset
213
- * @returns {!ByteBuffer}
214
- * @throws {Error}
215
- */
216
- ByteBuffer.prototype.append = function(src, offset) {};
217
-
218
- /**
219
- * @param {!ByteBuffer} src
220
- * @param {number=} offset
221
- * @returns {!ByteBuffer}
222
- * @throws {Error}
223
- */
224
- ByteBuffer.prototype.prepend = function(src, offset) {};
225
-
226
- /**
227
- * @param {number} value
228
- * @param {number=} offset
229
- * @returns {!ByteBuffer}
230
- */
231
- ByteBuffer.prototype.writeInt8 = function(value, offset) {};
232
-
233
- /**
234
- * @param {number=} offset
235
- * @returns {number}
236
- * @throws {Error}
237
- */
238
- ByteBuffer.prototype.readInt8 = function(offset) {};
239
-
240
- /**
241
- * @param {number} value
242
- * @param {number=} offset
243
- * @returns {!ByteBuffer}
244
- */
245
- ByteBuffer.prototype.writeByte = function(value, offset) {};
246
-
247
- /**
248
- * @param {number=} offset
249
- * @returns {number}
250
- * @throws {Error}
251
- */
252
- ByteBuffer.prototype.readByte = function(offset) {};
253
-
254
- /**
255
- * @param {number} value
256
- * @param {number=} offset
257
- * @returns {!ByteBuffer}
258
- */
259
- ByteBuffer.prototype.writeUint8 = function(value, offset) {};
260
-
261
- /**
262
- * @param {number=} offset
263
- * @returns {number}
264
- * @throws {Error}
265
- */
266
- ByteBuffer.prototype.readUint8 = function(offset) {};
267
-
268
- /**
269
- * @param {number} value
270
- * @param {number=} offset
271
- * @returns {!ByteBuffer}
272
- */
273
- ByteBuffer.prototype.writeInt16 = function(value, offset) {};
274
-
275
- /**
276
- * @param {number=} offset
277
- * @returns {number}
278
- * @throws {Error}
279
- */
280
- ByteBuffer.prototype.readInt16 = function(offset) {};
281
-
282
- /**
283
- * @param {number} value
284
- * @param {number=} offset
285
- * @returns {!ByteBuffer}
286
- */
287
- ByteBuffer.prototype.writeShort = function(value, offset) {};
288
-
289
- /**
290
- * @param {number=} offset
291
- * @returns {number}
292
- * @throws {Error}
293
- */
294
- ByteBuffer.prototype.readShort = function (offset) {};
295
-
296
- /**
297
- * @param {number} value
298
- * @param {number=} offset
299
- * @returns {!ByteBuffer}
300
- */
301
- ByteBuffer.prototype.writeUint16 = function(value, offset) {};
302
-
303
- /**
304
- * @param {number=} offset
305
- * @returns {number}
306
- * @throws {Error}
307
- */
308
- ByteBuffer.prototype.readUint16 = function(offset) {};
309
-
310
- /**
311
- * @param {number} value
312
- * @param {number=} offset
313
- * @returns {!ByteBuffer}
314
- */
315
- ByteBuffer.prototype.writeInt32 = function(value, offset) {};
316
-
317
- /**
318
- * @param {number=} offset
319
- * @returns {number}
320
- * @throws {Error}
321
- */
322
- ByteBuffer.prototype.readInt32 = function(offset) {};
323
-
324
- /**
325
- * @param {number} value
326
- * @param {number=} offset
327
- * @returns {!ByteBuffer}
328
- */
329
- ByteBuffer.prototype.writeInt = function(value, offset) {};
330
-
331
- /**
332
- * @param {number=} offset
333
- * @returns {number}
334
- * @throws {Error}
335
- */
336
- ByteBuffer.prototype.readInt = function(offset) {};
337
-
338
- /**
339
- * @param {number} value
340
- * @param {number=} offset
341
- * @returns {!ByteBuffer}
342
- */
343
- ByteBuffer.prototype.writeUint32 = function(value, offset) {};
344
-
345
- /**
346
- * @param {number=} offset
347
- * @returns {number}
348
- * @throws {Error}
349
- */
350
- ByteBuffer.prototype.readUint32 = function(offset) {};
351
-
352
- /**
353
- * @param {number|Long} value
354
- * @param {number=} offset
355
- * @returns {!ByteBuffer}
356
- */
357
- ByteBuffer.prototype.writeInt64 = function(value, offset) {};
358
-
359
- /**
360
- * @param {number=} offset
361
- * @returns {Long}
362
- * @throws {Error}
363
- */
364
- ByteBuffer.prototype.readInt64 = function(offset) {};
365
-
366
- /**
367
- * @param {number|Long} value
368
- * @param {number=} offset
369
- * @returns {!ByteBuffer}
370
- */
371
- ByteBuffer.prototype.writeUint64 = function(value, offset) {};
372
-
373
- /**
374
- * @param {number=} offset
375
- * @returns {Long}
376
- * @throws {Error}
377
- */
378
- ByteBuffer.prototype.readUint64 = function(offset) {};
379
-
380
- /**
381
- * @param {number} value
382
- * @param {number=} offset
383
- * @returns {!ByteBuffer}
384
- */
385
- ByteBuffer.prototype.writeFloat32 = function(value, offset) {};
386
-
387
- /**
388
- * @param {number=} offset
389
- * @returns {number}
390
- * @throws {Error}
391
- */
392
- ByteBuffer.prototype.readFloat32 = function(offset) {};
393
-
394
- /**
395
- * @param {number} value
396
- * @param {number=} offset
397
- * @returns {!ByteBuffer}
398
- */
399
- ByteBuffer.prototype.writeFloat = function(value, offset) {};
400
-
401
- /**
402
- * @param {number=} offset
403
- * @returns {number}
404
- * @throws {Error}
405
- */
406
- ByteBuffer.prototype.readFloat = function(offset) {};
407
-
408
- /**
409
- * @param {number} value
410
- * @param {number=} offset
411
- * @returns {!ByteBuffer}
412
- */
413
- ByteBuffer.prototype.writeFloat64 = function(value, offset) {};
414
-
415
- /**
416
- * @param {number=} offset
417
- * @returns {number}
418
- * @throws {Error}
419
- */
420
- ByteBuffer.prototype.readFloat64 = function(offset) {};
421
-
422
- /**
423
- * @param {number} value
424
- * @param {number=} offset
425
- * @returns {!ByteBuffer}
426
- */
427
- ByteBuffer.prototype.writeDouble = function(value, offset) {};
428
-
429
- /**
430
- * @param {number=} offset
431
- * @returns {number}
432
- * @throws {Error}
433
- */
434
- ByteBuffer.prototype.readDouble = function(offset) {};
435
-
436
- /**
437
- * @param {number} value
438
- * @param {number=} offset
439
- * @returns {!ByteBuffer}
440
- */
441
- ByteBuffer.prototype.writeLong = function(value, offset) {};
442
-
443
- /**
444
- * @param {number=} offset
445
- * @returns {number}
446
- * @throws {Error}
447
- */
448
- ByteBuffer.prototype.readLong = function(offset) {};
449
-
450
- /**
451
- * @param {number} value
452
- * @param {number=} offset
453
- * @returns {!ByteBuffer|number}
454
- */
455
- ByteBuffer.prototype.writeVarint32 = function(value, offset) {};
456
-
457
- /**
458
- * @param {number=} offset
459
- * @returns {number|!{value: number, length: number}}
460
- * @throws {Error}
461
- */
462
- ByteBuffer.prototype.readVarint32 = function(offset) {};
463
-
464
- /**
465
- * @param {number} value
466
- * @param {number=} offset
467
- * @returns {!ByteBuffer|number}
468
- */
469
- ByteBuffer.prototype.writeZigZagVarint32 = function(value, offset) {};
470
-
471
- /**
472
- * @param {number=} offset
473
- * @returns {number|{value: number, length: number}}
474
- * @throws {Error}
475
- */
476
- ByteBuffer.prototype.readZigZagVarint32 = function(offset) {};
477
-
478
- /**
479
- * @param {number|Long} value
480
- * @param {number=} offset
481
- * @returns {!ByteBuffer|number}
482
- * @throws {Error}
483
- */
484
- ByteBuffer.prototype.writeVarint64 = function(value, offset) {};
485
-
486
- /**
487
- * @param {number=} offset
488
- * @returns {!Long|{value: !Long, length: number}}
489
- * @throws {Error}
490
- */
491
- ByteBuffer.prototype.readVarint64 = function(offset) {};
492
-
493
- /**
494
- * @param {number|Long} value
495
- * @param {number=} offset
496
- * @returns {!ByteBuffer|number}
497
- * @throws {Error}
498
- */
499
- ByteBuffer.prototype.writeZigZagVarint64 = function(value, offset) {};
500
-
501
- /**
502
- * @param {number=} offset
503
- * @returns {!Long|!{value: !Long, length: number}}
504
- * @throws {Error}
505
- */
506
- ByteBuffer.prototype.readZigZagVarint64 = function(offset) {};
507
-
508
- /**
509
- * @param {number} value
510
- * @param {number=} offset
511
- * @returns {!ByteBuffer|number}
512
- */
513
- ByteBuffer.prototype.writeVarint = function(value, offset) {};
514
-
515
- /**
516
- * @param {number=} offset
517
- * @returns {number|!{value: number, length: number}}
518
- * @throws {Error}
519
- */
520
- ByteBuffer.prototype.readVarint = function(offset) {};
521
-
522
- /**
523
- * @param {number} value
524
- * @param {number=} offset
525
- * @returns {!ByteBuffer|number}
526
- */
527
- ByteBuffer.prototype.writeZigZagVarint = function(value, offset) {};
528
-
529
- /**
530
- * @param {number=} offset
531
- * @returns {number|{value: number, length: number}}
532
- * @throws {Error}
533
- */
534
- ByteBuffer.prototype.readZigZagVarint = function(offset) {};
535
-
536
- /**
537
- * @param {number} value
538
- * @returns {number}
539
- * @throws {Error}
540
- * @nosideeffects
541
- */
542
- ByteBuffer.calculateVarint32 = function(value) {};
543
-
544
- /**
545
- * @param {number} value
546
- * @returns {number}
547
- * @throws {Error}
548
- * @nosideeffects
549
- */
550
- ByteBuffer.calculateVarint64 = function(value) {};
551
-
552
- /**
553
- * @param {string} str
554
- * @returns {number}
555
- * @nosideeffects
556
- */
557
- ByteBuffer.calculateUTF8String = function(str) {};
558
-
559
- /**
560
- * @param {string} str
561
- * @param {number=} offset
562
- * @returns {!ByteBuffer|number}
563
- */
564
- ByteBuffer.prototype.writeUTF8String = function(str, offset) {};
565
-
566
- /**
567
- * @param {number} chars
568
- * @param {number=} offset
569
- * @returns {string|!{string: string, length: number}}
570
- * @throws {Error}
571
- */
572
- ByteBuffer.prototype.readUTF8String = function(chars, offset) {};
573
-
574
- /**
575
- * @param {number} length
576
- * @param {number} offset
577
- * @throws {Error}
578
- */
579
- ByteBuffer.prototype.readUTF8StringBytes = function(length, offset) {};
580
-
581
- /**
582
- * @param {string} str
583
- * @param {number=} offset
584
- * @returns {!ByteBuffer|number}
585
- */
586
- ByteBuffer.prototype.writeLString = function(str, offset) {};
587
-
588
- /**
589
- * @param {number=} offset
590
- * @returns {string|!{string: string, length: number}}
591
- * @throws {Error}
592
- */
593
- ByteBuffer.prototype.readLString = function(offset) {};
594
-
595
- /**
596
- * @param {string} str
597
- * @param {number=} offset
598
- * @returns {!ByteBuffer|number}
599
- */
600
- ByteBuffer.prototype.writeVString = function(str, offset) {};
601
-
602
- /**
603
- * @param {number=} offset
604
- * @returns {string|!{string: string, length: number}}
605
- * @throws {Error}
606
- */
607
- ByteBuffer.prototype.readVString = function(offset) {};
608
-
609
- /**
610
- * @param {string} str
611
- * @param {number=} offset
612
- * @returns {!ByteBuffer|number}
613
- */
614
- ByteBuffer.prototype.writeCString = function(str, offset) {};
615
-
616
- /**
617
- * @param {number=} offset
618
- * @returns {string|!{string: string, length: number}}
619
- * @throws {Error}
620
- */
621
- ByteBuffer.prototype.readCString = function(offset) {};
622
-
623
- /**
624
- * @param {*} data
625
- * @param {number=} offset
626
- * @param {(function(*):string)=} stringify
627
- * @returns {!ByteBuffer|number}
628
- */
629
- ByteBuffer.prototype.writeJSON = function(data, offset, stringify) {};
630
-
631
- /**
632
- * @param {number=} offset
633
- * @param {(function(string):*)=} parse
634
- * @returns {*|!{data: *, length: number}}
635
- * @throws {Error}
636
- */
637
- ByteBuffer.prototype.readJSON = function(offset, parse) {};
638
-
639
- /**
640
- * @param {number=} wrap
641
- * @returns {string}
642
- * @nosideeffects
643
- */
644
- ByteBuffer.prototype.toColumns = function(wrap) {};
645
-
646
- /**
647
- * @param {function(string)=} out
648
- */
649
- ByteBuffer.prototype.printDebug = function(out) {};
650
-
651
- /**
652
- * @param {boolean=} debug
653
- * @returns {string}
654
- * @nosideeffects
655
- */
656
- ByteBuffer.prototype.toHex = function(debug) {};
657
-
658
- /**
659
- * @returns {string}
660
- * @nosideeffects
661
- */
662
- ByteBuffer.prototype.toUTF8 = function() {};
663
-
664
- /**
665
- * @returns {string}
666
- * @nosideeffects
667
- */
668
- ByteBuffer.prototype.toBase64 = function() {};
669
-
670
- /**
671
- * @param {string=} enc
672
- * @returns {string}
673
- * @nosideeffects
674
- */
675
- ByteBuffer.prototype.toString = function(enc) {};
676
-
677
- /**
678
- * @param {boolean=} forceCopy
679
- * @returns {ArrayBuffer}
680
- * @nosideeffects
681
- */
682
- ByteBuffer.prototype.toArrayBuffer = function(forceCopy) {};
683
-
684
- /**
685
- * @param {!ByteBuffer} src
686
- * @param {number} offset
687
- * @returns {!{char: number, length: number}}
688
- * @nosideeffects
689
- */
690
- ByteBuffer.decodeUTF8Char = function(src, offset) {};
691
-
692
- /**
693
- * @param {number} charCode
694
- * @param {!ByteBuffer} dst
695
- * @param {number} offset
696
- * @returns {number}
697
- * @throws {Error}
698
- */
699
- ByteBuffer.encodeUTF8Char = function(charCode, dst, offset) {};
700
-
701
- /**
702
- * @param {number} charCode
703
- * @returns {number}
704
- * @throws {Error}
705
- * @nosideeffects
706
- */
707
- ByteBuffer.calculateUTF8Char = function(charCode) {};
708
-
709
- /**
710
- * @param {number} n
711
- * @returns {number}
712
- * @nosideeffects
713
- */
714
- ByteBuffer.zigZagEncode32 = function(n) {};
715
-
716
- /**
717
- * @param {number} n
718
- * @returns {number}
719
- * @nosideeffects
720
- */
721
- ByteBuffer.zigZagDecode32 = function(n) {};
722
-
723
- /**
724
- * @param {!ByteBuffer} bb
725
- * @returns {string}
726
- * @throws {Error}
727
- * @nosideeffects
728
- */
729
- ByteBuffer.encode64 = function(bb) {};
730
-
731
- /**
732
- * @param {string} str
733
- * @param {boolean=} littleEndian
734
- * @returns {!ByteBuffer}
735
- * @throws {Error}
736
- * @nosideeffects
737
- */
738
- ByteBuffer.decode64 = function(str, littleEndian) {};
739
-
740
- /**
741
- * @param {!ByteBuffer} bb
742
- * @returns {string}
743
- * @throws {Error}
744
- * @nosideeffects
745
- */
746
- ByteBuffer.encodeHex = function(bb) {};
747
-
748
- /**
749
- * @param {string} str
750
- * @param {boolean=} littleEndian
751
- * @returns {!ByteBuffer}
752
- * @throws {Error}
753
- * @nosideeffects
754
- */
755
- ByteBuffer.decodeHex = function(str, littleEndian) {};
756
-
757
- /**
758
- * @type {number}
759
- * @const
760
- */
761
- ByteBuffer.MAX_VARINT32_BYTES = 5;
762
-
763
- /**
764
- * @type {number}
765
- * @const
766
- */
767
- ByteBuffer.MAX_VARINT64_BYTES = 10;