// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: protobuf-net/bcl.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "bcl"; /** TimeSpan scale */ export enum TimeSpanScale { DAYS = 0, HOURS = 1, MINUTES = 2, SECONDS = 3, MILLISECONDS = 4, TICKS = 5, MINMAX = 15, UNRECOGNIZED = -1, } export function timeSpanScaleFromJSON(object: any): TimeSpanScale { switch (object) { case 0: case "DAYS": return TimeSpanScale.DAYS; case 1: case "HOURS": return TimeSpanScale.HOURS; case 2: case "MINUTES": return TimeSpanScale.MINUTES; case 3: case "SECONDS": return TimeSpanScale.SECONDS; case 4: case "MILLISECONDS": return TimeSpanScale.MILLISECONDS; case 5: case "TICKS": return TimeSpanScale.TICKS; case 15: case "MINMAX": return TimeSpanScale.MINMAX; case -1: case "UNRECOGNIZED": default: return TimeSpanScale.UNRECOGNIZED; } } export function timeSpanScaleToJSON(object: TimeSpanScale): string { switch (object) { case TimeSpanScale.DAYS: return "DAYS"; case TimeSpanScale.HOURS: return "HOURS"; case TimeSpanScale.MINUTES: return "MINUTES"; case TimeSpanScale.SECONDS: return "SECONDS"; case TimeSpanScale.MILLISECONDS: return "MILLISECONDS"; case TimeSpanScale.TICKS: return "TICKS"; case TimeSpanScale.MINMAX: return "MINMAX"; case TimeSpanScale.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } /** Represents a .NET Guid */ export interface Guid { /** the first 8 bytes of the guid */ lo: bigint; /** the second 8 bytes of the guid */ hi: bigint; } /** Represents a .NET DateTime */ export interface DateTime { /** the ticks count */ value: bigint; /** (default = Unspecified) */ scale: TimeSpanScale; } /** Represents a .NET TimeSpan */ export interface TimeSpan { /** the size of the timespan */ value: bigint; /** (default = Days) */ scale: TimeSpanScale; } /** Represents a .NET DateTimeOffset */ export interface DateTimeOffset { /** the ticks count */ value: bigint; /** the offset in minutes */ offset: number; /** (default = Days) */ scale: TimeSpanScale; } /** Represents a .NET decimal */ export interface Decimal { /** the low 64 bits of the decimal */ lo: bigint; /** the high 32 bits of the decimal */ hi: number; /** the sign and scale (bits 0-15 = scale, bit 31 = sign) */ signScale: number; } function createBaseGuid(): Guid { return { lo: 0n, hi: 0n }; } export const Guid: MessageFns = { encode(message: Guid, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.lo !== 0n) { if (BigInt.asUintN(64, message.lo) !== message.lo) { throw new globalThis.Error("value provided for field message.lo of type fixed64 too large"); } writer.uint32(9).fixed64(message.lo); } if (message.hi !== 0n) { if (BigInt.asUintN(64, message.hi) !== message.hi) { throw new globalThis.Error("value provided for field message.hi of type fixed64 too large"); } writer.uint32(17).fixed64(message.hi); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Guid { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGuid(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 9) { break; } message.lo = reader.fixed64() as bigint; continue; } case 2: { if (tag !== 17) { break; } message.hi = reader.fixed64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Guid { return { lo: isSet(object.lo) ? BigInt(object.lo) : 0n, hi: isSet(object.hi) ? BigInt(object.hi) : 0n }; }, toJSON(message: Guid): unknown { const obj: any = {}; if (message.lo !== 0n) { obj.lo = message.lo.toString(); } if (message.hi !== 0n) { obj.hi = message.hi.toString(); } return obj; }, create(base?: DeepPartial): Guid { return Guid.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Guid { const message = createBaseGuid(); message.lo = (object.lo !== undefined && object.lo !== null) ? BigInt(object.lo) : 0n; message.hi = (object.hi !== undefined && object.hi !== null) ? BigInt(object.hi) : 0n; return message; }, }; function createBaseDateTime(): DateTime { return { value: 0n, scale: 0 }; } export const DateTime: MessageFns = { encode(message: DateTime, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.value !== 0n) { if (BigInt.asIntN(64, message.value) !== message.value) { throw new globalThis.Error("value provided for field message.value of type sint64 too large"); } writer.uint32(8).sint64(message.value); } if (message.scale !== 0) { writer.uint32(16).int32(message.scale); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DateTime { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDateTime(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.value = reader.sint64() as bigint; continue; } case 2: { if (tag !== 16) { break; } message.scale = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): DateTime { return { value: isSet(object.value) ? BigInt(object.value) : 0n, scale: isSet(object.scale) ? timeSpanScaleFromJSON(object.scale) : 0, }; }, toJSON(message: DateTime): unknown { const obj: any = {}; if (message.value !== 0n) { obj.value = message.value.toString(); } if (message.scale !== 0) { obj.scale = timeSpanScaleToJSON(message.scale); } return obj; }, create(base?: DeepPartial): DateTime { return DateTime.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): DateTime { const message = createBaseDateTime(); message.value = (object.value !== undefined && object.value !== null) ? BigInt(object.value) : 0n; message.scale = object.scale ?? 0; return message; }, }; function createBaseTimeSpan(): TimeSpan { return { value: 0n, scale: 0 }; } export const TimeSpan: MessageFns = { encode(message: TimeSpan, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.value !== 0n) { if (BigInt.asIntN(64, message.value) !== message.value) { throw new globalThis.Error("value provided for field message.value of type sint64 too large"); } writer.uint32(8).sint64(message.value); } if (message.scale !== 0) { writer.uint32(16).int32(message.scale); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TimeSpan { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTimeSpan(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.value = reader.sint64() as bigint; continue; } case 2: { if (tag !== 16) { break; } message.scale = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): TimeSpan { return { value: isSet(object.value) ? BigInt(object.value) : 0n, scale: isSet(object.scale) ? timeSpanScaleFromJSON(object.scale) : 0, }; }, toJSON(message: TimeSpan): unknown { const obj: any = {}; if (message.value !== 0n) { obj.value = message.value.toString(); } if (message.scale !== 0) { obj.scale = timeSpanScaleToJSON(message.scale); } return obj; }, create(base?: DeepPartial): TimeSpan { return TimeSpan.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): TimeSpan { const message = createBaseTimeSpan(); message.value = (object.value !== undefined && object.value !== null) ? BigInt(object.value) : 0n; message.scale = object.scale ?? 0; return message; }, }; function createBaseDateTimeOffset(): DateTimeOffset { return { value: 0n, offset: 0, scale: 0 }; } export const DateTimeOffset: MessageFns = { encode(message: DateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.value !== 0n) { if (BigInt.asIntN(64, message.value) !== message.value) { throw new globalThis.Error("value provided for field message.value of type sint64 too large"); } writer.uint32(8).sint64(message.value); } if (message.offset !== 0) { writer.uint32(16).sint32(message.offset); } if (message.scale !== 0) { writer.uint32(24).int32(message.scale); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DateTimeOffset { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDateTimeOffset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.value = reader.sint64() as bigint; continue; } case 2: { if (tag !== 16) { break; } message.offset = reader.sint32(); continue; } case 3: { if (tag !== 24) { break; } message.scale = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): DateTimeOffset { return { value: isSet(object.value) ? BigInt(object.value) : 0n, offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0, scale: isSet(object.scale) ? timeSpanScaleFromJSON(object.scale) : 0, }; }, toJSON(message: DateTimeOffset): unknown { const obj: any = {}; if (message.value !== 0n) { obj.value = message.value.toString(); } if (message.offset !== 0) { obj.offset = Math.round(message.offset); } if (message.scale !== 0) { obj.scale = timeSpanScaleToJSON(message.scale); } return obj; }, create(base?: DeepPartial): DateTimeOffset { return DateTimeOffset.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): DateTimeOffset { const message = createBaseDateTimeOffset(); message.value = (object.value !== undefined && object.value !== null) ? BigInt(object.value) : 0n; message.offset = object.offset ?? 0; message.scale = object.scale ?? 0; return message; }, }; function createBaseDecimal(): Decimal { return { lo: 0n, hi: 0, signScale: 0 }; } export const Decimal: MessageFns = { encode(message: Decimal, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.lo !== 0n) { if (BigInt.asUintN(64, message.lo) !== message.lo) { throw new globalThis.Error("value provided for field message.lo of type uint64 too large"); } writer.uint32(8).uint64(message.lo); } if (message.hi !== 0) { writer.uint32(16).uint32(message.hi); } if (message.signScale !== 0) { writer.uint32(24).uint32(message.signScale); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Decimal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecimal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.lo = reader.uint64() as bigint; continue; } case 2: { if (tag !== 16) { break; } message.hi = reader.uint32(); continue; } case 3: { if (tag !== 24) { break; } message.signScale = reader.uint32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Decimal { return { lo: isSet(object.lo) ? BigInt(object.lo) : 0n, hi: isSet(object.hi) ? globalThis.Number(object.hi) : 0, signScale: isSet(object.signScale) ? globalThis.Number(object.signScale) : 0, }; }, toJSON(message: Decimal): unknown { const obj: any = {}; if (message.lo !== 0n) { obj.lo = message.lo.toString(); } if (message.hi !== 0) { obj.hi = Math.round(message.hi); } if (message.signScale !== 0) { obj.signScale = Math.round(message.signScale); } return obj; }, create(base?: DeepPartial): Decimal { return Decimal.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Decimal { const message = createBaseDecimal(); message.lo = (object.lo !== undefined && object.lo !== null) ? BigInt(object.lo) : 0n; message.hi = object.hi ?? 0; message.signScale = object.signScale ?? 0; return message; }, }; type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; export type DeepPartial = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; 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(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; }