2025-01-28 12:59:59 -06:00
|
|
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
|
|
|
// versions:
|
|
|
|
|
// protoc-gen-ts_proto v2.2.2
|
|
|
|
|
// protoc v5.28.2
|
|
|
|
|
// source: packages/core/src/protos/tank.proto
|
|
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
2025-01-30 11:31:55 -06:00
|
|
|
import { I18n } from "./i18n";
|
2025-01-28 12:59:59 -06:00
|
|
|
|
|
|
|
|
export const protobufPackage = "blitzkit";
|
|
|
|
|
|
|
|
|
|
export interface Tank {
|
2025-01-30 11:31:55 -06:00
|
|
|
id: string;
|
2025-03-05 00:10:00 -06:00
|
|
|
slug: string;
|
2025-01-30 11:31:55 -06:00
|
|
|
name: I18n;
|
2025-01-28 12:59:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createBaseTank(): Tank {
|
2025-03-05 00:10:00 -06:00
|
|
|
return { id: "", slug: "", name: createBaseI18n() };
|
2025-01-28 12:59:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const Tank: MessageFns<Tank> = {
|
|
|
|
|
encode(message: Tank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
2025-01-30 11:31:55 -06:00
|
|
|
if (message.id !== "") {
|
|
|
|
|
writer.uint32(10).string(message.id);
|
|
|
|
|
}
|
2025-03-05 00:10:00 -06:00
|
|
|
if (message.slug !== "") {
|
|
|
|
|
writer.uint32(18).string(message.slug);
|
2025-03-05 00:07:25 -06:00
|
|
|
}
|
2025-01-30 11:31:55 -06:00
|
|
|
if (message.name !== undefined) {
|
2025-03-05 00:07:25 -06:00
|
|
|
I18n.encode(message.name, writer.uint32(26).fork()).join();
|
2025-01-30 11:31:55 -06:00
|
|
|
}
|
2025-01-28 12:59:59 -06:00
|
|
|
return writer;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): Tank {
|
|
|
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
|
|
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
|
|
|
const message = createBaseTank();
|
|
|
|
|
while (reader.pos < end) {
|
|
|
|
|
const tag = reader.uint32();
|
|
|
|
|
switch (tag >>> 3) {
|
|
|
|
|
case 1: {
|
|
|
|
|
if (tag !== 10) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-30 11:31:55 -06:00
|
|
|
message.id = reader.string();
|
2025-01-28 12:59:59 -06:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
case 2: {
|
|
|
|
|
if (tag !== 18) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-05 00:10:00 -06:00
|
|
|
message.slug = reader.string();
|
2025-03-05 00:07:25 -06:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
case 3: {
|
|
|
|
|
if (tag !== 26) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-30 11:31:55 -06:00
|
|
|
message.name = I18n.decode(reader, reader.uint32());
|
2025-01-28 12:59:59 -06:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
reader.skip(tag & 7);
|
|
|
|
|
}
|
|
|
|
|
return message;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fromJSON(object: any): Tank {
|
|
|
|
|
return {
|
2025-01-30 11:31:55 -06:00
|
|
|
id: globalThis.String(assertSet("Tank.id", object.id)),
|
2025-03-05 00:10:00 -06:00
|
|
|
slug: globalThis.String(assertSet("Tank.slug", object.slug)),
|
2025-01-30 11:31:55 -06:00
|
|
|
name: I18n.fromJSON(assertSet("Tank.name", object.name)),
|
2025-01-28 12:59:59 -06:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toJSON(message: Tank): unknown {
|
|
|
|
|
const obj: any = {};
|
2025-01-30 11:31:55 -06:00
|
|
|
if (message.id !== "") {
|
|
|
|
|
obj.id = message.id;
|
|
|
|
|
}
|
2025-03-05 00:10:00 -06:00
|
|
|
if (message.slug !== "") {
|
|
|
|
|
obj.slug = message.slug;
|
2025-03-05 00:07:25 -06:00
|
|
|
}
|
2025-01-30 11:31:55 -06:00
|
|
|
if (message.name !== undefined) {
|
|
|
|
|
obj.name = I18n.toJSON(message.name);
|
|
|
|
|
}
|
2025-01-28 12:59:59 -06:00
|
|
|
return obj;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
create<I extends Exact<DeepPartial<Tank>, I>>(base?: I): Tank {
|
|
|
|
|
return Tank.fromPartial(base ?? ({} as any));
|
|
|
|
|
},
|
|
|
|
|
fromPartial<I extends Exact<DeepPartial<Tank>, I>>(object: I): Tank {
|
|
|
|
|
const message = createBaseTank();
|
2025-01-30 11:31:55 -06:00
|
|
|
message.id = object.id ?? "";
|
2025-03-05 00:10:00 -06:00
|
|
|
message.slug = object.slug ?? "";
|
2025-01-30 11:31:55 -06:00
|
|
|
message.name = (object.name !== undefined && object.name !== null)
|
|
|
|
|
? I18n.fromPartial(object.name)
|
|
|
|
|
: createBaseI18n();
|
2025-01-28 12:59:59 -06:00
|
|
|
return message;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
|
|
|
|
|
|
|
|
export 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 { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
|
|
|
|
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
|
|
|
: Partial<T>;
|
|
|
|
|
|
|
|
|
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
|
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
|
|
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
|
|
|
|
|
|
|
|
function isSet(value: any): boolean {
|
|
|
|
|
return value !== null && value !== undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function assertSet<T>(field: string, value: T | undefined): T {
|
|
|
|
|
if (!isSet(value)) {
|
|
|
|
|
throw new TypeError(`Required field ${field} is not set`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return value as T;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MessageFns<T> {
|
|
|
|
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
|
|
|
fromJSON(object: any): T;
|
|
|
|
|
toJSON(message: T): unknown;
|
|
|
|
|
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
|
|
|
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
|
|
|
}
|