diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d9fa2c..83cfe864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v0.0.51 -- Map keys are now typed as strings: `Record`. Previously other types were accepted, which would cause type checking to fail when the key was `boolean`, `bigint`, or `number`. This is also more correct because JavaScript always encodes object keys as strings. See [#151](https://github.com/tatethurston/TwirpScript/issues/151) for more background. +- When using protobuf `map` fields, map keys are now typed as strings: `Record`. Previously other types were accepted, which would cause type checking to fail when the key was `boolean`, `bigint`, or `number`. This is also more correct because JavaScript always encodes object keys as strings. Generated type definitions for `map` types are no longer exported. See [#151](https://github.com/tatethurston/TwirpScript/issues/151) for more background. - Empty messages now generate the full serialization interface implemented by other messages. This resolves an issue where messages with fields whose value was an empty message would fail code generation. - Enum serializers now have two private serialization helpers. This resolves an issue where Enums imported into other protobuf files failed code generation. See [#150](https://github.com/tatethurston/TwirpScript/issues/150) for more background. diff --git a/src/autogenerate/index.ts b/src/autogenerate/index.ts index 7db9a7aa..8a08f2ac 100644 --- a/src/autogenerate/index.ts +++ b/src/autogenerate/index.ts @@ -10,7 +10,6 @@ import { RUNTIME_MIN_CODE_GEN_SUPPORTED_VERSION } from "../runtime"; import { UserConfig } from "../cli"; const DEFAULT_IMPORT_TRACKER = { - hasMaps: false, hasBytes: false, }; @@ -28,25 +27,29 @@ function writeTypes(types: ProtoTypes[], isTopLevel: boolean): string { result += `export type ${name} = ${node.content.values .map((x) => `| '${x.name}'`) .join("\n")}\n\n`; - } else if (node.content.isMap) { - IMPORT_TRACKER.hasMaps = true; - result += `export type ${name} = Record< - ${node.content.fields[0].tsType}, - ${node.content.fields[1].tsType} | undefined>;\n\n`; } else { - result += `export interface ${name} {\n`; + result += `${printIf( + !node.content.isMap, + "export " + )}interface ${name} {\n`; node.content.fields.forEach( - ({ name: fieldName, tsType, repeated, optional, comments }) => { + ({ name: fieldName, tsType, repeated, optional, comments, map }) => { if (comments?.leading) { result += printComments(comments?.leading); } - result += `${fieldName}${printIf(optional, "?")}: ${tsType}`; - if (optional) { - result += "| null | undefined"; - } else if (repeated) { - result += "[]"; + result += `${fieldName}${printIf(optional, "?")}:`; + if (map) { + result += `Record`; + } else { + result += tsType; + if (optional) { + result += "| null | undefined"; + } else if (repeated) { + result += "[]"; + } } + result += ";\n"; } ); @@ -64,9 +67,9 @@ function writeTypes(types: ProtoTypes[], isTopLevel: boolean): string { } const toMapMessage = (name: string) => - `Object.entries${printIfTypescript( - "" - )}(${name}).map(([key, value]) => ({ key: key, value: value }))`; + `Object.entries(${name}).map(([key, value]) => ({ key: key ${printIfTypescript( + "as any" + )}, value: value ${printIfTypescript("as any")} }))`; const fromMapMessage = (x: string) => `Object.fromEntries(${x}.map(({ key, value }) => [key, value]))`; @@ -194,17 +197,13 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { result += "},\n\n"; } - // decode (protobuf, internal) + // encode (protobuf, internal) result += `\ /** * @private */ _writeMessage: function(${printIf(isEmpty, "_")}msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `Partial<${node.content.fullyQualifiedName}>` - }` + `: ${`Partial<${node.content.fullyQualifiedName}>`}` )}, writer${printIfTypescript(`: BinaryWriter`)})${printIfTypescript( `: BinaryWriter` )} { @@ -236,9 +235,13 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { res += `writer.${field.write}(${field.index}, `; if (field.tsType === "bigint") { if (field.repeated) { - res += `msg.${field.name}.map(x => x.toString())`; + res += `msg.${ + field.name + }.map(x => x.toString() ${printIfTypescript("as any")})`; } else { - res += `msg.${field.name}.toString()`; + res += `msg.${field.name}.toString() ${printIfTypescript( + "as any" + )}`; } } else if (field.read === "readEnum") { if (field.repeated) { @@ -267,21 +270,13 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { `; if (isEmpty) { result += `_writeMessageJSON: function(_msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `Partial<${node.content.fullyQualifiedName}>` - }` + `: ${`Partial<${node.content.fullyQualifiedName}>`}` )})${printIfTypescript(`: Record`)} { return {}; `; } else { result += `_writeMessageJSON: function(msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `Partial<${node.content.fullyQualifiedName}>` - }` + `: ${`Partial<${node.content.fullyQualifiedName}>`}` )})${printIfTypescript(`: Record`)} { const json${printIfTypescript(": Record")} = {}; ${node.content.fields @@ -363,32 +358,16 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { `; if (isEmpty) { result += `_readMessage: function(_msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` + `: ${`${node.content.fullyQualifiedName}`}` )}, _reader${printIfTypescript(`: BinaryReader`)})${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` + `: ${`${node.content.fullyQualifiedName}`}` )}{ return _msg;`; } else { result += `_readMessage: function(msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` + `: ${`${node.content.fullyQualifiedName}`}` )}, reader${printIfTypescript(`: BinaryReader`)})${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` + `: ${`${node.content.fullyQualifiedName}`}` )}{ while (reader.nextField()) { const field = reader.getFieldNumber(); @@ -400,15 +379,14 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { if (field.read === "readMessage") { if (field.map) { res += ` - const ${field.name} = {}${printIfTypescript( - ` as MapMessage<${field.tsType}>` + const map = {}${printIfTypescript( + ` as ${field.tsType}` )}; - reader.readMessage(${field.name}, ${ - field.tsType - }._readMessage); - msg.${field.name}[${field.name}.key] = ${ - field.name - }.value; + reader.readMessage(map, ${field.tsType}._readMessage); + msg.${field.name}[map.key${printIf( + field.tsType !== "string", + ".toString()" + )}] = map.value; `; } else if (field.repeated) { res += `const m = ${field.tsType}.initialize();`; @@ -462,20 +440,10 @@ function writeSerializers(types: ProtoTypes[], isTopLevel: boolean): string { * @private */ _readMessageJSON: function(msg${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` + `: ${`${node.content.fullyQualifiedName}`}` )}, ${printIf(isEmpty, "_")}json${printIfTypescript( `: any` - )})${printIfTypescript( - `: ${ - node.content.isMap - ? `MapMessage<${node.content.fullyQualifiedName}>` - : `${node.content.fullyQualifiedName}` - }` - )}{ + )})${printIfTypescript(`: ${`${node.content.fullyQualifiedName}`}`)}{ ${node.content.fields .map((field) => { let res = ""; @@ -806,10 +774,9 @@ export function generate( ${printIf( - config.isTS && (hasServices || IMPORT_TRACKER.hasMaps || hasSerializer), + config.isTS && (hasServices || hasSerializer), `import type { ${printIf(hasSerializer, "ByteSource,\n")} - ${printIf(IMPORT_TRACKER.hasMaps, "MapMessage,\n")} ${printIf(hasServices, "ClientConfiguration")}} from 'twirpscript';` )} ${printIf( diff --git a/src/runtime/index.ts b/src/runtime/index.ts index 1bded909..26755478 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -11,7 +11,6 @@ export { RUNTIME_MIN_CODE_GEN_SUPPORTED_VERSION, MIN_SUPPORTED_VERSION_0_0_49, } from "./compatCheck"; -export type { MapMessage } from "./protobuf"; export { BinaryReader, BinaryWriter, diff --git a/src/runtime/protobuf/index.ts b/src/runtime/protobuf/index.ts index 69edc550..809da928 100644 --- a/src/runtime/protobuf/index.ts +++ b/src/runtime/protobuf/index.ts @@ -1,10 +1,5 @@ export { BinaryReader, BinaryWriter } from "google-protobuf"; -export type MapMessage> = { - key: keyof Message; - value: Message[keyof Message]; -}; - export function encodeBase64Bytes(bytes: Uint8Array): string { return btoa( bytes.reduce((acc, current) => acc + String.fromCharCode(current), "") diff --git a/src/test-protos/__snapshots__/test.ts.snap b/src/test-protos/__snapshots__/test.ts.snap index 1fa605eb..bde9e644 100644 --- a/src/test-protos/__snapshots__/test.ts.snap +++ b/src/test-protos/__snapshots__/test.ts.snap @@ -14447,12 +14447,12 @@ export const TestHugeFieldNumbers = { break; } case 536870010: { - const stringStringMap = {}; + const map = {}; reader.readMessage( - stringStringMap, + map, TestHugeFieldNumbers.StringStringMap._readMessage ); - msg.stringStringMap[stringStringMap.key] = stringStringMap.value; + msg.stringStringMap[map.key.toString()] = map.value; break; } case 536870011: { @@ -15641,162 +15641,117 @@ export const TestMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {}; - reader.readMessage(mapInt32Int32, TestMap.MapInt32Int32._readMessage); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {}; - reader.readMessage(mapInt64Int64, TestMap.MapInt64Int64._readMessage); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {}; - reader.readMessage( - mapUint32Uint32, - TestMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {}; + reader.readMessage(map, TestMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {}; - reader.readMessage( - mapUint64Uint64, - TestMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {}; + reader.readMessage(map, TestMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {}; - reader.readMessage( - mapSint32Sint32, - TestMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {}; + reader.readMessage(map, TestMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {}; - reader.readMessage( - mapSint64Sint64, - TestMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {}; + reader.readMessage(map, TestMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {}; - reader.readMessage( - mapFixed32Fixed32, - TestMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {}; + reader.readMessage(map, TestMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {}; - reader.readMessage( - mapFixed64Fixed64, - TestMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {}; + reader.readMessage(map, TestMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = {}; - reader.readMessage( - mapSfixed32Sfixed32, - TestMap.MapSfixed32Sfixed32._readMessage - ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + const map = {}; + reader.readMessage(map, TestMap.MapSfixed32Sfixed32._readMessage); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = {}; - reader.readMessage( - mapSfixed64Sfixed64, - TestMap.MapSfixed64Sfixed64._readMessage - ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + const map = {}; + reader.readMessage(map, TestMap.MapSfixed64Sfixed64._readMessage); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {}; - reader.readMessage(mapInt32Float, TestMap.MapInt32Float._readMessage); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {}; - reader.readMessage( - mapInt32Double, - TestMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {}; - reader.readMessage(mapBoolBool, TestMap.MapBoolBool._readMessage); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {}; + reader.readMessage(map, TestMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {}; - reader.readMessage( - mapStringString, - TestMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {}; + reader.readMessage(map, TestMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {}; - reader.readMessage(mapInt32Bytes, TestMap.MapInt32Bytes._readMessage); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {}; - reader.readMessage(mapInt32Enum, TestMap.MapInt32Enum._readMessage); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = {}; - reader.readMessage( - mapInt32ForeignMessage, - TestMap.MapInt32ForeignMessage._readMessage - ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32ForeignMessage._readMessage); + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } case 18: { - const mapStringForeignMessage = {}; - reader.readMessage( - mapStringForeignMessage, - TestMap.MapStringForeignMessage._readMessage - ); - msg.mapStringForeignMessage[mapStringForeignMessage.key] = - mapStringForeignMessage.value; + const map = {}; + reader.readMessage(map, TestMap.MapStringForeignMessage._readMessage); + msg.mapStringForeignMessage[map.key.toString()] = map.value; break; } case 19: { - const mapInt32AllTypes = {}; - reader.readMessage( - mapInt32AllTypes, - TestMap.MapInt32AllTypes._readMessage - ); - msg.mapInt32AllTypes[mapInt32AllTypes.key] = mapInt32AllTypes.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32AllTypes._readMessage); + msg.mapInt32AllTypes[map.key.toString()] = map.value; break; } default: { @@ -17505,12 +17460,9 @@ export const TestMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Message = {}; - reader.readMessage( - mapInt32Message, - TestMessageMap.MapInt32Message._readMessage - ); - msg.mapInt32Message[mapInt32Message.key] = mapInt32Message.value; + const map = {}; + reader.readMessage(map, TestMessageMap.MapInt32Message._readMessage); + msg.mapInt32Message[map.key.toString()] = map.value; break; } default: { @@ -17728,15 +17680,15 @@ export const TestSameTypeMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const map1 = {}; - reader.readMessage(map1, TestSameTypeMap.Map1._readMessage); - msg.map1[map1.key] = map1.value; + const map = {}; + reader.readMessage(map, TestSameTypeMap.Map1._readMessage); + msg.map1[map.key.toString()] = map.value; break; } case 2: { - const map2 = {}; - reader.readMessage(map2, TestSameTypeMap.Map2._readMessage); - msg.map2[map2.key] = map2.value; + const map = {}; + reader.readMessage(map, TestSameTypeMap.Map2._readMessage); + msg.map2[map.key.toString()] = map.value; break; } default: { @@ -18001,12 +17953,9 @@ export const TestRequiredMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapField = {}; - reader.readMessage( - mapField, - TestRequiredMessageMap.MapField._readMessage - ); - msg.mapField[mapField.key] = mapField.value; + const map = {}; + reader.readMessage(map, TestRequiredMessageMap.MapField._readMessage); + msg.mapField[map.key.toString()] = map.value; break; } default: { @@ -18554,161 +18503,114 @@ export const TestArenaMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {}; - reader.readMessage( - mapInt32Int32, - TestArenaMap.MapInt32Int32._readMessage - ); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {}; - reader.readMessage( - mapInt64Int64, - TestArenaMap.MapInt64Int64._readMessage - ); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {}; - reader.readMessage( - mapUint32Uint32, - TestArenaMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {}; - reader.readMessage( - mapUint64Uint64, - TestArenaMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {}; - reader.readMessage( - mapSint32Sint32, - TestArenaMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {}; - reader.readMessage( - mapSint64Sint64, - TestArenaMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {}; - reader.readMessage( - mapFixed32Fixed32, - TestArenaMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {}; - reader.readMessage( - mapFixed64Fixed64, - TestArenaMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = {}; + const map = {}; reader.readMessage( - mapSfixed32Sfixed32, + map, TestArenaMap.MapSfixed32Sfixed32._readMessage ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = {}; + const map = {}; reader.readMessage( - mapSfixed64Sfixed64, + map, TestArenaMap.MapSfixed64Sfixed64._readMessage ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {}; - reader.readMessage( - mapInt32Float, - TestArenaMap.MapInt32Float._readMessage - ); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {}; - reader.readMessage( - mapInt32Double, - TestArenaMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {}; - reader.readMessage( - mapBoolBool, - TestArenaMap.MapBoolBool._readMessage - ); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {}; - reader.readMessage( - mapStringString, - TestArenaMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {}; - reader.readMessage( - mapInt32Bytes, - TestArenaMap.MapInt32Bytes._readMessage - ); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {}; - reader.readMessage( - mapInt32Enum, - TestArenaMap.MapInt32Enum._readMessage - ); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = {}; + const map = {}; reader.readMessage( - mapInt32ForeignMessage, + map, TestArenaMap.MapInt32ForeignMessage._readMessage ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } default: { @@ -20143,12 +20045,12 @@ export const MessageContainingMapCalledEntry = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const entry = {}; + const map = {}; reader.readMessage( - entry, + map, MessageContainingMapCalledEntry.Entry._readMessage ); - msg.entry[entry.key] = entry.value; + msg.entry[map.key.toString()] = map.value; break; } default: { @@ -20336,9 +20238,9 @@ export const TestRecursiveMapMessage = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const a = {}; - reader.readMessage(a, TestRecursiveMapMessage.A._readMessage); - msg.a[a.key] = a.value; + const map = {}; + reader.readMessage(map, TestRecursiveMapMessage.A._readMessage); + msg.a[map.key.toString()] = map.value; break; } default: { @@ -22896,9 +22798,9 @@ export const Struct = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const fields = {}; - reader.readMessage(fields, Struct.Fields._readMessage); - msg.fields[fields.key] = fields.value; + const map = {}; + reader.readMessage(map, Struct.Fields._readMessage); + msg.fields[map.key.toString()] = map.value; break; } default: { @@ -26241,160 +26143,120 @@ export const MapWellKnownTypes = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const anyField = {}; - reader.readMessage(anyField, MapWellKnownTypes.AnyField._readMessage); - msg.anyField[anyField.key] = anyField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.AnyField._readMessage); + msg.anyField[map.key.toString()] = map.value; break; } case 2: { - const apiField = {}; - reader.readMessage(apiField, MapWellKnownTypes.ApiField._readMessage); - msg.apiField[apiField.key] = apiField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.ApiField._readMessage); + msg.apiField[map.key.toString()] = map.value; break; } case 3: { - const durationField = {}; - reader.readMessage( - durationField, - MapWellKnownTypes.DurationField._readMessage - ); - msg.durationField[durationField.key] = durationField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.DurationField._readMessage); + msg.durationField[map.key.toString()] = map.value; break; } case 4: { - const emptyField = {}; - reader.readMessage( - emptyField, - MapWellKnownTypes.EmptyField._readMessage - ); - msg.emptyField[emptyField.key] = emptyField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.EmptyField._readMessage); + msg.emptyField[map.key.toString()] = map.value; break; } case 5: { - const fieldMaskField = {}; + const map = {}; reader.readMessage( - fieldMaskField, + map, MapWellKnownTypes.FieldMaskField._readMessage ); - msg.fieldMaskField[fieldMaskField.key] = fieldMaskField.value; + msg.fieldMaskField[map.key.toString()] = map.value; break; } case 6: { - const sourceContextField = {}; + const map = {}; reader.readMessage( - sourceContextField, + map, MapWellKnownTypes.SourceContextField._readMessage ); - msg.sourceContextField[sourceContextField.key] = - sourceContextField.value; + msg.sourceContextField[map.key.toString()] = map.value; break; } case 7: { - const structField = {}; - reader.readMessage( - structField, - MapWellKnownTypes.StructField._readMessage - ); - msg.structField[structField.key] = structField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.StructField._readMessage); + msg.structField[map.key.toString()] = map.value; break; } case 8: { - const timestampField = {}; + const map = {}; reader.readMessage( - timestampField, + map, MapWellKnownTypes.TimestampField._readMessage ); - msg.timestampField[timestampField.key] = timestampField.value; + msg.timestampField[map.key.toString()] = map.value; break; } case 9: { - const typeField = {}; - reader.readMessage( - typeField, - MapWellKnownTypes.TypeField._readMessage - ); - msg.typeField[typeField.key] = typeField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.TypeField._readMessage); + msg.typeField[map.key.toString()] = map.value; break; } case 10: { - const doubleField = {}; - reader.readMessage( - doubleField, - MapWellKnownTypes.DoubleField._readMessage - ); - msg.doubleField[doubleField.key] = doubleField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.DoubleField._readMessage); + msg.doubleField[map.key.toString()] = map.value; break; } case 11: { - const floatField = {}; - reader.readMessage( - floatField, - MapWellKnownTypes.FloatField._readMessage - ); - msg.floatField[floatField.key] = floatField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.FloatField._readMessage); + msg.floatField[map.key.toString()] = map.value; break; } case 12: { - const int64Field = {}; - reader.readMessage( - int64Field, - MapWellKnownTypes.Int64Field._readMessage - ); - msg.int64Field[int64Field.key] = int64Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Int64Field._readMessage); + msg.int64Field[map.key.toString()] = map.value; break; } case 13: { - const uint64Field = {}; - reader.readMessage( - uint64Field, - MapWellKnownTypes.Uint64Field._readMessage - ); - msg.uint64Field[uint64Field.key] = uint64Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Uint64Field._readMessage); + msg.uint64Field[map.key.toString()] = map.value; break; } case 14: { - const int32Field = {}; - reader.readMessage( - int32Field, - MapWellKnownTypes.Int32Field._readMessage - ); - msg.int32Field[int32Field.key] = int32Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Int32Field._readMessage); + msg.int32Field[map.key.toString()] = map.value; break; } case 15: { - const uint32Field = {}; - reader.readMessage( - uint32Field, - MapWellKnownTypes.Uint32Field._readMessage - ); - msg.uint32Field[uint32Field.key] = uint32Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Uint32Field._readMessage); + msg.uint32Field[map.key.toString()] = map.value; break; } case 16: { - const boolField = {}; - reader.readMessage( - boolField, - MapWellKnownTypes.BoolField._readMessage - ); - msg.boolField[boolField.key] = boolField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.BoolField._readMessage); + msg.boolField[map.key.toString()] = map.value; break; } case 17: { - const stringField = {}; - reader.readMessage( - stringField, - MapWellKnownTypes.StringField._readMessage - ); - msg.stringField[stringField.key] = stringField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.StringField._readMessage); + msg.stringField[map.key.toString()] = map.value; break; } case 18: { - const bytesField = {}; - reader.readMessage( - bytesField, - MapWellKnownTypes.BytesField._readMessage - ); - msg.bytesField[bytesField.key] = bytesField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.BytesField._readMessage); + msg.bytesField[map.key.toString()] = map.value; break; } default: { @@ -44899,12 +44761,12 @@ export const TestHugeFieldNumbers = { break; } case 536870010: { - const stringStringMap = {}; + const map = {}; reader.readMessage( - stringStringMap, + map, TestHugeFieldNumbers.StringStringMap._readMessage ); - msg.stringStringMap[stringStringMap.key] = stringStringMap.value; + msg.stringStringMap[map.key.toString()] = map.value; break; } case 536870011: { @@ -46100,162 +45962,117 @@ export const TestMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {}; - reader.readMessage(mapInt32Int32, TestMap.MapInt32Int32._readMessage); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {}; - reader.readMessage(mapInt64Int64, TestMap.MapInt64Int64._readMessage); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {}; - reader.readMessage( - mapUint32Uint32, - TestMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {}; + reader.readMessage(map, TestMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {}; - reader.readMessage( - mapUint64Uint64, - TestMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {}; + reader.readMessage(map, TestMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {}; - reader.readMessage( - mapSint32Sint32, - TestMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {}; + reader.readMessage(map, TestMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {}; - reader.readMessage( - mapSint64Sint64, - TestMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {}; + reader.readMessage(map, TestMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {}; - reader.readMessage( - mapFixed32Fixed32, - TestMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {}; + reader.readMessage(map, TestMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {}; - reader.readMessage( - mapFixed64Fixed64, - TestMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {}; + reader.readMessage(map, TestMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = {}; - reader.readMessage( - mapSfixed32Sfixed32, - TestMap.MapSfixed32Sfixed32._readMessage - ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + const map = {}; + reader.readMessage(map, TestMap.MapSfixed32Sfixed32._readMessage); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = {}; - reader.readMessage( - mapSfixed64Sfixed64, - TestMap.MapSfixed64Sfixed64._readMessage - ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + const map = {}; + reader.readMessage(map, TestMap.MapSfixed64Sfixed64._readMessage); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {}; - reader.readMessage(mapInt32Float, TestMap.MapInt32Float._readMessage); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {}; - reader.readMessage( - mapInt32Double, - TestMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {}; - reader.readMessage(mapBoolBool, TestMap.MapBoolBool._readMessage); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {}; + reader.readMessage(map, TestMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {}; - reader.readMessage( - mapStringString, - TestMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {}; + reader.readMessage(map, TestMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {}; - reader.readMessage(mapInt32Bytes, TestMap.MapInt32Bytes._readMessage); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {}; - reader.readMessage(mapInt32Enum, TestMap.MapInt32Enum._readMessage); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = {}; - reader.readMessage( - mapInt32ForeignMessage, - TestMap.MapInt32ForeignMessage._readMessage - ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32ForeignMessage._readMessage); + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } case 18: { - const mapStringForeignMessage = {}; - reader.readMessage( - mapStringForeignMessage, - TestMap.MapStringForeignMessage._readMessage - ); - msg.mapStringForeignMessage[mapStringForeignMessage.key] = - mapStringForeignMessage.value; + const map = {}; + reader.readMessage(map, TestMap.MapStringForeignMessage._readMessage); + msg.mapStringForeignMessage[map.key.toString()] = map.value; break; } case 19: { - const mapInt32AllTypes = {}; - reader.readMessage( - mapInt32AllTypes, - TestMap.MapInt32AllTypes._readMessage - ); - msg.mapInt32AllTypes[mapInt32AllTypes.key] = mapInt32AllTypes.value; + const map = {}; + reader.readMessage(map, TestMap.MapInt32AllTypes._readMessage); + msg.mapInt32AllTypes[map.key.toString()] = map.value; break; } default: { @@ -47964,12 +47781,9 @@ export const TestMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Message = {}; - reader.readMessage( - mapInt32Message, - TestMessageMap.MapInt32Message._readMessage - ); - msg.mapInt32Message[mapInt32Message.key] = mapInt32Message.value; + const map = {}; + reader.readMessage(map, TestMessageMap.MapInt32Message._readMessage); + msg.mapInt32Message[map.key.toString()] = map.value; break; } default: { @@ -48187,15 +48001,15 @@ export const TestSameTypeMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const map1 = {}; - reader.readMessage(map1, TestSameTypeMap.Map1._readMessage); - msg.map1[map1.key] = map1.value; + const map = {}; + reader.readMessage(map, TestSameTypeMap.Map1._readMessage); + msg.map1[map.key.toString()] = map.value; break; } case 2: { - const map2 = {}; - reader.readMessage(map2, TestSameTypeMap.Map2._readMessage); - msg.map2[map2.key] = map2.value; + const map = {}; + reader.readMessage(map, TestSameTypeMap.Map2._readMessage); + msg.map2[map.key.toString()] = map.value; break; } default: { @@ -48460,12 +48274,9 @@ export const TestRequiredMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapField = {}; - reader.readMessage( - mapField, - TestRequiredMessageMap.MapField._readMessage - ); - msg.mapField[mapField.key] = mapField.value; + const map = {}; + reader.readMessage(map, TestRequiredMessageMap.MapField._readMessage); + msg.mapField[map.key.toString()] = map.value; break; } default: { @@ -49013,161 +48824,114 @@ export const TestArenaMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {}; - reader.readMessage( - mapInt32Int32, - TestArenaMap.MapInt32Int32._readMessage - ); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {}; - reader.readMessage( - mapInt64Int64, - TestArenaMap.MapInt64Int64._readMessage - ); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {}; - reader.readMessage( - mapUint32Uint32, - TestArenaMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {}; - reader.readMessage( - mapUint64Uint64, - TestArenaMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {}; - reader.readMessage( - mapSint32Sint32, - TestArenaMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {}; - reader.readMessage( - mapSint64Sint64, - TestArenaMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {}; - reader.readMessage( - mapFixed32Fixed32, - TestArenaMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {}; - reader.readMessage( - mapFixed64Fixed64, - TestArenaMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = {}; + const map = {}; reader.readMessage( - mapSfixed32Sfixed32, + map, TestArenaMap.MapSfixed32Sfixed32._readMessage ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = {}; + const map = {}; reader.readMessage( - mapSfixed64Sfixed64, + map, TestArenaMap.MapSfixed64Sfixed64._readMessage ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {}; - reader.readMessage( - mapInt32Float, - TestArenaMap.MapInt32Float._readMessage - ); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {}; - reader.readMessage( - mapInt32Double, - TestArenaMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {}; - reader.readMessage( - mapBoolBool, - TestArenaMap.MapBoolBool._readMessage - ); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {}; - reader.readMessage( - mapStringString, - TestArenaMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {}; - reader.readMessage( - mapInt32Bytes, - TestArenaMap.MapInt32Bytes._readMessage - ); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {}; - reader.readMessage( - mapInt32Enum, - TestArenaMap.MapInt32Enum._readMessage - ); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {}; + reader.readMessage(map, TestArenaMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = {}; + const map = {}; reader.readMessage( - mapInt32ForeignMessage, + map, TestArenaMap.MapInt32ForeignMessage._readMessage ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } default: { @@ -50602,12 +50366,12 @@ export const MessageContainingMapCalledEntry = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const entry = {}; + const map = {}; reader.readMessage( - entry, + map, MessageContainingMapCalledEntry.Entry._readMessage ); - msg.entry[entry.key] = entry.value; + msg.entry[map.key.toString()] = map.value; break; } default: { @@ -50795,9 +50559,9 @@ export const TestRecursiveMapMessage = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const a = {}; - reader.readMessage(a, TestRecursiveMapMessage.A._readMessage); - msg.a[a.key] = a.value; + const map = {}; + reader.readMessage(map, TestRecursiveMapMessage.A._readMessage); + msg.a[map.key.toString()] = map.value; break; } default: { @@ -53411,9 +53175,9 @@ export const Struct = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const fields = {}; - reader.readMessage(fields, Struct.Fields._readMessage); - msg.fields[fields.key] = fields.value; + const map = {}; + reader.readMessage(map, Struct.Fields._readMessage); + msg.fields[map.key.toString()] = map.value; break; } default: { @@ -56777,160 +56541,120 @@ export const MapWellKnownTypes = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const anyField = {}; - reader.readMessage(anyField, MapWellKnownTypes.AnyField._readMessage); - msg.anyField[anyField.key] = anyField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.AnyField._readMessage); + msg.anyField[map.key.toString()] = map.value; break; } case 2: { - const apiField = {}; - reader.readMessage(apiField, MapWellKnownTypes.ApiField._readMessage); - msg.apiField[apiField.key] = apiField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.ApiField._readMessage); + msg.apiField[map.key.toString()] = map.value; break; } case 3: { - const durationField = {}; - reader.readMessage( - durationField, - MapWellKnownTypes.DurationField._readMessage - ); - msg.durationField[durationField.key] = durationField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.DurationField._readMessage); + msg.durationField[map.key.toString()] = map.value; break; } case 4: { - const emptyField = {}; - reader.readMessage( - emptyField, - MapWellKnownTypes.EmptyField._readMessage - ); - msg.emptyField[emptyField.key] = emptyField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.EmptyField._readMessage); + msg.emptyField[map.key.toString()] = map.value; break; } case 5: { - const fieldMaskField = {}; + const map = {}; reader.readMessage( - fieldMaskField, + map, MapWellKnownTypes.FieldMaskField._readMessage ); - msg.fieldMaskField[fieldMaskField.key] = fieldMaskField.value; + msg.fieldMaskField[map.key.toString()] = map.value; break; } case 6: { - const sourceContextField = {}; + const map = {}; reader.readMessage( - sourceContextField, + map, MapWellKnownTypes.SourceContextField._readMessage ); - msg.sourceContextField[sourceContextField.key] = - sourceContextField.value; + msg.sourceContextField[map.key.toString()] = map.value; break; } case 7: { - const structField = {}; - reader.readMessage( - structField, - MapWellKnownTypes.StructField._readMessage - ); - msg.structField[structField.key] = structField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.StructField._readMessage); + msg.structField[map.key.toString()] = map.value; break; } case 8: { - const timestampField = {}; + const map = {}; reader.readMessage( - timestampField, + map, MapWellKnownTypes.TimestampField._readMessage ); - msg.timestampField[timestampField.key] = timestampField.value; + msg.timestampField[map.key.toString()] = map.value; break; } case 9: { - const typeField = {}; - reader.readMessage( - typeField, - MapWellKnownTypes.TypeField._readMessage - ); - msg.typeField[typeField.key] = typeField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.TypeField._readMessage); + msg.typeField[map.key.toString()] = map.value; break; } case 10: { - const doubleField = {}; - reader.readMessage( - doubleField, - MapWellKnownTypes.DoubleField._readMessage - ); - msg.doubleField[doubleField.key] = doubleField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.DoubleField._readMessage); + msg.doubleField[map.key.toString()] = map.value; break; } case 11: { - const floatField = {}; - reader.readMessage( - floatField, - MapWellKnownTypes.FloatField._readMessage - ); - msg.floatField[floatField.key] = floatField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.FloatField._readMessage); + msg.floatField[map.key.toString()] = map.value; break; } case 12: { - const int64Field = {}; - reader.readMessage( - int64Field, - MapWellKnownTypes.Int64Field._readMessage - ); - msg.int64Field[int64Field.key] = int64Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Int64Field._readMessage); + msg.int64Field[map.key.toString()] = map.value; break; } case 13: { - const uint64Field = {}; - reader.readMessage( - uint64Field, - MapWellKnownTypes.Uint64Field._readMessage - ); - msg.uint64Field[uint64Field.key] = uint64Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Uint64Field._readMessage); + msg.uint64Field[map.key.toString()] = map.value; break; } case 14: { - const int32Field = {}; - reader.readMessage( - int32Field, - MapWellKnownTypes.Int32Field._readMessage - ); - msg.int32Field[int32Field.key] = int32Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Int32Field._readMessage); + msg.int32Field[map.key.toString()] = map.value; break; } case 15: { - const uint32Field = {}; - reader.readMessage( - uint32Field, - MapWellKnownTypes.Uint32Field._readMessage - ); - msg.uint32Field[uint32Field.key] = uint32Field.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.Uint32Field._readMessage); + msg.uint32Field[map.key.toString()] = map.value; break; } case 16: { - const boolField = {}; - reader.readMessage( - boolField, - MapWellKnownTypes.BoolField._readMessage - ); - msg.boolField[boolField.key] = boolField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.BoolField._readMessage); + msg.boolField[map.key.toString()] = map.value; break; } case 17: { - const stringField = {}; - reader.readMessage( - stringField, - MapWellKnownTypes.StringField._readMessage - ); - msg.stringField[stringField.key] = stringField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.StringField._readMessage); + msg.stringField[map.key.toString()] = map.value; break; } case 18: { - const bytesField = {}; - reader.readMessage( - bytesField, - MapWellKnownTypes.BytesField._readMessage - ); - msg.bytesField[bytesField.key] = bytesField.value; + const map = {}; + reader.readMessage(map, MapWellKnownTypes.BytesField._readMessage); + msg.bytesField[map.key.toString()] = map.value; break; } default: { @@ -61430,7 +61154,7 @@ export const ImportMessage = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/unittest.proto -import type { ByteSource, MapMessage, ClientConfiguration } from \\"twirpscript\\"; +import type { ByteSource, ClientConfiguration } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter, @@ -62443,7 +62167,10 @@ export interface TestHugeFieldNumbers { optionalString: string; optionalBytes: Uint8Array; optionalMessage: ForeignMessage; - stringStringMap: TestHugeFieldNumbers.StringStringMap; + stringStringMap: Record< + string, + TestHugeFieldNumbers.StringStringMap[\\"value\\"] | undefined + >; oneofUint32?: number | null | undefined; oneofTestAllTypes?: TestAllTypes | null | undefined; oneofString?: string | null | undefined; @@ -62455,7 +62182,10 @@ declare namespace TestHugeFieldNumbers { groupA: number; } - export type StringStringMap = Record; + interface StringStringMap { + key: string; + value: string; + } } export interface TestExtensionInsideTable { @@ -63520,31 +63250,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64.toString()); + writer.writeInt64String(2, msg.optionalInt64.toString() as any); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64.toString()); + writer.writeUint64String(4, msg.optionalUint64.toString() as any); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64.toString()); + writer.writeSint64String(6, msg.optionalSint64.toString() as any); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64.toString()); + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64.toString()); + writer.writeSfixed64(10, msg.optionalSfixed64.toString() as any); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -63626,7 +63356,7 @@ export const TestAllTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 32, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -63635,7 +63365,7 @@ export const TestAllTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 34, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -63644,7 +63374,7 @@ export const TestAllTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 36, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -63653,7 +63383,7 @@ export const TestAllTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 38, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -63662,7 +63392,7 @@ export const TestAllTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 40, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -63736,31 +63466,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64.toString()); + writer.writeInt64String(62, msg.defaultInt64.toString() as any); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64.toString()); + writer.writeUint64String(64, msg.defaultUint64.toString() as any); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64.toString()); + writer.writeSint64String(66, msg.defaultSint64.toString() as any); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64.toString()); + writer.writeFixed64String(68, msg.defaultFixed64.toString() as any); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64.toString()); + writer.writeSfixed64(70, msg.defaultSfixed64.toString() as any); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -70574,7 +70304,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt.toString()); + writer.writeInt64String(1, msg.myInt.toString() as any); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -70749,7 +70479,7 @@ export const TestFieldOrderings = { writer: BinaryWriter ): BinaryWriter { if (msg.oo) { - writer.writeInt64String(2, msg.oo.toString()); + writer.writeInt64String(2, msg.oo.toString() as any); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -71250,19 +70980,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64.toString()); + writer.writeUint64String(3, msg.largeUint64.toString() as any); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64.toString()); + writer.writeInt64String(5, msg.smallInt64.toString() as any); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64.toString()); + writer.writeInt64String(22, msg.reallySmallInt64.toString() as any); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -72448,7 +72178,7 @@ export const Int64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeInt64String(1, msg.data.toString()); + writer.writeInt64String(1, msg.data.toString() as any); } return writer; }, @@ -72556,7 +72286,7 @@ export const Uint64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeUint64String(1, msg.data.toString()); + writer.writeUint64String(1, msg.data.toString() as any); } return writer; }, @@ -73884,7 +73614,7 @@ export const TestOneof2 = { writer: BinaryWriter ): BinaryWriter { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt.toString()); + writer.writeInt64String(1, msg.quxInt.toString() as any); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -74298,7 +74028,7 @@ export const TestPackedTypes = { if (msg.packedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.packedInt64.map((x) => x.toString()) + msg.packedInt64.map((x) => x.toString() as any) ); } if (msg.packedUint32?.length) { @@ -74307,7 +74037,7 @@ export const TestPackedTypes = { if (msg.packedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.packedUint64.map((x) => x.toString()) + msg.packedUint64.map((x) => x.toString() as any) ); } if (msg.packedSint32?.length) { @@ -74316,7 +74046,7 @@ export const TestPackedTypes = { if (msg.packedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.packedSint64.map((x) => x.toString()) + msg.packedSint64.map((x) => x.toString() as any) ); } if (msg.packedFixed32?.length) { @@ -74325,7 +74055,7 @@ export const TestPackedTypes = { if (msg.packedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.packedFixed64.map((x) => x.toString()) + msg.packedFixed64.map((x) => x.toString() as any) ); } if (msg.packedSfixed32?.length) { @@ -74334,7 +74064,7 @@ export const TestPackedTypes = { if (msg.packedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.packedSfixed64.map((x) => x.toString()) + msg.packedSfixed64.map((x) => x.toString() as any) ); } if (msg.packedFloat?.length) { @@ -74619,7 +74349,7 @@ export const TestUnpackedTypes = { if (msg.unpackedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.unpackedInt64.map((x) => x.toString()) + msg.unpackedInt64.map((x) => x.toString() as any) ); } if (msg.unpackedUint32?.length) { @@ -74628,7 +74358,7 @@ export const TestUnpackedTypes = { if (msg.unpackedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.unpackedUint64.map((x) => x.toString()) + msg.unpackedUint64.map((x) => x.toString() as any) ); } if (msg.unpackedSint32?.length) { @@ -74637,7 +74367,7 @@ export const TestUnpackedTypes = { if (msg.unpackedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.unpackedSint64.map((x) => x.toString()) + msg.unpackedSint64.map((x) => x.toString() as any) ); } if (msg.unpackedFixed32?.length) { @@ -74646,7 +74376,7 @@ export const TestUnpackedTypes = { if (msg.unpackedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.unpackedFixed64.map((x) => x.toString()) + msg.unpackedFixed64.map((x) => x.toString() as any) ); } if (msg.unpackedSfixed32?.length) { @@ -74655,7 +74385,7 @@ export const TestUnpackedTypes = { if (msg.unpackedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.unpackedSfixed64.map((x) => x.toString()) + msg.unpackedSfixed64.map((x) => x.toString() as any) ); } if (msg.unpackedFloat?.length) { @@ -75504,13 +75234,13 @@ export const TestRepeatedScalarDifferentTagSizes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 2046, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 2047, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -75519,7 +75249,7 @@ export const TestRepeatedScalarDifferentTagSizes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 262143, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } return writer; @@ -77386,9 +77116,9 @@ export const TestHugeFieldNumbers = { if (msg.stringStringMap) { writer.writeRepeatedMessage( 536870010, - Object.entries(msg.stringStringMap).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.stringStringMap).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestHugeFieldNumbers.StringStringMap._writeMessage ); @@ -77450,8 +77180,8 @@ export const TestHugeFieldNumbers = { } if (msg.stringStringMap) { const stringStringMap = Object.fromEntries( - Object.entries(msg.stringStringMap) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.stringStringMap) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestHugeFieldNumbers.StringStringMap._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -77522,13 +77252,12 @@ export const TestHugeFieldNumbers = { break; } case 536870010: { - const stringStringMap = - {} as MapMessage; + const map = {} as TestHugeFieldNumbers.StringStringMap; reader.readMessage( - stringStringMap, + map, TestHugeFieldNumbers.StringStringMap._readMessage ); - msg.stringStringMap[stringStringMap.key] = stringStringMap.value; + msg.stringStringMap[map.key.toString()] = map.value; break; } case 536870011: { @@ -77600,8 +77329,8 @@ export const TestHugeFieldNumbers = { const _stringStringMap = json.stringStringMap ?? json.string_string_map; if (_stringStringMap) { msg.stringStringMap = Object.fromEntries( - Object.entries(_stringStringMap) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_stringStringMap) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestHugeFieldNumbers.StringStringMap._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -77750,7 +77479,7 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -77766,7 +77495,7 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -77782,9 +77511,9 @@ export const TestHugeFieldNumbers = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestHugeFieldNumbers.StringStringMap, reader: BinaryReader - ): MapMessage { + ): TestHugeFieldNumbers.StringStringMap { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -77809,9 +77538,9 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestHugeFieldNumbers.StringStringMap, json: any - ): MapMessage { + ): TestHugeFieldNumbers.StringStringMap { const _key = json.key; if (_key) { msg.key = _key; @@ -78231,7 +77960,7 @@ export const TestExtensionRangeSerialize = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/map_unittest.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter, @@ -78251,71 +77980,143 @@ export type MapEnum = \\"MAP_ENUM_FOO\\" | \\"MAP_ENUM_BAR\\" | \\"MAP_ENUM_BAZ\ * Tests maps. */ export interface TestMap { - mapInt32Int32: TestMap.MapInt32Int32; - mapInt64Int64: TestMap.MapInt64Int64; - mapUint32Uint32: TestMap.MapUint32Uint32; - mapUint64Uint64: TestMap.MapUint64Uint64; - mapSint32Sint32: TestMap.MapSint32Sint32; - mapSint64Sint64: TestMap.MapSint64Sint64; - mapFixed32Fixed32: TestMap.MapFixed32Fixed32; - mapFixed64Fixed64: TestMap.MapFixed64Fixed64; - mapSfixed32Sfixed32: TestMap.MapSfixed32Sfixed32; - mapSfixed64Sfixed64: TestMap.MapSfixed64Sfixed64; - mapInt32Float: TestMap.MapInt32Float; - mapInt32Double: TestMap.MapInt32Double; - mapBoolBool: TestMap.MapBoolBool; - mapStringString: TestMap.MapStringString; - mapInt32Bytes: TestMap.MapInt32Bytes; - mapInt32Enum: TestMap.MapInt32Enum; - mapInt32ForeignMessage: TestMap.MapInt32ForeignMessage; - mapStringForeignMessage: TestMap.MapStringForeignMessage; - mapInt32AllTypes: TestMap.MapInt32AllTypes; + mapInt32Int32: Record; + mapInt64Int64: Record; + mapUint32Uint32: Record; + mapUint64Uint64: Record; + mapSint32Sint32: Record; + mapSint64Sint64: Record; + mapFixed32Fixed32: Record< + string, + TestMap.MapFixed32Fixed32[\\"value\\"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestMap.MapFixed64Fixed64[\\"value\\"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestMap.MapSfixed32Sfixed32[\\"value\\"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestMap.MapSfixed64Sfixed64[\\"value\\"] | undefined + >; + mapInt32Float: Record; + mapInt32Double: Record; + mapBoolBool: Record; + mapStringString: Record; + mapInt32Bytes: Record; + mapInt32Enum: Record; + mapInt32ForeignMessage: Record< + string, + TestMap.MapInt32ForeignMessage[\\"value\\"] | undefined + >; + mapStringForeignMessage: Record< + string, + TestMap.MapStringForeignMessage[\\"value\\"] | undefined + >; + mapInt32AllTypes: Record< + string, + TestMap.MapInt32AllTypes[\\"value\\"] | undefined + >; } declare namespace TestMap { - export type MapInt32Int32 = Record; + interface MapInt32Int32 { + key: number; + value: number; + } - export type MapInt64Int64 = Record; + interface MapInt64Int64 { + key: bigint; + value: bigint; + } - export type MapUint32Uint32 = Record; + interface MapUint32Uint32 { + key: number; + value: number; + } - export type MapUint64Uint64 = Record; + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } - export type MapSint32Sint32 = Record; + interface MapSint32Sint32 { + key: number; + value: number; + } - export type MapSint64Sint64 = Record; + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } - export type MapFixed32Fixed32 = Record; + interface MapFixed32Fixed32 { + key: number; + value: number; + } - export type MapFixed64Fixed64 = Record; + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } - export type MapSfixed32Sfixed32 = Record; + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } - export type MapSfixed64Sfixed64 = Record; + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } - export type MapInt32Float = Record; + interface MapInt32Float { + key: number; + value: number; + } - export type MapInt32Double = Record; + interface MapInt32Double { + key: number; + value: number; + } - export type MapBoolBool = Record; + interface MapBoolBool { + key: boolean; + value: boolean; + } - export type MapStringString = Record; + interface MapStringString { + key: string; + value: string; + } - export type MapInt32Bytes = Record; + interface MapInt32Bytes { + key: number; + value: Uint8Array; + } - export type MapInt32Enum = Record; + interface MapInt32Enum { + key: number; + value: MapEnum; + } - export type MapInt32ForeignMessage = Record< - number, - ForeignMessage | undefined - >; + interface MapInt32ForeignMessage { + key: number; + value: ForeignMessage; + } - export type MapStringForeignMessage = Record< - string, - ForeignMessage | undefined - >; + interface MapStringForeignMessage { + key: string; + value: ForeignMessage; + } - export type MapInt32AllTypes = Record; + interface MapInt32AllTypes { + key: number; + value: TestAllTypes; + } } export interface TestMapSubmessage { @@ -78323,114 +78124,234 @@ export interface TestMapSubmessage { } export interface TestMessageMap { - mapInt32Message: TestMessageMap.MapInt32Message; + mapInt32Message: Record< + string, + TestMessageMap.MapInt32Message[\\"value\\"] | undefined + >; } declare namespace TestMessageMap { - export type MapInt32Message = Record; + interface MapInt32Message { + key: number; + value: TestAllTypes; + } } /** * Two map fields share the same entry default instance. */ export interface TestSameTypeMap { - map1: TestSameTypeMap.Map1; - map2: TestSameTypeMap.Map2; + map1: Record; + map2: Record; } declare namespace TestSameTypeMap { - export type Map1 = Record; + interface Map1 { + key: number; + value: number; + } - export type Map2 = Record; + interface Map2 { + key: number; + value: number; + } } /** * Test embedded message with required fields */ export interface TestRequiredMessageMap { - mapField: TestRequiredMessageMap.MapField; + mapField: Record< + string, + TestRequiredMessageMap.MapField[\\"value\\"] | undefined + >; } declare namespace TestRequiredMessageMap { - export type MapField = Record; + interface MapField { + key: number; + value: TestRequired; + } } export interface TestArenaMap { - mapInt32Int32: TestArenaMap.MapInt32Int32; - mapInt64Int64: TestArenaMap.MapInt64Int64; - mapUint32Uint32: TestArenaMap.MapUint32Uint32; - mapUint64Uint64: TestArenaMap.MapUint64Uint64; - mapSint32Sint32: TestArenaMap.MapSint32Sint32; - mapSint64Sint64: TestArenaMap.MapSint64Sint64; - mapFixed32Fixed32: TestArenaMap.MapFixed32Fixed32; - mapFixed64Fixed64: TestArenaMap.MapFixed64Fixed64; - mapSfixed32Sfixed32: TestArenaMap.MapSfixed32Sfixed32; - mapSfixed64Sfixed64: TestArenaMap.MapSfixed64Sfixed64; - mapInt32Float: TestArenaMap.MapInt32Float; - mapInt32Double: TestArenaMap.MapInt32Double; - mapBoolBool: TestArenaMap.MapBoolBool; - mapStringString: TestArenaMap.MapStringString; - mapInt32Bytes: TestArenaMap.MapInt32Bytes; - mapInt32Enum: TestArenaMap.MapInt32Enum; - mapInt32ForeignMessage: TestArenaMap.MapInt32ForeignMessage; + mapInt32Int32: Record< + string, + TestArenaMap.MapInt32Int32[\\"value\\"] | undefined + >; + mapInt64Int64: Record< + string, + TestArenaMap.MapInt64Int64[\\"value\\"] | undefined + >; + mapUint32Uint32: Record< + string, + TestArenaMap.MapUint32Uint32[\\"value\\"] | undefined + >; + mapUint64Uint64: Record< + string, + TestArenaMap.MapUint64Uint64[\\"value\\"] | undefined + >; + mapSint32Sint32: Record< + string, + TestArenaMap.MapSint32Sint32[\\"value\\"] | undefined + >; + mapSint64Sint64: Record< + string, + TestArenaMap.MapSint64Sint64[\\"value\\"] | undefined + >; + mapFixed32Fixed32: Record< + string, + TestArenaMap.MapFixed32Fixed32[\\"value\\"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestArenaMap.MapFixed64Fixed64[\\"value\\"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestArenaMap.MapSfixed32Sfixed32[\\"value\\"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestArenaMap.MapSfixed64Sfixed64[\\"value\\"] | undefined + >; + mapInt32Float: Record< + string, + TestArenaMap.MapInt32Float[\\"value\\"] | undefined + >; + mapInt32Double: Record< + string, + TestArenaMap.MapInt32Double[\\"value\\"] | undefined + >; + mapBoolBool: Record; + mapStringString: Record< + string, + TestArenaMap.MapStringString[\\"value\\"] | undefined + >; + mapInt32Bytes: Record< + string, + TestArenaMap.MapInt32Bytes[\\"value\\"] | undefined + >; + mapInt32Enum: Record; + mapInt32ForeignMessage: Record< + string, + TestArenaMap.MapInt32ForeignMessage[\\"value\\"] | undefined + >; } declare namespace TestArenaMap { - export type MapInt32Int32 = Record; + interface MapInt32Int32 { + key: number; + value: number; + } - export type MapInt64Int64 = Record; + interface MapInt64Int64 { + key: bigint; + value: bigint; + } - export type MapUint32Uint32 = Record; + interface MapUint32Uint32 { + key: number; + value: number; + } - export type MapUint64Uint64 = Record; + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } - export type MapSint32Sint32 = Record; + interface MapSint32Sint32 { + key: number; + value: number; + } - export type MapSint64Sint64 = Record; + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } - export type MapFixed32Fixed32 = Record; + interface MapFixed32Fixed32 { + key: number; + value: number; + } - export type MapFixed64Fixed64 = Record; + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } - export type MapSfixed32Sfixed32 = Record; + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } - export type MapSfixed64Sfixed64 = Record; + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } - export type MapInt32Float = Record; + interface MapInt32Float { + key: number; + value: number; + } - export type MapInt32Double = Record; + interface MapInt32Double { + key: number; + value: number; + } - export type MapBoolBool = Record; + interface MapBoolBool { + key: boolean; + value: boolean; + } - export type MapStringString = Record; + interface MapStringString { + key: string; + value: string; + } - export type MapInt32Bytes = Record; + interface MapInt32Bytes { + key: number; + value: Uint8Array; + } - export type MapInt32Enum = Record; + interface MapInt32Enum { + key: number; + value: MapEnum; + } - export type MapInt32ForeignMessage = Record< - number, - ForeignMessage | undefined - >; + interface MapInt32ForeignMessage { + key: number; + value: ForeignMessage; + } } /** * Previously, message cannot contain map field called \\"entry\\". */ export interface MessageContainingMapCalledEntry { - entry: MessageContainingMapCalledEntry.Entry; + entry: Record< + string, + MessageContainingMapCalledEntry.Entry[\\"value\\"] | undefined + >; } declare namespace MessageContainingMapCalledEntry { - export type Entry = Record; + interface Entry { + key: number; + value: number; + } } export interface TestRecursiveMapMessage { - a: TestRecursiveMapMessage.A; + a: Record; } declare namespace TestRecursiveMapMessage { - export type A = Record; + interface A { + key: string; + value: TestRecursiveMapMessage; + } } //========================================// @@ -78549,9 +78470,9 @@ export const TestMap = { if (msg.mapInt32Int32) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Int32._writeMessage ); @@ -78559,9 +78480,9 @@ export const TestMap = { if (msg.mapInt64Int64) { writer.writeRepeatedMessage( 2, - Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt64Int64._writeMessage ); @@ -78569,9 +78490,9 @@ export const TestMap = { if (msg.mapUint32Uint32) { writer.writeRepeatedMessage( 3, - Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapUint32Uint32._writeMessage ); @@ -78579,9 +78500,9 @@ export const TestMap = { if (msg.mapUint64Uint64) { writer.writeRepeatedMessage( 4, - Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapUint64Uint64._writeMessage ); @@ -78589,9 +78510,9 @@ export const TestMap = { if (msg.mapSint32Sint32) { writer.writeRepeatedMessage( 5, - Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSint32Sint32._writeMessage ); @@ -78599,9 +78520,9 @@ export const TestMap = { if (msg.mapSint64Sint64) { writer.writeRepeatedMessage( 6, - Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSint64Sint64._writeMessage ); @@ -78609,9 +78530,9 @@ export const TestMap = { if (msg.mapFixed32Fixed32) { writer.writeRepeatedMessage( 7, - Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapFixed32Fixed32._writeMessage ); @@ -78619,9 +78540,9 @@ export const TestMap = { if (msg.mapFixed64Fixed64) { writer.writeRepeatedMessage( 8, - Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapFixed64Fixed64._writeMessage ); @@ -78629,9 +78550,9 @@ export const TestMap = { if (msg.mapSfixed32Sfixed32) { writer.writeRepeatedMessage( 9, - Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSfixed32Sfixed32._writeMessage ); @@ -78639,9 +78560,9 @@ export const TestMap = { if (msg.mapSfixed64Sfixed64) { writer.writeRepeatedMessage( 10, - Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSfixed64Sfixed64._writeMessage ); @@ -78649,9 +78570,9 @@ export const TestMap = { if (msg.mapInt32Float) { writer.writeRepeatedMessage( 11, - Object.entries(msg.mapInt32Float).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Float._writeMessage ); @@ -78659,9 +78580,9 @@ export const TestMap = { if (msg.mapInt32Double) { writer.writeRepeatedMessage( 12, - Object.entries(msg.mapInt32Double).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Double._writeMessage ); @@ -78669,9 +78590,9 @@ export const TestMap = { if (msg.mapBoolBool) { writer.writeRepeatedMessage( 13, - Object.entries(msg.mapBoolBool).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapBoolBool._writeMessage ); @@ -78679,9 +78600,9 @@ export const TestMap = { if (msg.mapStringString) { writer.writeRepeatedMessage( 14, - Object.entries(msg.mapStringString).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapStringString._writeMessage ); @@ -78689,9 +78610,9 @@ export const TestMap = { if (msg.mapInt32Bytes) { writer.writeRepeatedMessage( 15, - Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Bytes._writeMessage ); @@ -78699,9 +78620,9 @@ export const TestMap = { if (msg.mapInt32Enum) { writer.writeRepeatedMessage( 16, - Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Enum._writeMessage ); @@ -78709,9 +78630,9 @@ export const TestMap = { if (msg.mapInt32ForeignMessage) { writer.writeRepeatedMessage( 17, - Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32ForeignMessage._writeMessage ); @@ -78719,18 +78640,19 @@ export const TestMap = { if (msg.mapStringForeignMessage) { writer.writeRepeatedMessage( 18, - Object.entries(msg.mapStringForeignMessage).map( - ([key, value]) => ({ key: key, value: value }) - ) as any, + Object.entries(msg.mapStringForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, TestMap.MapStringForeignMessage._writeMessage ); } if (msg.mapInt32AllTypes) { writer.writeRepeatedMessage( 19, - Object.entries(msg.mapInt32AllTypes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32AllTypes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32AllTypes._writeMessage ); @@ -78745,8 +78667,8 @@ export const TestMap = { const json: Record = {}; if (msg.mapInt32Int32) { const mapInt32Int32 = Object.fromEntries( - Object.entries(msg.mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Int32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78756,8 +78678,8 @@ export const TestMap = { } if (msg.mapInt64Int64) { const mapInt64Int64 = Object.fromEntries( - Object.entries(msg.mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt64Int64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78767,8 +78689,8 @@ export const TestMap = { } if (msg.mapUint32Uint32) { const mapUint32Uint32 = Object.fromEntries( - Object.entries(msg.mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint32Uint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78778,8 +78700,8 @@ export const TestMap = { } if (msg.mapUint64Uint64) { const mapUint64Uint64 = Object.fromEntries( - Object.entries(msg.mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint64Uint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78789,8 +78711,8 @@ export const TestMap = { } if (msg.mapSint32Sint32) { const mapSint32Sint32 = Object.fromEntries( - Object.entries(msg.mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint32Sint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78800,8 +78722,8 @@ export const TestMap = { } if (msg.mapSint64Sint64) { const mapSint64Sint64 = Object.fromEntries( - Object.entries(msg.mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint64Sint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78811,8 +78733,8 @@ export const TestMap = { } if (msg.mapFixed32Fixed32) { const mapFixed32Fixed32 = Object.fromEntries( - Object.entries(msg.mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed32Fixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78822,8 +78744,8 @@ export const TestMap = { } if (msg.mapFixed64Fixed64) { const mapFixed64Fixed64 = Object.fromEntries( - Object.entries(msg.mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed64Fixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78833,8 +78755,8 @@ export const TestMap = { } if (msg.mapSfixed32Sfixed32) { const mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(msg.mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed32Sfixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78844,8 +78766,8 @@ export const TestMap = { } if (msg.mapSfixed64Sfixed64) { const mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(msg.mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed64Sfixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78855,8 +78777,8 @@ export const TestMap = { } if (msg.mapInt32Float) { const mapInt32Float = Object.fromEntries( - Object.entries(msg.mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Float._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78866,8 +78788,8 @@ export const TestMap = { } if (msg.mapInt32Double) { const mapInt32Double = Object.fromEntries( - Object.entries(msg.mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Double._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78877,8 +78799,8 @@ export const TestMap = { } if (msg.mapBoolBool) { const mapBoolBool = Object.fromEntries( - Object.entries(msg.mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapBoolBool._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78888,8 +78810,8 @@ export const TestMap = { } if (msg.mapStringString) { const mapStringString = Object.fromEntries( - Object.entries(msg.mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringString._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78899,8 +78821,8 @@ export const TestMap = { } if (msg.mapInt32Bytes) { const mapInt32Bytes = Object.fromEntries( - Object.entries(msg.mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Bytes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78910,8 +78832,8 @@ export const TestMap = { } if (msg.mapInt32Enum) { const mapInt32Enum = Object.fromEntries( - Object.entries(msg.mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Enum._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78921,8 +78843,8 @@ export const TestMap = { } if (msg.mapInt32ForeignMessage) { const mapInt32ForeignMessage = Object.fromEntries( - Object.entries(msg.mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32ForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78932,8 +78854,8 @@ export const TestMap = { } if (msg.mapStringForeignMessage) { const mapStringForeignMessage = Object.fromEntries( - Object.entries(msg.mapStringForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78943,8 +78865,8 @@ export const TestMap = { } if (msg.mapInt32AllTypes) { const mapInt32AllTypes = Object.fromEntries( - Object.entries(msg.mapInt32AllTypes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32AllTypes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32AllTypes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -78963,166 +78885,117 @@ export const TestMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {} as MapMessage; - reader.readMessage(mapInt32Int32, TestMap.MapInt32Int32._readMessage); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {} as TestMap.MapInt32Int32; + reader.readMessage(map, TestMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {} as MapMessage; - reader.readMessage(mapInt64Int64, TestMap.MapInt64Int64._readMessage); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {} as TestMap.MapInt64Int64; + reader.readMessage(map, TestMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {} as MapMessage; - reader.readMessage( - mapUint32Uint32, - TestMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {} as TestMap.MapUint32Uint32; + reader.readMessage(map, TestMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {} as MapMessage; - reader.readMessage( - mapUint64Uint64, - TestMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {} as TestMap.MapUint64Uint64; + reader.readMessage(map, TestMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {} as MapMessage; - reader.readMessage( - mapSint32Sint32, - TestMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {} as TestMap.MapSint32Sint32; + reader.readMessage(map, TestMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {} as MapMessage; - reader.readMessage( - mapSint64Sint64, - TestMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {} as TestMap.MapSint64Sint64; + reader.readMessage(map, TestMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {} as MapMessage; - reader.readMessage( - mapFixed32Fixed32, - TestMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {} as TestMap.MapFixed32Fixed32; + reader.readMessage(map, TestMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {} as MapMessage; - reader.readMessage( - mapFixed64Fixed64, - TestMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {} as TestMap.MapFixed64Fixed64; + reader.readMessage(map, TestMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = - {} as MapMessage; - reader.readMessage( - mapSfixed32Sfixed32, - TestMap.MapSfixed32Sfixed32._readMessage - ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + const map = {} as TestMap.MapSfixed32Sfixed32; + reader.readMessage(map, TestMap.MapSfixed32Sfixed32._readMessage); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = - {} as MapMessage; - reader.readMessage( - mapSfixed64Sfixed64, - TestMap.MapSfixed64Sfixed64._readMessage - ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + const map = {} as TestMap.MapSfixed64Sfixed64; + reader.readMessage(map, TestMap.MapSfixed64Sfixed64._readMessage); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {} as MapMessage; - reader.readMessage(mapInt32Float, TestMap.MapInt32Float._readMessage); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {} as TestMap.MapInt32Float; + reader.readMessage(map, TestMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {} as MapMessage; - reader.readMessage( - mapInt32Double, - TestMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {} as TestMap.MapInt32Double; + reader.readMessage(map, TestMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {} as MapMessage; - reader.readMessage(mapBoolBool, TestMap.MapBoolBool._readMessage); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {} as TestMap.MapBoolBool; + reader.readMessage(map, TestMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {} as MapMessage; - reader.readMessage( - mapStringString, - TestMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {} as TestMap.MapStringString; + reader.readMessage(map, TestMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {} as MapMessage; - reader.readMessage(mapInt32Bytes, TestMap.MapInt32Bytes._readMessage); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {} as TestMap.MapInt32Bytes; + reader.readMessage(map, TestMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {} as MapMessage; - reader.readMessage(mapInt32Enum, TestMap.MapInt32Enum._readMessage); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {} as TestMap.MapInt32Enum; + reader.readMessage(map, TestMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = - {} as MapMessage; - reader.readMessage( - mapInt32ForeignMessage, - TestMap.MapInt32ForeignMessage._readMessage - ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + const map = {} as TestMap.MapInt32ForeignMessage; + reader.readMessage(map, TestMap.MapInt32ForeignMessage._readMessage); + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } case 18: { - const mapStringForeignMessage = - {} as MapMessage; - reader.readMessage( - mapStringForeignMessage, - TestMap.MapStringForeignMessage._readMessage - ); - msg.mapStringForeignMessage[mapStringForeignMessage.key] = - mapStringForeignMessage.value; + const map = {} as TestMap.MapStringForeignMessage; + reader.readMessage(map, TestMap.MapStringForeignMessage._readMessage); + msg.mapStringForeignMessage[map.key.toString()] = map.value; break; } case 19: { - const mapInt32AllTypes = {} as MapMessage; - reader.readMessage( - mapInt32AllTypes, - TestMap.MapInt32AllTypes._readMessage - ); - msg.mapInt32AllTypes[mapInt32AllTypes.key] = mapInt32AllTypes.value; + const map = {} as TestMap.MapInt32AllTypes; + reader.readMessage(map, TestMap.MapInt32AllTypes._readMessage); + msg.mapInt32AllTypes[map.key.toString()] = map.value; break; } default: { @@ -79141,8 +79014,8 @@ export const TestMap = { const _mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (_mapInt32Int32) { msg.mapInt32Int32 = Object.fromEntries( - Object.entries(_mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Int32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79150,8 +79023,8 @@ export const TestMap = { const _mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (_mapInt64Int64) { msg.mapInt64Int64 = Object.fromEntries( - Object.entries(_mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt64Int64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79159,8 +79032,8 @@ export const TestMap = { const _mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (_mapUint32Uint32) { msg.mapUint32Uint32 = Object.fromEntries( - Object.entries(_mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint32Uint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79168,8 +79041,8 @@ export const TestMap = { const _mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (_mapUint64Uint64) { msg.mapUint64Uint64 = Object.fromEntries( - Object.entries(_mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint64Uint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79177,8 +79050,8 @@ export const TestMap = { const _mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (_mapSint32Sint32) { msg.mapSint32Sint32 = Object.fromEntries( - Object.entries(_mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint32Sint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79186,8 +79059,8 @@ export const TestMap = { const _mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (_mapSint64Sint64) { msg.mapSint64Sint64 = Object.fromEntries( - Object.entries(_mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint64Sint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79196,8 +79069,8 @@ export const TestMap = { json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (_mapFixed32Fixed32) { msg.mapFixed32Fixed32 = Object.fromEntries( - Object.entries(_mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed32Fixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79206,8 +79079,8 @@ export const TestMap = { json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (_mapFixed64Fixed64) { msg.mapFixed64Fixed64 = Object.fromEntries( - Object.entries(_mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed64Fixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79216,8 +79089,8 @@ export const TestMap = { json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (_mapSfixed32Sfixed32) { msg.mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(_mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed32Sfixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79226,8 +79099,8 @@ export const TestMap = { json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (_mapSfixed64Sfixed64) { msg.mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(_mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed64Sfixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79235,8 +79108,8 @@ export const TestMap = { const _mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (_mapInt32Float) { msg.mapInt32Float = Object.fromEntries( - Object.entries(_mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Float._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79244,8 +79117,8 @@ export const TestMap = { const _mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (_mapInt32Double) { msg.mapInt32Double = Object.fromEntries( - Object.entries(_mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Double._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79253,8 +79126,8 @@ export const TestMap = { const _mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (_mapBoolBool) { msg.mapBoolBool = Object.fromEntries( - Object.entries(_mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapBoolBool._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79262,8 +79135,8 @@ export const TestMap = { const _mapStringString = json.mapStringString ?? json.map_string_string; if (_mapStringString) { msg.mapStringString = Object.fromEntries( - Object.entries(_mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringString._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79271,8 +79144,8 @@ export const TestMap = { const _mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (_mapInt32Bytes) { msg.mapInt32Bytes = Object.fromEntries( - Object.entries(_mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Bytes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79280,8 +79153,8 @@ export const TestMap = { const _mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (_mapInt32Enum) { msg.mapInt32Enum = Object.fromEntries( - Object.entries(_mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Enum._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79290,8 +79163,8 @@ export const TestMap = { json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (_mapInt32ForeignMessage) { msg.mapInt32ForeignMessage = Object.fromEntries( - Object.entries(_mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32ForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79300,8 +79173,8 @@ export const TestMap = { json.mapStringForeignMessage ?? json.map_string_foreign_message; if (_mapStringForeignMessage) { msg.mapStringForeignMessage = Object.fromEntries( - Object.entries(_mapStringForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79309,8 +79182,8 @@ export const TestMap = { const _mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (_mapInt32AllTypes) { msg.mapInt32AllTypes = Object.fromEntries( - Object.entries(_mapInt32AllTypes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32AllTypes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32AllTypes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -79323,7 +79196,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -79339,7 +79212,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79355,9 +79228,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Int32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Int32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79382,9 +79255,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Int32, json: any - ): MapMessage { + ): TestMap.MapInt32Int32 { const _key = json.key; if (_key) { msg.key = _key; @@ -79402,14 +79275,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeInt64String(1, msg.key.toString()); + writer.writeInt64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -79418,7 +79291,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79434,9 +79307,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt64Int64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt64Int64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79461,9 +79334,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt64Int64, json: any - ): MapMessage { + ): TestMap.MapInt64Int64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -79481,7 +79354,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -79497,7 +79370,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79513,9 +79386,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapUint32Uint32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapUint32Uint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79540,9 +79413,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapUint32Uint32, json: any - ): MapMessage { + ): TestMap.MapUint32Uint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -79560,14 +79433,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeUint64String(1, msg.key.toString()); + writer.writeUint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeUint64String(2, msg.value.toString()); + writer.writeUint64String(2, msg.value.toString() as any); } return writer; }, @@ -79576,7 +79449,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79592,9 +79465,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapUint64Uint64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapUint64Uint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79619,9 +79492,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapUint64Uint64, json: any - ): MapMessage { + ): TestMap.MapUint64Uint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -79639,7 +79512,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -79655,7 +79528,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79671,9 +79544,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSint32Sint32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSint32Sint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79698,9 +79571,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSint32Sint32, json: any - ): MapMessage { + ): TestMap.MapSint32Sint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -79718,14 +79591,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSint64String(1, msg.key.toString()); + writer.writeSint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSint64String(2, msg.value.toString()); + writer.writeSint64String(2, msg.value.toString() as any); } return writer; }, @@ -79734,7 +79607,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79750,9 +79623,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSint64Sint64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSint64Sint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79777,9 +79650,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSint64Sint64, json: any - ): MapMessage { + ): TestMap.MapSint64Sint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -79797,7 +79670,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -79813,7 +79686,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79829,9 +79702,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapFixed32Fixed32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapFixed32Fixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79856,9 +79729,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapFixed32Fixed32, json: any - ): MapMessage { + ): TestMap.MapFixed32Fixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -79876,14 +79749,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeFixed64String(1, msg.key.toString()); + writer.writeFixed64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeFixed64String(2, msg.value.toString()); + writer.writeFixed64String(2, msg.value.toString() as any); } return writer; }, @@ -79892,7 +79765,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79908,9 +79781,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapFixed64Fixed64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapFixed64Fixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -79935,9 +79808,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapFixed64Fixed64, json: any - ): MapMessage { + ): TestMap.MapFixed64Fixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -79955,7 +79828,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -79971,7 +79844,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -79987,9 +79860,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSfixed32Sfixed32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSfixed32Sfixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80014,9 +79887,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSfixed32Sfixed32, json: any - ): MapMessage { + ): TestMap.MapSfixed32Sfixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -80034,14 +79907,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSfixed64(1, msg.key.toString()); + writer.writeSfixed64(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSfixed64(2, msg.value.toString()); + writer.writeSfixed64(2, msg.value.toString() as any); } return writer; }, @@ -80050,7 +79923,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80066,9 +79939,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSfixed64Sfixed64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSfixed64Sfixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80093,9 +79966,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSfixed64Sfixed64, json: any - ): MapMessage { + ): TestMap.MapSfixed64Sfixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -80113,7 +79986,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80129,7 +80002,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80145,9 +80018,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Float, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Float { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80172,9 +80045,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Float, json: any - ): MapMessage { + ): TestMap.MapInt32Float { const _key = json.key; if (_key) { msg.key = _key; @@ -80192,7 +80065,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80208,7 +80081,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80224,9 +80097,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Double, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Double { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80251,9 +80124,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Double, json: any - ): MapMessage { + ): TestMap.MapInt32Double { const _key = json.key; if (_key) { msg.key = _key; @@ -80271,7 +80144,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80287,7 +80160,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80303,9 +80176,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapBoolBool, reader: BinaryReader - ): MapMessage { + ): TestMap.MapBoolBool { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80330,9 +80203,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapBoolBool, json: any - ): MapMessage { + ): TestMap.MapBoolBool { const _key = json.key; if (_key) { msg.key = _key; @@ -80350,7 +80223,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80366,7 +80239,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80382,9 +80255,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapStringString, reader: BinaryReader - ): MapMessage { + ): TestMap.MapStringString { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80409,9 +80282,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapStringString, json: any - ): MapMessage { + ): TestMap.MapStringString { const _key = json.key; if (_key) { msg.key = _key; @@ -80429,7 +80302,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80445,7 +80318,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80461,9 +80334,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Bytes, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Bytes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80488,9 +80361,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Bytes, json: any - ): MapMessage { + ): TestMap.MapInt32Bytes { const _key = json.key; if (_key) { msg.key = _key; @@ -80508,7 +80381,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80524,7 +80397,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80540,9 +80413,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Enum, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Enum { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80567,9 +80440,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Enum, json: any - ): MapMessage { + ): TestMap.MapInt32Enum { const _key = json.key; if (_key) { msg.key = _key; @@ -80587,7 +80460,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80603,7 +80476,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80622,9 +80495,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32ForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32ForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80652,9 +80525,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32ForeignMessage, json: any - ): MapMessage { + ): TestMap.MapInt32ForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -80674,7 +80547,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80690,7 +80563,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80709,9 +80582,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapStringForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestMap.MapStringForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80739,9 +80612,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapStringForeignMessage, json: any - ): MapMessage { + ): TestMap.MapStringForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -80761,7 +80634,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -80777,7 +80650,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -80796,9 +80669,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32AllTypes, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32AllTypes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -80826,9 +80699,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32AllTypes, json: any - ): MapMessage { + ): TestMap.MapInt32AllTypes { const _key = json.key; if (_key) { msg.key = _key; @@ -81017,9 +80890,9 @@ export const TestMessageMap = { if (msg.mapInt32Message) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Message).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Message).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMessageMap.MapInt32Message._writeMessage ); @@ -81036,8 +80909,8 @@ export const TestMessageMap = { const json: Record = {}; if (msg.mapInt32Message) { const mapInt32Message = Object.fromEntries( - Object.entries(msg.mapInt32Message) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Message) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMessageMap.MapInt32Message._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81059,13 +80932,9 @@ export const TestMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Message = - {} as MapMessage; - reader.readMessage( - mapInt32Message, - TestMessageMap.MapInt32Message._readMessage - ); - msg.mapInt32Message[mapInt32Message.key] = mapInt32Message.value; + const map = {} as TestMessageMap.MapInt32Message; + reader.readMessage(map, TestMessageMap.MapInt32Message._readMessage); + msg.mapInt32Message[map.key.toString()] = map.value; break; } default: { @@ -81084,8 +80953,8 @@ export const TestMessageMap = { const _mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (_mapInt32Message) { msg.mapInt32Message = Object.fromEntries( - Object.entries(_mapInt32Message) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Message) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMessageMap.MapInt32Message._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81098,7 +80967,7 @@ export const TestMessageMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -81114,7 +80983,7 @@ export const TestMessageMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -81133,9 +81002,9 @@ export const TestMessageMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMessageMap.MapInt32Message, reader: BinaryReader - ): MapMessage { + ): TestMessageMap.MapInt32Message { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -81163,9 +81032,9 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMessageMap.MapInt32Message, json: any - ): MapMessage { + ): TestMessageMap.MapInt32Message { const _key = json.key; if (_key) { msg.key = _key; @@ -81239,9 +81108,9 @@ export const TestSameTypeMap = { if (msg.map1) { writer.writeRepeatedMessage( 1, - Object.entries(msg.map1).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.map1).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestSameTypeMap.Map1._writeMessage ); @@ -81249,9 +81118,9 @@ export const TestSameTypeMap = { if (msg.map2) { writer.writeRepeatedMessage( 2, - Object.entries(msg.map2).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.map2).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestSameTypeMap.Map2._writeMessage ); @@ -81268,8 +81137,8 @@ export const TestSameTypeMap = { const json: Record = {}; if (msg.map1) { const map1 = Object.fromEntries( - Object.entries(msg.map1) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.map1) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map1._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81279,8 +81148,8 @@ export const TestSameTypeMap = { } if (msg.map2) { const map2 = Object.fromEntries( - Object.entries(msg.map2) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.map2) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map2._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81302,15 +81171,15 @@ export const TestSameTypeMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const map1 = {} as MapMessage; - reader.readMessage(map1, TestSameTypeMap.Map1._readMessage); - msg.map1[map1.key] = map1.value; + const map = {} as TestSameTypeMap.Map1; + reader.readMessage(map, TestSameTypeMap.Map1._readMessage); + msg.map1[map.key.toString()] = map.value; break; } case 2: { - const map2 = {} as MapMessage; - reader.readMessage(map2, TestSameTypeMap.Map2._readMessage); - msg.map2[map2.key] = map2.value; + const map = {} as TestSameTypeMap.Map2; + reader.readMessage(map, TestSameTypeMap.Map2._readMessage); + msg.map2[map.key.toString()] = map.value; break; } default: { @@ -81332,8 +81201,8 @@ export const TestSameTypeMap = { const _map1 = json.map1; if (_map1) { msg.map1 = Object.fromEntries( - Object.entries(_map1) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_map1) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map1._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81341,8 +81210,8 @@ export const TestSameTypeMap = { const _map2 = json.map2; if (_map2) { msg.map2 = Object.fromEntries( - Object.entries(_map2) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_map2) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map2._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81355,7 +81224,7 @@ export const TestSameTypeMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -81371,7 +81240,7 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -81387,9 +81256,9 @@ export const TestSameTypeMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map1, reader: BinaryReader - ): MapMessage { + ): TestSameTypeMap.Map1 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -81414,9 +81283,9 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map1, json: any - ): MapMessage { + ): TestSameTypeMap.Map1 { const _key = json.key; if (_key) { msg.key = _key; @@ -81434,7 +81303,7 @@ export const TestSameTypeMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -81450,7 +81319,7 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -81466,9 +81335,9 @@ export const TestSameTypeMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map2, reader: BinaryReader - ): MapMessage { + ): TestSameTypeMap.Map2 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -81493,9 +81362,9 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map2, json: any - ): MapMessage { + ): TestSameTypeMap.Map2 { const _key = json.key; if (_key) { msg.key = _key; @@ -81566,9 +81435,9 @@ export const TestRequiredMessageMap = { if (msg.mapField) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestRequiredMessageMap.MapField._writeMessage ); @@ -81585,8 +81454,8 @@ export const TestRequiredMessageMap = { const json: Record = {}; if (msg.mapField) { const mapField = Object.fromEntries( - Object.entries(msg.mapField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRequiredMessageMap.MapField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81608,12 +81477,9 @@ export const TestRequiredMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapField = {} as MapMessage; - reader.readMessage( - mapField, - TestRequiredMessageMap.MapField._readMessage - ); - msg.mapField[mapField.key] = mapField.value; + const map = {} as TestRequiredMessageMap.MapField; + reader.readMessage(map, TestRequiredMessageMap.MapField._readMessage); + msg.mapField[map.key.toString()] = map.value; break; } default: { @@ -81635,8 +81501,8 @@ export const TestRequiredMessageMap = { const _mapField = json.mapField ?? json.map_field; if (_mapField) { msg.mapField = Object.fromEntries( - Object.entries(_mapField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRequiredMessageMap.MapField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81649,7 +81515,7 @@ export const TestRequiredMessageMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -81665,7 +81531,7 @@ export const TestRequiredMessageMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -81684,9 +81550,9 @@ export const TestRequiredMessageMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestRequiredMessageMap.MapField, reader: BinaryReader - ): MapMessage { + ): TestRequiredMessageMap.MapField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -81714,9 +81580,9 @@ export const TestRequiredMessageMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestRequiredMessageMap.MapField, json: any - ): MapMessage { + ): TestRequiredMessageMap.MapField { const _key = json.key; if (_key) { msg.key = _key; @@ -81805,9 +81671,9 @@ export const TestArenaMap = { if (msg.mapInt32Int32) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Int32._writeMessage ); @@ -81815,9 +81681,9 @@ export const TestArenaMap = { if (msg.mapInt64Int64) { writer.writeRepeatedMessage( 2, - Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt64Int64._writeMessage ); @@ -81825,9 +81691,9 @@ export const TestArenaMap = { if (msg.mapUint32Uint32) { writer.writeRepeatedMessage( 3, - Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapUint32Uint32._writeMessage ); @@ -81835,9 +81701,9 @@ export const TestArenaMap = { if (msg.mapUint64Uint64) { writer.writeRepeatedMessage( 4, - Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapUint64Uint64._writeMessage ); @@ -81845,9 +81711,9 @@ export const TestArenaMap = { if (msg.mapSint32Sint32) { writer.writeRepeatedMessage( 5, - Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSint32Sint32._writeMessage ); @@ -81855,9 +81721,9 @@ export const TestArenaMap = { if (msg.mapSint64Sint64) { writer.writeRepeatedMessage( 6, - Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSint64Sint64._writeMessage ); @@ -81865,9 +81731,9 @@ export const TestArenaMap = { if (msg.mapFixed32Fixed32) { writer.writeRepeatedMessage( 7, - Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapFixed32Fixed32._writeMessage ); @@ -81875,9 +81741,9 @@ export const TestArenaMap = { if (msg.mapFixed64Fixed64) { writer.writeRepeatedMessage( 8, - Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapFixed64Fixed64._writeMessage ); @@ -81885,9 +81751,9 @@ export const TestArenaMap = { if (msg.mapSfixed32Sfixed32) { writer.writeRepeatedMessage( 9, - Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSfixed32Sfixed32._writeMessage ); @@ -81895,9 +81761,9 @@ export const TestArenaMap = { if (msg.mapSfixed64Sfixed64) { writer.writeRepeatedMessage( 10, - Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSfixed64Sfixed64._writeMessage ); @@ -81905,9 +81771,9 @@ export const TestArenaMap = { if (msg.mapInt32Float) { writer.writeRepeatedMessage( 11, - Object.entries(msg.mapInt32Float).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Float._writeMessage ); @@ -81915,9 +81781,9 @@ export const TestArenaMap = { if (msg.mapInt32Double) { writer.writeRepeatedMessage( 12, - Object.entries(msg.mapInt32Double).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Double._writeMessage ); @@ -81925,9 +81791,9 @@ export const TestArenaMap = { if (msg.mapBoolBool) { writer.writeRepeatedMessage( 13, - Object.entries(msg.mapBoolBool).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapBoolBool._writeMessage ); @@ -81935,9 +81801,9 @@ export const TestArenaMap = { if (msg.mapStringString) { writer.writeRepeatedMessage( 14, - Object.entries(msg.mapStringString).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapStringString._writeMessage ); @@ -81945,9 +81811,9 @@ export const TestArenaMap = { if (msg.mapInt32Bytes) { writer.writeRepeatedMessage( 15, - Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Bytes._writeMessage ); @@ -81955,9 +81821,9 @@ export const TestArenaMap = { if (msg.mapInt32Enum) { writer.writeRepeatedMessage( 16, - Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Enum._writeMessage ); @@ -81965,9 +81831,9 @@ export const TestArenaMap = { if (msg.mapInt32ForeignMessage) { writer.writeRepeatedMessage( 17, - Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32ForeignMessage._writeMessage ); @@ -81984,8 +81850,8 @@ export const TestArenaMap = { const json: Record = {}; if (msg.mapInt32Int32) { const mapInt32Int32 = Object.fromEntries( - Object.entries(msg.mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Int32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -81995,8 +81861,8 @@ export const TestArenaMap = { } if (msg.mapInt64Int64) { const mapInt64Int64 = Object.fromEntries( - Object.entries(msg.mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt64Int64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82006,8 +81872,8 @@ export const TestArenaMap = { } if (msg.mapUint32Uint32) { const mapUint32Uint32 = Object.fromEntries( - Object.entries(msg.mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint32Uint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82017,8 +81883,8 @@ export const TestArenaMap = { } if (msg.mapUint64Uint64) { const mapUint64Uint64 = Object.fromEntries( - Object.entries(msg.mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint64Uint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82028,8 +81894,8 @@ export const TestArenaMap = { } if (msg.mapSint32Sint32) { const mapSint32Sint32 = Object.fromEntries( - Object.entries(msg.mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint32Sint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82039,8 +81905,8 @@ export const TestArenaMap = { } if (msg.mapSint64Sint64) { const mapSint64Sint64 = Object.fromEntries( - Object.entries(msg.mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint64Sint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82050,8 +81916,8 @@ export const TestArenaMap = { } if (msg.mapFixed32Fixed32) { const mapFixed32Fixed32 = Object.fromEntries( - Object.entries(msg.mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed32Fixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82061,8 +81927,8 @@ export const TestArenaMap = { } if (msg.mapFixed64Fixed64) { const mapFixed64Fixed64 = Object.fromEntries( - Object.entries(msg.mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed64Fixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82072,8 +81938,8 @@ export const TestArenaMap = { } if (msg.mapSfixed32Sfixed32) { const mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(msg.mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed32Sfixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82083,8 +81949,8 @@ export const TestArenaMap = { } if (msg.mapSfixed64Sfixed64) { const mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(msg.mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed64Sfixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82094,8 +81960,8 @@ export const TestArenaMap = { } if (msg.mapInt32Float) { const mapInt32Float = Object.fromEntries( - Object.entries(msg.mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Float._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82105,8 +81971,8 @@ export const TestArenaMap = { } if (msg.mapInt32Double) { const mapInt32Double = Object.fromEntries( - Object.entries(msg.mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Double._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82116,8 +81982,8 @@ export const TestArenaMap = { } if (msg.mapBoolBool) { const mapBoolBool = Object.fromEntries( - Object.entries(msg.mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapBoolBool._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82127,8 +81993,8 @@ export const TestArenaMap = { } if (msg.mapStringString) { const mapStringString = Object.fromEntries( - Object.entries(msg.mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapStringString._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82138,8 +82004,8 @@ export const TestArenaMap = { } if (msg.mapInt32Bytes) { const mapInt32Bytes = Object.fromEntries( - Object.entries(msg.mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Bytes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82149,8 +82015,8 @@ export const TestArenaMap = { } if (msg.mapInt32Enum) { const mapInt32Enum = Object.fromEntries( - Object.entries(msg.mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Enum._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82160,8 +82026,8 @@ export const TestArenaMap = { } if (msg.mapInt32ForeignMessage) { const mapInt32ForeignMessage = Object.fromEntries( - Object.entries(msg.mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32ForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82183,171 +82049,114 @@ export const TestArenaMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {} as MapMessage; - reader.readMessage( - mapInt32Int32, - TestArenaMap.MapInt32Int32._readMessage - ); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {} as TestArenaMap.MapInt32Int32; + reader.readMessage(map, TestArenaMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {} as MapMessage; - reader.readMessage( - mapInt64Int64, - TestArenaMap.MapInt64Int64._readMessage - ); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {} as TestArenaMap.MapInt64Int64; + reader.readMessage(map, TestArenaMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = - {} as MapMessage; - reader.readMessage( - mapUint32Uint32, - TestArenaMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {} as TestArenaMap.MapUint32Uint32; + reader.readMessage(map, TestArenaMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = - {} as MapMessage; - reader.readMessage( - mapUint64Uint64, - TestArenaMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {} as TestArenaMap.MapUint64Uint64; + reader.readMessage(map, TestArenaMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = - {} as MapMessage; - reader.readMessage( - mapSint32Sint32, - TestArenaMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {} as TestArenaMap.MapSint32Sint32; + reader.readMessage(map, TestArenaMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = - {} as MapMessage; - reader.readMessage( - mapSint64Sint64, - TestArenaMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {} as TestArenaMap.MapSint64Sint64; + reader.readMessage(map, TestArenaMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = - {} as MapMessage; - reader.readMessage( - mapFixed32Fixed32, - TestArenaMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {} as TestArenaMap.MapFixed32Fixed32; + reader.readMessage(map, TestArenaMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = - {} as MapMessage; - reader.readMessage( - mapFixed64Fixed64, - TestArenaMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {} as TestArenaMap.MapFixed64Fixed64; + reader.readMessage(map, TestArenaMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = - {} as MapMessage; + const map = {} as TestArenaMap.MapSfixed32Sfixed32; reader.readMessage( - mapSfixed32Sfixed32, + map, TestArenaMap.MapSfixed32Sfixed32._readMessage ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = - {} as MapMessage; + const map = {} as TestArenaMap.MapSfixed64Sfixed64; reader.readMessage( - mapSfixed64Sfixed64, + map, TestArenaMap.MapSfixed64Sfixed64._readMessage ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {} as MapMessage; - reader.readMessage( - mapInt32Float, - TestArenaMap.MapInt32Float._readMessage - ); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {} as TestArenaMap.MapInt32Float; + reader.readMessage(map, TestArenaMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {} as MapMessage; - reader.readMessage( - mapInt32Double, - TestArenaMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {} as TestArenaMap.MapInt32Double; + reader.readMessage(map, TestArenaMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {} as MapMessage; - reader.readMessage( - mapBoolBool, - TestArenaMap.MapBoolBool._readMessage - ); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {} as TestArenaMap.MapBoolBool; + reader.readMessage(map, TestArenaMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = - {} as MapMessage; - reader.readMessage( - mapStringString, - TestArenaMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {} as TestArenaMap.MapStringString; + reader.readMessage(map, TestArenaMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {} as MapMessage; - reader.readMessage( - mapInt32Bytes, - TestArenaMap.MapInt32Bytes._readMessage - ); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {} as TestArenaMap.MapInt32Bytes; + reader.readMessage(map, TestArenaMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {} as MapMessage; - reader.readMessage( - mapInt32Enum, - TestArenaMap.MapInt32Enum._readMessage - ); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {} as TestArenaMap.MapInt32Enum; + reader.readMessage(map, TestArenaMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = - {} as MapMessage; + const map = {} as TestArenaMap.MapInt32ForeignMessage; reader.readMessage( - mapInt32ForeignMessage, + map, TestArenaMap.MapInt32ForeignMessage._readMessage ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } default: { @@ -82366,8 +82175,8 @@ export const TestArenaMap = { const _mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (_mapInt32Int32) { msg.mapInt32Int32 = Object.fromEntries( - Object.entries(_mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Int32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82375,8 +82184,8 @@ export const TestArenaMap = { const _mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (_mapInt64Int64) { msg.mapInt64Int64 = Object.fromEntries( - Object.entries(_mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt64Int64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82384,8 +82193,8 @@ export const TestArenaMap = { const _mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (_mapUint32Uint32) { msg.mapUint32Uint32 = Object.fromEntries( - Object.entries(_mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint32Uint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82393,8 +82202,8 @@ export const TestArenaMap = { const _mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (_mapUint64Uint64) { msg.mapUint64Uint64 = Object.fromEntries( - Object.entries(_mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint64Uint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82402,8 +82211,8 @@ export const TestArenaMap = { const _mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (_mapSint32Sint32) { msg.mapSint32Sint32 = Object.fromEntries( - Object.entries(_mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint32Sint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82411,8 +82220,8 @@ export const TestArenaMap = { const _mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (_mapSint64Sint64) { msg.mapSint64Sint64 = Object.fromEntries( - Object.entries(_mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint64Sint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82421,8 +82230,8 @@ export const TestArenaMap = { json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (_mapFixed32Fixed32) { msg.mapFixed32Fixed32 = Object.fromEntries( - Object.entries(_mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed32Fixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82431,8 +82240,8 @@ export const TestArenaMap = { json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (_mapFixed64Fixed64) { msg.mapFixed64Fixed64 = Object.fromEntries( - Object.entries(_mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed64Fixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82441,8 +82250,8 @@ export const TestArenaMap = { json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (_mapSfixed32Sfixed32) { msg.mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(_mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed32Sfixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82451,8 +82260,8 @@ export const TestArenaMap = { json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (_mapSfixed64Sfixed64) { msg.mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(_mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed64Sfixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82460,8 +82269,8 @@ export const TestArenaMap = { const _mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (_mapInt32Float) { msg.mapInt32Float = Object.fromEntries( - Object.entries(_mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Float._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82469,8 +82278,8 @@ export const TestArenaMap = { const _mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (_mapInt32Double) { msg.mapInt32Double = Object.fromEntries( - Object.entries(_mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Double._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82478,8 +82287,8 @@ export const TestArenaMap = { const _mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (_mapBoolBool) { msg.mapBoolBool = Object.fromEntries( - Object.entries(_mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapBoolBool._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82487,8 +82296,8 @@ export const TestArenaMap = { const _mapStringString = json.mapStringString ?? json.map_string_string; if (_mapStringString) { msg.mapStringString = Object.fromEntries( - Object.entries(_mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapStringString._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82496,8 +82305,8 @@ export const TestArenaMap = { const _mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (_mapInt32Bytes) { msg.mapInt32Bytes = Object.fromEntries( - Object.entries(_mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Bytes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82505,8 +82314,8 @@ export const TestArenaMap = { const _mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (_mapInt32Enum) { msg.mapInt32Enum = Object.fromEntries( - Object.entries(_mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Enum._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82515,8 +82324,8 @@ export const TestArenaMap = { json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (_mapInt32ForeignMessage) { msg.mapInt32ForeignMessage = Object.fromEntries( - Object.entries(_mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32ForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -82529,7 +82338,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -82545,7 +82354,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82561,9 +82370,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Int32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Int32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82588,9 +82397,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Int32, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Int32 { const _key = json.key; if (_key) { msg.key = _key; @@ -82608,14 +82417,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeInt64String(1, msg.key.toString()); + writer.writeInt64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -82624,7 +82433,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82640,9 +82449,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt64Int64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt64Int64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82667,9 +82476,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt64Int64, json: any - ): MapMessage { + ): TestArenaMap.MapInt64Int64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -82687,7 +82496,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -82703,7 +82512,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82719,9 +82528,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint32Uint32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapUint32Uint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82746,9 +82555,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint32Uint32, json: any - ): MapMessage { + ): TestArenaMap.MapUint32Uint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -82766,14 +82575,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeUint64String(1, msg.key.toString()); + writer.writeUint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeUint64String(2, msg.value.toString()); + writer.writeUint64String(2, msg.value.toString() as any); } return writer; }, @@ -82782,7 +82591,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82798,9 +82607,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint64Uint64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapUint64Uint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82825,9 +82634,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint64Uint64, json: any - ): MapMessage { + ): TestArenaMap.MapUint64Uint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -82845,7 +82654,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -82861,7 +82670,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82877,9 +82686,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint32Sint32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSint32Sint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82904,9 +82713,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint32Sint32, json: any - ): MapMessage { + ): TestArenaMap.MapSint32Sint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -82924,14 +82733,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSint64String(1, msg.key.toString()); + writer.writeSint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSint64String(2, msg.value.toString()); + writer.writeSint64String(2, msg.value.toString() as any); } return writer; }, @@ -82940,7 +82749,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -82956,9 +82765,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint64Sint64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSint64Sint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -82983,9 +82792,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint64Sint64, json: any - ): MapMessage { + ): TestArenaMap.MapSint64Sint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -83003,7 +82812,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83019,7 +82828,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83035,9 +82844,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed32Fixed32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapFixed32Fixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83062,9 +82871,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed32Fixed32, json: any - ): MapMessage { + ): TestArenaMap.MapFixed32Fixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -83082,14 +82891,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeFixed64String(1, msg.key.toString()); + writer.writeFixed64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeFixed64String(2, msg.value.toString()); + writer.writeFixed64String(2, msg.value.toString() as any); } return writer; }, @@ -83098,7 +82907,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83114,9 +82923,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed64Fixed64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapFixed64Fixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83141,9 +82950,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed64Fixed64, json: any - ): MapMessage { + ): TestArenaMap.MapFixed64Fixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -83161,7 +82970,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83177,7 +82986,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83193,9 +83002,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed32Sfixed32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSfixed32Sfixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83220,9 +83029,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed32Sfixed32, json: any - ): MapMessage { + ): TestArenaMap.MapSfixed32Sfixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -83240,14 +83049,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSfixed64(1, msg.key.toString()); + writer.writeSfixed64(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSfixed64(2, msg.value.toString()); + writer.writeSfixed64(2, msg.value.toString() as any); } return writer; }, @@ -83256,7 +83065,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83272,9 +83081,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed64Sfixed64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSfixed64Sfixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83299,9 +83108,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed64Sfixed64, json: any - ): MapMessage { + ): TestArenaMap.MapSfixed64Sfixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -83319,7 +83128,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83335,7 +83144,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83351,9 +83160,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Float, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Float { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83378,9 +83187,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Float, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Float { const _key = json.key; if (_key) { msg.key = _key; @@ -83398,7 +83207,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83414,7 +83223,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83430,9 +83239,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Double, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Double { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83457,9 +83266,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Double, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Double { const _key = json.key; if (_key) { msg.key = _key; @@ -83477,7 +83286,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83493,7 +83302,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83509,9 +83318,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapBoolBool, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapBoolBool { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83536,9 +83345,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapBoolBool, json: any - ): MapMessage { + ): TestArenaMap.MapBoolBool { const _key = json.key; if (_key) { msg.key = _key; @@ -83556,7 +83365,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83572,7 +83381,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83588,9 +83397,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapStringString, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapStringString { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83615,9 +83424,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapStringString, json: any - ): MapMessage { + ): TestArenaMap.MapStringString { const _key = json.key; if (_key) { msg.key = _key; @@ -83635,7 +83444,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83651,7 +83460,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83667,9 +83476,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Bytes, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Bytes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83694,9 +83503,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Bytes, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Bytes { const _key = json.key; if (_key) { msg.key = _key; @@ -83714,7 +83523,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83730,7 +83539,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83746,9 +83555,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Enum, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Enum { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83773,9 +83582,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Enum, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Enum { const _key = json.key; if (_key) { msg.key = _key; @@ -83793,7 +83602,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -83809,7 +83618,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -83828,9 +83637,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32ForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32ForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -83858,9 +83667,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32ForeignMessage, json: any - ): MapMessage { + ): TestArenaMap.MapInt32ForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -83935,9 +83744,9 @@ export const MessageContainingMapCalledEntry = { if (msg.entry) { writer.writeRepeatedMessage( 1, - Object.entries(msg.entry).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.entry).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MessageContainingMapCalledEntry.Entry._writeMessage ); @@ -83954,8 +83763,8 @@ export const MessageContainingMapCalledEntry = { const json: Record = {}; if (msg.entry) { const entry = Object.fromEntries( - Object.entries(msg.entry) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.entry) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MessageContainingMapCalledEntry.Entry._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -83977,12 +83786,12 @@ export const MessageContainingMapCalledEntry = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const entry = {} as MapMessage; + const map = {} as MessageContainingMapCalledEntry.Entry; reader.readMessage( - entry, + map, MessageContainingMapCalledEntry.Entry._readMessage ); - msg.entry[entry.key] = entry.value; + msg.entry[map.key.toString()] = map.value; break; } default: { @@ -84004,8 +83813,8 @@ export const MessageContainingMapCalledEntry = { const _entry = json.entry; if (_entry) { msg.entry = Object.fromEntries( - Object.entries(_entry) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_entry) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MessageContainingMapCalledEntry.Entry._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -84018,7 +83827,7 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -84034,7 +83843,7 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -84050,9 +83859,9 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MessageContainingMapCalledEntry.Entry, reader: BinaryReader - ): MapMessage { + ): MessageContainingMapCalledEntry.Entry { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -84077,9 +83886,9 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MessageContainingMapCalledEntry.Entry, json: any - ): MapMessage { + ): MessageContainingMapCalledEntry.Entry { const _key = json.key; if (_key) { msg.key = _key; @@ -84150,9 +83959,9 @@ export const TestRecursiveMapMessage = { if (msg.a) { writer.writeRepeatedMessage( 1, - Object.entries(msg.a).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.a).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestRecursiveMapMessage.A._writeMessage ); @@ -84169,8 +83978,8 @@ export const TestRecursiveMapMessage = { const json: Record = {}; if (msg.a) { const a = Object.fromEntries( - Object.entries(msg.a) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.a) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRecursiveMapMessage.A._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -84192,9 +84001,9 @@ export const TestRecursiveMapMessage = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const a = {} as MapMessage; - reader.readMessage(a, TestRecursiveMapMessage.A._readMessage); - msg.a[a.key] = a.value; + const map = {} as TestRecursiveMapMessage.A; + reader.readMessage(map, TestRecursiveMapMessage.A._readMessage); + msg.a[map.key.toString()] = map.value; break; } default: { @@ -84216,8 +84025,8 @@ export const TestRecursiveMapMessage = { const _a = json.a; if (_a) { msg.a = Object.fromEntries( - Object.entries(_a) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_a) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRecursiveMapMessage.A._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -84230,7 +84039,7 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -84250,7 +84059,7 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -84269,9 +84078,9 @@ export const TestRecursiveMapMessage = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestRecursiveMapMessage.A, reader: BinaryReader - ): MapMessage { + ): TestRecursiveMapMessage.A { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -84299,9 +84108,9 @@ export const TestRecursiveMapMessage = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestRecursiveMapMessage.A, json: any - ): MapMessage { + ): TestRecursiveMapMessage.A { const _key = json.key; if (_key) { msg.key = _key; @@ -87010,7 +86819,7 @@ export const Duration = { writer: BinaryWriter ): BinaryWriter { if (msg.seconds) { - writer.writeInt64String(1, msg.seconds.toString()); + writer.writeInt64String(1, msg.seconds.toString() as any); } if (msg.nanos) { writer.writeInt32(2, msg.nanos); @@ -87541,7 +87350,7 @@ export const FieldMask = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/struct.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter } from \\"twirpscript\\"; //========================================// @@ -87570,11 +87379,14 @@ export interface Struct { /** * Unordered map of dynamically typed values. */ - fields: Struct.Fields; + fields: Record; } declare namespace Struct { - export type Fields = Record; + interface Fields { + key: string; + value: Value; + } } /** @@ -87711,9 +87523,9 @@ export const Struct = { if (msg.fields) { writer.writeRepeatedMessage( 1, - Object.entries(msg.fields).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fields).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, Struct.Fields._writeMessage ); @@ -87728,8 +87540,8 @@ export const Struct = { const json: Record = {}; if (msg.fields) { const fields = Object.fromEntries( - Object.entries(msg.fields) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fields) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Struct.Fields._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -87748,9 +87560,9 @@ export const Struct = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const fields = {} as MapMessage; - reader.readMessage(fields, Struct.Fields._readMessage); - msg.fields[fields.key] = fields.value; + const map = {} as Struct.Fields; + reader.readMessage(map, Struct.Fields._readMessage); + msg.fields[map.key.toString()] = map.value; break; } default: { @@ -87769,8 +87581,8 @@ export const Struct = { const _fields = json.fields; if (_fields) { msg.fields = Object.fromEntries( - Object.entries(_fields) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fields) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Struct.Fields._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -87783,7 +87595,7 @@ export const Struct = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -87799,7 +87611,7 @@ export const Struct = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -87818,9 +87630,9 @@ export const Struct = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: Struct.Fields, reader: BinaryReader - ): MapMessage { + ): Struct.Fields { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -87844,10 +87656,7 @@ export const Struct = { /** * @private */ - _readMessageJSON: function ( - msg: MapMessage, - json: any - ): MapMessage { + _readMessageJSON: function (msg: Struct.Fields, json: any): Struct.Fields { const _key = json.key; if (_key) { msg.key = _key; @@ -88334,7 +88143,7 @@ export const Timestamp = { writer: BinaryWriter ): BinaryWriter { if (msg.seconds) { - writer.writeInt64String(1, msg.seconds.toString()); + writer.writeInt64String(1, msg.seconds.toString() as any); } if (msg.nanos) { writer.writeInt32(2, msg.nanos); @@ -88797,7 +88606,7 @@ export const Int64Value = { writer: BinaryWriter ): BinaryWriter { if (msg.value) { - writer.writeInt64String(1, msg.value.toString()); + writer.writeInt64String(1, msg.value.toString() as any); } return writer; }, @@ -88899,7 +88708,7 @@ export const UInt64Value = { writer: BinaryWriter ): BinaryWriter { if (msg.value) { - writer.writeUint64String(1, msg.value.toString()); + writer.writeUint64String(1, msg.value.toString() as any); } return writer; }, @@ -89475,7 +89284,7 @@ export const BytesValue = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/unittest_well_known_types.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter } from \\"twirpscript\\"; import { Any } from \\"./any.pb\\"; @@ -89587,62 +89396,143 @@ export interface OneofWellKnownTypes { * well-known types, as messages can't be map keys. */ export interface MapWellKnownTypes { - anyField: MapWellKnownTypes.AnyField; - apiField: MapWellKnownTypes.ApiField; - durationField: MapWellKnownTypes.DurationField; - emptyField: MapWellKnownTypes.EmptyField; - fieldMaskField: MapWellKnownTypes.FieldMaskField; - sourceContextField: MapWellKnownTypes.SourceContextField; - structField: MapWellKnownTypes.StructField; - timestampField: MapWellKnownTypes.TimestampField; - typeField: MapWellKnownTypes.TypeField; - doubleField: MapWellKnownTypes.DoubleField; - floatField: MapWellKnownTypes.FloatField; - int64Field: MapWellKnownTypes.Int64Field; - uint64Field: MapWellKnownTypes.Uint64Field; - int32Field: MapWellKnownTypes.Int32Field; - uint32Field: MapWellKnownTypes.Uint32Field; - boolField: MapWellKnownTypes.BoolField; - stringField: MapWellKnownTypes.StringField; - bytesField: MapWellKnownTypes.BytesField; + anyField: Record; + apiField: Record; + durationField: Record< + string, + MapWellKnownTypes.DurationField[\\"value\\"] | undefined + >; + emptyField: Record; + fieldMaskField: Record< + string, + MapWellKnownTypes.FieldMaskField[\\"value\\"] | undefined + >; + sourceContextField: Record< + string, + MapWellKnownTypes.SourceContextField[\\"value\\"] | undefined + >; + structField: Record< + string, + MapWellKnownTypes.StructField[\\"value\\"] | undefined + >; + timestampField: Record< + string, + MapWellKnownTypes.TimestampField[\\"value\\"] | undefined + >; + typeField: Record; + doubleField: Record< + string, + MapWellKnownTypes.DoubleField[\\"value\\"] | undefined + >; + floatField: Record; + int64Field: Record; + uint64Field: Record< + string, + MapWellKnownTypes.Uint64Field[\\"value\\"] | undefined + >; + int32Field: Record; + uint32Field: Record< + string, + MapWellKnownTypes.Uint32Field[\\"value\\"] | undefined + >; + boolField: Record; + stringField: Record< + string, + MapWellKnownTypes.StringField[\\"value\\"] | undefined + >; + bytesField: Record; } declare namespace MapWellKnownTypes { - export type AnyField = Record; + interface AnyField { + key: number; + value: Any; + } - export type ApiField = Record; + interface ApiField { + key: number; + value: Api; + } - export type DurationField = Record; + interface DurationField { + key: number; + value: Duration; + } - export type EmptyField = Record; + interface EmptyField { + key: number; + value: Empty; + } - export type FieldMaskField = Record; + interface FieldMaskField { + key: number; + value: FieldMask; + } - export type SourceContextField = Record; + interface SourceContextField { + key: number; + value: SourceContext; + } - export type StructField = Record; + interface StructField { + key: number; + value: Struct; + } - export type TimestampField = Record; + interface TimestampField { + key: number; + value: Timestamp; + } - export type TypeField = Record; + interface TypeField { + key: number; + value: Type; + } - export type DoubleField = Record; + interface DoubleField { + key: number; + value: DoubleValue; + } - export type FloatField = Record; + interface FloatField { + key: number; + value: FloatValue; + } - export type Int64Field = Record; + interface Int64Field { + key: number; + value: Int64Value; + } - export type Uint64Field = Record; + interface Uint64Field { + key: number; + value: UInt64Value; + } - export type Int32Field = Record; + interface Int32Field { + key: number; + value: Int32Value; + } - export type Uint32Field = Record; + interface Uint32Field { + key: number; + value: UInt32Value; + } - export type BoolField = Record; + interface BoolField { + key: number; + value: BoolValue; + } - export type StringField = Record; + interface StringField { + key: number; + value: StringValue; + } - export type BytesField = Record; + interface BytesField { + key: number; + value: BytesValue; + } } //========================================// @@ -91212,9 +91102,9 @@ export const MapWellKnownTypes = { if (msg.anyField) { writer.writeRepeatedMessage( 1, - Object.entries(msg.anyField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.anyField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.AnyField._writeMessage ); @@ -91222,9 +91112,9 @@ export const MapWellKnownTypes = { if (msg.apiField) { writer.writeRepeatedMessage( 2, - Object.entries(msg.apiField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.apiField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.ApiField._writeMessage ); @@ -91232,9 +91122,9 @@ export const MapWellKnownTypes = { if (msg.durationField) { writer.writeRepeatedMessage( 3, - Object.entries(msg.durationField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.durationField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.DurationField._writeMessage ); @@ -91242,9 +91132,9 @@ export const MapWellKnownTypes = { if (msg.emptyField) { writer.writeRepeatedMessage( 4, - Object.entries(msg.emptyField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.emptyField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.EmptyField._writeMessage ); @@ -91252,9 +91142,9 @@ export const MapWellKnownTypes = { if (msg.fieldMaskField) { writer.writeRepeatedMessage( 5, - Object.entries(msg.fieldMaskField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fieldMaskField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.FieldMaskField._writeMessage ); @@ -91262,9 +91152,9 @@ export const MapWellKnownTypes = { if (msg.sourceContextField) { writer.writeRepeatedMessage( 6, - Object.entries(msg.sourceContextField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.sourceContextField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.SourceContextField._writeMessage ); @@ -91272,9 +91162,9 @@ export const MapWellKnownTypes = { if (msg.structField) { writer.writeRepeatedMessage( 7, - Object.entries(msg.structField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.structField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.StructField._writeMessage ); @@ -91282,9 +91172,9 @@ export const MapWellKnownTypes = { if (msg.timestampField) { writer.writeRepeatedMessage( 8, - Object.entries(msg.timestampField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.timestampField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.TimestampField._writeMessage ); @@ -91292,9 +91182,9 @@ export const MapWellKnownTypes = { if (msg.typeField) { writer.writeRepeatedMessage( 9, - Object.entries(msg.typeField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.typeField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.TypeField._writeMessage ); @@ -91302,9 +91192,9 @@ export const MapWellKnownTypes = { if (msg.doubleField) { writer.writeRepeatedMessage( 10, - Object.entries(msg.doubleField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.doubleField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.DoubleField._writeMessage ); @@ -91312,9 +91202,9 @@ export const MapWellKnownTypes = { if (msg.floatField) { writer.writeRepeatedMessage( 11, - Object.entries(msg.floatField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.floatField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.FloatField._writeMessage ); @@ -91322,9 +91212,9 @@ export const MapWellKnownTypes = { if (msg.int64Field) { writer.writeRepeatedMessage( 12, - Object.entries(msg.int64Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.int64Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Int64Field._writeMessage ); @@ -91332,9 +91222,9 @@ export const MapWellKnownTypes = { if (msg.uint64Field) { writer.writeRepeatedMessage( 13, - Object.entries(msg.uint64Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.uint64Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Uint64Field._writeMessage ); @@ -91342,9 +91232,9 @@ export const MapWellKnownTypes = { if (msg.int32Field) { writer.writeRepeatedMessage( 14, - Object.entries(msg.int32Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.int32Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Int32Field._writeMessage ); @@ -91352,9 +91242,9 @@ export const MapWellKnownTypes = { if (msg.uint32Field) { writer.writeRepeatedMessage( 15, - Object.entries(msg.uint32Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.uint32Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Uint32Field._writeMessage ); @@ -91362,9 +91252,9 @@ export const MapWellKnownTypes = { if (msg.boolField) { writer.writeRepeatedMessage( 16, - Object.entries(msg.boolField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.boolField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.BoolField._writeMessage ); @@ -91372,9 +91262,9 @@ export const MapWellKnownTypes = { if (msg.stringField) { writer.writeRepeatedMessage( 17, - Object.entries(msg.stringField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.stringField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.StringField._writeMessage ); @@ -91382,9 +91272,9 @@ export const MapWellKnownTypes = { if (msg.bytesField) { writer.writeRepeatedMessage( 18, - Object.entries(msg.bytesField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.bytesField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.BytesField._writeMessage ); @@ -91401,8 +91291,8 @@ export const MapWellKnownTypes = { const json: Record = {}; if (msg.anyField) { const anyField = Object.fromEntries( - Object.entries(msg.anyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.anyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.AnyField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91412,8 +91302,8 @@ export const MapWellKnownTypes = { } if (msg.apiField) { const apiField = Object.fromEntries( - Object.entries(msg.apiField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.apiField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.ApiField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91423,8 +91313,8 @@ export const MapWellKnownTypes = { } if (msg.durationField) { const durationField = Object.fromEntries( - Object.entries(msg.durationField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.durationField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DurationField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91434,8 +91324,8 @@ export const MapWellKnownTypes = { } if (msg.emptyField) { const emptyField = Object.fromEntries( - Object.entries(msg.emptyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.emptyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.EmptyField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91445,8 +91335,8 @@ export const MapWellKnownTypes = { } if (msg.fieldMaskField) { const fieldMaskField = Object.fromEntries( - Object.entries(msg.fieldMaskField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fieldMaskField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FieldMaskField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91456,8 +91346,8 @@ export const MapWellKnownTypes = { } if (msg.sourceContextField) { const sourceContextField = Object.fromEntries( - Object.entries(msg.sourceContextField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.sourceContextField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.SourceContextField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91467,8 +91357,8 @@ export const MapWellKnownTypes = { } if (msg.structField) { const structField = Object.fromEntries( - Object.entries(msg.structField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.structField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StructField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91478,8 +91368,8 @@ export const MapWellKnownTypes = { } if (msg.timestampField) { const timestampField = Object.fromEntries( - Object.entries(msg.timestampField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.timestampField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TimestampField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91489,8 +91379,8 @@ export const MapWellKnownTypes = { } if (msg.typeField) { const typeField = Object.fromEntries( - Object.entries(msg.typeField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.typeField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TypeField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91500,8 +91390,8 @@ export const MapWellKnownTypes = { } if (msg.doubleField) { const doubleField = Object.fromEntries( - Object.entries(msg.doubleField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.doubleField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DoubleField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91511,8 +91401,8 @@ export const MapWellKnownTypes = { } if (msg.floatField) { const floatField = Object.fromEntries( - Object.entries(msg.floatField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.floatField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FloatField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91522,8 +91412,8 @@ export const MapWellKnownTypes = { } if (msg.int64Field) { const int64Field = Object.fromEntries( - Object.entries(msg.int64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.int64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int64Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91533,8 +91423,8 @@ export const MapWellKnownTypes = { } if (msg.uint64Field) { const uint64Field = Object.fromEntries( - Object.entries(msg.uint64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.uint64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint64Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91544,8 +91434,8 @@ export const MapWellKnownTypes = { } if (msg.int32Field) { const int32Field = Object.fromEntries( - Object.entries(msg.int32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.int32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int32Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91555,8 +91445,8 @@ export const MapWellKnownTypes = { } if (msg.uint32Field) { const uint32Field = Object.fromEntries( - Object.entries(msg.uint32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.uint32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint32Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91566,8 +91456,8 @@ export const MapWellKnownTypes = { } if (msg.boolField) { const boolField = Object.fromEntries( - Object.entries(msg.boolField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.boolField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BoolField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91577,8 +91467,8 @@ export const MapWellKnownTypes = { } if (msg.stringField) { const stringField = Object.fromEntries( - Object.entries(msg.stringField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.stringField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StringField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91588,8 +91478,8 @@ export const MapWellKnownTypes = { } if (msg.bytesField) { const bytesField = Object.fromEntries( - Object.entries(msg.bytesField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.bytesField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BytesField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91611,164 +91501,120 @@ export const MapWellKnownTypes = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const anyField = {} as MapMessage; - reader.readMessage(anyField, MapWellKnownTypes.AnyField._readMessage); - msg.anyField[anyField.key] = anyField.value; + const map = {} as MapWellKnownTypes.AnyField; + reader.readMessage(map, MapWellKnownTypes.AnyField._readMessage); + msg.anyField[map.key.toString()] = map.value; break; } case 2: { - const apiField = {} as MapMessage; - reader.readMessage(apiField, MapWellKnownTypes.ApiField._readMessage); - msg.apiField[apiField.key] = apiField.value; + const map = {} as MapWellKnownTypes.ApiField; + reader.readMessage(map, MapWellKnownTypes.ApiField._readMessage); + msg.apiField[map.key.toString()] = map.value; break; } case 3: { - const durationField = - {} as MapMessage; - reader.readMessage( - durationField, - MapWellKnownTypes.DurationField._readMessage - ); - msg.durationField[durationField.key] = durationField.value; + const map = {} as MapWellKnownTypes.DurationField; + reader.readMessage(map, MapWellKnownTypes.DurationField._readMessage); + msg.durationField[map.key.toString()] = map.value; break; } case 4: { - const emptyField = {} as MapMessage; - reader.readMessage( - emptyField, - MapWellKnownTypes.EmptyField._readMessage - ); - msg.emptyField[emptyField.key] = emptyField.value; + const map = {} as MapWellKnownTypes.EmptyField; + reader.readMessage(map, MapWellKnownTypes.EmptyField._readMessage); + msg.emptyField[map.key.toString()] = map.value; break; } case 5: { - const fieldMaskField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.FieldMaskField; reader.readMessage( - fieldMaskField, + map, MapWellKnownTypes.FieldMaskField._readMessage ); - msg.fieldMaskField[fieldMaskField.key] = fieldMaskField.value; + msg.fieldMaskField[map.key.toString()] = map.value; break; } case 6: { - const sourceContextField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.SourceContextField; reader.readMessage( - sourceContextField, + map, MapWellKnownTypes.SourceContextField._readMessage ); - msg.sourceContextField[sourceContextField.key] = - sourceContextField.value; + msg.sourceContextField[map.key.toString()] = map.value; break; } case 7: { - const structField = {} as MapMessage; - reader.readMessage( - structField, - MapWellKnownTypes.StructField._readMessage - ); - msg.structField[structField.key] = structField.value; + const map = {} as MapWellKnownTypes.StructField; + reader.readMessage(map, MapWellKnownTypes.StructField._readMessage); + msg.structField[map.key.toString()] = map.value; break; } case 8: { - const timestampField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.TimestampField; reader.readMessage( - timestampField, + map, MapWellKnownTypes.TimestampField._readMessage ); - msg.timestampField[timestampField.key] = timestampField.value; + msg.timestampField[map.key.toString()] = map.value; break; } case 9: { - const typeField = {} as MapMessage; - reader.readMessage( - typeField, - MapWellKnownTypes.TypeField._readMessage - ); - msg.typeField[typeField.key] = typeField.value; + const map = {} as MapWellKnownTypes.TypeField; + reader.readMessage(map, MapWellKnownTypes.TypeField._readMessage); + msg.typeField[map.key.toString()] = map.value; break; } case 10: { - const doubleField = {} as MapMessage; - reader.readMessage( - doubleField, - MapWellKnownTypes.DoubleField._readMessage - ); - msg.doubleField[doubleField.key] = doubleField.value; + const map = {} as MapWellKnownTypes.DoubleField; + reader.readMessage(map, MapWellKnownTypes.DoubleField._readMessage); + msg.doubleField[map.key.toString()] = map.value; break; } case 11: { - const floatField = {} as MapMessage; - reader.readMessage( - floatField, - MapWellKnownTypes.FloatField._readMessage - ); - msg.floatField[floatField.key] = floatField.value; + const map = {} as MapWellKnownTypes.FloatField; + reader.readMessage(map, MapWellKnownTypes.FloatField._readMessage); + msg.floatField[map.key.toString()] = map.value; break; } case 12: { - const int64Field = {} as MapMessage; - reader.readMessage( - int64Field, - MapWellKnownTypes.Int64Field._readMessage - ); - msg.int64Field[int64Field.key] = int64Field.value; + const map = {} as MapWellKnownTypes.Int64Field; + reader.readMessage(map, MapWellKnownTypes.Int64Field._readMessage); + msg.int64Field[map.key.toString()] = map.value; break; } case 13: { - const uint64Field = {} as MapMessage; - reader.readMessage( - uint64Field, - MapWellKnownTypes.Uint64Field._readMessage - ); - msg.uint64Field[uint64Field.key] = uint64Field.value; + const map = {} as MapWellKnownTypes.Uint64Field; + reader.readMessage(map, MapWellKnownTypes.Uint64Field._readMessage); + msg.uint64Field[map.key.toString()] = map.value; break; } case 14: { - const int32Field = {} as MapMessage; - reader.readMessage( - int32Field, - MapWellKnownTypes.Int32Field._readMessage - ); - msg.int32Field[int32Field.key] = int32Field.value; + const map = {} as MapWellKnownTypes.Int32Field; + reader.readMessage(map, MapWellKnownTypes.Int32Field._readMessage); + msg.int32Field[map.key.toString()] = map.value; break; } case 15: { - const uint32Field = {} as MapMessage; - reader.readMessage( - uint32Field, - MapWellKnownTypes.Uint32Field._readMessage - ); - msg.uint32Field[uint32Field.key] = uint32Field.value; + const map = {} as MapWellKnownTypes.Uint32Field; + reader.readMessage(map, MapWellKnownTypes.Uint32Field._readMessage); + msg.uint32Field[map.key.toString()] = map.value; break; } case 16: { - const boolField = {} as MapMessage; - reader.readMessage( - boolField, - MapWellKnownTypes.BoolField._readMessage - ); - msg.boolField[boolField.key] = boolField.value; + const map = {} as MapWellKnownTypes.BoolField; + reader.readMessage(map, MapWellKnownTypes.BoolField._readMessage); + msg.boolField[map.key.toString()] = map.value; break; } case 17: { - const stringField = {} as MapMessage; - reader.readMessage( - stringField, - MapWellKnownTypes.StringField._readMessage - ); - msg.stringField[stringField.key] = stringField.value; + const map = {} as MapWellKnownTypes.StringField; + reader.readMessage(map, MapWellKnownTypes.StringField._readMessage); + msg.stringField[map.key.toString()] = map.value; break; } case 18: { - const bytesField = {} as MapMessage; - reader.readMessage( - bytesField, - MapWellKnownTypes.BytesField._readMessage - ); - msg.bytesField[bytesField.key] = bytesField.value; + const map = {} as MapWellKnownTypes.BytesField; + reader.readMessage(map, MapWellKnownTypes.BytesField._readMessage); + msg.bytesField[map.key.toString()] = map.value; break; } default: { @@ -91790,8 +91636,8 @@ export const MapWellKnownTypes = { const _anyField = json.anyField ?? json.any_field; if (_anyField) { msg.anyField = Object.fromEntries( - Object.entries(_anyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_anyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.AnyField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91799,8 +91645,8 @@ export const MapWellKnownTypes = { const _apiField = json.apiField ?? json.api_field; if (_apiField) { msg.apiField = Object.fromEntries( - Object.entries(_apiField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_apiField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.ApiField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91808,8 +91654,8 @@ export const MapWellKnownTypes = { const _durationField = json.durationField ?? json.duration_field; if (_durationField) { msg.durationField = Object.fromEntries( - Object.entries(_durationField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_durationField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DurationField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91817,8 +91663,8 @@ export const MapWellKnownTypes = { const _emptyField = json.emptyField ?? json.empty_field; if (_emptyField) { msg.emptyField = Object.fromEntries( - Object.entries(_emptyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_emptyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.EmptyField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91826,8 +91672,8 @@ export const MapWellKnownTypes = { const _fieldMaskField = json.fieldMaskField ?? json.field_mask_field; if (_fieldMaskField) { msg.fieldMaskField = Object.fromEntries( - Object.entries(_fieldMaskField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fieldMaskField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FieldMaskField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91836,8 +91682,8 @@ export const MapWellKnownTypes = { json.sourceContextField ?? json.source_context_field; if (_sourceContextField) { msg.sourceContextField = Object.fromEntries( - Object.entries(_sourceContextField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_sourceContextField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.SourceContextField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91845,8 +91691,8 @@ export const MapWellKnownTypes = { const _structField = json.structField ?? json.struct_field; if (_structField) { msg.structField = Object.fromEntries( - Object.entries(_structField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_structField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StructField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91854,8 +91700,8 @@ export const MapWellKnownTypes = { const _timestampField = json.timestampField ?? json.timestamp_field; if (_timestampField) { msg.timestampField = Object.fromEntries( - Object.entries(_timestampField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_timestampField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TimestampField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91863,8 +91709,8 @@ export const MapWellKnownTypes = { const _typeField = json.typeField ?? json.type_field; if (_typeField) { msg.typeField = Object.fromEntries( - Object.entries(_typeField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_typeField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TypeField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91872,8 +91718,8 @@ export const MapWellKnownTypes = { const _doubleField = json.doubleField ?? json.double_field; if (_doubleField) { msg.doubleField = Object.fromEntries( - Object.entries(_doubleField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_doubleField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DoubleField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91881,8 +91727,8 @@ export const MapWellKnownTypes = { const _floatField = json.floatField ?? json.float_field; if (_floatField) { msg.floatField = Object.fromEntries( - Object.entries(_floatField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_floatField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FloatField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91890,8 +91736,8 @@ export const MapWellKnownTypes = { const _int64Field = json.int64Field ?? json.int64_field; if (_int64Field) { msg.int64Field = Object.fromEntries( - Object.entries(_int64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_int64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int64Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91899,8 +91745,8 @@ export const MapWellKnownTypes = { const _uint64Field = json.uint64Field ?? json.uint64_field; if (_uint64Field) { msg.uint64Field = Object.fromEntries( - Object.entries(_uint64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_uint64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint64Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91908,8 +91754,8 @@ export const MapWellKnownTypes = { const _int32Field = json.int32Field ?? json.int32_field; if (_int32Field) { msg.int32Field = Object.fromEntries( - Object.entries(_int32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_int32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int32Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91917,8 +91763,8 @@ export const MapWellKnownTypes = { const _uint32Field = json.uint32Field ?? json.uint32_field; if (_uint32Field) { msg.uint32Field = Object.fromEntries( - Object.entries(_uint32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_uint32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint32Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91926,8 +91772,8 @@ export const MapWellKnownTypes = { const _boolField = json.boolField ?? json.bool_field; if (_boolField) { msg.boolField = Object.fromEntries( - Object.entries(_boolField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_boolField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BoolField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91935,8 +91781,8 @@ export const MapWellKnownTypes = { const _stringField = json.stringField ?? json.string_field; if (_stringField) { msg.stringField = Object.fromEntries( - Object.entries(_stringField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_stringField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StringField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91944,8 +91790,8 @@ export const MapWellKnownTypes = { const _bytesField = json.bytesField ?? json.bytes_field; if (_bytesField) { msg.bytesField = Object.fromEntries( - Object.entries(_bytesField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_bytesField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BytesField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -91958,7 +91804,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -91974,7 +91820,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -91993,9 +91839,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.AnyField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.AnyField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92020,9 +91866,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.AnyField, json: any - ): MapMessage { + ): MapWellKnownTypes.AnyField { const _key = json.key; if (_key) { msg.key = _key; @@ -92042,7 +91888,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92058,7 +91904,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92077,9 +91923,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.ApiField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.ApiField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92104,9 +91950,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.ApiField, json: any - ): MapMessage { + ): MapWellKnownTypes.ApiField { const _key = json.key; if (_key) { msg.key = _key; @@ -92126,7 +91972,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92142,7 +91988,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92161,9 +92007,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DurationField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.DurationField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92188,9 +92034,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DurationField, json: any - ): MapMessage { + ): MapWellKnownTypes.DurationField { const _key = json.key; if (_key) { msg.key = _key; @@ -92210,7 +92056,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92226,7 +92072,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92245,9 +92091,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.EmptyField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.EmptyField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92272,9 +92118,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.EmptyField, json: any - ): MapMessage { + ): MapWellKnownTypes.EmptyField { const _key = json.key; if (_key) { msg.key = _key; @@ -92294,7 +92140,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92310,7 +92156,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92329,9 +92175,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FieldMaskField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.FieldMaskField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92356,9 +92202,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FieldMaskField, json: any - ): MapMessage { + ): MapWellKnownTypes.FieldMaskField { const _key = json.key; if (_key) { msg.key = _key; @@ -92378,7 +92224,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92394,7 +92240,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92413,9 +92259,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.SourceContextField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.SourceContextField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92443,9 +92289,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.SourceContextField, json: any - ): MapMessage { + ): MapWellKnownTypes.SourceContextField { const _key = json.key; if (_key) { msg.key = _key; @@ -92465,7 +92311,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92481,7 +92327,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92500,9 +92346,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StructField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.StructField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92527,9 +92373,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StructField, json: any - ): MapMessage { + ): MapWellKnownTypes.StructField { const _key = json.key; if (_key) { msg.key = _key; @@ -92549,7 +92395,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92565,7 +92411,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92584,9 +92430,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TimestampField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.TimestampField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92611,9 +92457,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TimestampField, json: any - ): MapMessage { + ): MapWellKnownTypes.TimestampField { const _key = json.key; if (_key) { msg.key = _key; @@ -92633,7 +92479,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92649,7 +92495,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92668,9 +92514,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TypeField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.TypeField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92695,9 +92541,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TypeField, json: any - ): MapMessage { + ): MapWellKnownTypes.TypeField { const _key = json.key; if (_key) { msg.key = _key; @@ -92717,7 +92563,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92733,7 +92579,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92752,9 +92598,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DoubleField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.DoubleField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92782,9 +92628,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DoubleField, json: any - ): MapMessage { + ): MapWellKnownTypes.DoubleField { const _key = json.key; if (_key) { msg.key = _key; @@ -92804,7 +92650,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92820,7 +92666,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92839,9 +92685,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FloatField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.FloatField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92869,9 +92715,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FloatField, json: any - ): MapMessage { + ): MapWellKnownTypes.FloatField { const _key = json.key; if (_key) { msg.key = _key; @@ -92891,7 +92737,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92907,7 +92753,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -92926,9 +92772,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int64Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Int64Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -92956,9 +92802,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int64Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Int64Field { const _key = json.key; if (_key) { msg.key = _key; @@ -92978,7 +92824,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -92994,7 +92840,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93013,9 +92859,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint64Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Uint64Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93043,9 +92889,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint64Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Uint64Field { const _key = json.key; if (_key) { msg.key = _key; @@ -93065,7 +92911,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -93081,7 +92927,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93100,9 +92946,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int32Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Int32Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93130,9 +92976,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int32Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Int32Field { const _key = json.key; if (_key) { msg.key = _key; @@ -93152,7 +92998,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -93168,7 +93014,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93187,9 +93033,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint32Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Uint32Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93217,9 +93063,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint32Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Uint32Field { const _key = json.key; if (_key) { msg.key = _key; @@ -93239,7 +93085,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -93255,7 +93101,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93274,9 +93120,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BoolField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.BoolField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93301,9 +93147,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BoolField, json: any - ): MapMessage { + ): MapWellKnownTypes.BoolField { const _key = json.key; if (_key) { msg.key = _key; @@ -93323,7 +93169,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -93339,7 +93185,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93358,9 +93204,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StringField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.StringField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93388,9 +93234,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StringField, json: any - ): MapMessage { + ): MapWellKnownTypes.StringField { const _key = json.key; if (_key) { msg.key = _key; @@ -93410,7 +93256,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -93426,7 +93272,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -93445,9 +93291,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BytesField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.BytesField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -93475,9 +93321,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BytesField, json: any - ): MapMessage { + ): MapWellKnownTypes.BytesField { const _key = json.key; if (_key) { msg.key = _key; @@ -93858,31 +93704,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64.toString()); + writer.writeInt64String(2, msg.optionalInt64.toString() as any); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64.toString()); + writer.writeUint64String(4, msg.optionalUint64.toString() as any); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64.toString()); + writer.writeSint64String(6, msg.optionalSint64.toString() as any); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64.toString()); + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64.toString()); + writer.writeSfixed64(10, msg.optionalSfixed64.toString() as any); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -93968,7 +93814,7 @@ export const TestAllTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 32, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -93977,7 +93823,7 @@ export const TestAllTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 34, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -93986,7 +93832,7 @@ export const TestAllTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 36, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -93995,7 +93841,7 @@ export const TestAllTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 38, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -94004,7 +93850,7 @@ export const TestAllTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 40, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -95068,7 +94914,7 @@ export const TestPackedTypes = { if (msg.packedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.packedInt64.map((x) => x.toString()) + msg.packedInt64.map((x) => x.toString() as any) ); } if (msg.packedUint32?.length) { @@ -95077,7 +94923,7 @@ export const TestPackedTypes = { if (msg.packedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.packedUint64.map((x) => x.toString()) + msg.packedUint64.map((x) => x.toString() as any) ); } if (msg.packedSint32?.length) { @@ -95086,7 +94932,7 @@ export const TestPackedTypes = { if (msg.packedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.packedSint64.map((x) => x.toString()) + msg.packedSint64.map((x) => x.toString() as any) ); } if (msg.packedFixed32?.length) { @@ -95095,7 +94941,7 @@ export const TestPackedTypes = { if (msg.packedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.packedFixed64.map((x) => x.toString()) + msg.packedFixed64.map((x) => x.toString() as any) ); } if (msg.packedSfixed32?.length) { @@ -95104,7 +94950,7 @@ export const TestPackedTypes = { if (msg.packedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.packedSfixed64.map((x) => x.toString()) + msg.packedSfixed64.map((x) => x.toString() as any) ); } if (msg.packedFloat?.length) { @@ -95389,7 +95235,7 @@ export const TestUnpackedTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 2, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -95398,7 +95244,7 @@ export const TestUnpackedTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 4, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -95407,7 +95253,7 @@ export const TestUnpackedTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 6, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -95416,7 +95262,7 @@ export const TestUnpackedTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 8, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -95425,7 +95271,7 @@ export const TestUnpackedTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 10, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -96724,7 +96570,7 @@ export const ImportMessage = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/unittest.proto -import type { ByteSource, MapMessage, ClientConfiguration } from \\"twirpscript\\"; +import type { ByteSource, ClientConfiguration } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter, @@ -97737,7 +97583,10 @@ export interface TestHugeFieldNumbers { optionalString: string; optionalBytes: Uint8Array; optionalMessage: ForeignMessage; - stringStringMap: TestHugeFieldNumbers.StringStringMap; + stringStringMap: Record< + string, + TestHugeFieldNumbers.StringStringMap[\\"value\\"] | undefined + >; oneofUint32?: number | null | undefined; oneofTestAllTypes?: TestAllTypes | null | undefined; oneofString?: string | null | undefined; @@ -97749,7 +97598,10 @@ declare namespace TestHugeFieldNumbers { groupA: number; } - export type StringStringMap = Record; + interface StringStringMap { + key: string; + value: string; + } } export interface TestExtensionInsideTable { @@ -98814,31 +98666,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64.toString()); + writer.writeInt64String(2, msg.optionalInt64.toString() as any); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64.toString()); + writer.writeUint64String(4, msg.optionalUint64.toString() as any); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64.toString()); + writer.writeSint64String(6, msg.optionalSint64.toString() as any); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64.toString()); + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64.toString()); + writer.writeSfixed64(10, msg.optionalSfixed64.toString() as any); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -98920,7 +98772,7 @@ export const TestAllTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 32, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -98929,7 +98781,7 @@ export const TestAllTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 34, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -98938,7 +98790,7 @@ export const TestAllTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 36, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -98947,7 +98799,7 @@ export const TestAllTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 38, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -98956,7 +98808,7 @@ export const TestAllTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 40, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -99030,31 +98882,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64.toString()); + writer.writeInt64String(62, msg.defaultInt64.toString() as any); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64.toString()); + writer.writeUint64String(64, msg.defaultUint64.toString() as any); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64.toString()); + writer.writeSint64String(66, msg.defaultSint64.toString() as any); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64.toString()); + writer.writeFixed64String(68, msg.defaultFixed64.toString() as any); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64.toString()); + writer.writeSfixed64(70, msg.defaultSfixed64.toString() as any); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -105868,7 +105720,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt.toString()); + writer.writeInt64String(1, msg.myInt.toString() as any); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -106043,7 +105895,7 @@ export const TestFieldOrderings = { writer: BinaryWriter ): BinaryWriter { if (msg.oo) { - writer.writeInt64String(2, msg.oo.toString()); + writer.writeInt64String(2, msg.oo.toString() as any); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -106544,19 +106396,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64.toString()); + writer.writeUint64String(3, msg.largeUint64.toString() as any); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64.toString()); + writer.writeInt64String(5, msg.smallInt64.toString() as any); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64.toString()); + writer.writeInt64String(22, msg.reallySmallInt64.toString() as any); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -107742,7 +107594,7 @@ export const Int64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeInt64String(1, msg.data.toString()); + writer.writeInt64String(1, msg.data.toString() as any); } return writer; }, @@ -107850,7 +107702,7 @@ export const Uint64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeUint64String(1, msg.data.toString()); + writer.writeUint64String(1, msg.data.toString() as any); } return writer; }, @@ -109178,7 +109030,7 @@ export const TestOneof2 = { writer: BinaryWriter ): BinaryWriter { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt.toString()); + writer.writeInt64String(1, msg.quxInt.toString() as any); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -109592,7 +109444,7 @@ export const TestPackedTypes = { if (msg.packedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.packedInt64.map((x) => x.toString()) + msg.packedInt64.map((x) => x.toString() as any) ); } if (msg.packedUint32?.length) { @@ -109601,7 +109453,7 @@ export const TestPackedTypes = { if (msg.packedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.packedUint64.map((x) => x.toString()) + msg.packedUint64.map((x) => x.toString() as any) ); } if (msg.packedSint32?.length) { @@ -109610,7 +109462,7 @@ export const TestPackedTypes = { if (msg.packedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.packedSint64.map((x) => x.toString()) + msg.packedSint64.map((x) => x.toString() as any) ); } if (msg.packedFixed32?.length) { @@ -109619,7 +109471,7 @@ export const TestPackedTypes = { if (msg.packedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.packedFixed64.map((x) => x.toString()) + msg.packedFixed64.map((x) => x.toString() as any) ); } if (msg.packedSfixed32?.length) { @@ -109628,7 +109480,7 @@ export const TestPackedTypes = { if (msg.packedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.packedSfixed64.map((x) => x.toString()) + msg.packedSfixed64.map((x) => x.toString() as any) ); } if (msg.packedFloat?.length) { @@ -109913,7 +109765,7 @@ export const TestUnpackedTypes = { if (msg.unpackedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.unpackedInt64.map((x) => x.toString()) + msg.unpackedInt64.map((x) => x.toString() as any) ); } if (msg.unpackedUint32?.length) { @@ -109922,7 +109774,7 @@ export const TestUnpackedTypes = { if (msg.unpackedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.unpackedUint64.map((x) => x.toString()) + msg.unpackedUint64.map((x) => x.toString() as any) ); } if (msg.unpackedSint32?.length) { @@ -109931,7 +109783,7 @@ export const TestUnpackedTypes = { if (msg.unpackedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.unpackedSint64.map((x) => x.toString()) + msg.unpackedSint64.map((x) => x.toString() as any) ); } if (msg.unpackedFixed32?.length) { @@ -109940,7 +109792,7 @@ export const TestUnpackedTypes = { if (msg.unpackedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.unpackedFixed64.map((x) => x.toString()) + msg.unpackedFixed64.map((x) => x.toString() as any) ); } if (msg.unpackedSfixed32?.length) { @@ -109949,7 +109801,7 @@ export const TestUnpackedTypes = { if (msg.unpackedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.unpackedSfixed64.map((x) => x.toString()) + msg.unpackedSfixed64.map((x) => x.toString() as any) ); } if (msg.unpackedFloat?.length) { @@ -110798,13 +110650,13 @@ export const TestRepeatedScalarDifferentTagSizes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 2046, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 2047, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -110813,7 +110665,7 @@ export const TestRepeatedScalarDifferentTagSizes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 262143, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } return writer; @@ -112680,9 +112532,9 @@ export const TestHugeFieldNumbers = { if (msg.stringStringMap) { writer.writeRepeatedMessage( 536870010, - Object.entries(msg.stringStringMap).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.stringStringMap).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestHugeFieldNumbers.StringStringMap._writeMessage ); @@ -112744,8 +112596,8 @@ export const TestHugeFieldNumbers = { } if (msg.stringStringMap) { const stringStringMap = Object.fromEntries( - Object.entries(msg.stringStringMap) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.stringStringMap) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestHugeFieldNumbers.StringStringMap._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -112816,13 +112668,12 @@ export const TestHugeFieldNumbers = { break; } case 536870010: { - const stringStringMap = - {} as MapMessage; + const map = {} as TestHugeFieldNumbers.StringStringMap; reader.readMessage( - stringStringMap, + map, TestHugeFieldNumbers.StringStringMap._readMessage ); - msg.stringStringMap[stringStringMap.key] = stringStringMap.value; + msg.stringStringMap[map.key.toString()] = map.value; break; } case 536870011: { @@ -112894,8 +112745,8 @@ export const TestHugeFieldNumbers = { const _stringStringMap = json.stringStringMap ?? json.string_string_map; if (_stringStringMap) { msg.stringStringMap = Object.fromEntries( - Object.entries(_stringStringMap) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_stringStringMap) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestHugeFieldNumbers.StringStringMap._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -113044,7 +112895,7 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -113060,7 +112911,7 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -113076,9 +112927,9 @@ export const TestHugeFieldNumbers = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestHugeFieldNumbers.StringStringMap, reader: BinaryReader - ): MapMessage { + ): TestHugeFieldNumbers.StringStringMap { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -113103,9 +112954,9 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestHugeFieldNumbers.StringStringMap, json: any - ): MapMessage { + ): TestHugeFieldNumbers.StringStringMap { const _key = json.key; if (_key) { msg.key = _key; @@ -113532,7 +113383,7 @@ export const TestExtensionRangeSerialize = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/map_unittest.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter, @@ -113552,71 +113403,143 @@ export type MapEnum = \\"MAP_ENUM_FOO\\" | \\"MAP_ENUM_BAR\\" | \\"MAP_ENUM_BAZ\ * Tests maps. */ export interface TestMap { - mapInt32Int32: TestMap.MapInt32Int32; - mapInt64Int64: TestMap.MapInt64Int64; - mapUint32Uint32: TestMap.MapUint32Uint32; - mapUint64Uint64: TestMap.MapUint64Uint64; - mapSint32Sint32: TestMap.MapSint32Sint32; - mapSint64Sint64: TestMap.MapSint64Sint64; - mapFixed32Fixed32: TestMap.MapFixed32Fixed32; - mapFixed64Fixed64: TestMap.MapFixed64Fixed64; - mapSfixed32Sfixed32: TestMap.MapSfixed32Sfixed32; - mapSfixed64Sfixed64: TestMap.MapSfixed64Sfixed64; - mapInt32Float: TestMap.MapInt32Float; - mapInt32Double: TestMap.MapInt32Double; - mapBoolBool: TestMap.MapBoolBool; - mapStringString: TestMap.MapStringString; - mapInt32Bytes: TestMap.MapInt32Bytes; - mapInt32Enum: TestMap.MapInt32Enum; - mapInt32ForeignMessage: TestMap.MapInt32ForeignMessage; - mapStringForeignMessage: TestMap.MapStringForeignMessage; - mapInt32AllTypes: TestMap.MapInt32AllTypes; + mapInt32Int32: Record; + mapInt64Int64: Record; + mapUint32Uint32: Record; + mapUint64Uint64: Record; + mapSint32Sint32: Record; + mapSint64Sint64: Record; + mapFixed32Fixed32: Record< + string, + TestMap.MapFixed32Fixed32[\\"value\\"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestMap.MapFixed64Fixed64[\\"value\\"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestMap.MapSfixed32Sfixed32[\\"value\\"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestMap.MapSfixed64Sfixed64[\\"value\\"] | undefined + >; + mapInt32Float: Record; + mapInt32Double: Record; + mapBoolBool: Record; + mapStringString: Record; + mapInt32Bytes: Record; + mapInt32Enum: Record; + mapInt32ForeignMessage: Record< + string, + TestMap.MapInt32ForeignMessage[\\"value\\"] | undefined + >; + mapStringForeignMessage: Record< + string, + TestMap.MapStringForeignMessage[\\"value\\"] | undefined + >; + mapInt32AllTypes: Record< + string, + TestMap.MapInt32AllTypes[\\"value\\"] | undefined + >; } declare namespace TestMap { - export type MapInt32Int32 = Record; + interface MapInt32Int32 { + key: number; + value: number; + } - export type MapInt64Int64 = Record; + interface MapInt64Int64 { + key: bigint; + value: bigint; + } - export type MapUint32Uint32 = Record; + interface MapUint32Uint32 { + key: number; + value: number; + } - export type MapUint64Uint64 = Record; + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } - export type MapSint32Sint32 = Record; + interface MapSint32Sint32 { + key: number; + value: number; + } - export type MapSint64Sint64 = Record; + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } - export type MapFixed32Fixed32 = Record; + interface MapFixed32Fixed32 { + key: number; + value: number; + } - export type MapFixed64Fixed64 = Record; + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } - export type MapSfixed32Sfixed32 = Record; + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } - export type MapSfixed64Sfixed64 = Record; + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } - export type MapInt32Float = Record; + interface MapInt32Float { + key: number; + value: number; + } - export type MapInt32Double = Record; + interface MapInt32Double { + key: number; + value: number; + } - export type MapBoolBool = Record; + interface MapBoolBool { + key: boolean; + value: boolean; + } - export type MapStringString = Record; + interface MapStringString { + key: string; + value: string; + } - export type MapInt32Bytes = Record; + interface MapInt32Bytes { + key: number; + value: Uint8Array; + } - export type MapInt32Enum = Record; + interface MapInt32Enum { + key: number; + value: MapEnum; + } - export type MapInt32ForeignMessage = Record< - number, - ForeignMessage | undefined - >; + interface MapInt32ForeignMessage { + key: number; + value: ForeignMessage; + } - export type MapStringForeignMessage = Record< - string, - ForeignMessage | undefined - >; + interface MapStringForeignMessage { + key: string; + value: ForeignMessage; + } - export type MapInt32AllTypes = Record; + interface MapInt32AllTypes { + key: number; + value: TestAllTypes; + } } export interface TestMapSubmessage { @@ -113624,114 +113547,234 @@ export interface TestMapSubmessage { } export interface TestMessageMap { - mapInt32Message: TestMessageMap.MapInt32Message; + mapInt32Message: Record< + string, + TestMessageMap.MapInt32Message[\\"value\\"] | undefined + >; } declare namespace TestMessageMap { - export type MapInt32Message = Record; + interface MapInt32Message { + key: number; + value: TestAllTypes; + } } /** * Two map fields share the same entry default instance. */ export interface TestSameTypeMap { - map1: TestSameTypeMap.Map1; - map2: TestSameTypeMap.Map2; + map1: Record; + map2: Record; } declare namespace TestSameTypeMap { - export type Map1 = Record; + interface Map1 { + key: number; + value: number; + } - export type Map2 = Record; + interface Map2 { + key: number; + value: number; + } } /** * Test embedded message with required fields */ export interface TestRequiredMessageMap { - mapField: TestRequiredMessageMap.MapField; + mapField: Record< + string, + TestRequiredMessageMap.MapField[\\"value\\"] | undefined + >; } declare namespace TestRequiredMessageMap { - export type MapField = Record; + interface MapField { + key: number; + value: TestRequired; + } } export interface TestArenaMap { - mapInt32Int32: TestArenaMap.MapInt32Int32; - mapInt64Int64: TestArenaMap.MapInt64Int64; - mapUint32Uint32: TestArenaMap.MapUint32Uint32; - mapUint64Uint64: TestArenaMap.MapUint64Uint64; - mapSint32Sint32: TestArenaMap.MapSint32Sint32; - mapSint64Sint64: TestArenaMap.MapSint64Sint64; - mapFixed32Fixed32: TestArenaMap.MapFixed32Fixed32; - mapFixed64Fixed64: TestArenaMap.MapFixed64Fixed64; - mapSfixed32Sfixed32: TestArenaMap.MapSfixed32Sfixed32; - mapSfixed64Sfixed64: TestArenaMap.MapSfixed64Sfixed64; - mapInt32Float: TestArenaMap.MapInt32Float; - mapInt32Double: TestArenaMap.MapInt32Double; - mapBoolBool: TestArenaMap.MapBoolBool; - mapStringString: TestArenaMap.MapStringString; - mapInt32Bytes: TestArenaMap.MapInt32Bytes; - mapInt32Enum: TestArenaMap.MapInt32Enum; - mapInt32ForeignMessage: TestArenaMap.MapInt32ForeignMessage; + mapInt32Int32: Record< + string, + TestArenaMap.MapInt32Int32[\\"value\\"] | undefined + >; + mapInt64Int64: Record< + string, + TestArenaMap.MapInt64Int64[\\"value\\"] | undefined + >; + mapUint32Uint32: Record< + string, + TestArenaMap.MapUint32Uint32[\\"value\\"] | undefined + >; + mapUint64Uint64: Record< + string, + TestArenaMap.MapUint64Uint64[\\"value\\"] | undefined + >; + mapSint32Sint32: Record< + string, + TestArenaMap.MapSint32Sint32[\\"value\\"] | undefined + >; + mapSint64Sint64: Record< + string, + TestArenaMap.MapSint64Sint64[\\"value\\"] | undefined + >; + mapFixed32Fixed32: Record< + string, + TestArenaMap.MapFixed32Fixed32[\\"value\\"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestArenaMap.MapFixed64Fixed64[\\"value\\"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestArenaMap.MapSfixed32Sfixed32[\\"value\\"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestArenaMap.MapSfixed64Sfixed64[\\"value\\"] | undefined + >; + mapInt32Float: Record< + string, + TestArenaMap.MapInt32Float[\\"value\\"] | undefined + >; + mapInt32Double: Record< + string, + TestArenaMap.MapInt32Double[\\"value\\"] | undefined + >; + mapBoolBool: Record; + mapStringString: Record< + string, + TestArenaMap.MapStringString[\\"value\\"] | undefined + >; + mapInt32Bytes: Record< + string, + TestArenaMap.MapInt32Bytes[\\"value\\"] | undefined + >; + mapInt32Enum: Record; + mapInt32ForeignMessage: Record< + string, + TestArenaMap.MapInt32ForeignMessage[\\"value\\"] | undefined + >; } declare namespace TestArenaMap { - export type MapInt32Int32 = Record; + interface MapInt32Int32 { + key: number; + value: number; + } - export type MapInt64Int64 = Record; + interface MapInt64Int64 { + key: bigint; + value: bigint; + } - export type MapUint32Uint32 = Record; + interface MapUint32Uint32 { + key: number; + value: number; + } - export type MapUint64Uint64 = Record; + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } - export type MapSint32Sint32 = Record; + interface MapSint32Sint32 { + key: number; + value: number; + } - export type MapSint64Sint64 = Record; + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } - export type MapFixed32Fixed32 = Record; + interface MapFixed32Fixed32 { + key: number; + value: number; + } - export type MapFixed64Fixed64 = Record; + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } - export type MapSfixed32Sfixed32 = Record; + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } - export type MapSfixed64Sfixed64 = Record; + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } - export type MapInt32Float = Record; + interface MapInt32Float { + key: number; + value: number; + } - export type MapInt32Double = Record; + interface MapInt32Double { + key: number; + value: number; + } - export type MapBoolBool = Record; + interface MapBoolBool { + key: boolean; + value: boolean; + } - export type MapStringString = Record; + interface MapStringString { + key: string; + value: string; + } - export type MapInt32Bytes = Record; + interface MapInt32Bytes { + key: number; + value: Uint8Array; + } - export type MapInt32Enum = Record; + interface MapInt32Enum { + key: number; + value: MapEnum; + } - export type MapInt32ForeignMessage = Record< - number, - ForeignMessage | undefined - >; + interface MapInt32ForeignMessage { + key: number; + value: ForeignMessage; + } } /** * Previously, message cannot contain map field called \\"entry\\". */ export interface MessageContainingMapCalledEntry { - entry: MessageContainingMapCalledEntry.Entry; + entry: Record< + string, + MessageContainingMapCalledEntry.Entry[\\"value\\"] | undefined + >; } declare namespace MessageContainingMapCalledEntry { - export type Entry = Record; + interface Entry { + key: number; + value: number; + } } export interface TestRecursiveMapMessage { - a: TestRecursiveMapMessage.A; + a: Record; } declare namespace TestRecursiveMapMessage { - export type A = Record; + interface A { + key: string; + value: TestRecursiveMapMessage; + } } //========================================// @@ -113850,9 +113893,9 @@ export const TestMap = { if (msg.mapInt32Int32) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Int32._writeMessage ); @@ -113860,9 +113903,9 @@ export const TestMap = { if (msg.mapInt64Int64) { writer.writeRepeatedMessage( 2, - Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt64Int64._writeMessage ); @@ -113870,9 +113913,9 @@ export const TestMap = { if (msg.mapUint32Uint32) { writer.writeRepeatedMessage( 3, - Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapUint32Uint32._writeMessage ); @@ -113880,9 +113923,9 @@ export const TestMap = { if (msg.mapUint64Uint64) { writer.writeRepeatedMessage( 4, - Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapUint64Uint64._writeMessage ); @@ -113890,9 +113933,9 @@ export const TestMap = { if (msg.mapSint32Sint32) { writer.writeRepeatedMessage( 5, - Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSint32Sint32._writeMessage ); @@ -113900,9 +113943,9 @@ export const TestMap = { if (msg.mapSint64Sint64) { writer.writeRepeatedMessage( 6, - Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSint64Sint64._writeMessage ); @@ -113910,9 +113953,9 @@ export const TestMap = { if (msg.mapFixed32Fixed32) { writer.writeRepeatedMessage( 7, - Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapFixed32Fixed32._writeMessage ); @@ -113920,9 +113963,9 @@ export const TestMap = { if (msg.mapFixed64Fixed64) { writer.writeRepeatedMessage( 8, - Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapFixed64Fixed64._writeMessage ); @@ -113930,9 +113973,9 @@ export const TestMap = { if (msg.mapSfixed32Sfixed32) { writer.writeRepeatedMessage( 9, - Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSfixed32Sfixed32._writeMessage ); @@ -113940,9 +113983,9 @@ export const TestMap = { if (msg.mapSfixed64Sfixed64) { writer.writeRepeatedMessage( 10, - Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapSfixed64Sfixed64._writeMessage ); @@ -113950,9 +113993,9 @@ export const TestMap = { if (msg.mapInt32Float) { writer.writeRepeatedMessage( 11, - Object.entries(msg.mapInt32Float).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Float._writeMessage ); @@ -113960,9 +114003,9 @@ export const TestMap = { if (msg.mapInt32Double) { writer.writeRepeatedMessage( 12, - Object.entries(msg.mapInt32Double).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Double._writeMessage ); @@ -113970,9 +114013,9 @@ export const TestMap = { if (msg.mapBoolBool) { writer.writeRepeatedMessage( 13, - Object.entries(msg.mapBoolBool).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapBoolBool._writeMessage ); @@ -113980,9 +114023,9 @@ export const TestMap = { if (msg.mapStringString) { writer.writeRepeatedMessage( 14, - Object.entries(msg.mapStringString).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapStringString._writeMessage ); @@ -113990,9 +114033,9 @@ export const TestMap = { if (msg.mapInt32Bytes) { writer.writeRepeatedMessage( 15, - Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Bytes._writeMessage ); @@ -114000,9 +114043,9 @@ export const TestMap = { if (msg.mapInt32Enum) { writer.writeRepeatedMessage( 16, - Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32Enum._writeMessage ); @@ -114010,9 +114053,9 @@ export const TestMap = { if (msg.mapInt32ForeignMessage) { writer.writeRepeatedMessage( 17, - Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32ForeignMessage._writeMessage ); @@ -114020,18 +114063,19 @@ export const TestMap = { if (msg.mapStringForeignMessage) { writer.writeRepeatedMessage( 18, - Object.entries(msg.mapStringForeignMessage).map( - ([key, value]) => ({ key: key, value: value }) - ) as any, + Object.entries(msg.mapStringForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, TestMap.MapStringForeignMessage._writeMessage ); } if (msg.mapInt32AllTypes) { writer.writeRepeatedMessage( 19, - Object.entries(msg.mapInt32AllTypes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32AllTypes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMap.MapInt32AllTypes._writeMessage ); @@ -114046,8 +114090,8 @@ export const TestMap = { const json: Record = {}; if (msg.mapInt32Int32) { const mapInt32Int32 = Object.fromEntries( - Object.entries(msg.mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Int32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114057,8 +114101,8 @@ export const TestMap = { } if (msg.mapInt64Int64) { const mapInt64Int64 = Object.fromEntries( - Object.entries(msg.mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt64Int64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114068,8 +114112,8 @@ export const TestMap = { } if (msg.mapUint32Uint32) { const mapUint32Uint32 = Object.fromEntries( - Object.entries(msg.mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint32Uint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114079,8 +114123,8 @@ export const TestMap = { } if (msg.mapUint64Uint64) { const mapUint64Uint64 = Object.fromEntries( - Object.entries(msg.mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint64Uint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114090,8 +114134,8 @@ export const TestMap = { } if (msg.mapSint32Sint32) { const mapSint32Sint32 = Object.fromEntries( - Object.entries(msg.mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint32Sint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114101,8 +114145,8 @@ export const TestMap = { } if (msg.mapSint64Sint64) { const mapSint64Sint64 = Object.fromEntries( - Object.entries(msg.mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint64Sint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114112,8 +114156,8 @@ export const TestMap = { } if (msg.mapFixed32Fixed32) { const mapFixed32Fixed32 = Object.fromEntries( - Object.entries(msg.mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed32Fixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114123,8 +114167,8 @@ export const TestMap = { } if (msg.mapFixed64Fixed64) { const mapFixed64Fixed64 = Object.fromEntries( - Object.entries(msg.mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed64Fixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114134,8 +114178,8 @@ export const TestMap = { } if (msg.mapSfixed32Sfixed32) { const mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(msg.mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed32Sfixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114145,8 +114189,8 @@ export const TestMap = { } if (msg.mapSfixed64Sfixed64) { const mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(msg.mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed64Sfixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114156,8 +114200,8 @@ export const TestMap = { } if (msg.mapInt32Float) { const mapInt32Float = Object.fromEntries( - Object.entries(msg.mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Float._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114167,8 +114211,8 @@ export const TestMap = { } if (msg.mapInt32Double) { const mapInt32Double = Object.fromEntries( - Object.entries(msg.mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Double._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114178,8 +114222,8 @@ export const TestMap = { } if (msg.mapBoolBool) { const mapBoolBool = Object.fromEntries( - Object.entries(msg.mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapBoolBool._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114189,8 +114233,8 @@ export const TestMap = { } if (msg.mapStringString) { const mapStringString = Object.fromEntries( - Object.entries(msg.mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringString._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114200,8 +114244,8 @@ export const TestMap = { } if (msg.mapInt32Bytes) { const mapInt32Bytes = Object.fromEntries( - Object.entries(msg.mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Bytes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114211,8 +114255,8 @@ export const TestMap = { } if (msg.mapInt32Enum) { const mapInt32Enum = Object.fromEntries( - Object.entries(msg.mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Enum._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114222,8 +114266,8 @@ export const TestMap = { } if (msg.mapInt32ForeignMessage) { const mapInt32ForeignMessage = Object.fromEntries( - Object.entries(msg.mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32ForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114233,8 +114277,8 @@ export const TestMap = { } if (msg.mapStringForeignMessage) { const mapStringForeignMessage = Object.fromEntries( - Object.entries(msg.mapStringForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114244,8 +114288,8 @@ export const TestMap = { } if (msg.mapInt32AllTypes) { const mapInt32AllTypes = Object.fromEntries( - Object.entries(msg.mapInt32AllTypes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32AllTypes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32AllTypes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114264,166 +114308,117 @@ export const TestMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {} as MapMessage; - reader.readMessage(mapInt32Int32, TestMap.MapInt32Int32._readMessage); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {} as TestMap.MapInt32Int32; + reader.readMessage(map, TestMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {} as MapMessage; - reader.readMessage(mapInt64Int64, TestMap.MapInt64Int64._readMessage); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {} as TestMap.MapInt64Int64; + reader.readMessage(map, TestMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = {} as MapMessage; - reader.readMessage( - mapUint32Uint32, - TestMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {} as TestMap.MapUint32Uint32; + reader.readMessage(map, TestMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = {} as MapMessage; - reader.readMessage( - mapUint64Uint64, - TestMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {} as TestMap.MapUint64Uint64; + reader.readMessage(map, TestMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = {} as MapMessage; - reader.readMessage( - mapSint32Sint32, - TestMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {} as TestMap.MapSint32Sint32; + reader.readMessage(map, TestMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = {} as MapMessage; - reader.readMessage( - mapSint64Sint64, - TestMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {} as TestMap.MapSint64Sint64; + reader.readMessage(map, TestMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = {} as MapMessage; - reader.readMessage( - mapFixed32Fixed32, - TestMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {} as TestMap.MapFixed32Fixed32; + reader.readMessage(map, TestMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = {} as MapMessage; - reader.readMessage( - mapFixed64Fixed64, - TestMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {} as TestMap.MapFixed64Fixed64; + reader.readMessage(map, TestMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = - {} as MapMessage; - reader.readMessage( - mapSfixed32Sfixed32, - TestMap.MapSfixed32Sfixed32._readMessage - ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + const map = {} as TestMap.MapSfixed32Sfixed32; + reader.readMessage(map, TestMap.MapSfixed32Sfixed32._readMessage); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = - {} as MapMessage; - reader.readMessage( - mapSfixed64Sfixed64, - TestMap.MapSfixed64Sfixed64._readMessage - ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + const map = {} as TestMap.MapSfixed64Sfixed64; + reader.readMessage(map, TestMap.MapSfixed64Sfixed64._readMessage); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {} as MapMessage; - reader.readMessage(mapInt32Float, TestMap.MapInt32Float._readMessage); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {} as TestMap.MapInt32Float; + reader.readMessage(map, TestMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {} as MapMessage; - reader.readMessage( - mapInt32Double, - TestMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {} as TestMap.MapInt32Double; + reader.readMessage(map, TestMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {} as MapMessage; - reader.readMessage(mapBoolBool, TestMap.MapBoolBool._readMessage); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {} as TestMap.MapBoolBool; + reader.readMessage(map, TestMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = {} as MapMessage; - reader.readMessage( - mapStringString, - TestMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {} as TestMap.MapStringString; + reader.readMessage(map, TestMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {} as MapMessage; - reader.readMessage(mapInt32Bytes, TestMap.MapInt32Bytes._readMessage); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {} as TestMap.MapInt32Bytes; + reader.readMessage(map, TestMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {} as MapMessage; - reader.readMessage(mapInt32Enum, TestMap.MapInt32Enum._readMessage); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {} as TestMap.MapInt32Enum; + reader.readMessage(map, TestMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = - {} as MapMessage; - reader.readMessage( - mapInt32ForeignMessage, - TestMap.MapInt32ForeignMessage._readMessage - ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + const map = {} as TestMap.MapInt32ForeignMessage; + reader.readMessage(map, TestMap.MapInt32ForeignMessage._readMessage); + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } case 18: { - const mapStringForeignMessage = - {} as MapMessage; - reader.readMessage( - mapStringForeignMessage, - TestMap.MapStringForeignMessage._readMessage - ); - msg.mapStringForeignMessage[mapStringForeignMessage.key] = - mapStringForeignMessage.value; + const map = {} as TestMap.MapStringForeignMessage; + reader.readMessage(map, TestMap.MapStringForeignMessage._readMessage); + msg.mapStringForeignMessage[map.key.toString()] = map.value; break; } case 19: { - const mapInt32AllTypes = {} as MapMessage; - reader.readMessage( - mapInt32AllTypes, - TestMap.MapInt32AllTypes._readMessage - ); - msg.mapInt32AllTypes[mapInt32AllTypes.key] = mapInt32AllTypes.value; + const map = {} as TestMap.MapInt32AllTypes; + reader.readMessage(map, TestMap.MapInt32AllTypes._readMessage); + msg.mapInt32AllTypes[map.key.toString()] = map.value; break; } default: { @@ -114442,8 +114437,8 @@ export const TestMap = { const _mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (_mapInt32Int32) { msg.mapInt32Int32 = Object.fromEntries( - Object.entries(_mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Int32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114451,8 +114446,8 @@ export const TestMap = { const _mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (_mapInt64Int64) { msg.mapInt64Int64 = Object.fromEntries( - Object.entries(_mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt64Int64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114460,8 +114455,8 @@ export const TestMap = { const _mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (_mapUint32Uint32) { msg.mapUint32Uint32 = Object.fromEntries( - Object.entries(_mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint32Uint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114469,8 +114464,8 @@ export const TestMap = { const _mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (_mapUint64Uint64) { msg.mapUint64Uint64 = Object.fromEntries( - Object.entries(_mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapUint64Uint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114478,8 +114473,8 @@ export const TestMap = { const _mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (_mapSint32Sint32) { msg.mapSint32Sint32 = Object.fromEntries( - Object.entries(_mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint32Sint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114487,8 +114482,8 @@ export const TestMap = { const _mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (_mapSint64Sint64) { msg.mapSint64Sint64 = Object.fromEntries( - Object.entries(_mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSint64Sint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114497,8 +114492,8 @@ export const TestMap = { json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (_mapFixed32Fixed32) { msg.mapFixed32Fixed32 = Object.fromEntries( - Object.entries(_mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed32Fixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114507,8 +114502,8 @@ export const TestMap = { json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (_mapFixed64Fixed64) { msg.mapFixed64Fixed64 = Object.fromEntries( - Object.entries(_mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapFixed64Fixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114517,8 +114512,8 @@ export const TestMap = { json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (_mapSfixed32Sfixed32) { msg.mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(_mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed32Sfixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114527,8 +114522,8 @@ export const TestMap = { json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (_mapSfixed64Sfixed64) { msg.mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(_mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapSfixed64Sfixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114536,8 +114531,8 @@ export const TestMap = { const _mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (_mapInt32Float) { msg.mapInt32Float = Object.fromEntries( - Object.entries(_mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Float._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114545,8 +114540,8 @@ export const TestMap = { const _mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (_mapInt32Double) { msg.mapInt32Double = Object.fromEntries( - Object.entries(_mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Double._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114554,8 +114549,8 @@ export const TestMap = { const _mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (_mapBoolBool) { msg.mapBoolBool = Object.fromEntries( - Object.entries(_mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapBoolBool._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114563,8 +114558,8 @@ export const TestMap = { const _mapStringString = json.mapStringString ?? json.map_string_string; if (_mapStringString) { msg.mapStringString = Object.fromEntries( - Object.entries(_mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringString._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114572,8 +114567,8 @@ export const TestMap = { const _mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (_mapInt32Bytes) { msg.mapInt32Bytes = Object.fromEntries( - Object.entries(_mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Bytes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114581,8 +114576,8 @@ export const TestMap = { const _mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (_mapInt32Enum) { msg.mapInt32Enum = Object.fromEntries( - Object.entries(_mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32Enum._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114591,8 +114586,8 @@ export const TestMap = { json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (_mapInt32ForeignMessage) { msg.mapInt32ForeignMessage = Object.fromEntries( - Object.entries(_mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32ForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114601,8 +114596,8 @@ export const TestMap = { json.mapStringForeignMessage ?? json.map_string_foreign_message; if (_mapStringForeignMessage) { msg.mapStringForeignMessage = Object.fromEntries( - Object.entries(_mapStringForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapStringForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114610,8 +114605,8 @@ export const TestMap = { const _mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (_mapInt32AllTypes) { msg.mapInt32AllTypes = Object.fromEntries( - Object.entries(_mapInt32AllTypes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32AllTypes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMap.MapInt32AllTypes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -114624,7 +114619,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -114640,7 +114635,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -114656,9 +114651,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Int32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Int32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -114683,9 +114678,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Int32, json: any - ): MapMessage { + ): TestMap.MapInt32Int32 { const _key = json.key; if (_key) { msg.key = _key; @@ -114703,14 +114698,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeInt64String(1, msg.key.toString()); + writer.writeInt64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -114719,7 +114714,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -114735,9 +114730,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt64Int64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt64Int64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -114762,9 +114757,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt64Int64, json: any - ): MapMessage { + ): TestMap.MapInt64Int64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -114782,7 +114777,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -114798,7 +114793,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -114814,9 +114809,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapUint32Uint32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapUint32Uint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -114841,9 +114836,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapUint32Uint32, json: any - ): MapMessage { + ): TestMap.MapUint32Uint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -114861,14 +114856,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeUint64String(1, msg.key.toString()); + writer.writeUint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeUint64String(2, msg.value.toString()); + writer.writeUint64String(2, msg.value.toString() as any); } return writer; }, @@ -114877,7 +114872,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -114893,9 +114888,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapUint64Uint64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapUint64Uint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -114920,9 +114915,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapUint64Uint64, json: any - ): MapMessage { + ): TestMap.MapUint64Uint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -114940,7 +114935,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -114956,7 +114951,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -114972,9 +114967,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSint32Sint32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSint32Sint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -114999,9 +114994,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSint32Sint32, json: any - ): MapMessage { + ): TestMap.MapSint32Sint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -115019,14 +115014,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSint64String(1, msg.key.toString()); + writer.writeSint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSint64String(2, msg.value.toString()); + writer.writeSint64String(2, msg.value.toString() as any); } return writer; }, @@ -115035,7 +115030,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115051,9 +115046,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSint64Sint64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSint64Sint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115078,9 +115073,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSint64Sint64, json: any - ): MapMessage { + ): TestMap.MapSint64Sint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -115098,7 +115093,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115114,7 +115109,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115130,9 +115125,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapFixed32Fixed32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapFixed32Fixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115157,9 +115152,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapFixed32Fixed32, json: any - ): MapMessage { + ): TestMap.MapFixed32Fixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -115177,14 +115172,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeFixed64String(1, msg.key.toString()); + writer.writeFixed64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeFixed64String(2, msg.value.toString()); + writer.writeFixed64String(2, msg.value.toString() as any); } return writer; }, @@ -115193,7 +115188,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115209,9 +115204,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapFixed64Fixed64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapFixed64Fixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115236,9 +115231,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapFixed64Fixed64, json: any - ): MapMessage { + ): TestMap.MapFixed64Fixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -115256,7 +115251,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115272,7 +115267,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115288,9 +115283,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSfixed32Sfixed32, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSfixed32Sfixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115315,9 +115310,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSfixed32Sfixed32, json: any - ): MapMessage { + ): TestMap.MapSfixed32Sfixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -115335,14 +115330,14 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSfixed64(1, msg.key.toString()); + writer.writeSfixed64(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSfixed64(2, msg.value.toString()); + writer.writeSfixed64(2, msg.value.toString() as any); } return writer; }, @@ -115351,7 +115346,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115367,9 +115362,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapSfixed64Sfixed64, reader: BinaryReader - ): MapMessage { + ): TestMap.MapSfixed64Sfixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115394,9 +115389,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapSfixed64Sfixed64, json: any - ): MapMessage { + ): TestMap.MapSfixed64Sfixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -115414,7 +115409,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115430,7 +115425,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115446,9 +115441,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Float, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Float { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115473,9 +115468,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Float, json: any - ): MapMessage { + ): TestMap.MapInt32Float { const _key = json.key; if (_key) { msg.key = _key; @@ -115493,7 +115488,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115509,7 +115504,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115525,9 +115520,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Double, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Double { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115552,9 +115547,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Double, json: any - ): MapMessage { + ): TestMap.MapInt32Double { const _key = json.key; if (_key) { msg.key = _key; @@ -115572,7 +115567,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115588,7 +115583,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115604,9 +115599,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapBoolBool, reader: BinaryReader - ): MapMessage { + ): TestMap.MapBoolBool { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115631,9 +115626,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapBoolBool, json: any - ): MapMessage { + ): TestMap.MapBoolBool { const _key = json.key; if (_key) { msg.key = _key; @@ -115651,7 +115646,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115667,7 +115662,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115683,9 +115678,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapStringString, reader: BinaryReader - ): MapMessage { + ): TestMap.MapStringString { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115710,9 +115705,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapStringString, json: any - ): MapMessage { + ): TestMap.MapStringString { const _key = json.key; if (_key) { msg.key = _key; @@ -115730,7 +115725,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115746,7 +115741,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115762,9 +115757,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Bytes, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Bytes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115789,9 +115784,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Bytes, json: any - ): MapMessage { + ): TestMap.MapInt32Bytes { const _key = json.key; if (_key) { msg.key = _key; @@ -115809,7 +115804,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115825,7 +115820,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115841,9 +115836,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32Enum, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32Enum { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115868,9 +115863,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32Enum, json: any - ): MapMessage { + ): TestMap.MapInt32Enum { const _key = json.key; if (_key) { msg.key = _key; @@ -115888,7 +115883,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115904,7 +115899,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -115923,9 +115918,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32ForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32ForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -115953,9 +115948,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32ForeignMessage, json: any - ): MapMessage { + ): TestMap.MapInt32ForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -115975,7 +115970,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -115991,7 +115986,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116010,9 +116005,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapStringForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestMap.MapStringForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -116040,9 +116035,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapStringForeignMessage, json: any - ): MapMessage { + ): TestMap.MapStringForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -116062,7 +116057,7 @@ export const TestMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -116078,7 +116073,7 @@ export const TestMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116097,9 +116092,9 @@ export const TestMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMap.MapInt32AllTypes, reader: BinaryReader - ): MapMessage { + ): TestMap.MapInt32AllTypes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -116127,9 +116122,9 @@ export const TestMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMap.MapInt32AllTypes, json: any - ): MapMessage { + ): TestMap.MapInt32AllTypes { const _key = json.key; if (_key) { msg.key = _key; @@ -116318,9 +116313,9 @@ export const TestMessageMap = { if (msg.mapInt32Message) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Message).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Message).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestMessageMap.MapInt32Message._writeMessage ); @@ -116337,8 +116332,8 @@ export const TestMessageMap = { const json: Record = {}; if (msg.mapInt32Message) { const mapInt32Message = Object.fromEntries( - Object.entries(msg.mapInt32Message) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Message) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMessageMap.MapInt32Message._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116360,13 +116355,9 @@ export const TestMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Message = - {} as MapMessage; - reader.readMessage( - mapInt32Message, - TestMessageMap.MapInt32Message._readMessage - ); - msg.mapInt32Message[mapInt32Message.key] = mapInt32Message.value; + const map = {} as TestMessageMap.MapInt32Message; + reader.readMessage(map, TestMessageMap.MapInt32Message._readMessage); + msg.mapInt32Message[map.key.toString()] = map.value; break; } default: { @@ -116385,8 +116376,8 @@ export const TestMessageMap = { const _mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (_mapInt32Message) { msg.mapInt32Message = Object.fromEntries( - Object.entries(_mapInt32Message) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Message) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestMessageMap.MapInt32Message._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116399,7 +116390,7 @@ export const TestMessageMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -116415,7 +116406,7 @@ export const TestMessageMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116434,9 +116425,9 @@ export const TestMessageMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestMessageMap.MapInt32Message, reader: BinaryReader - ): MapMessage { + ): TestMessageMap.MapInt32Message { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -116464,9 +116455,9 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestMessageMap.MapInt32Message, json: any - ): MapMessage { + ): TestMessageMap.MapInt32Message { const _key = json.key; if (_key) { msg.key = _key; @@ -116540,9 +116531,9 @@ export const TestSameTypeMap = { if (msg.map1) { writer.writeRepeatedMessage( 1, - Object.entries(msg.map1).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.map1).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestSameTypeMap.Map1._writeMessage ); @@ -116550,9 +116541,9 @@ export const TestSameTypeMap = { if (msg.map2) { writer.writeRepeatedMessage( 2, - Object.entries(msg.map2).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.map2).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestSameTypeMap.Map2._writeMessage ); @@ -116569,8 +116560,8 @@ export const TestSameTypeMap = { const json: Record = {}; if (msg.map1) { const map1 = Object.fromEntries( - Object.entries(msg.map1) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.map1) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map1._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116580,8 +116571,8 @@ export const TestSameTypeMap = { } if (msg.map2) { const map2 = Object.fromEntries( - Object.entries(msg.map2) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.map2) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map2._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116603,15 +116594,15 @@ export const TestSameTypeMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const map1 = {} as MapMessage; - reader.readMessage(map1, TestSameTypeMap.Map1._readMessage); - msg.map1[map1.key] = map1.value; + const map = {} as TestSameTypeMap.Map1; + reader.readMessage(map, TestSameTypeMap.Map1._readMessage); + msg.map1[map.key.toString()] = map.value; break; } case 2: { - const map2 = {} as MapMessage; - reader.readMessage(map2, TestSameTypeMap.Map2._readMessage); - msg.map2[map2.key] = map2.value; + const map = {} as TestSameTypeMap.Map2; + reader.readMessage(map, TestSameTypeMap.Map2._readMessage); + msg.map2[map.key.toString()] = map.value; break; } default: { @@ -116633,8 +116624,8 @@ export const TestSameTypeMap = { const _map1 = json.map1; if (_map1) { msg.map1 = Object.fromEntries( - Object.entries(_map1) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_map1) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map1._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116642,8 +116633,8 @@ export const TestSameTypeMap = { const _map2 = json.map2; if (_map2) { msg.map2 = Object.fromEntries( - Object.entries(_map2) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_map2) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestSameTypeMap.Map2._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116656,7 +116647,7 @@ export const TestSameTypeMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -116672,7 +116663,7 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116688,9 +116679,9 @@ export const TestSameTypeMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map1, reader: BinaryReader - ): MapMessage { + ): TestSameTypeMap.Map1 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -116715,9 +116706,9 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map1, json: any - ): MapMessage { + ): TestSameTypeMap.Map1 { const _key = json.key; if (_key) { msg.key = _key; @@ -116735,7 +116726,7 @@ export const TestSameTypeMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -116751,7 +116742,7 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116767,9 +116758,9 @@ export const TestSameTypeMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map2, reader: BinaryReader - ): MapMessage { + ): TestSameTypeMap.Map2 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -116794,9 +116785,9 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestSameTypeMap.Map2, json: any - ): MapMessage { + ): TestSameTypeMap.Map2 { const _key = json.key; if (_key) { msg.key = _key; @@ -116867,9 +116858,9 @@ export const TestRequiredMessageMap = { if (msg.mapField) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestRequiredMessageMap.MapField._writeMessage ); @@ -116886,8 +116877,8 @@ export const TestRequiredMessageMap = { const json: Record = {}; if (msg.mapField) { const mapField = Object.fromEntries( - Object.entries(msg.mapField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRequiredMessageMap.MapField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116909,12 +116900,9 @@ export const TestRequiredMessageMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapField = {} as MapMessage; - reader.readMessage( - mapField, - TestRequiredMessageMap.MapField._readMessage - ); - msg.mapField[mapField.key] = mapField.value; + const map = {} as TestRequiredMessageMap.MapField; + reader.readMessage(map, TestRequiredMessageMap.MapField._readMessage); + msg.mapField[map.key.toString()] = map.value; break; } default: { @@ -116936,8 +116924,8 @@ export const TestRequiredMessageMap = { const _mapField = json.mapField ?? json.map_field; if (_mapField) { msg.mapField = Object.fromEntries( - Object.entries(_mapField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRequiredMessageMap.MapField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -116950,7 +116938,7 @@ export const TestRequiredMessageMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -116966,7 +116954,7 @@ export const TestRequiredMessageMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -116985,9 +116973,9 @@ export const TestRequiredMessageMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestRequiredMessageMap.MapField, reader: BinaryReader - ): MapMessage { + ): TestRequiredMessageMap.MapField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -117015,9 +117003,9 @@ export const TestRequiredMessageMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestRequiredMessageMap.MapField, json: any - ): MapMessage { + ): TestRequiredMessageMap.MapField { const _key = json.key; if (_key) { msg.key = _key; @@ -117106,9 +117094,9 @@ export const TestArenaMap = { if (msg.mapInt32Int32) { writer.writeRepeatedMessage( 1, - Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Int32._writeMessage ); @@ -117116,9 +117104,9 @@ export const TestArenaMap = { if (msg.mapInt64Int64) { writer.writeRepeatedMessage( 2, - Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt64Int64._writeMessage ); @@ -117126,9 +117114,9 @@ export const TestArenaMap = { if (msg.mapUint32Uint32) { writer.writeRepeatedMessage( 3, - Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapUint32Uint32._writeMessage ); @@ -117136,9 +117124,9 @@ export const TestArenaMap = { if (msg.mapUint64Uint64) { writer.writeRepeatedMessage( 4, - Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapUint64Uint64._writeMessage ); @@ -117146,9 +117134,9 @@ export const TestArenaMap = { if (msg.mapSint32Sint32) { writer.writeRepeatedMessage( 5, - Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSint32Sint32._writeMessage ); @@ -117156,9 +117144,9 @@ export const TestArenaMap = { if (msg.mapSint64Sint64) { writer.writeRepeatedMessage( 6, - Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSint64Sint64._writeMessage ); @@ -117166,9 +117154,9 @@ export const TestArenaMap = { if (msg.mapFixed32Fixed32) { writer.writeRepeatedMessage( 7, - Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapFixed32Fixed32._writeMessage ); @@ -117176,9 +117164,9 @@ export const TestArenaMap = { if (msg.mapFixed64Fixed64) { writer.writeRepeatedMessage( 8, - Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapFixed64Fixed64._writeMessage ); @@ -117186,9 +117174,9 @@ export const TestArenaMap = { if (msg.mapSfixed32Sfixed32) { writer.writeRepeatedMessage( 9, - Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSfixed32Sfixed32._writeMessage ); @@ -117196,9 +117184,9 @@ export const TestArenaMap = { if (msg.mapSfixed64Sfixed64) { writer.writeRepeatedMessage( 10, - Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapSfixed64Sfixed64._writeMessage ); @@ -117206,9 +117194,9 @@ export const TestArenaMap = { if (msg.mapInt32Float) { writer.writeRepeatedMessage( 11, - Object.entries(msg.mapInt32Float).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Float._writeMessage ); @@ -117216,9 +117204,9 @@ export const TestArenaMap = { if (msg.mapInt32Double) { writer.writeRepeatedMessage( 12, - Object.entries(msg.mapInt32Double).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Double._writeMessage ); @@ -117226,9 +117214,9 @@ export const TestArenaMap = { if (msg.mapBoolBool) { writer.writeRepeatedMessage( 13, - Object.entries(msg.mapBoolBool).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapBoolBool._writeMessage ); @@ -117236,9 +117224,9 @@ export const TestArenaMap = { if (msg.mapStringString) { writer.writeRepeatedMessage( 14, - Object.entries(msg.mapStringString).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapStringString._writeMessage ); @@ -117246,9 +117234,9 @@ export const TestArenaMap = { if (msg.mapInt32Bytes) { writer.writeRepeatedMessage( 15, - Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Bytes).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Bytes._writeMessage ); @@ -117256,9 +117244,9 @@ export const TestArenaMap = { if (msg.mapInt32Enum) { writer.writeRepeatedMessage( 16, - Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32Enum).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32Enum._writeMessage ); @@ -117266,9 +117254,9 @@ export const TestArenaMap = { if (msg.mapInt32ForeignMessage) { writer.writeRepeatedMessage( 17, - Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.mapInt32ForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestArenaMap.MapInt32ForeignMessage._writeMessage ); @@ -117285,8 +117273,8 @@ export const TestArenaMap = { const json: Record = {}; if (msg.mapInt32Int32) { const mapInt32Int32 = Object.fromEntries( - Object.entries(msg.mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Int32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117296,8 +117284,8 @@ export const TestArenaMap = { } if (msg.mapInt64Int64) { const mapInt64Int64 = Object.fromEntries( - Object.entries(msg.mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt64Int64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117307,8 +117295,8 @@ export const TestArenaMap = { } if (msg.mapUint32Uint32) { const mapUint32Uint32 = Object.fromEntries( - Object.entries(msg.mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint32Uint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117318,8 +117306,8 @@ export const TestArenaMap = { } if (msg.mapUint64Uint64) { const mapUint64Uint64 = Object.fromEntries( - Object.entries(msg.mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint64Uint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117329,8 +117317,8 @@ export const TestArenaMap = { } if (msg.mapSint32Sint32) { const mapSint32Sint32 = Object.fromEntries( - Object.entries(msg.mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint32Sint32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117340,8 +117328,8 @@ export const TestArenaMap = { } if (msg.mapSint64Sint64) { const mapSint64Sint64 = Object.fromEntries( - Object.entries(msg.mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint64Sint64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117351,8 +117339,8 @@ export const TestArenaMap = { } if (msg.mapFixed32Fixed32) { const mapFixed32Fixed32 = Object.fromEntries( - Object.entries(msg.mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed32Fixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117362,8 +117350,8 @@ export const TestArenaMap = { } if (msg.mapFixed64Fixed64) { const mapFixed64Fixed64 = Object.fromEntries( - Object.entries(msg.mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed64Fixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117373,8 +117361,8 @@ export const TestArenaMap = { } if (msg.mapSfixed32Sfixed32) { const mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(msg.mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed32Sfixed32._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117384,8 +117372,8 @@ export const TestArenaMap = { } if (msg.mapSfixed64Sfixed64) { const mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(msg.mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed64Sfixed64._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117395,8 +117383,8 @@ export const TestArenaMap = { } if (msg.mapInt32Float) { const mapInt32Float = Object.fromEntries( - Object.entries(msg.mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Float._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117406,8 +117394,8 @@ export const TestArenaMap = { } if (msg.mapInt32Double) { const mapInt32Double = Object.fromEntries( - Object.entries(msg.mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Double._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117417,8 +117405,8 @@ export const TestArenaMap = { } if (msg.mapBoolBool) { const mapBoolBool = Object.fromEntries( - Object.entries(msg.mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapBoolBool._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117428,8 +117416,8 @@ export const TestArenaMap = { } if (msg.mapStringString) { const mapStringString = Object.fromEntries( - Object.entries(msg.mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapStringString._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117439,8 +117427,8 @@ export const TestArenaMap = { } if (msg.mapInt32Bytes) { const mapInt32Bytes = Object.fromEntries( - Object.entries(msg.mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Bytes._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117450,8 +117438,8 @@ export const TestArenaMap = { } if (msg.mapInt32Enum) { const mapInt32Enum = Object.fromEntries( - Object.entries(msg.mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Enum._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117461,8 +117449,8 @@ export const TestArenaMap = { } if (msg.mapInt32ForeignMessage) { const mapInt32ForeignMessage = Object.fromEntries( - Object.entries(msg.mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32ForeignMessage._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117484,171 +117472,114 @@ export const TestArenaMap = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const mapInt32Int32 = {} as MapMessage; - reader.readMessage( - mapInt32Int32, - TestArenaMap.MapInt32Int32._readMessage - ); - msg.mapInt32Int32[mapInt32Int32.key] = mapInt32Int32.value; + const map = {} as TestArenaMap.MapInt32Int32; + reader.readMessage(map, TestArenaMap.MapInt32Int32._readMessage); + msg.mapInt32Int32[map.key.toString()] = map.value; break; } case 2: { - const mapInt64Int64 = {} as MapMessage; - reader.readMessage( - mapInt64Int64, - TestArenaMap.MapInt64Int64._readMessage - ); - msg.mapInt64Int64[mapInt64Int64.key] = mapInt64Int64.value; + const map = {} as TestArenaMap.MapInt64Int64; + reader.readMessage(map, TestArenaMap.MapInt64Int64._readMessage); + msg.mapInt64Int64[map.key.toString()] = map.value; break; } case 3: { - const mapUint32Uint32 = - {} as MapMessage; - reader.readMessage( - mapUint32Uint32, - TestArenaMap.MapUint32Uint32._readMessage - ); - msg.mapUint32Uint32[mapUint32Uint32.key] = mapUint32Uint32.value; + const map = {} as TestArenaMap.MapUint32Uint32; + reader.readMessage(map, TestArenaMap.MapUint32Uint32._readMessage); + msg.mapUint32Uint32[map.key.toString()] = map.value; break; } case 4: { - const mapUint64Uint64 = - {} as MapMessage; - reader.readMessage( - mapUint64Uint64, - TestArenaMap.MapUint64Uint64._readMessage - ); - msg.mapUint64Uint64[mapUint64Uint64.key] = mapUint64Uint64.value; + const map = {} as TestArenaMap.MapUint64Uint64; + reader.readMessage(map, TestArenaMap.MapUint64Uint64._readMessage); + msg.mapUint64Uint64[map.key.toString()] = map.value; break; } case 5: { - const mapSint32Sint32 = - {} as MapMessage; - reader.readMessage( - mapSint32Sint32, - TestArenaMap.MapSint32Sint32._readMessage - ); - msg.mapSint32Sint32[mapSint32Sint32.key] = mapSint32Sint32.value; + const map = {} as TestArenaMap.MapSint32Sint32; + reader.readMessage(map, TestArenaMap.MapSint32Sint32._readMessage); + msg.mapSint32Sint32[map.key.toString()] = map.value; break; } case 6: { - const mapSint64Sint64 = - {} as MapMessage; - reader.readMessage( - mapSint64Sint64, - TestArenaMap.MapSint64Sint64._readMessage - ); - msg.mapSint64Sint64[mapSint64Sint64.key] = mapSint64Sint64.value; + const map = {} as TestArenaMap.MapSint64Sint64; + reader.readMessage(map, TestArenaMap.MapSint64Sint64._readMessage); + msg.mapSint64Sint64[map.key.toString()] = map.value; break; } case 7: { - const mapFixed32Fixed32 = - {} as MapMessage; - reader.readMessage( - mapFixed32Fixed32, - TestArenaMap.MapFixed32Fixed32._readMessage - ); - msg.mapFixed32Fixed32[mapFixed32Fixed32.key] = - mapFixed32Fixed32.value; + const map = {} as TestArenaMap.MapFixed32Fixed32; + reader.readMessage(map, TestArenaMap.MapFixed32Fixed32._readMessage); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; break; } case 8: { - const mapFixed64Fixed64 = - {} as MapMessage; - reader.readMessage( - mapFixed64Fixed64, - TestArenaMap.MapFixed64Fixed64._readMessage - ); - msg.mapFixed64Fixed64[mapFixed64Fixed64.key] = - mapFixed64Fixed64.value; + const map = {} as TestArenaMap.MapFixed64Fixed64; + reader.readMessage(map, TestArenaMap.MapFixed64Fixed64._readMessage); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; break; } case 9: { - const mapSfixed32Sfixed32 = - {} as MapMessage; + const map = {} as TestArenaMap.MapSfixed32Sfixed32; reader.readMessage( - mapSfixed32Sfixed32, + map, TestArenaMap.MapSfixed32Sfixed32._readMessage ); - msg.mapSfixed32Sfixed32[mapSfixed32Sfixed32.key] = - mapSfixed32Sfixed32.value; + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; break; } case 10: { - const mapSfixed64Sfixed64 = - {} as MapMessage; + const map = {} as TestArenaMap.MapSfixed64Sfixed64; reader.readMessage( - mapSfixed64Sfixed64, + map, TestArenaMap.MapSfixed64Sfixed64._readMessage ); - msg.mapSfixed64Sfixed64[mapSfixed64Sfixed64.key] = - mapSfixed64Sfixed64.value; + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; break; } case 11: { - const mapInt32Float = {} as MapMessage; - reader.readMessage( - mapInt32Float, - TestArenaMap.MapInt32Float._readMessage - ); - msg.mapInt32Float[mapInt32Float.key] = mapInt32Float.value; + const map = {} as TestArenaMap.MapInt32Float; + reader.readMessage(map, TestArenaMap.MapInt32Float._readMessage); + msg.mapInt32Float[map.key.toString()] = map.value; break; } case 12: { - const mapInt32Double = {} as MapMessage; - reader.readMessage( - mapInt32Double, - TestArenaMap.MapInt32Double._readMessage - ); - msg.mapInt32Double[mapInt32Double.key] = mapInt32Double.value; + const map = {} as TestArenaMap.MapInt32Double; + reader.readMessage(map, TestArenaMap.MapInt32Double._readMessage); + msg.mapInt32Double[map.key.toString()] = map.value; break; } case 13: { - const mapBoolBool = {} as MapMessage; - reader.readMessage( - mapBoolBool, - TestArenaMap.MapBoolBool._readMessage - ); - msg.mapBoolBool[mapBoolBool.key] = mapBoolBool.value; + const map = {} as TestArenaMap.MapBoolBool; + reader.readMessage(map, TestArenaMap.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; break; } case 14: { - const mapStringString = - {} as MapMessage; - reader.readMessage( - mapStringString, - TestArenaMap.MapStringString._readMessage - ); - msg.mapStringString[mapStringString.key] = mapStringString.value; + const map = {} as TestArenaMap.MapStringString; + reader.readMessage(map, TestArenaMap.MapStringString._readMessage); + msg.mapStringString[map.key.toString()] = map.value; break; } case 15: { - const mapInt32Bytes = {} as MapMessage; - reader.readMessage( - mapInt32Bytes, - TestArenaMap.MapInt32Bytes._readMessage - ); - msg.mapInt32Bytes[mapInt32Bytes.key] = mapInt32Bytes.value; + const map = {} as TestArenaMap.MapInt32Bytes; + reader.readMessage(map, TestArenaMap.MapInt32Bytes._readMessage); + msg.mapInt32Bytes[map.key.toString()] = map.value; break; } case 16: { - const mapInt32Enum = {} as MapMessage; - reader.readMessage( - mapInt32Enum, - TestArenaMap.MapInt32Enum._readMessage - ); - msg.mapInt32Enum[mapInt32Enum.key] = mapInt32Enum.value; + const map = {} as TestArenaMap.MapInt32Enum; + reader.readMessage(map, TestArenaMap.MapInt32Enum._readMessage); + msg.mapInt32Enum[map.key.toString()] = map.value; break; } case 17: { - const mapInt32ForeignMessage = - {} as MapMessage; + const map = {} as TestArenaMap.MapInt32ForeignMessage; reader.readMessage( - mapInt32ForeignMessage, + map, TestArenaMap.MapInt32ForeignMessage._readMessage ); - msg.mapInt32ForeignMessage[mapInt32ForeignMessage.key] = - mapInt32ForeignMessage.value; + msg.mapInt32ForeignMessage[map.key.toString()] = map.value; break; } default: { @@ -117667,8 +117598,8 @@ export const TestArenaMap = { const _mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (_mapInt32Int32) { msg.mapInt32Int32 = Object.fromEntries( - Object.entries(_mapInt32Int32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Int32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117676,8 +117607,8 @@ export const TestArenaMap = { const _mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (_mapInt64Int64) { msg.mapInt64Int64 = Object.fromEntries( - Object.entries(_mapInt64Int64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt64Int64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117685,8 +117616,8 @@ export const TestArenaMap = { const _mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (_mapUint32Uint32) { msg.mapUint32Uint32 = Object.fromEntries( - Object.entries(_mapUint32Uint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint32Uint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117694,8 +117625,8 @@ export const TestArenaMap = { const _mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (_mapUint64Uint64) { msg.mapUint64Uint64 = Object.fromEntries( - Object.entries(_mapUint64Uint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapUint64Uint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117703,8 +117634,8 @@ export const TestArenaMap = { const _mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (_mapSint32Sint32) { msg.mapSint32Sint32 = Object.fromEntries( - Object.entries(_mapSint32Sint32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint32Sint32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117712,8 +117643,8 @@ export const TestArenaMap = { const _mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (_mapSint64Sint64) { msg.mapSint64Sint64 = Object.fromEntries( - Object.entries(_mapSint64Sint64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSint64Sint64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117722,8 +117653,8 @@ export const TestArenaMap = { json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (_mapFixed32Fixed32) { msg.mapFixed32Fixed32 = Object.fromEntries( - Object.entries(_mapFixed32Fixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed32Fixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117732,8 +117663,8 @@ export const TestArenaMap = { json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (_mapFixed64Fixed64) { msg.mapFixed64Fixed64 = Object.fromEntries( - Object.entries(_mapFixed64Fixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapFixed64Fixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117742,8 +117673,8 @@ export const TestArenaMap = { json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (_mapSfixed32Sfixed32) { msg.mapSfixed32Sfixed32 = Object.fromEntries( - Object.entries(_mapSfixed32Sfixed32) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed32Sfixed32._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117752,8 +117683,8 @@ export const TestArenaMap = { json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (_mapSfixed64Sfixed64) { msg.mapSfixed64Sfixed64 = Object.fromEntries( - Object.entries(_mapSfixed64Sfixed64) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapSfixed64Sfixed64._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117761,8 +117692,8 @@ export const TestArenaMap = { const _mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (_mapInt32Float) { msg.mapInt32Float = Object.fromEntries( - Object.entries(_mapInt32Float) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Float._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117770,8 +117701,8 @@ export const TestArenaMap = { const _mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (_mapInt32Double) { msg.mapInt32Double = Object.fromEntries( - Object.entries(_mapInt32Double) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Double._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117779,8 +117710,8 @@ export const TestArenaMap = { const _mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (_mapBoolBool) { msg.mapBoolBool = Object.fromEntries( - Object.entries(_mapBoolBool) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapBoolBool._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117788,8 +117719,8 @@ export const TestArenaMap = { const _mapStringString = json.mapStringString ?? json.map_string_string; if (_mapStringString) { msg.mapStringString = Object.fromEntries( - Object.entries(_mapStringString) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapStringString._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117797,8 +117728,8 @@ export const TestArenaMap = { const _mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (_mapInt32Bytes) { msg.mapInt32Bytes = Object.fromEntries( - Object.entries(_mapInt32Bytes) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Bytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Bytes._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117806,8 +117737,8 @@ export const TestArenaMap = { const _mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (_mapInt32Enum) { msg.mapInt32Enum = Object.fromEntries( - Object.entries(_mapInt32Enum) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32Enum) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32Enum._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117816,8 +117747,8 @@ export const TestArenaMap = { json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (_mapInt32ForeignMessage) { msg.mapInt32ForeignMessage = Object.fromEntries( - Object.entries(_mapInt32ForeignMessage) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_mapInt32ForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestArenaMap.MapInt32ForeignMessage._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -117830,7 +117761,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -117846,7 +117777,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -117862,9 +117793,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Int32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Int32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -117889,9 +117820,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Int32, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Int32 { const _key = json.key; if (_key) { msg.key = _key; @@ -117909,14 +117840,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeInt64String(1, msg.key.toString()); + writer.writeInt64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -117925,7 +117856,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -117941,9 +117872,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt64Int64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt64Int64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -117968,9 +117899,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt64Int64, json: any - ): MapMessage { + ): TestArenaMap.MapInt64Int64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -117988,7 +117919,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118004,7 +117935,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118020,9 +117951,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint32Uint32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapUint32Uint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118047,9 +117978,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint32Uint32, json: any - ): MapMessage { + ): TestArenaMap.MapUint32Uint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -118067,14 +117998,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeUint64String(1, msg.key.toString()); + writer.writeUint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeUint64String(2, msg.value.toString()); + writer.writeUint64String(2, msg.value.toString() as any); } return writer; }, @@ -118083,7 +118014,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118099,9 +118030,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint64Uint64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapUint64Uint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118126,9 +118057,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapUint64Uint64, json: any - ): MapMessage { + ): TestArenaMap.MapUint64Uint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -118146,7 +118077,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118162,7 +118093,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118178,9 +118109,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint32Sint32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSint32Sint32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118205,9 +118136,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint32Sint32, json: any - ): MapMessage { + ): TestArenaMap.MapSint32Sint32 { const _key = json.key; if (_key) { msg.key = _key; @@ -118225,14 +118156,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSint64String(1, msg.key.toString()); + writer.writeSint64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSint64String(2, msg.value.toString()); + writer.writeSint64String(2, msg.value.toString() as any); } return writer; }, @@ -118241,7 +118172,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118257,9 +118188,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint64Sint64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSint64Sint64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118284,9 +118215,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSint64Sint64, json: any - ): MapMessage { + ): TestArenaMap.MapSint64Sint64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -118304,7 +118235,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118320,7 +118251,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118336,9 +118267,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed32Fixed32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapFixed32Fixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118363,9 +118294,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed32Fixed32, json: any - ): MapMessage { + ): TestArenaMap.MapFixed32Fixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -118383,14 +118314,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeFixed64String(1, msg.key.toString()); + writer.writeFixed64String(1, msg.key.toString() as any); } if (msg.value) { - writer.writeFixed64String(2, msg.value.toString()); + writer.writeFixed64String(2, msg.value.toString() as any); } return writer; }, @@ -118399,7 +118330,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118415,9 +118346,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed64Fixed64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapFixed64Fixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118442,9 +118373,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapFixed64Fixed64, json: any - ): MapMessage { + ): TestArenaMap.MapFixed64Fixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -118462,7 +118393,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118478,7 +118409,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118494,9 +118425,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed32Sfixed32, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSfixed32Sfixed32 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118521,9 +118452,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed32Sfixed32, json: any - ): MapMessage { + ): TestArenaMap.MapSfixed32Sfixed32 { const _key = json.key; if (_key) { msg.key = _key; @@ -118541,14 +118472,14 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { - writer.writeSfixed64(1, msg.key.toString()); + writer.writeSfixed64(1, msg.key.toString() as any); } if (msg.value) { - writer.writeSfixed64(2, msg.value.toString()); + writer.writeSfixed64(2, msg.value.toString() as any); } return writer; }, @@ -118557,7 +118488,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118573,9 +118504,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed64Sfixed64, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapSfixed64Sfixed64 { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118600,9 +118531,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapSfixed64Sfixed64, json: any - ): MapMessage { + ): TestArenaMap.MapSfixed64Sfixed64 { const _key = json.key; if (_key) { msg.key = BigInt(_key); @@ -118620,7 +118551,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118636,7 +118567,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118652,9 +118583,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Float, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Float { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118679,9 +118610,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Float, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Float { const _key = json.key; if (_key) { msg.key = _key; @@ -118699,7 +118630,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118715,7 +118646,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118731,9 +118662,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Double, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Double { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118758,9 +118689,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Double, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Double { const _key = json.key; if (_key) { msg.key = _key; @@ -118778,7 +118709,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118794,7 +118725,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118810,9 +118741,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapBoolBool, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapBoolBool { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118837,9 +118768,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapBoolBool, json: any - ): MapMessage { + ): TestArenaMap.MapBoolBool { const _key = json.key; if (_key) { msg.key = _key; @@ -118857,7 +118788,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118873,7 +118804,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118889,9 +118820,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapStringString, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapStringString { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118916,9 +118847,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapStringString, json: any - ): MapMessage { + ): TestArenaMap.MapStringString { const _key = json.key; if (_key) { msg.key = _key; @@ -118936,7 +118867,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -118952,7 +118883,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -118968,9 +118899,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Bytes, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Bytes { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -118995,9 +118926,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Bytes, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Bytes { const _key = json.key; if (_key) { msg.key = _key; @@ -119015,7 +118946,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -119031,7 +118962,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -119047,9 +118978,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Enum, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32Enum { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -119074,9 +119005,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32Enum, json: any - ): MapMessage { + ): TestArenaMap.MapInt32Enum { const _key = json.key; if (_key) { msg.key = _key; @@ -119094,7 +119025,7 @@ export const TestArenaMap = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -119110,7 +119041,7 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -119129,9 +119060,9 @@ export const TestArenaMap = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32ForeignMessage, reader: BinaryReader - ): MapMessage { + ): TestArenaMap.MapInt32ForeignMessage { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -119159,9 +119090,9 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestArenaMap.MapInt32ForeignMessage, json: any - ): MapMessage { + ): TestArenaMap.MapInt32ForeignMessage { const _key = json.key; if (_key) { msg.key = _key; @@ -119236,9 +119167,9 @@ export const MessageContainingMapCalledEntry = { if (msg.entry) { writer.writeRepeatedMessage( 1, - Object.entries(msg.entry).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.entry).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MessageContainingMapCalledEntry.Entry._writeMessage ); @@ -119255,8 +119186,8 @@ export const MessageContainingMapCalledEntry = { const json: Record = {}; if (msg.entry) { const entry = Object.fromEntries( - Object.entries(msg.entry) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.entry) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MessageContainingMapCalledEntry.Entry._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -119278,12 +119209,12 @@ export const MessageContainingMapCalledEntry = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const entry = {} as MapMessage; + const map = {} as MessageContainingMapCalledEntry.Entry; reader.readMessage( - entry, + map, MessageContainingMapCalledEntry.Entry._readMessage ); - msg.entry[entry.key] = entry.value; + msg.entry[map.key.toString()] = map.value; break; } default: { @@ -119305,8 +119236,8 @@ export const MessageContainingMapCalledEntry = { const _entry = json.entry; if (_entry) { msg.entry = Object.fromEntries( - Object.entries(_entry) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_entry) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MessageContainingMapCalledEntry.Entry._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -119319,7 +119250,7 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -119335,7 +119266,7 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -119351,9 +119282,9 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MessageContainingMapCalledEntry.Entry, reader: BinaryReader - ): MapMessage { + ): MessageContainingMapCalledEntry.Entry { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -119378,9 +119309,9 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MessageContainingMapCalledEntry.Entry, json: any - ): MapMessage { + ): MessageContainingMapCalledEntry.Entry { const _key = json.key; if (_key) { msg.key = _key; @@ -119451,9 +119382,9 @@ export const TestRecursiveMapMessage = { if (msg.a) { writer.writeRepeatedMessage( 1, - Object.entries(msg.a).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.a).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, TestRecursiveMapMessage.A._writeMessage ); @@ -119470,8 +119401,8 @@ export const TestRecursiveMapMessage = { const json: Record = {}; if (msg.a) { const a = Object.fromEntries( - Object.entries(msg.a) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.a) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRecursiveMapMessage.A._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -119493,9 +119424,9 @@ export const TestRecursiveMapMessage = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const a = {} as MapMessage; - reader.readMessage(a, TestRecursiveMapMessage.A._readMessage); - msg.a[a.key] = a.value; + const map = {} as TestRecursiveMapMessage.A; + reader.readMessage(map, TestRecursiveMapMessage.A._readMessage); + msg.a[map.key.toString()] = map.value; break; } default: { @@ -119517,8 +119448,8 @@ export const TestRecursiveMapMessage = { const _a = json.a; if (_a) { msg.a = Object.fromEntries( - Object.entries(_a) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_a) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(TestRecursiveMapMessage.A._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -119531,7 +119462,7 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -119551,7 +119482,7 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -119570,9 +119501,9 @@ export const TestRecursiveMapMessage = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: TestRecursiveMapMessage.A, reader: BinaryReader - ): MapMessage { + ): TestRecursiveMapMessage.A { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -119600,9 +119531,9 @@ export const TestRecursiveMapMessage = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: TestRecursiveMapMessage.A, json: any - ): MapMessage { + ): TestRecursiveMapMessage.A { const _key = json.key; if (_key) { msg.key = _key; @@ -122346,7 +122277,7 @@ export const Duration = { writer: BinaryWriter ): BinaryWriter { if (msg.seconds) { - writer.writeInt64String(1, msg.seconds.toString()); + writer.writeInt64String(1, msg.seconds.toString() as any); } if (msg.nanos) { writer.writeInt32(2, msg.nanos); @@ -122898,7 +122829,7 @@ export const FieldMask = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/struct.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter } from \\"twirpscript\\"; //========================================// @@ -122927,11 +122858,14 @@ export interface Struct { /** * Unordered map of dynamically typed values. */ - fields: Struct.Fields; + fields: Record; } declare namespace Struct { - export type Fields = Record; + interface Fields { + key: string; + value: Value; + } } /** @@ -123068,9 +123002,9 @@ export const Struct = { if (msg.fields) { writer.writeRepeatedMessage( 1, - Object.entries(msg.fields).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fields).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, Struct.Fields._writeMessage ); @@ -123085,8 +123019,8 @@ export const Struct = { const json: Record = {}; if (msg.fields) { const fields = Object.fromEntries( - Object.entries(msg.fields) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fields) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Struct.Fields._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -123105,9 +123039,9 @@ export const Struct = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const fields = {} as MapMessage; - reader.readMessage(fields, Struct.Fields._readMessage); - msg.fields[fields.key] = fields.value; + const map = {} as Struct.Fields; + reader.readMessage(map, Struct.Fields._readMessage); + msg.fields[map.key.toString()] = map.value; break; } default: { @@ -123126,8 +123060,8 @@ export const Struct = { const _fields = json.fields; if (_fields) { msg.fields = Object.fromEntries( - Object.entries(_fields) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fields) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Struct.Fields._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -123140,7 +123074,7 @@ export const Struct = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -123156,7 +123090,7 @@ export const Struct = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -123175,9 +123109,9 @@ export const Struct = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: Struct.Fields, reader: BinaryReader - ): MapMessage { + ): Struct.Fields { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -123201,10 +123135,7 @@ export const Struct = { /** * @private */ - _readMessageJSON: function ( - msg: MapMessage, - json: any - ): MapMessage { + _readMessageJSON: function (msg: Struct.Fields, json: any): Struct.Fields { const _key = json.key; if (_key) { msg.key = _key; @@ -123698,7 +123629,7 @@ export const Timestamp = { writer: BinaryWriter ): BinaryWriter { if (msg.seconds) { - writer.writeInt64String(1, msg.seconds.toString()); + writer.writeInt64String(1, msg.seconds.toString() as any); } if (msg.nanos) { writer.writeInt32(2, msg.nanos); @@ -124168,7 +124099,7 @@ export const Int64Value = { writer: BinaryWriter ): BinaryWriter { if (msg.value) { - writer.writeInt64String(1, msg.value.toString()); + writer.writeInt64String(1, msg.value.toString() as any); } return writer; }, @@ -124270,7 +124201,7 @@ export const UInt64Value = { writer: BinaryWriter ): BinaryWriter { if (msg.value) { - writer.writeUint64String(1, msg.value.toString()); + writer.writeUint64String(1, msg.value.toString() as any); } return writer; }, @@ -124853,7 +124784,7 @@ export const BytesValue = { "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: google/protobuf/unittest_well_known_types.proto -import type { ByteSource, MapMessage } from \\"twirpscript\\"; +import type { ByteSource } from \\"twirpscript\\"; import { BinaryReader, BinaryWriter } from \\"twirpscript\\"; import { Any } from \\"./any.pb\\"; @@ -124965,62 +124896,143 @@ export interface OneofWellKnownTypes { * well-known types, as messages can't be map keys. */ export interface MapWellKnownTypes { - anyField: MapWellKnownTypes.AnyField; - apiField: MapWellKnownTypes.ApiField; - durationField: MapWellKnownTypes.DurationField; - emptyField: MapWellKnownTypes.EmptyField; - fieldMaskField: MapWellKnownTypes.FieldMaskField; - sourceContextField: MapWellKnownTypes.SourceContextField; - structField: MapWellKnownTypes.StructField; - timestampField: MapWellKnownTypes.TimestampField; - typeField: MapWellKnownTypes.TypeField; - doubleField: MapWellKnownTypes.DoubleField; - floatField: MapWellKnownTypes.FloatField; - int64Field: MapWellKnownTypes.Int64Field; - uint64Field: MapWellKnownTypes.Uint64Field; - int32Field: MapWellKnownTypes.Int32Field; - uint32Field: MapWellKnownTypes.Uint32Field; - boolField: MapWellKnownTypes.BoolField; - stringField: MapWellKnownTypes.StringField; - bytesField: MapWellKnownTypes.BytesField; + anyField: Record; + apiField: Record; + durationField: Record< + string, + MapWellKnownTypes.DurationField[\\"value\\"] | undefined + >; + emptyField: Record; + fieldMaskField: Record< + string, + MapWellKnownTypes.FieldMaskField[\\"value\\"] | undefined + >; + sourceContextField: Record< + string, + MapWellKnownTypes.SourceContextField[\\"value\\"] | undefined + >; + structField: Record< + string, + MapWellKnownTypes.StructField[\\"value\\"] | undefined + >; + timestampField: Record< + string, + MapWellKnownTypes.TimestampField[\\"value\\"] | undefined + >; + typeField: Record; + doubleField: Record< + string, + MapWellKnownTypes.DoubleField[\\"value\\"] | undefined + >; + floatField: Record; + int64Field: Record; + uint64Field: Record< + string, + MapWellKnownTypes.Uint64Field[\\"value\\"] | undefined + >; + int32Field: Record; + uint32Field: Record< + string, + MapWellKnownTypes.Uint32Field[\\"value\\"] | undefined + >; + boolField: Record; + stringField: Record< + string, + MapWellKnownTypes.StringField[\\"value\\"] | undefined + >; + bytesField: Record; } declare namespace MapWellKnownTypes { - export type AnyField = Record; + interface AnyField { + key: number; + value: Any; + } - export type ApiField = Record; + interface ApiField { + key: number; + value: Api; + } - export type DurationField = Record; + interface DurationField { + key: number; + value: Duration; + } - export type EmptyField = Record; + interface EmptyField { + key: number; + value: Empty; + } - export type FieldMaskField = Record; + interface FieldMaskField { + key: number; + value: FieldMask; + } - export type SourceContextField = Record; + interface SourceContextField { + key: number; + value: SourceContext; + } - export type StructField = Record; + interface StructField { + key: number; + value: Struct; + } - export type TimestampField = Record; + interface TimestampField { + key: number; + value: Timestamp; + } - export type TypeField = Record; + interface TypeField { + key: number; + value: Type; + } - export type DoubleField = Record; + interface DoubleField { + key: number; + value: DoubleValue; + } - export type FloatField = Record; + interface FloatField { + key: number; + value: FloatValue; + } - export type Int64Field = Record; + interface Int64Field { + key: number; + value: Int64Value; + } - export type Uint64Field = Record; + interface Uint64Field { + key: number; + value: UInt64Value; + } - export type Int32Field = Record; + interface Int32Field { + key: number; + value: Int32Value; + } - export type Uint32Field = Record; + interface Uint32Field { + key: number; + value: UInt32Value; + } - export type BoolField = Record; + interface BoolField { + key: number; + value: BoolValue; + } - export type StringField = Record; + interface StringField { + key: number; + value: StringValue; + } - export type BytesField = Record; + interface BytesField { + key: number; + value: BytesValue; + } } //========================================// @@ -126590,9 +126602,9 @@ export const MapWellKnownTypes = { if (msg.anyField) { writer.writeRepeatedMessage( 1, - Object.entries(msg.anyField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.anyField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.AnyField._writeMessage ); @@ -126600,9 +126612,9 @@ export const MapWellKnownTypes = { if (msg.apiField) { writer.writeRepeatedMessage( 2, - Object.entries(msg.apiField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.apiField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.ApiField._writeMessage ); @@ -126610,9 +126622,9 @@ export const MapWellKnownTypes = { if (msg.durationField) { writer.writeRepeatedMessage( 3, - Object.entries(msg.durationField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.durationField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.DurationField._writeMessage ); @@ -126620,9 +126632,9 @@ export const MapWellKnownTypes = { if (msg.emptyField) { writer.writeRepeatedMessage( 4, - Object.entries(msg.emptyField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.emptyField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.EmptyField._writeMessage ); @@ -126630,9 +126642,9 @@ export const MapWellKnownTypes = { if (msg.fieldMaskField) { writer.writeRepeatedMessage( 5, - Object.entries(msg.fieldMaskField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fieldMaskField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.FieldMaskField._writeMessage ); @@ -126640,9 +126652,9 @@ export const MapWellKnownTypes = { if (msg.sourceContextField) { writer.writeRepeatedMessage( 6, - Object.entries(msg.sourceContextField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.sourceContextField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.SourceContextField._writeMessage ); @@ -126650,9 +126662,9 @@ export const MapWellKnownTypes = { if (msg.structField) { writer.writeRepeatedMessage( 7, - Object.entries(msg.structField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.structField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.StructField._writeMessage ); @@ -126660,9 +126672,9 @@ export const MapWellKnownTypes = { if (msg.timestampField) { writer.writeRepeatedMessage( 8, - Object.entries(msg.timestampField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.timestampField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.TimestampField._writeMessage ); @@ -126670,9 +126682,9 @@ export const MapWellKnownTypes = { if (msg.typeField) { writer.writeRepeatedMessage( 9, - Object.entries(msg.typeField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.typeField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.TypeField._writeMessage ); @@ -126680,9 +126692,9 @@ export const MapWellKnownTypes = { if (msg.doubleField) { writer.writeRepeatedMessage( 10, - Object.entries(msg.doubleField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.doubleField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.DoubleField._writeMessage ); @@ -126690,9 +126702,9 @@ export const MapWellKnownTypes = { if (msg.floatField) { writer.writeRepeatedMessage( 11, - Object.entries(msg.floatField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.floatField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.FloatField._writeMessage ); @@ -126700,9 +126712,9 @@ export const MapWellKnownTypes = { if (msg.int64Field) { writer.writeRepeatedMessage( 12, - Object.entries(msg.int64Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.int64Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Int64Field._writeMessage ); @@ -126710,9 +126722,9 @@ export const MapWellKnownTypes = { if (msg.uint64Field) { writer.writeRepeatedMessage( 13, - Object.entries(msg.uint64Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.uint64Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Uint64Field._writeMessage ); @@ -126720,9 +126732,9 @@ export const MapWellKnownTypes = { if (msg.int32Field) { writer.writeRepeatedMessage( 14, - Object.entries(msg.int32Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.int32Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Int32Field._writeMessage ); @@ -126730,9 +126742,9 @@ export const MapWellKnownTypes = { if (msg.uint32Field) { writer.writeRepeatedMessage( 15, - Object.entries(msg.uint32Field).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.uint32Field).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.Uint32Field._writeMessage ); @@ -126740,9 +126752,9 @@ export const MapWellKnownTypes = { if (msg.boolField) { writer.writeRepeatedMessage( 16, - Object.entries(msg.boolField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.boolField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.BoolField._writeMessage ); @@ -126750,9 +126762,9 @@ export const MapWellKnownTypes = { if (msg.stringField) { writer.writeRepeatedMessage( 17, - Object.entries(msg.stringField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.stringField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.StringField._writeMessage ); @@ -126760,9 +126772,9 @@ export const MapWellKnownTypes = { if (msg.bytesField) { writer.writeRepeatedMessage( 18, - Object.entries(msg.bytesField).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.bytesField).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, MapWellKnownTypes.BytesField._writeMessage ); @@ -126779,8 +126791,8 @@ export const MapWellKnownTypes = { const json: Record = {}; if (msg.anyField) { const anyField = Object.fromEntries( - Object.entries(msg.anyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.anyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.AnyField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126790,8 +126802,8 @@ export const MapWellKnownTypes = { } if (msg.apiField) { const apiField = Object.fromEntries( - Object.entries(msg.apiField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.apiField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.ApiField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126801,8 +126813,8 @@ export const MapWellKnownTypes = { } if (msg.durationField) { const durationField = Object.fromEntries( - Object.entries(msg.durationField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.durationField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DurationField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126812,8 +126824,8 @@ export const MapWellKnownTypes = { } if (msg.emptyField) { const emptyField = Object.fromEntries( - Object.entries(msg.emptyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.emptyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.EmptyField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126823,8 +126835,8 @@ export const MapWellKnownTypes = { } if (msg.fieldMaskField) { const fieldMaskField = Object.fromEntries( - Object.entries(msg.fieldMaskField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fieldMaskField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FieldMaskField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126834,8 +126846,8 @@ export const MapWellKnownTypes = { } if (msg.sourceContextField) { const sourceContextField = Object.fromEntries( - Object.entries(msg.sourceContextField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.sourceContextField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.SourceContextField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126845,8 +126857,8 @@ export const MapWellKnownTypes = { } if (msg.structField) { const structField = Object.fromEntries( - Object.entries(msg.structField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.structField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StructField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126856,8 +126868,8 @@ export const MapWellKnownTypes = { } if (msg.timestampField) { const timestampField = Object.fromEntries( - Object.entries(msg.timestampField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.timestampField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TimestampField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126867,8 +126879,8 @@ export const MapWellKnownTypes = { } if (msg.typeField) { const typeField = Object.fromEntries( - Object.entries(msg.typeField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.typeField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TypeField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126878,8 +126890,8 @@ export const MapWellKnownTypes = { } if (msg.doubleField) { const doubleField = Object.fromEntries( - Object.entries(msg.doubleField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.doubleField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DoubleField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126889,8 +126901,8 @@ export const MapWellKnownTypes = { } if (msg.floatField) { const floatField = Object.fromEntries( - Object.entries(msg.floatField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.floatField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FloatField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126900,8 +126912,8 @@ export const MapWellKnownTypes = { } if (msg.int64Field) { const int64Field = Object.fromEntries( - Object.entries(msg.int64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.int64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int64Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126911,8 +126923,8 @@ export const MapWellKnownTypes = { } if (msg.uint64Field) { const uint64Field = Object.fromEntries( - Object.entries(msg.uint64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.uint64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint64Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126922,8 +126934,8 @@ export const MapWellKnownTypes = { } if (msg.int32Field) { const int32Field = Object.fromEntries( - Object.entries(msg.int32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.int32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int32Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126933,8 +126945,8 @@ export const MapWellKnownTypes = { } if (msg.uint32Field) { const uint32Field = Object.fromEntries( - Object.entries(msg.uint32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.uint32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint32Field._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126944,8 +126956,8 @@ export const MapWellKnownTypes = { } if (msg.boolField) { const boolField = Object.fromEntries( - Object.entries(msg.boolField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.boolField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BoolField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126955,8 +126967,8 @@ export const MapWellKnownTypes = { } if (msg.stringField) { const stringField = Object.fromEntries( - Object.entries(msg.stringField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.stringField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StringField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126966,8 +126978,8 @@ export const MapWellKnownTypes = { } if (msg.bytesField) { const bytesField = Object.fromEntries( - Object.entries(msg.bytesField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.bytesField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BytesField._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -126989,164 +127001,120 @@ export const MapWellKnownTypes = { const field = reader.getFieldNumber(); switch (field) { case 1: { - const anyField = {} as MapMessage; - reader.readMessage(anyField, MapWellKnownTypes.AnyField._readMessage); - msg.anyField[anyField.key] = anyField.value; + const map = {} as MapWellKnownTypes.AnyField; + reader.readMessage(map, MapWellKnownTypes.AnyField._readMessage); + msg.anyField[map.key.toString()] = map.value; break; } case 2: { - const apiField = {} as MapMessage; - reader.readMessage(apiField, MapWellKnownTypes.ApiField._readMessage); - msg.apiField[apiField.key] = apiField.value; + const map = {} as MapWellKnownTypes.ApiField; + reader.readMessage(map, MapWellKnownTypes.ApiField._readMessage); + msg.apiField[map.key.toString()] = map.value; break; } case 3: { - const durationField = - {} as MapMessage; - reader.readMessage( - durationField, - MapWellKnownTypes.DurationField._readMessage - ); - msg.durationField[durationField.key] = durationField.value; + const map = {} as MapWellKnownTypes.DurationField; + reader.readMessage(map, MapWellKnownTypes.DurationField._readMessage); + msg.durationField[map.key.toString()] = map.value; break; } case 4: { - const emptyField = {} as MapMessage; - reader.readMessage( - emptyField, - MapWellKnownTypes.EmptyField._readMessage - ); - msg.emptyField[emptyField.key] = emptyField.value; + const map = {} as MapWellKnownTypes.EmptyField; + reader.readMessage(map, MapWellKnownTypes.EmptyField._readMessage); + msg.emptyField[map.key.toString()] = map.value; break; } case 5: { - const fieldMaskField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.FieldMaskField; reader.readMessage( - fieldMaskField, + map, MapWellKnownTypes.FieldMaskField._readMessage ); - msg.fieldMaskField[fieldMaskField.key] = fieldMaskField.value; + msg.fieldMaskField[map.key.toString()] = map.value; break; } case 6: { - const sourceContextField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.SourceContextField; reader.readMessage( - sourceContextField, + map, MapWellKnownTypes.SourceContextField._readMessage ); - msg.sourceContextField[sourceContextField.key] = - sourceContextField.value; + msg.sourceContextField[map.key.toString()] = map.value; break; } case 7: { - const structField = {} as MapMessage; - reader.readMessage( - structField, - MapWellKnownTypes.StructField._readMessage - ); - msg.structField[structField.key] = structField.value; + const map = {} as MapWellKnownTypes.StructField; + reader.readMessage(map, MapWellKnownTypes.StructField._readMessage); + msg.structField[map.key.toString()] = map.value; break; } case 8: { - const timestampField = - {} as MapMessage; + const map = {} as MapWellKnownTypes.TimestampField; reader.readMessage( - timestampField, + map, MapWellKnownTypes.TimestampField._readMessage ); - msg.timestampField[timestampField.key] = timestampField.value; + msg.timestampField[map.key.toString()] = map.value; break; } case 9: { - const typeField = {} as MapMessage; - reader.readMessage( - typeField, - MapWellKnownTypes.TypeField._readMessage - ); - msg.typeField[typeField.key] = typeField.value; + const map = {} as MapWellKnownTypes.TypeField; + reader.readMessage(map, MapWellKnownTypes.TypeField._readMessage); + msg.typeField[map.key.toString()] = map.value; break; } case 10: { - const doubleField = {} as MapMessage; - reader.readMessage( - doubleField, - MapWellKnownTypes.DoubleField._readMessage - ); - msg.doubleField[doubleField.key] = doubleField.value; + const map = {} as MapWellKnownTypes.DoubleField; + reader.readMessage(map, MapWellKnownTypes.DoubleField._readMessage); + msg.doubleField[map.key.toString()] = map.value; break; } case 11: { - const floatField = {} as MapMessage; - reader.readMessage( - floatField, - MapWellKnownTypes.FloatField._readMessage - ); - msg.floatField[floatField.key] = floatField.value; + const map = {} as MapWellKnownTypes.FloatField; + reader.readMessage(map, MapWellKnownTypes.FloatField._readMessage); + msg.floatField[map.key.toString()] = map.value; break; } case 12: { - const int64Field = {} as MapMessage; - reader.readMessage( - int64Field, - MapWellKnownTypes.Int64Field._readMessage - ); - msg.int64Field[int64Field.key] = int64Field.value; + const map = {} as MapWellKnownTypes.Int64Field; + reader.readMessage(map, MapWellKnownTypes.Int64Field._readMessage); + msg.int64Field[map.key.toString()] = map.value; break; } case 13: { - const uint64Field = {} as MapMessage; - reader.readMessage( - uint64Field, - MapWellKnownTypes.Uint64Field._readMessage - ); - msg.uint64Field[uint64Field.key] = uint64Field.value; + const map = {} as MapWellKnownTypes.Uint64Field; + reader.readMessage(map, MapWellKnownTypes.Uint64Field._readMessage); + msg.uint64Field[map.key.toString()] = map.value; break; } case 14: { - const int32Field = {} as MapMessage; - reader.readMessage( - int32Field, - MapWellKnownTypes.Int32Field._readMessage - ); - msg.int32Field[int32Field.key] = int32Field.value; + const map = {} as MapWellKnownTypes.Int32Field; + reader.readMessage(map, MapWellKnownTypes.Int32Field._readMessage); + msg.int32Field[map.key.toString()] = map.value; break; } case 15: { - const uint32Field = {} as MapMessage; - reader.readMessage( - uint32Field, - MapWellKnownTypes.Uint32Field._readMessage - ); - msg.uint32Field[uint32Field.key] = uint32Field.value; + const map = {} as MapWellKnownTypes.Uint32Field; + reader.readMessage(map, MapWellKnownTypes.Uint32Field._readMessage); + msg.uint32Field[map.key.toString()] = map.value; break; } case 16: { - const boolField = {} as MapMessage; - reader.readMessage( - boolField, - MapWellKnownTypes.BoolField._readMessage - ); - msg.boolField[boolField.key] = boolField.value; + const map = {} as MapWellKnownTypes.BoolField; + reader.readMessage(map, MapWellKnownTypes.BoolField._readMessage); + msg.boolField[map.key.toString()] = map.value; break; } case 17: { - const stringField = {} as MapMessage; - reader.readMessage( - stringField, - MapWellKnownTypes.StringField._readMessage - ); - msg.stringField[stringField.key] = stringField.value; + const map = {} as MapWellKnownTypes.StringField; + reader.readMessage(map, MapWellKnownTypes.StringField._readMessage); + msg.stringField[map.key.toString()] = map.value; break; } case 18: { - const bytesField = {} as MapMessage; - reader.readMessage( - bytesField, - MapWellKnownTypes.BytesField._readMessage - ); - msg.bytesField[bytesField.key] = bytesField.value; + const map = {} as MapWellKnownTypes.BytesField; + reader.readMessage(map, MapWellKnownTypes.BytesField._readMessage); + msg.bytesField[map.key.toString()] = map.value; break; } default: { @@ -127168,8 +127136,8 @@ export const MapWellKnownTypes = { const _anyField = json.anyField ?? json.any_field; if (_anyField) { msg.anyField = Object.fromEntries( - Object.entries(_anyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_anyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.AnyField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127177,8 +127145,8 @@ export const MapWellKnownTypes = { const _apiField = json.apiField ?? json.api_field; if (_apiField) { msg.apiField = Object.fromEntries( - Object.entries(_apiField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_apiField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.ApiField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127186,8 +127154,8 @@ export const MapWellKnownTypes = { const _durationField = json.durationField ?? json.duration_field; if (_durationField) { msg.durationField = Object.fromEntries( - Object.entries(_durationField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_durationField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DurationField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127195,8 +127163,8 @@ export const MapWellKnownTypes = { const _emptyField = json.emptyField ?? json.empty_field; if (_emptyField) { msg.emptyField = Object.fromEntries( - Object.entries(_emptyField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_emptyField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.EmptyField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127204,8 +127172,8 @@ export const MapWellKnownTypes = { const _fieldMaskField = json.fieldMaskField ?? json.field_mask_field; if (_fieldMaskField) { msg.fieldMaskField = Object.fromEntries( - Object.entries(_fieldMaskField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fieldMaskField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FieldMaskField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127214,8 +127182,8 @@ export const MapWellKnownTypes = { json.sourceContextField ?? json.source_context_field; if (_sourceContextField) { msg.sourceContextField = Object.fromEntries( - Object.entries(_sourceContextField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_sourceContextField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.SourceContextField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127223,8 +127191,8 @@ export const MapWellKnownTypes = { const _structField = json.structField ?? json.struct_field; if (_structField) { msg.structField = Object.fromEntries( - Object.entries(_structField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_structField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StructField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127232,8 +127200,8 @@ export const MapWellKnownTypes = { const _timestampField = json.timestampField ?? json.timestamp_field; if (_timestampField) { msg.timestampField = Object.fromEntries( - Object.entries(_timestampField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_timestampField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TimestampField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127241,8 +127209,8 @@ export const MapWellKnownTypes = { const _typeField = json.typeField ?? json.type_field; if (_typeField) { msg.typeField = Object.fromEntries( - Object.entries(_typeField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_typeField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.TypeField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127250,8 +127218,8 @@ export const MapWellKnownTypes = { const _doubleField = json.doubleField ?? json.double_field; if (_doubleField) { msg.doubleField = Object.fromEntries( - Object.entries(_doubleField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_doubleField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.DoubleField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127259,8 +127227,8 @@ export const MapWellKnownTypes = { const _floatField = json.floatField ?? json.float_field; if (_floatField) { msg.floatField = Object.fromEntries( - Object.entries(_floatField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_floatField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.FloatField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127268,8 +127236,8 @@ export const MapWellKnownTypes = { const _int64Field = json.int64Field ?? json.int64_field; if (_int64Field) { msg.int64Field = Object.fromEntries( - Object.entries(_int64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_int64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int64Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127277,8 +127245,8 @@ export const MapWellKnownTypes = { const _uint64Field = json.uint64Field ?? json.uint64_field; if (_uint64Field) { msg.uint64Field = Object.fromEntries( - Object.entries(_uint64Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_uint64Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint64Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127286,8 +127254,8 @@ export const MapWellKnownTypes = { const _int32Field = json.int32Field ?? json.int32_field; if (_int32Field) { msg.int32Field = Object.fromEntries( - Object.entries(_int32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_int32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Int32Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127295,8 +127263,8 @@ export const MapWellKnownTypes = { const _uint32Field = json.uint32Field ?? json.uint32_field; if (_uint32Field) { msg.uint32Field = Object.fromEntries( - Object.entries(_uint32Field) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_uint32Field) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.Uint32Field._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127304,8 +127272,8 @@ export const MapWellKnownTypes = { const _boolField = json.boolField ?? json.bool_field; if (_boolField) { msg.boolField = Object.fromEntries( - Object.entries(_boolField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_boolField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BoolField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127313,8 +127281,8 @@ export const MapWellKnownTypes = { const _stringField = json.stringField ?? json.string_field; if (_stringField) { msg.stringField = Object.fromEntries( - Object.entries(_stringField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_stringField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.StringField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127322,8 +127290,8 @@ export const MapWellKnownTypes = { const _bytesField = json.bytesField ?? json.bytes_field; if (_bytesField) { msg.bytesField = Object.fromEntries( - Object.entries(_bytesField) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_bytesField) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(MapWellKnownTypes.BytesField._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -127336,7 +127304,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127352,7 +127320,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127371,9 +127339,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.AnyField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.AnyField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127398,9 +127366,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.AnyField, json: any - ): MapMessage { + ): MapWellKnownTypes.AnyField { const _key = json.key; if (_key) { msg.key = _key; @@ -127420,7 +127388,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127436,7 +127404,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127455,9 +127423,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.ApiField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.ApiField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127482,9 +127450,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.ApiField, json: any - ): MapMessage { + ): MapWellKnownTypes.ApiField { const _key = json.key; if (_key) { msg.key = _key; @@ -127504,7 +127472,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127520,7 +127488,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127539,9 +127507,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DurationField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.DurationField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127566,9 +127534,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DurationField, json: any - ): MapMessage { + ): MapWellKnownTypes.DurationField { const _key = json.key; if (_key) { msg.key = _key; @@ -127588,7 +127556,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127604,7 +127572,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127623,9 +127591,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.EmptyField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.EmptyField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127650,9 +127618,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.EmptyField, json: any - ): MapMessage { + ): MapWellKnownTypes.EmptyField { const _key = json.key; if (_key) { msg.key = _key; @@ -127672,7 +127640,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127688,7 +127656,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127707,9 +127675,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FieldMaskField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.FieldMaskField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127734,9 +127702,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FieldMaskField, json: any - ): MapMessage { + ): MapWellKnownTypes.FieldMaskField { const _key = json.key; if (_key) { msg.key = _key; @@ -127756,7 +127724,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127772,7 +127740,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127791,9 +127759,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.SourceContextField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.SourceContextField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127821,9 +127789,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.SourceContextField, json: any - ): MapMessage { + ): MapWellKnownTypes.SourceContextField { const _key = json.key; if (_key) { msg.key = _key; @@ -127843,7 +127811,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127859,7 +127827,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127878,9 +127846,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StructField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.StructField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127905,9 +127873,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StructField, json: any - ): MapMessage { + ): MapWellKnownTypes.StructField { const _key = json.key; if (_key) { msg.key = _key; @@ -127927,7 +127895,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -127943,7 +127911,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -127962,9 +127930,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TimestampField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.TimestampField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -127989,9 +127957,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TimestampField, json: any - ): MapMessage { + ): MapWellKnownTypes.TimestampField { const _key = json.key; if (_key) { msg.key = _key; @@ -128011,7 +127979,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128027,7 +127995,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128046,9 +128014,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TypeField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.TypeField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128073,9 +128041,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.TypeField, json: any - ): MapMessage { + ): MapWellKnownTypes.TypeField { const _key = json.key; if (_key) { msg.key = _key; @@ -128095,7 +128063,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128111,7 +128079,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128130,9 +128098,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DoubleField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.DoubleField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128160,9 +128128,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.DoubleField, json: any - ): MapMessage { + ): MapWellKnownTypes.DoubleField { const _key = json.key; if (_key) { msg.key = _key; @@ -128182,7 +128150,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128198,7 +128166,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128217,9 +128185,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FloatField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.FloatField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128247,9 +128215,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.FloatField, json: any - ): MapMessage { + ): MapWellKnownTypes.FloatField { const _key = json.key; if (_key) { msg.key = _key; @@ -128269,7 +128237,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128285,7 +128253,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128304,9 +128272,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int64Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Int64Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128334,9 +128302,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int64Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Int64Field { const _key = json.key; if (_key) { msg.key = _key; @@ -128356,7 +128324,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128372,7 +128340,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128391,9 +128359,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint64Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Uint64Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128421,9 +128389,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint64Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Uint64Field { const _key = json.key; if (_key) { msg.key = _key; @@ -128443,7 +128411,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128459,7 +128427,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128478,9 +128446,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int32Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Int32Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128508,9 +128476,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Int32Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Int32Field { const _key = json.key; if (_key) { msg.key = _key; @@ -128530,7 +128498,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128546,7 +128514,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128565,9 +128533,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint32Field, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.Uint32Field { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128595,9 +128563,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.Uint32Field, json: any - ): MapMessage { + ): MapWellKnownTypes.Uint32Field { const _key = json.key; if (_key) { msg.key = _key; @@ -128617,7 +128585,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128633,7 +128601,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128652,9 +128620,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BoolField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.BoolField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128679,9 +128647,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BoolField, json: any - ): MapMessage { + ): MapWellKnownTypes.BoolField { const _key = json.key; if (_key) { msg.key = _key; @@ -128701,7 +128669,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128717,7 +128685,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128736,9 +128704,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StringField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.StringField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128766,9 +128734,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.StringField, json: any - ): MapMessage { + ): MapWellKnownTypes.StringField { const _key = json.key; if (_key) { msg.key = _key; @@ -128788,7 +128756,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -128804,7 +128772,7 @@ export const MapWellKnownTypes = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -128823,9 +128791,9 @@ export const MapWellKnownTypes = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BytesField, reader: BinaryReader - ): MapMessage { + ): MapWellKnownTypes.BytesField { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -128853,9 +128821,9 @@ export const MapWellKnownTypes = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: MapWellKnownTypes.BytesField, json: any - ): MapMessage { + ): MapWellKnownTypes.BytesField { const _key = json.key; if (_key) { msg.key = _key; @@ -129243,31 +129211,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64.toString()); + writer.writeInt64String(2, msg.optionalInt64.toString() as any); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64.toString()); + writer.writeUint64String(4, msg.optionalUint64.toString() as any); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64.toString()); + writer.writeSint64String(6, msg.optionalSint64.toString() as any); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64.toString()); + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64.toString()); + writer.writeSfixed64(10, msg.optionalSfixed64.toString() as any); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -129353,7 +129321,7 @@ export const TestAllTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 32, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -129362,7 +129330,7 @@ export const TestAllTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 34, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -129371,7 +129339,7 @@ export const TestAllTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 36, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -129380,7 +129348,7 @@ export const TestAllTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 38, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -129389,7 +129357,7 @@ export const TestAllTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 40, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { @@ -130453,7 +130421,7 @@ export const TestPackedTypes = { if (msg.packedInt64?.length) { writer.writeRepeatedInt64String( 91, - msg.packedInt64.map((x) => x.toString()) + msg.packedInt64.map((x) => x.toString() as any) ); } if (msg.packedUint32?.length) { @@ -130462,7 +130430,7 @@ export const TestPackedTypes = { if (msg.packedUint64?.length) { writer.writeRepeatedUint64String( 93, - msg.packedUint64.map((x) => x.toString()) + msg.packedUint64.map((x) => x.toString() as any) ); } if (msg.packedSint32?.length) { @@ -130471,7 +130439,7 @@ export const TestPackedTypes = { if (msg.packedSint64?.length) { writer.writeRepeatedSint64String( 95, - msg.packedSint64.map((x) => x.toString()) + msg.packedSint64.map((x) => x.toString() as any) ); } if (msg.packedFixed32?.length) { @@ -130480,7 +130448,7 @@ export const TestPackedTypes = { if (msg.packedFixed64?.length) { writer.writeRepeatedFixed64String( 97, - msg.packedFixed64.map((x) => x.toString()) + msg.packedFixed64.map((x) => x.toString() as any) ); } if (msg.packedSfixed32?.length) { @@ -130489,7 +130457,7 @@ export const TestPackedTypes = { if (msg.packedSfixed64?.length) { writer.writeRepeatedSfixed64( 99, - msg.packedSfixed64.map((x) => x.toString()) + msg.packedSfixed64.map((x) => x.toString() as any) ); } if (msg.packedFloat?.length) { @@ -130774,7 +130742,7 @@ export const TestUnpackedTypes = { if (msg.repeatedInt64?.length) { writer.writeRepeatedInt64String( 2, - msg.repeatedInt64.map((x) => x.toString()) + msg.repeatedInt64.map((x) => x.toString() as any) ); } if (msg.repeatedUint32?.length) { @@ -130783,7 +130751,7 @@ export const TestUnpackedTypes = { if (msg.repeatedUint64?.length) { writer.writeRepeatedUint64String( 4, - msg.repeatedUint64.map((x) => x.toString()) + msg.repeatedUint64.map((x) => x.toString() as any) ); } if (msg.repeatedSint32?.length) { @@ -130792,7 +130760,7 @@ export const TestUnpackedTypes = { if (msg.repeatedSint64?.length) { writer.writeRepeatedSint64String( 6, - msg.repeatedSint64.map((x) => x.toString()) + msg.repeatedSint64.map((x) => x.toString() as any) ); } if (msg.repeatedFixed32?.length) { @@ -130801,7 +130769,7 @@ export const TestUnpackedTypes = { if (msg.repeatedFixed64?.length) { writer.writeRepeatedFixed64String( 8, - msg.repeatedFixed64.map((x) => x.toString()) + msg.repeatedFixed64.map((x) => x.toString() as any) ); } if (msg.repeatedSfixed32?.length) { @@ -130810,7 +130778,7 @@ export const TestUnpackedTypes = { if (msg.repeatedSfixed64?.length) { writer.writeRepeatedSfixed64( 10, - msg.repeatedSfixed64.map((x) => x.toString()) + msg.repeatedSfixed64.map((x) => x.toString() as any) ); } if (msg.repeatedFloat?.length) { diff --git a/src/test-serialization/message.pb.ts b/src/test-serialization/message.pb.ts index 47ea4183..e69cd5f1 100644 --- a/src/test-serialization/message.pb.ts +++ b/src/test-serialization/message.pb.ts @@ -1,7 +1,7 @@ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: message.proto -import type { ByteSource, MapMessage } from "../../src"; +import type { ByteSource } from "../../src"; import { BinaryReader, BinaryWriter, @@ -17,7 +17,7 @@ export type Baz = "FOO" | "BAR"; export interface Foo { fieldOne?: number | null | undefined; - fieldTwo: Foo.FieldTwo; + fieldTwo: Record; fieldThree: Bar[]; fieldFour: Foo.FooBar; fieldFive: bigint[]; @@ -31,25 +31,34 @@ export interface Foo { declare namespace Foo { export interface FooBar { fieldOne: string; - fieldTwo: Foo.FooBar.FieldTwo; + fieldTwo: Record; fieldThree: number[]; } namespace FooBar { - export type FieldTwo = Record; + interface FieldTwo { + key: string; + value: bigint; + } } - export type FieldTwo = Record; + interface FieldTwo { + key: string; + value: Bar; + } } export interface Bar { fieldOne: string; - fieldTwo: Bar.FieldTwo; + fieldTwo: Record; fieldThree: number[]; } declare namespace Bar { - export type FieldTwo = Record; + interface FieldTwo { + key: string; + value: bigint; + } } //========================================// @@ -154,9 +163,9 @@ export const Foo = { if (msg.fieldTwo) { writer.writeRepeatedMessage( 2, - Object.entries(msg.fieldTwo).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fieldTwo).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, Foo.FieldTwo._writeMessage ); @@ -170,7 +179,7 @@ export const Foo = { if (msg.fieldFive?.length) { writer.writeRepeatedInt64String( 5, - msg.fieldFive.map((x) => x.toString()) + msg.fieldFive.map((x) => x.toString() as any) ); } if (msg.fieldSix && Baz._toInt(msg.fieldSix)) { @@ -180,7 +189,7 @@ export const Foo = { writer.writeRepeatedEnum(7, msg.fieldSeven.map(Baz._toInt)); } if (msg.fieldEight) { - writer.writeInt64String(8, msg.fieldEight.toString()); + writer.writeInt64String(8, msg.fieldEight.toString() as any); } if (msg.fieldNine?.length) { writer.writeBytes(9, msg.fieldNine); @@ -201,8 +210,8 @@ export const Foo = { } if (msg.fieldTwo) { const fieldTwo = Object.fromEntries( - Object.entries(msg.fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Foo.FieldTwo._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -252,9 +261,9 @@ export const Foo = { break; } case 2: { - const fieldTwo = {} as MapMessage; - reader.readMessage(fieldTwo, Foo.FieldTwo._readMessage); - msg.fieldTwo[fieldTwo.key] = fieldTwo.value; + const map = {} as Foo.FieldTwo; + reader.readMessage(map, Foo.FieldTwo._readMessage); + msg.fieldTwo[map.key.toString()] = map.value; break; } case 3: { @@ -311,8 +320,8 @@ export const Foo = { const _fieldTwo = json.fieldTwo ?? json.field_two; if (_fieldTwo) { msg.fieldTwo = Object.fromEntries( - Object.entries(_fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Foo.FieldTwo._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -420,9 +429,9 @@ export const Foo = { if (msg.fieldTwo) { writer.writeRepeatedMessage( 2, - Object.entries(msg.fieldTwo).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fieldTwo).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, Foo.FooBar.FieldTwo._writeMessage ); @@ -445,8 +454,8 @@ export const Foo = { } if (msg.fieldTwo) { const fieldTwo = Object.fromEntries( - Object.entries(msg.fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Foo.FooBar.FieldTwo._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -472,9 +481,9 @@ export const Foo = { break; } case 2: { - const fieldTwo = {} as MapMessage; - reader.readMessage(fieldTwo, Foo.FooBar.FieldTwo._readMessage); - msg.fieldTwo[fieldTwo.key] = fieldTwo.value; + const map = {} as Foo.FooBar.FieldTwo; + reader.readMessage(map, Foo.FooBar.FieldTwo._readMessage); + msg.fieldTwo[map.key.toString()] = map.value; break; } case 3: { @@ -501,8 +510,8 @@ export const Foo = { const _fieldTwo = json.fieldTwo ?? json.field_two; if (_fieldTwo) { msg.fieldTwo = Object.fromEntries( - Object.entries(_fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Foo.FooBar.FieldTwo._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -519,14 +528,14 @@ export const Foo = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { writer.writeString(1, msg.key); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -535,7 +544,7 @@ export const Foo = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -551,9 +560,9 @@ export const Foo = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: Foo.FooBar.FieldTwo, reader: BinaryReader - ): MapMessage { + ): Foo.FooBar.FieldTwo { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -578,9 +587,9 @@ export const Foo = { * @private */ _readMessageJSON: function ( - msg: MapMessage, + msg: Foo.FooBar.FieldTwo, json: any - ): MapMessage { + ): Foo.FooBar.FieldTwo { const _key = json.key; if (_key) { msg.key = _key; @@ -599,7 +608,7 @@ export const Foo = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { @@ -615,7 +624,7 @@ export const Foo = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -634,9 +643,9 @@ export const Foo = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: Foo.FieldTwo, reader: BinaryReader - ): MapMessage { + ): Foo.FieldTwo { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -660,10 +669,7 @@ export const Foo = { /** * @private */ - _readMessageJSON: function ( - msg: MapMessage, - json: any - ): MapMessage { + _readMessageJSON: function (msg: Foo.FieldTwo, json: any): Foo.FieldTwo { const _key = json.key; if (_key) { msg.key = _key; @@ -732,9 +738,9 @@ export const Bar = { if (msg.fieldTwo) { writer.writeRepeatedMessage( 2, - Object.entries(msg.fieldTwo).map(([key, value]) => ({ - key: key, - value: value, + Object.entries(msg.fieldTwo).map(([key, value]) => ({ + key: key as any, + value: value as any, })) as any, Bar.FieldTwo._writeMessage ); @@ -755,8 +761,8 @@ export const Bar = { } if (msg.fieldTwo) { const fieldTwo = Object.fromEntries( - Object.entries(msg.fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(msg.fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Bar.FieldTwo._writeMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -782,9 +788,9 @@ export const Bar = { break; } case 2: { - const fieldTwo = {} as MapMessage; - reader.readMessage(fieldTwo, Bar.FieldTwo._readMessage); - msg.fieldTwo[fieldTwo.key] = fieldTwo.value; + const map = {} as Bar.FieldTwo; + reader.readMessage(map, Bar.FieldTwo._readMessage); + msg.fieldTwo[map.key.toString()] = map.value; break; } case 3: { @@ -811,8 +817,8 @@ export const Bar = { const _fieldTwo = json.fieldTwo ?? json.field_two; if (_fieldTwo) { msg.fieldTwo = Object.fromEntries( - Object.entries(_fieldTwo) - .map(([key, value]) => ({ key: key, value: value })) + Object.entries(_fieldTwo) + .map(([key, value]) => ({ key: key as any, value: value as any })) .map(Bar.FieldTwo._readMessageJSON) .map(({ key, value }) => [key, value]) ); @@ -829,14 +835,14 @@ export const Bar = { * @private */ _writeMessage: function ( - msg: MapMessage, + msg: Partial, writer: BinaryWriter ): BinaryWriter { if (msg.key) { writer.writeString(1, msg.key); } if (msg.value) { - writer.writeInt64String(2, msg.value.toString()); + writer.writeInt64String(2, msg.value.toString() as any); } return writer; }, @@ -845,7 +851,7 @@ export const Bar = { * @private */ _writeMessageJSON: function ( - msg: MapMessage + msg: Partial ): Record { const json: Record = {}; if (msg.key) { @@ -861,9 +867,9 @@ export const Bar = { * @private */ _readMessage: function ( - msg: MapMessage, + msg: Bar.FieldTwo, reader: BinaryReader - ): MapMessage { + ): Bar.FieldTwo { while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -887,10 +893,7 @@ export const Bar = { /** * @private */ - _readMessageJSON: function ( - msg: MapMessage, - json: any - ): MapMessage { + _readMessageJSON: function (msg: Bar.FieldTwo, json: any): Bar.FieldTwo { const _key = json.key; if (_key) { msg.key = _key;