discord-protos 1.0.1 → 1.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.
@@ -0,0 +1,613 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = void 0;
4
+ // @generated by protobuf-ts 2.8.2
5
+ // @generated from protobuf file "google/protobuf/wrappers.proto" (package "google.protobuf", syntax proto3)
6
+ // tslint:disable
7
+ //
8
+ // Protocol Buffers - Google's data interchange format
9
+ // Copyright 2008 Google Inc. All rights reserved.
10
+ // https://developers.google.com/protocol-buffers/
11
+ //
12
+ // Redistribution and use in source and binary forms, with or without
13
+ // modification, are permitted provided that the following conditions are
14
+ // met:
15
+ //
16
+ // * Redistributions of source code must retain the above copyright
17
+ // notice, this list of conditions and the following disclaimer.
18
+ // * Redistributions in binary form must reproduce the above
19
+ // copyright notice, this list of conditions and the following disclaimer
20
+ // in the documentation and/or other materials provided with the
21
+ // distribution.
22
+ // * Neither the name of Google Inc. nor the names of its
23
+ // contributors may be used to endorse or promote products derived from
24
+ // this software without specific prior written permission.
25
+ //
26
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+ //
38
+ //
39
+ // Wrappers for primitive (non-message) types. These types are useful
40
+ // for embedding primitives in the `google.protobuf.Any` type and for places
41
+ // where we need to distinguish between the absence of a primitive
42
+ // typed field and its default value.
43
+ //
44
+ // These wrappers have no meaningful use within repeated fields as they lack
45
+ // the ability to detect presence on individual elements.
46
+ // These wrappers have no meaningful use within a map or a oneof since
47
+ // individual entries of a map or fields of a oneof can already detect presence.
48
+ //
49
+ const runtime_1 = require("@protobuf-ts/runtime");
50
+ const runtime_2 = require("@protobuf-ts/runtime");
51
+ const runtime_3 = require("@protobuf-ts/runtime");
52
+ const runtime_4 = require("@protobuf-ts/runtime");
53
+ const runtime_5 = require("@protobuf-ts/runtime");
54
+ const runtime_6 = require("@protobuf-ts/runtime");
55
+ const runtime_7 = require("@protobuf-ts/runtime");
56
+ // @generated message type with reflection information, may provide speed optimized methods
57
+ class DoubleValue$Type extends runtime_7.MessageType {
58
+ constructor() {
59
+ super("google.protobuf.DoubleValue", [
60
+ { no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }
61
+ ]);
62
+ }
63
+ /**
64
+ * Encode `DoubleValue` to JSON number.
65
+ */
66
+ internalJsonWrite(message, options) {
67
+ return this.refJsonWriter.scalar(2, message.value, "value", false, true);
68
+ }
69
+ /**
70
+ * Decode `DoubleValue` from JSON number.
71
+ */
72
+ internalJsonRead(json, options, target) {
73
+ if (!target)
74
+ target = this.create();
75
+ target.value = this.refJsonReader.scalar(json, 1, undefined, "value");
76
+ return target;
77
+ }
78
+ create(value) {
79
+ const message = { value: 0 };
80
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
81
+ if (value !== undefined)
82
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
83
+ return message;
84
+ }
85
+ internalBinaryRead(reader, length, options, target) {
86
+ let message = target ?? this.create(), end = reader.pos + length;
87
+ while (reader.pos < end) {
88
+ let [fieldNo, wireType] = reader.tag();
89
+ switch (fieldNo) {
90
+ case /* double value */ 1:
91
+ message.value = reader.double();
92
+ break;
93
+ default:
94
+ let u = options.readUnknownField;
95
+ if (u === "throw")
96
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
97
+ let d = reader.skip(wireType);
98
+ if (u !== false)
99
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
100
+ }
101
+ }
102
+ return message;
103
+ }
104
+ internalBinaryWrite(message, writer, options) {
105
+ /* double value = 1; */
106
+ if (message.value !== 0)
107
+ writer.tag(1, runtime_3.WireType.Bit64).double(message.value);
108
+ let u = options.writeUnknownFields;
109
+ if (u !== false)
110
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
111
+ return writer;
112
+ }
113
+ }
114
+ /**
115
+ * @generated MessageType for protobuf message google.protobuf.DoubleValue
116
+ */
117
+ exports.DoubleValue = new DoubleValue$Type();
118
+ // @generated message type with reflection information, may provide speed optimized methods
119
+ class FloatValue$Type extends runtime_7.MessageType {
120
+ constructor() {
121
+ super("google.protobuf.FloatValue", [
122
+ { no: 1, name: "value", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }
123
+ ]);
124
+ }
125
+ /**
126
+ * Encode `FloatValue` to JSON number.
127
+ */
128
+ internalJsonWrite(message, options) {
129
+ return this.refJsonWriter.scalar(1, message.value, "value", false, true);
130
+ }
131
+ /**
132
+ * Decode `FloatValue` from JSON number.
133
+ */
134
+ internalJsonRead(json, options, target) {
135
+ if (!target)
136
+ target = this.create();
137
+ target.value = this.refJsonReader.scalar(json, 1, undefined, "value");
138
+ return target;
139
+ }
140
+ create(value) {
141
+ const message = { value: 0 };
142
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
143
+ if (value !== undefined)
144
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
145
+ return message;
146
+ }
147
+ internalBinaryRead(reader, length, options, target) {
148
+ let message = target ?? this.create(), end = reader.pos + length;
149
+ while (reader.pos < end) {
150
+ let [fieldNo, wireType] = reader.tag();
151
+ switch (fieldNo) {
152
+ case /* float value */ 1:
153
+ message.value = reader.float();
154
+ break;
155
+ default:
156
+ let u = options.readUnknownField;
157
+ if (u === "throw")
158
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
159
+ let d = reader.skip(wireType);
160
+ if (u !== false)
161
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
162
+ }
163
+ }
164
+ return message;
165
+ }
166
+ internalBinaryWrite(message, writer, options) {
167
+ /* float value = 1; */
168
+ if (message.value !== 0)
169
+ writer.tag(1, runtime_3.WireType.Bit32).float(message.value);
170
+ let u = options.writeUnknownFields;
171
+ if (u !== false)
172
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
173
+ return writer;
174
+ }
175
+ }
176
+ /**
177
+ * @generated MessageType for protobuf message google.protobuf.FloatValue
178
+ */
179
+ exports.FloatValue = new FloatValue$Type();
180
+ // @generated message type with reflection information, may provide speed optimized methods
181
+ class Int64Value$Type extends runtime_7.MessageType {
182
+ constructor() {
183
+ super("google.protobuf.Int64Value", [
184
+ { no: 1, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
185
+ ]);
186
+ }
187
+ /**
188
+ * Encode `Int64Value` to JSON string.
189
+ */
190
+ internalJsonWrite(message, options) {
191
+ return this.refJsonWriter.scalar(runtime_1.ScalarType.INT64, message.value, "value", false, true);
192
+ }
193
+ /**
194
+ * Decode `Int64Value` from JSON string.
195
+ */
196
+ internalJsonRead(json, options, target) {
197
+ if (!target)
198
+ target = this.create();
199
+ target.value = this.refJsonReader.scalar(json, runtime_1.ScalarType.INT64, runtime_2.LongType.BIGINT, "value");
200
+ return target;
201
+ }
202
+ create(value) {
203
+ const message = { value: 0n };
204
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
205
+ if (value !== undefined)
206
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
207
+ return message;
208
+ }
209
+ internalBinaryRead(reader, length, options, target) {
210
+ let message = target ?? this.create(), end = reader.pos + length;
211
+ while (reader.pos < end) {
212
+ let [fieldNo, wireType] = reader.tag();
213
+ switch (fieldNo) {
214
+ case /* int64 value */ 1:
215
+ message.value = reader.int64().toBigInt();
216
+ break;
217
+ default:
218
+ let u = options.readUnknownField;
219
+ if (u === "throw")
220
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
221
+ let d = reader.skip(wireType);
222
+ if (u !== false)
223
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
224
+ }
225
+ }
226
+ return message;
227
+ }
228
+ internalBinaryWrite(message, writer, options) {
229
+ /* int64 value = 1; */
230
+ if (message.value !== 0n)
231
+ writer.tag(1, runtime_3.WireType.Varint).int64(message.value);
232
+ let u = options.writeUnknownFields;
233
+ if (u !== false)
234
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
235
+ return writer;
236
+ }
237
+ }
238
+ /**
239
+ * @generated MessageType for protobuf message google.protobuf.Int64Value
240
+ */
241
+ exports.Int64Value = new Int64Value$Type();
242
+ // @generated message type with reflection information, may provide speed optimized methods
243
+ class UInt64Value$Type extends runtime_7.MessageType {
244
+ constructor() {
245
+ super("google.protobuf.UInt64Value", [
246
+ { no: 1, name: "value", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
247
+ ]);
248
+ }
249
+ /**
250
+ * Encode `UInt64Value` to JSON string.
251
+ */
252
+ internalJsonWrite(message, options) {
253
+ return this.refJsonWriter.scalar(runtime_1.ScalarType.UINT64, message.value, "value", false, true);
254
+ }
255
+ /**
256
+ * Decode `UInt64Value` from JSON string.
257
+ */
258
+ internalJsonRead(json, options, target) {
259
+ if (!target)
260
+ target = this.create();
261
+ target.value = this.refJsonReader.scalar(json, runtime_1.ScalarType.UINT64, runtime_2.LongType.BIGINT, "value");
262
+ return target;
263
+ }
264
+ create(value) {
265
+ const message = { value: 0n };
266
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
267
+ if (value !== undefined)
268
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
269
+ return message;
270
+ }
271
+ internalBinaryRead(reader, length, options, target) {
272
+ let message = target ?? this.create(), end = reader.pos + length;
273
+ while (reader.pos < end) {
274
+ let [fieldNo, wireType] = reader.tag();
275
+ switch (fieldNo) {
276
+ case /* uint64 value */ 1:
277
+ message.value = reader.uint64().toBigInt();
278
+ break;
279
+ default:
280
+ let u = options.readUnknownField;
281
+ if (u === "throw")
282
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
283
+ let d = reader.skip(wireType);
284
+ if (u !== false)
285
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
286
+ }
287
+ }
288
+ return message;
289
+ }
290
+ internalBinaryWrite(message, writer, options) {
291
+ /* uint64 value = 1; */
292
+ if (message.value !== 0n)
293
+ writer.tag(1, runtime_3.WireType.Varint).uint64(message.value);
294
+ let u = options.writeUnknownFields;
295
+ if (u !== false)
296
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
297
+ return writer;
298
+ }
299
+ }
300
+ /**
301
+ * @generated MessageType for protobuf message google.protobuf.UInt64Value
302
+ */
303
+ exports.UInt64Value = new UInt64Value$Type();
304
+ // @generated message type with reflection information, may provide speed optimized methods
305
+ class Int32Value$Type extends runtime_7.MessageType {
306
+ constructor() {
307
+ super("google.protobuf.Int32Value", [
308
+ { no: 1, name: "value", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
309
+ ]);
310
+ }
311
+ /**
312
+ * Encode `Int32Value` to JSON string.
313
+ */
314
+ internalJsonWrite(message, options) {
315
+ return this.refJsonWriter.scalar(5, message.value, "value", false, true);
316
+ }
317
+ /**
318
+ * Decode `Int32Value` from JSON string.
319
+ */
320
+ internalJsonRead(json, options, target) {
321
+ if (!target)
322
+ target = this.create();
323
+ target.value = this.refJsonReader.scalar(json, 5, undefined, "value");
324
+ return target;
325
+ }
326
+ create(value) {
327
+ const message = { value: 0 };
328
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
329
+ if (value !== undefined)
330
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
331
+ return message;
332
+ }
333
+ internalBinaryRead(reader, length, options, target) {
334
+ let message = target ?? this.create(), end = reader.pos + length;
335
+ while (reader.pos < end) {
336
+ let [fieldNo, wireType] = reader.tag();
337
+ switch (fieldNo) {
338
+ case /* int32 value */ 1:
339
+ message.value = reader.int32();
340
+ break;
341
+ default:
342
+ let u = options.readUnknownField;
343
+ if (u === "throw")
344
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
345
+ let d = reader.skip(wireType);
346
+ if (u !== false)
347
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
348
+ }
349
+ }
350
+ return message;
351
+ }
352
+ internalBinaryWrite(message, writer, options) {
353
+ /* int32 value = 1; */
354
+ if (message.value !== 0)
355
+ writer.tag(1, runtime_3.WireType.Varint).int32(message.value);
356
+ let u = options.writeUnknownFields;
357
+ if (u !== false)
358
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
359
+ return writer;
360
+ }
361
+ }
362
+ /**
363
+ * @generated MessageType for protobuf message google.protobuf.Int32Value
364
+ */
365
+ exports.Int32Value = new Int32Value$Type();
366
+ // @generated message type with reflection information, may provide speed optimized methods
367
+ class UInt32Value$Type extends runtime_7.MessageType {
368
+ constructor() {
369
+ super("google.protobuf.UInt32Value", [
370
+ { no: 1, name: "value", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
371
+ ]);
372
+ }
373
+ /**
374
+ * Encode `UInt32Value` to JSON string.
375
+ */
376
+ internalJsonWrite(message, options) {
377
+ return this.refJsonWriter.scalar(13, message.value, "value", false, true);
378
+ }
379
+ /**
380
+ * Decode `UInt32Value` from JSON string.
381
+ */
382
+ internalJsonRead(json, options, target) {
383
+ if (!target)
384
+ target = this.create();
385
+ target.value = this.refJsonReader.scalar(json, 13, undefined, "value");
386
+ return target;
387
+ }
388
+ create(value) {
389
+ const message = { value: 0 };
390
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
391
+ if (value !== undefined)
392
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
393
+ return message;
394
+ }
395
+ internalBinaryRead(reader, length, options, target) {
396
+ let message = target ?? this.create(), end = reader.pos + length;
397
+ while (reader.pos < end) {
398
+ let [fieldNo, wireType] = reader.tag();
399
+ switch (fieldNo) {
400
+ case /* uint32 value */ 1:
401
+ message.value = reader.uint32();
402
+ break;
403
+ default:
404
+ let u = options.readUnknownField;
405
+ if (u === "throw")
406
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
407
+ let d = reader.skip(wireType);
408
+ if (u !== false)
409
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
410
+ }
411
+ }
412
+ return message;
413
+ }
414
+ internalBinaryWrite(message, writer, options) {
415
+ /* uint32 value = 1; */
416
+ if (message.value !== 0)
417
+ writer.tag(1, runtime_3.WireType.Varint).uint32(message.value);
418
+ let u = options.writeUnknownFields;
419
+ if (u !== false)
420
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
421
+ return writer;
422
+ }
423
+ }
424
+ /**
425
+ * @generated MessageType for protobuf message google.protobuf.UInt32Value
426
+ */
427
+ exports.UInt32Value = new UInt32Value$Type();
428
+ // @generated message type with reflection information, may provide speed optimized methods
429
+ class BoolValue$Type extends runtime_7.MessageType {
430
+ constructor() {
431
+ super("google.protobuf.BoolValue", [
432
+ { no: 1, name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
433
+ ]);
434
+ }
435
+ /**
436
+ * Encode `BoolValue` to JSON bool.
437
+ */
438
+ internalJsonWrite(message, options) {
439
+ return message.value;
440
+ }
441
+ /**
442
+ * Decode `BoolValue` from JSON bool.
443
+ */
444
+ internalJsonRead(json, options, target) {
445
+ if (!target)
446
+ target = this.create();
447
+ target.value = this.refJsonReader.scalar(json, 8, undefined, "value");
448
+ return target;
449
+ }
450
+ create(value) {
451
+ const message = { value: false };
452
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
453
+ if (value !== undefined)
454
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
455
+ return message;
456
+ }
457
+ internalBinaryRead(reader, length, options, target) {
458
+ let message = target ?? this.create(), end = reader.pos + length;
459
+ while (reader.pos < end) {
460
+ let [fieldNo, wireType] = reader.tag();
461
+ switch (fieldNo) {
462
+ case /* bool value */ 1:
463
+ message.value = reader.bool();
464
+ break;
465
+ default:
466
+ let u = options.readUnknownField;
467
+ if (u === "throw")
468
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
469
+ let d = reader.skip(wireType);
470
+ if (u !== false)
471
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
472
+ }
473
+ }
474
+ return message;
475
+ }
476
+ internalBinaryWrite(message, writer, options) {
477
+ /* bool value = 1; */
478
+ if (message.value !== false)
479
+ writer.tag(1, runtime_3.WireType.Varint).bool(message.value);
480
+ let u = options.writeUnknownFields;
481
+ if (u !== false)
482
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
483
+ return writer;
484
+ }
485
+ }
486
+ /**
487
+ * @generated MessageType for protobuf message google.protobuf.BoolValue
488
+ */
489
+ exports.BoolValue = new BoolValue$Type();
490
+ // @generated message type with reflection information, may provide speed optimized methods
491
+ class StringValue$Type extends runtime_7.MessageType {
492
+ constructor() {
493
+ super("google.protobuf.StringValue", [
494
+ { no: 1, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
495
+ ]);
496
+ }
497
+ /**
498
+ * Encode `StringValue` to JSON string.
499
+ */
500
+ internalJsonWrite(message, options) {
501
+ return message.value;
502
+ }
503
+ /**
504
+ * Decode `StringValue` from JSON string.
505
+ */
506
+ internalJsonRead(json, options, target) {
507
+ if (!target)
508
+ target = this.create();
509
+ target.value = this.refJsonReader.scalar(json, 9, undefined, "value");
510
+ return target;
511
+ }
512
+ create(value) {
513
+ const message = { value: "" };
514
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
515
+ if (value !== undefined)
516
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
517
+ return message;
518
+ }
519
+ internalBinaryRead(reader, length, options, target) {
520
+ let message = target ?? this.create(), end = reader.pos + length;
521
+ while (reader.pos < end) {
522
+ let [fieldNo, wireType] = reader.tag();
523
+ switch (fieldNo) {
524
+ case /* string value */ 1:
525
+ message.value = reader.string();
526
+ break;
527
+ default:
528
+ let u = options.readUnknownField;
529
+ if (u === "throw")
530
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
531
+ let d = reader.skip(wireType);
532
+ if (u !== false)
533
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
534
+ }
535
+ }
536
+ return message;
537
+ }
538
+ internalBinaryWrite(message, writer, options) {
539
+ /* string value = 1; */
540
+ if (message.value !== "")
541
+ writer.tag(1, runtime_3.WireType.LengthDelimited).string(message.value);
542
+ let u = options.writeUnknownFields;
543
+ if (u !== false)
544
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
545
+ return writer;
546
+ }
547
+ }
548
+ /**
549
+ * @generated MessageType for protobuf message google.protobuf.StringValue
550
+ */
551
+ exports.StringValue = new StringValue$Type();
552
+ // @generated message type with reflection information, may provide speed optimized methods
553
+ class BytesValue$Type extends runtime_7.MessageType {
554
+ constructor() {
555
+ super("google.protobuf.BytesValue", [
556
+ { no: 1, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
557
+ ]);
558
+ }
559
+ /**
560
+ * Encode `BytesValue` to JSON string.
561
+ */
562
+ internalJsonWrite(message, options) {
563
+ return this.refJsonWriter.scalar(12, message.value, "value", false, true);
564
+ }
565
+ /**
566
+ * Decode `BytesValue` from JSON string.
567
+ */
568
+ internalJsonRead(json, options, target) {
569
+ if (!target)
570
+ target = this.create();
571
+ target.value = this.refJsonReader.scalar(json, 12, undefined, "value");
572
+ return target;
573
+ }
574
+ create(value) {
575
+ const message = { value: new Uint8Array(0) };
576
+ globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this });
577
+ if (value !== undefined)
578
+ (0, runtime_5.reflectionMergePartial)(this, message, value);
579
+ return message;
580
+ }
581
+ internalBinaryRead(reader, length, options, target) {
582
+ let message = target ?? this.create(), end = reader.pos + length;
583
+ while (reader.pos < end) {
584
+ let [fieldNo, wireType] = reader.tag();
585
+ switch (fieldNo) {
586
+ case /* bytes value */ 1:
587
+ message.value = reader.bytes();
588
+ break;
589
+ default:
590
+ let u = options.readUnknownField;
591
+ if (u === "throw")
592
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
593
+ let d = reader.skip(wireType);
594
+ if (u !== false)
595
+ (u === true ? runtime_4.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
596
+ }
597
+ }
598
+ return message;
599
+ }
600
+ internalBinaryWrite(message, writer, options) {
601
+ /* bytes value = 1; */
602
+ if (message.value.length)
603
+ writer.tag(1, runtime_3.WireType.LengthDelimited).bytes(message.value);
604
+ let u = options.writeUnknownFields;
605
+ if (u !== false)
606
+ (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
607
+ return writer;
608
+ }
609
+ }
610
+ /**
611
+ * @generated MessageType for protobuf message google.protobuf.BytesValue
612
+ */
613
+ exports.BytesValue = new BytesValue$Type();
package/dist/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/test.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const encoded = _1.PreloadedUserSettings.toBase64({
5
+ status: {
6
+ status: {
7
+ value: "online",
8
+ },
9
+ customStatus: {
10
+ text: "Hello World",
11
+ emojiId: 0n,
12
+ emojiName: "",
13
+ expiresAtMs: 0n,
14
+ },
15
+ },
16
+ });
17
+ const decoded = _1.PreloadedUserSettings.fromBase64(encoded);
18
+ console.log(encoded, decoded);