@sentio/runtime 4.0.0-rc.1 → 4.0.0-rc.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.
@@ -1,134 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8-patch.2
4
- // protoc v6.33.5
5
- // source: google/type/money.proto
6
-
7
- /* eslint-disable */
8
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
-
10
- export interface Money {
11
- currencyCode: string;
12
- units: bigint;
13
- nanos: number;
14
- }
15
-
16
- function createBaseMoney(): Money {
17
- return { currencyCode: "", units: 0n, nanos: 0 };
18
- }
19
-
20
- export const Money: MessageFns<Money> = {
21
- encode(message: Money, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
22
- if (message.currencyCode !== "") {
23
- writer.uint32(10).string(message.currencyCode);
24
- }
25
- if (message.units !== 0n) {
26
- if (BigInt.asIntN(64, message.units) !== message.units) {
27
- throw new globalThis.Error("value provided for field message.units of type int64 too large");
28
- }
29
- writer.uint32(16).int64(message.units);
30
- }
31
- if (message.nanos !== 0) {
32
- writer.uint32(24).int32(message.nanos);
33
- }
34
- return writer;
35
- },
36
-
37
- decode(input: BinaryReader | Uint8Array, length?: number): Money {
38
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
39
- const end = length === undefined ? reader.len : reader.pos + length;
40
- const message = createBaseMoney();
41
- while (reader.pos < end) {
42
- const tag = reader.uint32();
43
- switch (tag >>> 3) {
44
- case 1: {
45
- if (tag !== 10) {
46
- break;
47
- }
48
-
49
- message.currencyCode = reader.string();
50
- continue;
51
- }
52
- case 2: {
53
- if (tag !== 16) {
54
- break;
55
- }
56
-
57
- message.units = reader.int64() as bigint;
58
- continue;
59
- }
60
- case 3: {
61
- if (tag !== 24) {
62
- break;
63
- }
64
-
65
- message.nanos = reader.int32();
66
- continue;
67
- }
68
- }
69
- if ((tag & 7) === 4 || tag === 0) {
70
- break;
71
- }
72
- reader.skip(tag & 7);
73
- }
74
- return message;
75
- },
76
-
77
- fromJSON(object: any): Money {
78
- return {
79
- currencyCode: isSet(object.currencyCode)
80
- ? globalThis.String(object.currencyCode)
81
- : isSet(object.currency_code)
82
- ? globalThis.String(object.currency_code)
83
- : "",
84
- units: isSet(object.units) ? BigInt(object.units) : 0n,
85
- nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
86
- };
87
- },
88
-
89
- toJSON(message: Money): unknown {
90
- const obj: any = {};
91
- if (message.currencyCode !== "") {
92
- obj.currencyCode = message.currencyCode;
93
- }
94
- if (message.units !== 0n) {
95
- obj.units = message.units.toString();
96
- }
97
- if (message.nanos !== 0) {
98
- obj.nanos = Math.round(message.nanos);
99
- }
100
- return obj;
101
- },
102
-
103
- create(base?: DeepPartial<Money>): Money {
104
- return Money.fromPartial(base ?? {});
105
- },
106
- fromPartial(object: DeepPartial<Money>): Money {
107
- const message = createBaseMoney();
108
- message.currencyCode = object.currencyCode ?? "";
109
- message.units = object.units ?? 0n;
110
- message.nanos = object.nanos ?? 0;
111
- return message;
112
- },
113
- };
114
-
115
- type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
116
-
117
- type DeepPartial<T> = T extends Builtin ? T
118
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
119
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
120
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
121
- : Partial<T>;
122
-
123
- function isSet(value: any): boolean {
124
- return value !== null && value !== undefined;
125
- }
126
-
127
- interface MessageFns<T> {
128
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
129
- decode(input: BinaryReader | Uint8Array, length?: number): T;
130
- fromJSON(object: any): T;
131
- toJSON(message: T): unknown;
132
- create(base?: DeepPartial<T>): T;
133
- fromPartial(object: DeepPartial<T>): T;
134
- }