// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.10.1 // protoc v6.33.2 // source: platform_shared/example.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = ""; export enum IMUType { IMU_NONE = 0, IMU_ACCEL = 1, IMU_GYRO = 2, UNRECOGNIZED = -1, } export function iMUTypeFromJSON(object: any): IMUType { switch (object) { case 0: case "IMU_NONE": return IMUType.IMU_NONE; case 1: case "IMU_ACCEL": return IMUType.IMU_ACCEL; case 2: case "IMU_GYRO": return IMUType.IMU_GYRO; case -1: case "UNRECOGNIZED": default: return IMUType.UNRECOGNIZED; } } export function iMUTypeToJSON(object: IMUType): string { switch (object) { case IMUType.IMU_NONE: return "IMU_NONE"; case IMUType.IMU_ACCEL: return "IMU_ACCEL"; case IMUType.IMU_GYRO: return "IMU_GYRO"; case IMUType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface IMUReport { type: IMUType; xVal: number; } function createBaseIMUReport(): IMUReport { return { type: 0, xVal: 0 }; } export const IMUReport: MessageFns = { encode(message: IMUReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.xVal !== 0) { writer.uint32(17).double(message.xVal); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IMUReport { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIMUReport(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.type = reader.int32() as any; continue; } case 2: { if (tag !== 17) { break; } message.xVal = reader.double(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): IMUReport { return { type: isSet(object.type) ? iMUTypeFromJSON(object.type) : 0, xVal: isSet(object.xVal) ? globalThis.Number(object.xVal) : 0, }; }, toJSON(message: IMUReport): unknown { const obj: any = {}; if (message.type !== 0) { obj.type = iMUTypeToJSON(message.type); } if (message.xVal !== 0) { obj.xVal = message.xVal; } return obj; }, create, I>>(base?: I): IMUReport { return IMUReport.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): IMUReport { const message = createBaseIMUReport(); message.type = object.type ?? 0; message.xVal = object.xVal ?? 0; return message; }, }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function isSet(value: any): boolean { return value !== null && value !== undefined; } export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create, I>>(base?: I): T; fromPartial, I>>(object: I): T; }