@blueyerobotics/protocol-definitions 3.2.0-09fee2ba

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,132 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ /**
3
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
4
+ * URL that describes the type of the serialized message.
5
+ *
6
+ * Protobuf library provides support to pack/unpack Any values in the form
7
+ * of utility functions or additional generated methods of the Any type.
8
+ *
9
+ * Example 1: Pack and unpack a message in C++.
10
+ *
11
+ * Foo foo = ...;
12
+ * Any any;
13
+ * any.PackFrom(foo);
14
+ * ...
15
+ * if (any.UnpackTo(&foo)) {
16
+ * ...
17
+ * }
18
+ *
19
+ * Example 2: Pack and unpack a message in Java.
20
+ *
21
+ * Foo foo = ...;
22
+ * Any any = Any.pack(foo);
23
+ * ...
24
+ * if (any.is(Foo.class)) {
25
+ * foo = any.unpack(Foo.class);
26
+ * }
27
+ *
28
+ * Example 3: Pack and unpack a message in Python.
29
+ *
30
+ * foo = Foo(...)
31
+ * any = Any()
32
+ * any.Pack(foo)
33
+ * ...
34
+ * if any.Is(Foo.DESCRIPTOR):
35
+ * any.Unpack(foo)
36
+ * ...
37
+ *
38
+ * Example 4: Pack and unpack a message in Go
39
+ *
40
+ * foo := &pb.Foo{...}
41
+ * any, err := anypb.New(foo)
42
+ * if err != nil {
43
+ * ...
44
+ * }
45
+ * ...
46
+ * foo := &pb.Foo{}
47
+ * if err := any.UnmarshalTo(foo); err != nil {
48
+ * ...
49
+ * }
50
+ *
51
+ * The pack methods provided by protobuf library will by default use
52
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
53
+ * methods only use the fully qualified type name after the last '/'
54
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
55
+ * name "y.z".
56
+ *
57
+ * JSON
58
+ *
59
+ * The JSON representation of an `Any` value uses the regular
60
+ * representation of the deserialized, embedded message, with an
61
+ * additional field `@type` which contains the type URL. Example:
62
+ *
63
+ * package google.profile;
64
+ * message Person {
65
+ * string first_name = 1;
66
+ * string last_name = 2;
67
+ * }
68
+ *
69
+ * {
70
+ * "@type": "type.googleapis.com/google.profile.Person",
71
+ * "firstName": <string>,
72
+ * "lastName": <string>
73
+ * }
74
+ *
75
+ * If the embedded message type is well-known and has a custom JSON
76
+ * representation, that representation will be embedded adding a field
77
+ * `value` which holds the custom JSON in addition to the `@type`
78
+ * field. Example (for message [google.protobuf.Duration][]):
79
+ *
80
+ * {
81
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
82
+ * "value": "1.212s"
83
+ * }
84
+ */
85
+ export interface Any {
86
+ /**
87
+ * A URL/resource name that uniquely identifies the type of the serialized
88
+ * protocol buffer message. This string must contain at least
89
+ * one "/" character. The last segment of the URL's path must represent
90
+ * the fully qualified name of the type (as in
91
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
92
+ * (e.g., leading "." is not accepted).
93
+ *
94
+ * In practice, teams usually precompile into the binary all types that they
95
+ * expect it to use in the context of Any. However, for URLs which use the
96
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
97
+ * server that maps type URLs to message definitions as follows:
98
+ *
99
+ * * If no scheme is provided, `https` is assumed.
100
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
101
+ * value in binary format, or produce an error.
102
+ * * Applications are allowed to cache lookup results based on the
103
+ * URL, or have them precompiled into a binary to avoid any
104
+ * lookup. Therefore, binary compatibility needs to be preserved
105
+ * on changes to types. (Use versioned type names to manage
106
+ * breaking changes.)
107
+ *
108
+ * Note: this functionality is not currently available in the official
109
+ * protobuf release, and it is not used for type URLs beginning with
110
+ * type.googleapis.com.
111
+ *
112
+ * Schemes other than `http`, `https` (or the empty scheme) might be
113
+ * used with implementation specific semantics.
114
+ */
115
+ typeUrl: string;
116
+ /** Must be a valid serialized protocol buffer of the above specified type. */
117
+ value: Uint8Array;
118
+ }
119
+ export declare const Any: MessageFns<Any>;
120
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
121
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
122
+ [K in keyof T]?: DeepPartial<T[K]>;
123
+ } : Partial<T>;
124
+ interface MessageFns<T> {
125
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
126
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
127
+ fromJSON(object: any): T;
128
+ toJSON(message: T): unknown;
129
+ create(base?: DeepPartial<T>): T;
130
+ fromPartial(object: DeepPartial<T>): T;
131
+ }
132
+ export {};
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v3.21.12
6
+ // source: google/protobuf/any.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Any = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ function createBaseAny() {
12
+ return { typeUrl: "", value: new Uint8Array(0) };
13
+ }
14
+ exports.Any = {
15
+ encode(message, writer = new wire_1.BinaryWriter()) {
16
+ if (message.typeUrl !== "") {
17
+ writer.uint32(10).string(message.typeUrl);
18
+ }
19
+ if (message.value.length !== 0) {
20
+ writer.uint32(18).bytes(message.value);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
26
+ const end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseAny();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1: {
32
+ if (tag !== 10) {
33
+ break;
34
+ }
35
+ message.typeUrl = reader.string();
36
+ continue;
37
+ }
38
+ case 2: {
39
+ if (tag !== 18) {
40
+ break;
41
+ }
42
+ message.value = reader.bytes();
43
+ continue;
44
+ }
45
+ }
46
+ if ((tag & 7) === 4 || tag === 0) {
47
+ break;
48
+ }
49
+ reader.skip(tag & 7);
50
+ }
51
+ return message;
52
+ },
53
+ fromJSON(object) {
54
+ return {
55
+ typeUrl: isSet(object.typeUrl) ? gt.String(object.typeUrl) : "",
56
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
57
+ };
58
+ },
59
+ toJSON(message) {
60
+ const obj = {};
61
+ if (message.typeUrl !== "") {
62
+ obj.typeUrl = message.typeUrl;
63
+ }
64
+ if (message.value.length !== 0) {
65
+ obj.value = base64FromBytes(message.value);
66
+ }
67
+ return obj;
68
+ },
69
+ create(base) {
70
+ return exports.Any.fromPartial(base ?? {});
71
+ },
72
+ fromPartial(object) {
73
+ const message = createBaseAny();
74
+ message.typeUrl = object.typeUrl ?? "";
75
+ message.value = object.value ?? new Uint8Array(0);
76
+ return message;
77
+ },
78
+ };
79
+ const gt = (() => {
80
+ if (typeof globalThis !== "undefined") {
81
+ return globalThis;
82
+ }
83
+ if (typeof self !== "undefined") {
84
+ return self;
85
+ }
86
+ if (typeof window !== "undefined") {
87
+ return window;
88
+ }
89
+ if (typeof global !== "undefined") {
90
+ return global;
91
+ }
92
+ throw "Unable to locate global object";
93
+ })();
94
+ function bytesFromBase64(b64) {
95
+ if (gt.Buffer) {
96
+ return Uint8Array.from(gt.Buffer.from(b64, "base64"));
97
+ }
98
+ else {
99
+ const bin = gt.atob(b64);
100
+ const arr = new Uint8Array(bin.length);
101
+ for (let i = 0; i < bin.length; ++i) {
102
+ arr[i] = bin.charCodeAt(i);
103
+ }
104
+ return arr;
105
+ }
106
+ }
107
+ function base64FromBytes(arr) {
108
+ if (gt.Buffer) {
109
+ return gt.Buffer.from(arr).toString("base64");
110
+ }
111
+ else {
112
+ const bin = [];
113
+ arr.forEach((byte) => {
114
+ bin.push(gt.String.fromCharCode(byte));
115
+ });
116
+ return gt.btoa(bin.join(""));
117
+ }
118
+ }
119
+ function isSet(value) {
120
+ return value !== null && value !== undefined;
121
+ }
@@ -0,0 +1,92 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ /**
3
+ * A Duration represents a signed, fixed-length span of time represented
4
+ * as a count of seconds and fractions of seconds at nanosecond
5
+ * resolution. It is independent of any calendar and concepts like "day"
6
+ * or "month". It is related to Timestamp in that the difference between
7
+ * two Timestamp values is a Duration and it can be added or subtracted
8
+ * from a Timestamp. Range is approximately +-10,000 years.
9
+ *
10
+ * # Examples
11
+ *
12
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
13
+ *
14
+ * Timestamp start = ...;
15
+ * Timestamp end = ...;
16
+ * Duration duration = ...;
17
+ *
18
+ * duration.seconds = end.seconds - start.seconds;
19
+ * duration.nanos = end.nanos - start.nanos;
20
+ *
21
+ * if (duration.seconds < 0 && duration.nanos > 0) {
22
+ * duration.seconds += 1;
23
+ * duration.nanos -= 1000000000;
24
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
25
+ * duration.seconds -= 1;
26
+ * duration.nanos += 1000000000;
27
+ * }
28
+ *
29
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
30
+ *
31
+ * Timestamp start = ...;
32
+ * Duration duration = ...;
33
+ * Timestamp end = ...;
34
+ *
35
+ * end.seconds = start.seconds + duration.seconds;
36
+ * end.nanos = start.nanos + duration.nanos;
37
+ *
38
+ * if (end.nanos < 0) {
39
+ * end.seconds -= 1;
40
+ * end.nanos += 1000000000;
41
+ * } else if (end.nanos >= 1000000000) {
42
+ * end.seconds += 1;
43
+ * end.nanos -= 1000000000;
44
+ * }
45
+ *
46
+ * Example 3: Compute Duration from datetime.timedelta in Python.
47
+ *
48
+ * td = datetime.timedelta(days=3, minutes=10)
49
+ * duration = Duration()
50
+ * duration.FromTimedelta(td)
51
+ *
52
+ * # JSON Mapping
53
+ *
54
+ * In JSON format, the Duration type is encoded as a string rather than an
55
+ * object, where the string ends in the suffix "s" (indicating seconds) and
56
+ * is preceded by the number of seconds, with nanoseconds expressed as
57
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
58
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
59
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
60
+ * microsecond should be expressed in JSON format as "3.000001s".
61
+ */
62
+ export interface Duration {
63
+ /**
64
+ * Signed seconds of the span of time. Must be from -315,576,000,000
65
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
66
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
67
+ */
68
+ seconds: number;
69
+ /**
70
+ * Signed fractions of a second at nanosecond resolution of the span
71
+ * of time. Durations less than one second are represented with a 0
72
+ * `seconds` field and a positive or negative `nanos` field. For durations
73
+ * of one second or more, a non-zero value for the `nanos` field must be
74
+ * of the same sign as the `seconds` field. Must be from -999,999,999
75
+ * to +999,999,999 inclusive.
76
+ */
77
+ nanos: number;
78
+ }
79
+ export declare const Duration: MessageFns<Duration>;
80
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
81
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
82
+ [K in keyof T]?: DeepPartial<T[K]>;
83
+ } : Partial<T>;
84
+ interface MessageFns<T> {
85
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
86
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
87
+ fromJSON(object: any): T;
88
+ toJSON(message: T): unknown;
89
+ create(base?: DeepPartial<T>): T;
90
+ fromPartial(object: DeepPartial<T>): T;
91
+ }
92
+ export {};
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v3.21.12
6
+ // source: google/protobuf/duration.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Duration = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ function createBaseDuration() {
12
+ return { seconds: 0, nanos: 0 };
13
+ }
14
+ exports.Duration = {
15
+ encode(message, writer = new wire_1.BinaryWriter()) {
16
+ if (message.seconds !== 0) {
17
+ writer.uint32(8).int64(message.seconds);
18
+ }
19
+ if (message.nanos !== 0) {
20
+ writer.uint32(16).int32(message.nanos);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
26
+ const end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseDuration();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1: {
32
+ if (tag !== 8) {
33
+ break;
34
+ }
35
+ message.seconds = longToNumber(reader.int64());
36
+ continue;
37
+ }
38
+ case 2: {
39
+ if (tag !== 16) {
40
+ break;
41
+ }
42
+ message.nanos = reader.int32();
43
+ continue;
44
+ }
45
+ }
46
+ if ((tag & 7) === 4 || tag === 0) {
47
+ break;
48
+ }
49
+ reader.skip(tag & 7);
50
+ }
51
+ return message;
52
+ },
53
+ fromJSON(object) {
54
+ return {
55
+ seconds: isSet(object.seconds) ? gt.Number(object.seconds) : 0,
56
+ nanos: isSet(object.nanos) ? gt.Number(object.nanos) : 0,
57
+ };
58
+ },
59
+ toJSON(message) {
60
+ const obj = {};
61
+ if (message.seconds !== 0) {
62
+ obj.seconds = Math.round(message.seconds);
63
+ }
64
+ if (message.nanos !== 0) {
65
+ obj.nanos = Math.round(message.nanos);
66
+ }
67
+ return obj;
68
+ },
69
+ create(base) {
70
+ return exports.Duration.fromPartial(base ?? {});
71
+ },
72
+ fromPartial(object) {
73
+ const message = createBaseDuration();
74
+ message.seconds = object.seconds ?? 0;
75
+ message.nanos = object.nanos ?? 0;
76
+ return message;
77
+ },
78
+ };
79
+ const gt = (() => {
80
+ if (typeof globalThis !== "undefined") {
81
+ return globalThis;
82
+ }
83
+ if (typeof self !== "undefined") {
84
+ return self;
85
+ }
86
+ if (typeof window !== "undefined") {
87
+ return window;
88
+ }
89
+ if (typeof global !== "undefined") {
90
+ return global;
91
+ }
92
+ throw "Unable to locate global object";
93
+ })();
94
+ function longToNumber(int64) {
95
+ const num = gt.Number(int64.toString());
96
+ if (num > gt.Number.MAX_SAFE_INTEGER) {
97
+ throw new gt.Error("Value is larger than Number.MAX_SAFE_INTEGER");
98
+ }
99
+ if (num < gt.Number.MIN_SAFE_INTEGER) {
100
+ throw new gt.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
101
+ }
102
+ return num;
103
+ }
104
+ function isSet(value) {
105
+ return value !== null && value !== undefined;
106
+ }
@@ -0,0 +1,121 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ /**
3
+ * A Timestamp represents a point in time independent of any time zone or local
4
+ * calendar, encoded as a count of seconds and fractions of seconds at
5
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
6
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
7
+ * Gregorian calendar backwards to year one.
8
+ *
9
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
10
+ * second table is needed for interpretation, using a [24-hour linear
11
+ * smear](https://developers.google.com/time/smear).
12
+ *
13
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
14
+ * restricting to that range, we ensure that we can convert to and from [RFC
15
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
16
+ *
17
+ * # Examples
18
+ *
19
+ * Example 1: Compute Timestamp from POSIX `time()`.
20
+ *
21
+ * Timestamp timestamp;
22
+ * timestamp.set_seconds(time(NULL));
23
+ * timestamp.set_nanos(0);
24
+ *
25
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
26
+ *
27
+ * struct timeval tv;
28
+ * gettimeofday(&tv, NULL);
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(tv.tv_sec);
32
+ * timestamp.set_nanos(tv.tv_usec * 1000);
33
+ *
34
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
35
+ *
36
+ * FILETIME ft;
37
+ * GetSystemTimeAsFileTime(&ft);
38
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
39
+ *
40
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
41
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
42
+ * Timestamp timestamp;
43
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
44
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
45
+ *
46
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
47
+ *
48
+ * long millis = System.currentTimeMillis();
49
+ *
50
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
51
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
52
+ *
53
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
54
+ *
55
+ * Instant now = Instant.now();
56
+ *
57
+ * Timestamp timestamp =
58
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
59
+ * .setNanos(now.getNano()).build();
60
+ *
61
+ * Example 6: Compute Timestamp from current time in Python.
62
+ *
63
+ * timestamp = Timestamp()
64
+ * timestamp.GetCurrentTime()
65
+ *
66
+ * # JSON Mapping
67
+ *
68
+ * In JSON format, the Timestamp type is encoded as a string in the
69
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
70
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
71
+ * where {year} is always expressed using four digits while {month}, {day},
72
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
73
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
74
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
75
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
76
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
77
+ * able to accept both UTC and other timezones (as indicated by an offset).
78
+ *
79
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
80
+ * 01:30 UTC on January 15, 2017.
81
+ *
82
+ * In JavaScript, one can convert a Date object to this format using the
83
+ * standard
84
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
85
+ * method. In Python, a standard `datetime.datetime` object can be converted
86
+ * to this format using
87
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
88
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
89
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
90
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
91
+ * ) to obtain a formatter capable of generating timestamps in this format.
92
+ */
93
+ export interface Timestamp {
94
+ /**
95
+ * Represents seconds of UTC time since Unix epoch
96
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
97
+ * 9999-12-31T23:59:59Z inclusive.
98
+ */
99
+ seconds: number;
100
+ /**
101
+ * Non-negative fractions of a second at nanosecond resolution. Negative
102
+ * second values with fractions must still have non-negative nanos values
103
+ * that count forward in time. Must be from 0 to 999,999,999
104
+ * inclusive.
105
+ */
106
+ nanos: number;
107
+ }
108
+ export declare const Timestamp: MessageFns<Timestamp>;
109
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
110
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
111
+ [K in keyof T]?: DeepPartial<T[K]>;
112
+ } : Partial<T>;
113
+ interface MessageFns<T> {
114
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
115
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
116
+ fromJSON(object: any): T;
117
+ toJSON(message: T): unknown;
118
+ create(base?: DeepPartial<T>): T;
119
+ fromPartial(object: DeepPartial<T>): T;
120
+ }
121
+ export {};
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v3.21.12
6
+ // source: google/protobuf/timestamp.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Timestamp = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ function createBaseTimestamp() {
12
+ return { seconds: 0, nanos: 0 };
13
+ }
14
+ exports.Timestamp = {
15
+ encode(message, writer = new wire_1.BinaryWriter()) {
16
+ if (message.seconds !== 0) {
17
+ writer.uint32(8).int64(message.seconds);
18
+ }
19
+ if (message.nanos !== 0) {
20
+ writer.uint32(16).int32(message.nanos);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
26
+ const end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseTimestamp();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1: {
32
+ if (tag !== 8) {
33
+ break;
34
+ }
35
+ message.seconds = longToNumber(reader.int64());
36
+ continue;
37
+ }
38
+ case 2: {
39
+ if (tag !== 16) {
40
+ break;
41
+ }
42
+ message.nanos = reader.int32();
43
+ continue;
44
+ }
45
+ }
46
+ if ((tag & 7) === 4 || tag === 0) {
47
+ break;
48
+ }
49
+ reader.skip(tag & 7);
50
+ }
51
+ return message;
52
+ },
53
+ fromJSON(object) {
54
+ return {
55
+ seconds: isSet(object.seconds) ? gt.Number(object.seconds) : 0,
56
+ nanos: isSet(object.nanos) ? gt.Number(object.nanos) : 0,
57
+ };
58
+ },
59
+ toJSON(message) {
60
+ const obj = {};
61
+ if (message.seconds !== 0) {
62
+ obj.seconds = Math.round(message.seconds);
63
+ }
64
+ if (message.nanos !== 0) {
65
+ obj.nanos = Math.round(message.nanos);
66
+ }
67
+ return obj;
68
+ },
69
+ create(base) {
70
+ return exports.Timestamp.fromPartial(base ?? {});
71
+ },
72
+ fromPartial(object) {
73
+ const message = createBaseTimestamp();
74
+ message.seconds = object.seconds ?? 0;
75
+ message.nanos = object.nanos ?? 0;
76
+ return message;
77
+ },
78
+ };
79
+ const gt = (() => {
80
+ if (typeof globalThis !== "undefined") {
81
+ return globalThis;
82
+ }
83
+ if (typeof self !== "undefined") {
84
+ return self;
85
+ }
86
+ if (typeof window !== "undefined") {
87
+ return window;
88
+ }
89
+ if (typeof global !== "undefined") {
90
+ return global;
91
+ }
92
+ throw "Unable to locate global object";
93
+ })();
94
+ function longToNumber(int64) {
95
+ const num = gt.Number(int64.toString());
96
+ if (num > gt.Number.MAX_SAFE_INTEGER) {
97
+ throw new gt.Error("Value is larger than Number.MAX_SAFE_INTEGER");
98
+ }
99
+ if (num < gt.Number.MIN_SAFE_INTEGER) {
100
+ throw new gt.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
101
+ }
102
+ return num;
103
+ }
104
+ function isSet(value) {
105
+ return value !== null && value !== undefined;
106
+ }
@@ -0,0 +1 @@
1
+ export * as protocol from "./index.blueye.protocol";