@shock-cinema/contracts 1.0.0

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,230 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v6.33.2
5
+ // source: google/protobuf/timestamp.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "google.protobuf";
11
+
12
+ /**
13
+ * A Timestamp represents a point in time independent of any time zone or local
14
+ * calendar, encoded as a count of seconds and fractions of seconds at
15
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
16
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
17
+ * Gregorian calendar backwards to year one.
18
+ *
19
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
20
+ * second table is needed for interpretation, using a [24-hour linear
21
+ * smear](https://developers.google.com/time/smear).
22
+ *
23
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
24
+ * restricting to that range, we ensure that we can convert to and from [RFC
25
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
26
+ *
27
+ * # Examples
28
+ *
29
+ * Example 1: Compute Timestamp from POSIX `time()`.
30
+ *
31
+ * Timestamp timestamp;
32
+ * timestamp.set_seconds(time(NULL));
33
+ * timestamp.set_nanos(0);
34
+ *
35
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
36
+ *
37
+ * struct timeval tv;
38
+ * gettimeofday(&tv, NULL);
39
+ *
40
+ * Timestamp timestamp;
41
+ * timestamp.set_seconds(tv.tv_sec);
42
+ * timestamp.set_nanos(tv.tv_usec * 1000);
43
+ *
44
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
45
+ *
46
+ * FILETIME ft;
47
+ * GetSystemTimeAsFileTime(&ft);
48
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
49
+ *
50
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
51
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
52
+ * Timestamp timestamp;
53
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
54
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
55
+ *
56
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
57
+ *
58
+ * long millis = System.currentTimeMillis();
59
+ *
60
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
61
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
62
+ *
63
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
64
+ *
65
+ * Instant now = Instant.now();
66
+ *
67
+ * Timestamp timestamp =
68
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
69
+ * .setNanos(now.getNano()).build();
70
+ *
71
+ * Example 6: Compute Timestamp from current time in Python.
72
+ *
73
+ * timestamp = Timestamp()
74
+ * timestamp.GetCurrentTime()
75
+ *
76
+ * # JSON Mapping
77
+ *
78
+ * In JSON format, the Timestamp type is encoded as a string in the
79
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
80
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
81
+ * where {year} is always expressed using four digits while {month}, {day},
82
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
83
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
84
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
85
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
86
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
87
+ * able to accept both UTC and other timezones (as indicated by an offset).
88
+ *
89
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
90
+ * 01:30 UTC on January 15, 2017.
91
+ *
92
+ * In JavaScript, one can convert a Date object to this format using the
93
+ * standard
94
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
95
+ * method. In Python, a standard `datetime.datetime` object can be converted
96
+ * to this format using
97
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
98
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
99
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
100
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
101
+ * ) to obtain a formatter capable of generating timestamps in this format.
102
+ */
103
+ export interface Timestamp {
104
+ /**
105
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
106
+ * be between -315576000000 and 315576000000 inclusive (which corresponds to
107
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
108
+ */
109
+ seconds: number;
110
+ /**
111
+ * Non-negative fractions of a second at nanosecond resolution. This field is
112
+ * the nanosecond portion of the duration, not an alternative to seconds.
113
+ * Negative second values with fractions must still have non-negative nanos
114
+ * values that count forward in time. Must be between 0 and 999,999,999
115
+ * inclusive.
116
+ */
117
+ nanos: number;
118
+ }
119
+
120
+ function createBaseTimestamp(): Timestamp {
121
+ return { seconds: 0, nanos: 0 };
122
+ }
123
+
124
+ export const Timestamp: MessageFns<Timestamp> = {
125
+ encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
126
+ if (message.seconds !== 0) {
127
+ writer.uint32(8).int64(message.seconds);
128
+ }
129
+ if (message.nanos !== 0) {
130
+ writer.uint32(16).int32(message.nanos);
131
+ }
132
+ return writer;
133
+ },
134
+
135
+ decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
136
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
137
+ const end = length === undefined ? reader.len : reader.pos + length;
138
+ const message = createBaseTimestamp();
139
+ while (reader.pos < end) {
140
+ const tag = reader.uint32();
141
+ switch (tag >>> 3) {
142
+ case 1: {
143
+ if (tag !== 8) {
144
+ break;
145
+ }
146
+
147
+ message.seconds = longToNumber(reader.int64());
148
+ continue;
149
+ }
150
+ case 2: {
151
+ if (tag !== 16) {
152
+ break;
153
+ }
154
+
155
+ message.nanos = reader.int32();
156
+ continue;
157
+ }
158
+ }
159
+ if ((tag & 7) === 4 || tag === 0) {
160
+ break;
161
+ }
162
+ reader.skip(tag & 7);
163
+ }
164
+ return message;
165
+ },
166
+
167
+ fromJSON(object: any): Timestamp {
168
+ return {
169
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
170
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
171
+ };
172
+ },
173
+
174
+ toJSON(message: Timestamp): unknown {
175
+ const obj: any = {};
176
+ if (message.seconds !== 0) {
177
+ obj.seconds = Math.round(message.seconds);
178
+ }
179
+ if (message.nanos !== 0) {
180
+ obj.nanos = Math.round(message.nanos);
181
+ }
182
+ return obj;
183
+ },
184
+
185
+ create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
186
+ return Timestamp.fromPartial(base ?? ({} as any));
187
+ },
188
+ fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(object: I): Timestamp {
189
+ const message = createBaseTimestamp();
190
+ message.seconds = object.seconds ?? 0;
191
+ message.nanos = object.nanos ?? 0;
192
+ return message;
193
+ },
194
+ };
195
+
196
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
197
+
198
+ export type DeepPartial<T> = T extends Builtin ? T
199
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
200
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
201
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
202
+ : Partial<T>;
203
+
204
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
205
+ export type Exact<P, I extends P> = P extends Builtin ? P
206
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
207
+
208
+ function longToNumber(int64: { toString(): string }): number {
209
+ const num = globalThis.Number(int64.toString());
210
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
211
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
212
+ }
213
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
214
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
215
+ }
216
+ return num;
217
+ }
218
+
219
+ function isSet(value: any): boolean {
220
+ return value !== null && value !== undefined;
221
+ }
222
+
223
+ export interface MessageFns<T> {
224
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
225
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
226
+ fromJSON(object: any): T;
227
+ toJSON(message: T): unknown;
228
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
229
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
230
+ }