Skip to content

Commit ce573c9

Browse files
committed
fix: add export annotation where the libs are used
1 parent c3d0c0c commit ce573c9

File tree

4 files changed

+118
-6
lines changed

4 files changed

+118
-6
lines changed

binary/reader.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ jspb.BinaryReader.prototype.getBuffer = function() {
192192
/**
193193
* @return {number} The field number of the next field in the buffer, or
194194
* INVALID_FIELD_NUMBER if there is no next field.
195+
* @export
195196
*/
196197
jspb.BinaryReader.prototype.getFieldNumber = function() {
197198
return this.nextField_;
@@ -219,6 +220,7 @@ jspb.BinaryReader.prototype.isDelimited = function() {
219220
/**
220221
* @return {boolean} Whether the current wire type is an end-group tag. Used as
221222
* an exit condition in decoder loops in generated code.
223+
* @export
222224
*/
223225
jspb.BinaryReader.prototype.isEndGroup = function() {
224226
return this.nextWireType_ == jspb.BinaryConstants.WireType.END_GROUP;
@@ -272,6 +274,7 @@ jspb.BinaryReader.prototype.advance = function(count) {
272274
* we saw a valid field header or false if we've read the whole stream.
273275
* Throws an error if we encountered a deprecated START_GROUP/END_GROUP field.
274276
* @return {boolean} True if the stream contains more fields.
277+
* @export
275278
*/
276279
jspb.BinaryReader.prototype.nextField = function() {
277280
// If we're at the end of the block, there are no more fields.
@@ -541,6 +544,7 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) {
541544
* @template T
542545
* @param {T} message
543546
* @param {function(T, !jspb.BinaryReader)} reader
547+
* @export
544548
*/
545549
jspb.BinaryReader.prototype.readMessage = function(message, reader) {
546550
goog.asserts.assert(
@@ -614,6 +618,7 @@ jspb.BinaryReader.prototype.getFieldDecoder = function() {
614618
* error if the next field in the stream is not of the correct wire type.
615619
*
616620
* @return {number} The value of the signed 32-bit integer field.
621+
* @export
617622
*/
618623
jspb.BinaryReader.prototype.readInt32 = function() {
619624
goog.asserts.assert(
@@ -643,6 +648,7 @@ jspb.BinaryReader.prototype.readInt32String = function() {
643648
* error if the next field in the stream is not of the correct wire type.
644649
*
645650
* @return {number} The value of the signed 64-bit integer field.
651+
* @export
646652
*/
647653
jspb.BinaryReader.prototype.readInt64 = function() {
648654
goog.asserts.assert(
@@ -928,6 +934,7 @@ jspb.BinaryReader.prototype.readEnum = function() {
928934
* field in the stream is not of the correct wire type.
929935
*
930936
* @return {string} The value of the string field.
937+
* @export
931938
*/
932939
jspb.BinaryReader.prototype.readString = function() {
933940
goog.asserts.assert(
@@ -942,6 +949,7 @@ jspb.BinaryReader.prototype.readString = function() {
942949
* null if the next field in the stream has an invalid length value.
943950
*
944951
* @return {!Uint8Array} The block of bytes.
952+
* @export
945953
*/
946954
jspb.BinaryReader.prototype.readBytes = function() {
947955
goog.asserts.assert(

binary/writer.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ jspb.BinaryWriter.prototype.reset = function() {
204204
/**
205205
* Converts the encoded data into a Uint8Array.
206206
* @return {!Uint8Array}
207+
* @export
207208
*/
208209
jspb.BinaryWriter.prototype.getResultBuffer = function() {
209210
goog.asserts.assert(this.bookmarks_.length == 0);
@@ -468,6 +469,7 @@ jspb.BinaryWriter.prototype.writeZigzagVarintHash64_ = function(field, value) {
468469
* will be truncated.
469470
* @param {number} field The field number.
470471
* @param {number?} value The value to write.
472+
* @export
471473
*/
472474
jspb.BinaryWriter.prototype.writeInt32 = function(field, value) {
473475
if (value == null) return;
@@ -497,6 +499,7 @@ jspb.BinaryWriter.prototype.writeInt32String = function(field, value) {
497499
* will be truncated.
498500
* @param {number} field The field number.
499501
* @param {number?} value The value to write.
502+
* @export
500503
*/
501504
jspb.BinaryWriter.prototype.writeInt64 = function(field, value) {
502505
if (value == null) return;
@@ -524,6 +527,7 @@ jspb.BinaryWriter.prototype.writeInt64String = function(field, value) {
524527
* will be truncated.
525528
* @param {number} field The field number.
526529
* @param {number?} value The value to write.
530+
* @export
527531
*/
528532
jspb.BinaryWriter.prototype.writeUint32 = function(field, value) {
529533
if (value == null) return;
@@ -553,6 +557,7 @@ jspb.BinaryWriter.prototype.writeUint32String = function(field, value) {
553557
* will be truncated.
554558
* @param {number} field The field number.
555559
* @param {number?} value The value to write.
560+
* @export
556561
*/
557562
jspb.BinaryWriter.prototype.writeUint64 = function(field, value) {
558563
if (value == null) return;
@@ -580,6 +585,7 @@ jspb.BinaryWriter.prototype.writeUint64String = function(field, value) {
580585
* will be truncated.
581586
* @param {number} field The field number.
582587
* @param {number?} value The value to write.
588+
* @export
583589
*/
584590
jspb.BinaryWriter.prototype.writeSint32 = function(field, value) {
585591
if (value == null) return;
@@ -594,6 +600,7 @@ jspb.BinaryWriter.prototype.writeSint32 = function(field, value) {
594600
* will be truncated.
595601
* @param {number} field The field number.
596602
* @param {number?} value The value to write.
603+
* @export
597604
*/
598605
jspb.BinaryWriter.prototype.writeSint64 = function(field, value) {
599606
if (value == null) return;
@@ -632,6 +639,7 @@ jspb.BinaryWriter.prototype.writeSint64String = function(field, value) {
632639
* will be truncated.
633640
* @param {number} field The field number.
634641
* @param {number?} value The value to write.
642+
* @export
635643
*/
636644
jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) {
637645
if (value == null) return;
@@ -647,6 +655,7 @@ jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) {
647655
* will be truncated.
648656
* @param {number} field The field number.
649657
* @param {number?} value The value to write.
658+
* @export
650659
*/
651660
jspb.BinaryWriter.prototype.writeFixed64 = function(field, value) {
652661
if (value == null) return;
@@ -675,6 +684,7 @@ jspb.BinaryWriter.prototype.writeFixed64String = function(field, value) {
675684
* [-2^31,2^31) will be truncated.
676685
* @param {number} field The field number.
677686
* @param {number?} value The value to write.
687+
* @export
678688
*/
679689
jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) {
680690
if (value == null) return;
@@ -690,6 +700,7 @@ jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) {
690700
* [-2^63,2^63) will be truncated.
691701
* @param {number} field The field number.
692702
* @param {number?} value The value to write.
703+
* @export
693704
*/
694705
jspb.BinaryWriter.prototype.writeSfixed64 = function(field, value) {
695706
if (value == null) return;
@@ -719,6 +730,7 @@ jspb.BinaryWriter.prototype.writeSfixed64String = function(field, value) {
719730
* requiring more than 32 bits of precision will be truncated.
720731
* @param {number} field The field number.
721732
* @param {number?} value The value to write.
733+
* @export
722734
*/
723735
jspb.BinaryWriter.prototype.writeFloat = function(field, value) {
724736
if (value == null) return;
@@ -732,6 +744,7 @@ jspb.BinaryWriter.prototype.writeFloat = function(field, value) {
732744
* native format used by JavaScript, no precision will be lost.
733745
* @param {number} field The field number.
734746
* @param {number?} value The value to write.
747+
* @export
735748
*/
736749
jspb.BinaryWriter.prototype.writeDouble = function(field, value) {
737750
if (value == null) return;
@@ -746,6 +759,7 @@ jspb.BinaryWriter.prototype.writeDouble = function(field, value) {
746759
* in the string representation of the proto.
747760
* @param {number} field The field number.
748761
* @param {boolean?|number?} value The value to write.
762+
* @export
749763
*/
750764
jspb.BinaryWriter.prototype.writeBool = function(field, value) {
751765
if (value == null) return;
@@ -759,6 +773,7 @@ jspb.BinaryWriter.prototype.writeBool = function(field, value) {
759773
* Writes an enum field to the buffer.
760774
* @param {number} field The field number.
761775
* @param {number?} value The value to write.
776+
* @export
762777
*/
763778
jspb.BinaryWriter.prototype.writeEnum = function(field, value) {
764779
if (value == null) return;
@@ -773,6 +788,7 @@ jspb.BinaryWriter.prototype.writeEnum = function(field, value) {
773788
* Writes a string field to the buffer.
774789
* @param {number} field The field number.
775790
* @param {string?} value The string to write.
791+
* @export
776792
*/
777793
jspb.BinaryWriter.prototype.writeString = function(field, value) {
778794
if (value == null) return;
@@ -787,6 +803,7 @@ jspb.BinaryWriter.prototype.writeString = function(field, value) {
787803
* of the C++ implementation, empty byte arrays _are_ serialized.
788804
* @param {number} field The field number.
789805
* @param {?jspb.ByteSource} value The array of bytes to write.
806+
* @export
790807
*/
791808
jspb.BinaryWriter.prototype.writeBytes = function(field, value) {
792809
if (value == null) return;
@@ -812,6 +829,7 @@ jspb.BinaryWriter.prototype.writeBytes = function(field, value) {
812829
* mapunion(MessageType, (X) =>
813830
* cond(eq(X, 'null'), none(), X)))
814831
* =:
832+
* @export
815833
*/
816834
jspb.BinaryWriter.prototype.writeMessage = function(
817835
field, value, writerCallback) {
@@ -871,6 +889,7 @@ jspb.BinaryWriter.prototype.writeMessageSet = function(
871889
* mapunion(MessageType, (X) =>
872890
* cond(eq(X, 'null'), none(), X)))
873891
* =:
892+
* @export
874893
*/
875894
jspb.BinaryWriter.prototype.writeGroup = function(
876895
field, value, writerCallback) {
@@ -955,6 +974,7 @@ jspb.BinaryWriter.prototype.writeSplitZigzagVarint64 = function(
955974
* Writes an array of numbers to the buffer as a repeated 32-bit int field.
956975
* @param {number} field The field number.
957976
* @param {?Array<number>} value The array of ints to write.
977+
* @export
958978
*/
959979
jspb.BinaryWriter.prototype.writeRepeatedInt32 = function(field, value) {
960980
if (value == null) return;
@@ -982,6 +1002,7 @@ jspb.BinaryWriter.prototype.writeRepeatedInt32String = function(field, value) {
9821002
* Writes an array of numbers to the buffer as a repeated 64-bit int field.
9831003
* @param {number} field The field number.
9841004
* @param {?Array<number>} value The array of ints to write.
1005+
* @export
9851006
*/
9861007
jspb.BinaryWriter.prototype.writeRepeatedInt64 = function(field, value) {
9871008
if (value == null) return;
@@ -1061,6 +1082,7 @@ jspb.BinaryWriter.prototype.writeRepeatedInt64String = function(field, value) {
10611082
* field.
10621083
* @param {number} field The field number.
10631084
* @param {?Array<number>} value The array of ints to write.
1085+
* @export
10641086
*/
10651087
jspb.BinaryWriter.prototype.writeRepeatedUint32 = function(field, value) {
10661088
if (value == null) return;
@@ -1089,6 +1111,7 @@ jspb.BinaryWriter.prototype.writeRepeatedUint32String = function(field, value) {
10891111
* field.
10901112
* @param {number} field The field number.
10911113
* @param {?Array<number>} value The array of ints to write.
1114+
* @export
10921115
*/
10931116
jspb.BinaryWriter.prototype.writeRepeatedUint64 = function(field, value) {
10941117
if (value == null) return;
@@ -1116,6 +1139,7 @@ jspb.BinaryWriter.prototype.writeRepeatedUint64String = function(field, value) {
11161139
* Writes an array numbers to the buffer as a repeated signed 32-bit int field.
11171140
* @param {number} field The field number.
11181141
* @param {?Array<number>} value The array of ints to write.
1142+
* @export
11191143
*/
11201144
jspb.BinaryWriter.prototype.writeRepeatedSint32 = function(field, value) {
11211145
if (value == null) return;
@@ -1129,6 +1153,7 @@ jspb.BinaryWriter.prototype.writeRepeatedSint32 = function(field, value) {
11291153
* Writes an array numbers to the buffer as a repeated signed 64-bit int field.
11301154
* @param {number} field The field number.
11311155
* @param {?Array<number>} value The array of ints to write.
1156+
* @export
11321157
*/
11331158
jspb.BinaryWriter.prototype.writeRepeatedSint64 = function(field, value) {
11341159
if (value == null) return;
@@ -1401,6 +1426,7 @@ jspb.BinaryWriter.prototype.writeRepeatedVarintHash64 =
14011426
* Writes an array of numbers to the buffer as a packed 32-bit int field.
14021427
* @param {number} field The field number.
14031428
* @param {?Array<number>} value The array of ints to write.
1429+
* @export
14041430
*/
14051431
jspb.BinaryWriter.prototype.writePackedInt32 = function(field, value) {
14061432
if (value == null || !value.length) return;
@@ -1432,6 +1458,7 @@ jspb.BinaryWriter.prototype.writePackedInt32String = function(field, value) {
14321458
* Writes an array of numbers to the buffer as a packed 64-bit int field.
14331459
* @param {number} field The field number.
14341460
* @param {?Array<number>} value The array of ints to write.
1461+
* @export
14351462
*/
14361463
jspb.BinaryWriter.prototype.writePackedInt64 = function(field, value) {
14371464
if (value == null || !value.length) return;
@@ -1525,6 +1552,7 @@ jspb.BinaryWriter.prototype.writePackedInt64String = function(field, value) {
15251552
* Writes an array numbers to the buffer as a packed unsigned 32-bit int field.
15261553
* @param {number} field The field number.
15271554
* @param {?Array<number>} value The array of ints to write.
1555+
* @export
15281556
*/
15291557
jspb.BinaryWriter.prototype.writePackedUint32 = function(field, value) {
15301558
if (value == null || !value.length) return;
@@ -1557,6 +1585,7 @@ jspb.BinaryWriter.prototype.writePackedUint32String =
15571585
* Writes an array numbers to the buffer as a packed unsigned 64-bit int field.
15581586
* @param {number} field The field number.
15591587
* @param {?Array<number>} value The array of ints to write.
1588+
* @export
15601589
*/
15611590
jspb.BinaryWriter.prototype.writePackedUint64 = function(field, value) {
15621591
if (value == null || !value.length) return;
@@ -1590,6 +1619,7 @@ jspb.BinaryWriter.prototype.writePackedUint64String =
15901619
* Writes an array numbers to the buffer as a packed signed 32-bit int field.
15911620
* @param {number} field The field number.
15921621
* @param {?Array<number>} value The array of ints to write.
1622+
* @export
15931623
*/
15941624
jspb.BinaryWriter.prototype.writePackedSint32 = function(field, value) {
15951625
if (value == null || !value.length) return;
@@ -1605,6 +1635,7 @@ jspb.BinaryWriter.prototype.writePackedSint32 = function(field, value) {
16051635
* Writes an array of numbers to the buffer as a packed signed 64-bit int field.
16061636
* @param {number} field The field number.
16071637
* @param {?Array<number>} value The array of ints to write.
1638+
* @export
16081639
*/
16091640
jspb.BinaryWriter.prototype.writePackedSint64 = function(field, value) {
16101641
if (value == null || !value.length) return;

0 commit comments

Comments
 (0)