diff --git a/packages/bundle-size/README.md b/packages/bundle-size/README.md index b8700164a..819170e1b 100644 --- a/packages/bundle-size/README.md +++ b/packages/bundle-size/README.md @@ -19,7 +19,7 @@ usually do. We repeat this for an increasing number of files. | protobuf-es | 4 | 92,563 b | 37,277 b | 10,113 b | | protobuf-es | 8 | 101,904 b | 41,775 b | 10,824 b | | protobuf-es | 16 | 165,584 b | 67,020 b | 13,312 b | -| protobuf-es | 32 | 343,363 b | 147,051 b | 20,063 b | +| protobuf-es | 32 | 344,962 b | 147,972 b | 20,177 b | | protobuf-javascript | 1 | 339,613 b | 255,820 b | 42,481 b | | protobuf-javascript | 4 | 366,281 b | 271,092 b | 43,912 b | | protobuf-javascript | 8 | 388,324 b | 283,409 b | 45,038 b | diff --git a/packages/bundle-size/chart.svg b/packages/bundle-size/chart.svg index 0f3d5abf5..57e6de001 100644 --- a/packages/bundle-size/chart.svg +++ b/packages/bundle-size/chart.svg @@ -43,14 +43,14 @@ 0 KiB - + protobuf-es protobuf-es 9.57 KiB for 1 files protobuf-es 9.88 KiB for 4 files protobuf-es 10.57 KiB for 8 files protobuf-es 13 KiB for 16 files -protobuf-es 19.59 KiB for 32 files +protobuf-es 19.7 KiB for 32 files diff --git a/packages/protobuf-conformance/failing_tests_text_format.txt b/packages/protobuf-conformance/failing_tests_text_format.txt index c4dccbbdb..3fc1a3445 100644 --- a/packages/protobuf-conformance/failing_tests_text_format.txt +++ b/packages/protobuf-conformance/failing_tests_text_format.txt @@ -111,3 +111,12 @@ Required.Proto3.TextFormatInput.Uint32FieldTooLarge Required.Proto3.TextFormatInput.Uint64FieldMaxValue.ProtobufOutput Required.Proto3.TextFormatInput.Uint64FieldMaxValue.TextFormatOutput Required.Proto3.TextFormatInput.Uint64FieldTooLarge +Required.Proto2.TextFormatInput.GroupFieldExtension.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldExtension.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldExtensionGroupName +Required.Proto2.TextFormatInput.GroupFieldLowercased.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldLowercased.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldLowercasedMultiWord.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldLowercasedMultiWord.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldMultiWord.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldMultiWord.TextFormatOutput diff --git a/packages/protobuf-conformance/package.json b/packages/protobuf-conformance/package.json index 589ef39fd..9165114b0 100644 --- a/packages/protobuf-conformance/package.json +++ b/packages/protobuf-conformance/package.json @@ -6,11 +6,11 @@ "build": "npm run build:esm+types", "build:esm+types": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/types", "pregenerate": "rm -rf src/gen/*", - "generate": "protoc --es_out=src/gen --es_opt=ts_nocheck=false,target=ts --proto_path=$(upstream-include conformance) $(upstream-files conformance)", + "generate": "protoc --es_out=src/gen --es_opt=ts_nocheck=false,target=ts --proto_path=$(upstream-include conformance) conformance/conformance.proto google/protobuf/test_messages_proto2.proto google/protobuf/test_messages_proto3.proto", "postgenerate": "license-header src/gen", "test": "npm run test:bigint && npm run test:string", - "test:bigint": "BUF_BIGINT_DISABLE=0 conformance_test_runner --enforce_recommended --failure_list failing_tests_with_bigint.txt --text_format_failure_list failing_tests_text_format.txt bin/conformance_esm.js", - "test:string": "BUF_BIGINT_DISABLE=1 conformance_test_runner --enforce_recommended --failure_list failing_tests_without_bigint.txt --text_format_failure_list failing_tests_text_format.txt bin/conformance_esm.js" + "test:bigint": "BUF_BIGINT_DISABLE=0 conformance_test_runner --maximum_edition PROTO3 --enforce_recommended --failure_list failing_tests_with_bigint.txt --text_format_failure_list failing_tests_text_format.txt bin/conformance_esm.js", + "test:string": "BUF_BIGINT_DISABLE=1 conformance_test_runner --maximum_edition PROTO3 --enforce_recommended --failure_list failing_tests_without_bigint.txt --text_format_failure_list failing_tests_text_format.txt bin/conformance_esm.js" }, "type": "module", "types": "./dist/types/index.d.ts", diff --git a/packages/protobuf-conformance/src/gen/google/protobuf/test_messages_proto2_pb.ts b/packages/protobuf-conformance/src/gen/google/protobuf/test_messages_proto2_pb.ts index a57ebccee..6802fa78e 100644 --- a/packages/protobuf-conformance/src/gen/google/protobuf/test_messages_proto2_pb.ts +++ b/packages/protobuf-conformance/src/gen/google/protobuf/test_messages_proto2_pb.ts @@ -583,6 +583,11 @@ export class TestAllTypesProto2 extends Message { */ data?: TestAllTypesProto2_Data; + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField multiwordgroupfield = 204; + */ + multiwordgroupfield?: TestAllTypesProto2_MultiWordGroupField; + /** * default values * @@ -861,6 +866,7 @@ export class TestAllTypesProto2 extends Message { { no: 118, name: "oneof_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "oneof_field" }, { no: 119, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), oneof: "oneof_field" }, { no: 201, name: "data", kind: "message", T: TestAllTypesProto2_Data, delimited: true, opt: true }, + { no: 204, name: "multiwordgroupfield", kind: "message", T: TestAllTypesProto2_MultiWordGroupField, delimited: true, opt: true }, { no: 241, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: -123456789 }, { no: 242, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("-9123456789123456789") }, { no: 243, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 2123456789 }, @@ -1035,6 +1041,49 @@ export class TestAllTypesProto2_Data extends Message { } } +/** + * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField + */ +export class TestAllTypesProto2_MultiWordGroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 205; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 206; + */ + groupUint32?: number; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 205, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 206, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromJsonString(jsonString, options); + } + + static equals(a: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined, b: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined): boolean { + return proto2.util.equals(TestAllTypesProto2_MultiWordGroupField, a, b); + } +} + /** * message_set test case. * @@ -1197,6 +1246,49 @@ export class ForeignMessageProto2 extends Message { } } +/** + * @generated from message protobuf_test_messages.proto2.GroupField + */ +export class GroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 122; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 123; + */ + groupUint32?: number; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "protobuf_test_messages.proto2.GroupField"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 122, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 123, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GroupField { + return new GroupField().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GroupField { + return new GroupField().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GroupField { + return new GroupField().fromJsonString(jsonString, options); + } + + static equals(a: GroupField | PlainMessage | undefined, b: GroupField | PlainMessage | undefined): boolean { + return proto2.util.equals(GroupField, a, b); + } +} + /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes */ @@ -2000,3 +2092,12 @@ export const extension_int32 = proto2.makeExtension( { no: 120, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, ); +/** + * @generated from extension: optional protobuf_test_messages.proto2.GroupField groupfield = 121; + */ +export const groupfield = proto2.makeExtension( + "protobuf_test_messages.proto2.groupfield", + TestAllTypesProto2, + () => ({ no: 121, kind: "message", T: GroupField, delimited: true, opt: true }), +); + diff --git a/packages/protobuf-test/extra/deprecation-implicit.proto b/packages/protobuf-test/extra/deprecation-implicit.proto index d61cb2581..997ebb6dd 100644 --- a/packages/protobuf-test/extra/deprecation-implicit.proto +++ b/packages/protobuf-test/extra/deprecation-implicit.proto @@ -33,5 +33,5 @@ service ImplicitlyDeprecatedService { } extend google.protobuf.FieldOptions { - int32 implicitly_deprecated_option = 2001; + int32 implicitly_deprecated_option = 2002; } diff --git a/packages/protobuf-test/extra/extensions-proto3.proto b/packages/protobuf-test/extra/extensions-proto3.proto index ec0e4c57b..ef11868cb 100644 --- a/packages/protobuf-test/extra/extensions-proto3.proto +++ b/packages/protobuf-test/extra/extensions-proto3.proto @@ -19,8 +19,8 @@ import "google/protobuf/descriptor.proto"; // In proto3, we can only extend options. extend google.protobuf.FileOptions { - uint32 uint32_ext = 1001; - optional uint32 optional_uint32_ext = 1002; + uint32 uint32_ext = 7001; + optional uint32 optional_uint32_ext = 7002; repeated uint32 packed_uint32_ext = 7003; repeated uint32 unpacked_uint32_ext = 7004 [packed = false]; } diff --git a/packages/protobuf-test/src/descriptor-set.test.ts b/packages/protobuf-test/src/descriptor-set.test.ts index e25b4458a..10b230d58 100644 --- a/packages/protobuf-test/src/descriptor-set.test.ts +++ b/packages/protobuf-test/src/descriptor-set.test.ts @@ -41,6 +41,7 @@ import { TestNestedExtension, } from "./gen/ts/google/protobuf/unittest_pb.js"; import { + EnumFeature, test as test_ext, TestFeatures, } from "./gen/ts/google/protobuf/unittest_features_pb.js"; @@ -323,7 +324,7 @@ describe("DescriptorSet", () => { expect(file).toBeDefined(); if (file !== undefined) { const tf = getTestFeatures(file); - expect(tf.intFileFeature).toBe(1); + expect(tf.fileFeature).toBe(EnumFeature.VALUE3); } }); test("overrides can be read from unknown fields of getFeatures()", async () => { @@ -334,7 +335,7 @@ describe("DescriptorSet", () => { edition = "2023"; package protobuf_unittest; import "google/protobuf/unittest_features.proto"; - option features.(pb.test).int_file_feature = 8; + option features.(pb.test).file_feature = VALUE8; `, }, { includeImports: true }, @@ -344,7 +345,7 @@ describe("DescriptorSet", () => { expect(file).toBeDefined(); if (file !== undefined) { const tf = getTestFeatures(file); - expect(tf.intFileFeature).toBe(8); + expect(tf.fileFeature).toBe(EnumFeature.VALUE8); } }); diff --git a/packages/protobuf-test/src/edition-feature-resolver.test.ts b/packages/protobuf-test/src/edition-feature-resolver.test.ts deleted file mode 100644 index aa537f557..000000000 --- a/packages/protobuf-test/src/edition-feature-resolver.test.ts +++ /dev/null @@ -1,828 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { describe, expect, test } from "@jest/globals"; -import { readFileSync } from "fs"; - -import type { - AnyMessage, - DescExtension, - DescMessage, - DescEnum, -} from "@bufbuild/protobuf"; -import { - createDescriptorSet, - Edition, - FeatureSet, - FeatureSet_EnumType, - FeatureSet_FieldPresence, - FeatureSet_JsonFormat, - FeatureSet_MessageEncoding, - FeatureSet_RepeatedFieldEncoding, - FeatureSet_Utf8Validation, - FeatureSetDefaults, - FeatureSetDefaults_FeatureSetEditionDefault, - isMessage, - protoInt64, - ScalarType, -} from "@bufbuild/protobuf"; -import assert from "node:assert"; -import { UpstreamProtobuf } from "upstream-protobuf"; - -/** - * A rough implementation of the edition feature resolution. Does not support - * extensions. - * - * See https://github.com/protocolbuffers/protobuf/blob/main/docs/design/editions/protobuf-editions-design-features.md#specification-of-an-edition - * - * @private experimental, API may change drastically - */ -export class FeatureResolver { - static compileDefaults( - minimumEdition: Edition, - maximumEdition: Edition, - descFeatureSet: DescMessage, - ...descExtensions: DescExtension[] - ): FeatureSetDefaults { - if (minimumEdition > maximumEdition) { - throw new Error( - `Invalid edition range, edition ${Edition[minimumEdition]} is newer than edition ${Edition[maximumEdition]}.`, - ); - } - validateFeatureSetDescriptor(descFeatureSet); - - // Collect all the editions with unique defaults. - const collector = new EditionCollector(minimumEdition, maximumEdition); - collector.add(descFeatureSet); - for (const extension of descExtensions) { - validateExtension(extension); - collector.add(extension.message); - } - const editions = collector.get(); - - const defaults = new FeatureSetDefaults({ - minimumEdition, - maximumEdition, - }); - for (const edition of editions) { - defaults.defaults.push( - new FeatureSetDefaults_FeatureSetEditionDefault({ - edition, - features: fillDefaults(edition, descFeatureSet, ...descExtensions), - }), - ); - } - return defaults; - } - - static create( - edition: Edition, - compiledFeatureSetDefaults: FeatureSetDefaults, - ): FeatureResolver { - const minimumEdition = compiledFeatureSetDefaults.minimumEdition ?? 0; - const maximumEdition = compiledFeatureSetDefaults.maximumEdition ?? 0; - if (edition < minimumEdition) { - throw new Error( - `Edition ${Edition[edition]} is earlier than the minimum supported edition ${Edition[minimumEdition]}`, - ); - } - if (maximumEdition < edition) { - throw new Error( - `Edition ${Edition[edition]} is later than the maximum supported edition ${Edition[maximumEdition]}`, - ); - } - let prevEdition = Edition.EDITION_UNKNOWN; - for (const editionDefault of compiledFeatureSetDefaults.defaults) { - const editionDefaultEdition = editionDefault.edition ?? 0; - if (editionDefaultEdition === Edition.EDITION_UNKNOWN) { - throw new Error( - `Invalid edition ${Edition[editionDefaultEdition]} specified.`, - ); - } - if (prevEdition !== Edition.EDITION_UNKNOWN) { - if (editionDefaultEdition <= prevEdition) { - throw new Error( - `Feature set defaults are not strictly increasing. Edition ${ - Edition[prevEdition] - } is greater than or equal to edition ${ - Edition[editionDefault.edition ?? 0] - }.`, - ); - } - } - validateMergedFeatures(editionDefault.features ?? new FeatureSet()); - prevEdition = editionDefaultEdition; - } - const highestMatch = findHighestMatchingEdition( - edition, - compiledFeatureSetDefaults.defaults, - ); - if (highestMatch?.features === undefined) { - throw new Error(`No valid default found for edition ${Edition[edition]}`); - } - return new FeatureResolver(highestMatch.features); - } - - private constructor(private readonly defaults: FeatureSet) {} - - mergeFeatures( - mergedParent: FeatureSet, - unmergedChild: FeatureSet, - ): FeatureSet { - const features = new FeatureSet(); - features.fromBinary(this.defaults.toBinary()); - features.fromBinary(mergedParent.toBinary()); - features.fromBinary(unmergedChild.toBinary()); - validateMergedFeatures(features); - return features; - } -} - -class EditionCollector { - private readonly set = new Set(); - - constructor( - private readonly minimumEdition: Edition, - private readonly maximumEdition: Edition, - ) {} - - add(descMessage: DescMessage) { - for (const field of descMessage.fields) { - const def = field.proto.options?.editionDefaults; - if (def === undefined) { - continue; - } - for (const { edition } of def) { - if (edition === undefined) { - continue; - } - if (this.maximumEdition < edition) { - continue; - } - this.set.add(edition); - } - } - } - - get() { - const editions = Array.from(this.set.values()).sort((a, b) => a - b); - if (editions.length == 0 || editions[0] > this.minimumEdition) { - // Always insert the minimum edition to make sure the full range is covered - // in valid defaults. - editions.unshift(this.minimumEdition); - } - return editions; - } -} - -function fillDefaults( - edition: Edition, - descFeatureSet: DescMessage, - ...descExtensions: DescExtension[] // eslint-disable-line @typescript-eslint/no-unused-vars -- TODO extensions -): FeatureSet { - const featureSet = new FeatureSet(); - for (const field of descFeatureSet.fields) { - const fieldLocalName = FeatureSet.fields.find(field.number)?.localName; - if (fieldLocalName === undefined) { - throw new Error( - `Cannot find local name for feature field ${field.parent.typeName}.${field.name}`, - ); - } - const highestMatch = findHighestMatchingEdition( - edition, - field.proto.options?.editionDefaults.concat() ?? [], - ); - if (highestMatch === undefined) { - throw new Error( - `No valid default found for edition ${Edition[edition]} in feature field ${field.parent.typeName}.${field.name}`, - ); - } - let value: unknown; - switch (field.fieldKind) { - case "message": - throw new Error( - `Cannot parse default value for edition ${Edition[edition]} in feature field ${field.parent.typeName}.${field.name}. Text format for messages is not implemented.`, - ); - case "scalar": - value = parseTextFormatScalarValue( - field.scalar, - highestMatch.value ?? "", - ); - break; - case "enum": - value = parseTextFormatEnumValue(field.enum, highestMatch.value ?? ""); - break; - case "map": - throw new Error( - `Cannot parse default value for edition ${Edition[edition]} in feature field ${field.parent.typeName}.${field.name}. Map field is unexpected.`, - ); - } - (featureSet as AnyMessage)[fieldLocalName] = value; - } - return featureSet; -} - -function validateFeatureSetDescriptor(descFeatureSet: DescMessage) { - if (descFeatureSet.oneofs.length > 0) { - throw new Error( - `Type ${descFeatureSet.typeName} contains unsupported oneof feature fields.`, - ); - } - for (const field of descFeatureSet.fields) { - if (!field.optional) { - throw new Error( - `Feature field ${field.parent.typeName}.${field.name} is an unsupported required field.`, - ); - } - if (field.repeated) { - throw new Error( - `Feature field ${field.parent.typeName}.${field.name} is an unsupported repeated field.`, - ); - } - if ((field.proto.options?.targets.length ?? 0) === 0) { - throw new Error( - `Feature field ${field.parent.typeName}.${field.name} has no target specified.`, - ); - } - } -} - -function validateExtension( - descExtension: DescExtension, -): asserts descExtension is DescExtension & { fieldKind: "message" } { - if (descExtension.fieldKind !== "message") { - throw new Error( - `Extension ${descExtension.typeName} is not of message type. Feature extensions should always use messages to allow for evolution.`, - ); - } - if (descExtension.message.typeName !== FeatureSet.typeName) { - throw new Error( - `Extension ${descExtension.typeName} is not an extension of ${FeatureSet.typeName}.`, - ); - } - if (descExtension.repeated) { - throw new Error( - `Only singular features extensions are supported. Found repeated extension ${descExtension.typeName}.`, - ); - } - if ( - descExtension.message.nestedExtensions.length > 0 || - descExtension.message.proto.extensionRange.length > 0 - ) { - throw new Error( - `Nested extensions in feature extension ${descExtension.typeName} are not supported.`, - ); - } -} - -function validateMergedFeatures(featureSet: FeatureSet) { - function checkEnumFeature( - fieldLocalName: - | "fieldPresence" - | "enumType" - | "repeatedFieldEncoding" - | "utf8Validation" - | "messageEncoding" - | "jsonFormat", - ) { - const value = featureSet[fieldLocalName] ?? 0; - if (value === 0) { - const field = featureSet - .getType() - .fields.list() - .find((f) => f.localName === fieldLocalName); - const fieldProtoName = field?.name ?? fieldLocalName; - throw new Error( - `Feature field ${ - featureSet.getType().typeName - }.${fieldProtoName} must resolve to a known value.`, - ); - } - } - - checkEnumFeature("fieldPresence"); - checkEnumFeature("enumType"); - checkEnumFeature("repeatedFieldEncoding"); - checkEnumFeature("utf8Validation"); - checkEnumFeature("messageEncoding"); - checkEnumFeature("jsonFormat"); -} - -// Find latest edition in the given defaults that is earlier or equal to the given edition. -// See https://github.com/protocolbuffers/protobuf/blob/main/docs/design/editions/protobuf-editions-design-features.md#specification-of-an-edition -function findHighestMatchingEdition< - T extends { edition?: Edition | undefined }, ->(edition: Edition, defaults: T[]): T | undefined { - const d = defaults - .concat() - .sort((a, b) => (a.edition ?? 0) - (b.edition ?? 0)); - let highestMatch: T | undefined = undefined; - for (let i = d.length - 1; i >= 0; i--) { - const c = d[i]; - if ((c.edition ?? 0) <= edition) { - highestMatch = c; - break; - } - } - return highestMatch; -} - -export function parseTextFormatEnumValue( - descEnum: DescEnum, - value: string, -): number { - const enumValue = descEnum.values.find((v) => v.name === value); - assert(enumValue, `cannot parse ${descEnum.name} default value: ${value}`); - return enumValue.number; -} - -export function parseTextFormatScalarValue( - type: ScalarType, - value: string, -): number | boolean | string | bigint | Uint8Array { - switch (type) { - case ScalarType.STRING: - return value; - case ScalarType.BYTES: { - const u = unescapeBytesDefaultValue(value); - if (u === false) { - throw new Error( - `cannot parse ${ScalarType[type]} default value: ${value}`, - ); - } - return u; - } - case ScalarType.INT64: - case ScalarType.SFIXED64: - case ScalarType.SINT64: - return protoInt64.parse(value); - case ScalarType.UINT64: - case ScalarType.FIXED64: - return protoInt64.uParse(value); - case ScalarType.DOUBLE: - case ScalarType.FLOAT: - switch (value) { - case "inf": - return Number.POSITIVE_INFINITY; - case "-inf": - return Number.NEGATIVE_INFINITY; - case "nan": - return Number.NaN; - default: - return parseFloat(value); - } - case ScalarType.BOOL: - return value === "true"; - case ScalarType.INT32: - case ScalarType.UINT32: - case ScalarType.SINT32: - case ScalarType.FIXED32: - case ScalarType.SFIXED32: - return parseInt(value, 10); - } -} - -/** - * Parses a text-encoded default value (proto2) of a BYTES field. - */ -function unescapeBytesDefaultValue(str: string): Uint8Array | false { - const b: number[] = []; - const input = { - tail: str, - c: "", - next(): boolean { - if (this.tail.length == 0) { - return false; - } - this.c = this.tail[0]; - this.tail = this.tail.substring(1); - return true; - }, - take(n: number): string | false { - if (this.tail.length >= n) { - const r = this.tail.substring(0, n); - this.tail = this.tail.substring(n); - return r; - } - return false; - }, - }; - while (input.next()) { - switch (input.c) { - case "\\": - if (input.next()) { - switch (input.c as string) { - case "\\": - b.push(input.c.charCodeAt(0)); - break; - case "b": - b.push(0x08); - break; - case "f": - b.push(0x0c); - break; - case "n": - b.push(0x0a); - break; - case "r": - b.push(0x0d); - break; - case "t": - b.push(0x09); - break; - case "v": - b.push(0x0b); - break; - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": { - const s = input.c; - const t = input.take(2); - if (t === false) { - return false; - } - const n = parseInt(s + t, 8); - if (isNaN(n)) { - return false; - } - b.push(n); - break; - } - case "x": { - const s = input.c; - const t = input.take(2); - if (t === false) { - return false; - } - const n = parseInt(s + t, 16); - if (isNaN(n)) { - return false; - } - b.push(n); - break; - } - case "u": { - const s = input.c; - const t = input.take(4); - if (t === false) { - return false; - } - const n = parseInt(s + t, 16); - if (isNaN(n)) { - return false; - } - const chunk = new Uint8Array(4); - const view = new DataView(chunk.buffer); - view.setInt32(0, n, true); - b.push(chunk[0], chunk[1], chunk[2], chunk[3]); - break; - } - case "U": { - const s = input.c; - const t = input.take(8); - if (t === false) { - return false; - } - const tc = protoInt64.uEnc(s + t); - const chunk = new Uint8Array(8); - const view = new DataView(chunk.buffer); - view.setInt32(0, tc.lo, true); - view.setInt32(4, tc.hi, true); - b.push( - chunk[0], - chunk[1], - chunk[2], - chunk[3], - chunk[4], - chunk[5], - chunk[6], - chunk[7], - ); - break; - } - } - } - break; - default: - b.push(input.c.charCodeAt(0)); - } - } - return new Uint8Array(b); -} - -describe("FeatureResolver", function () { - const set = createDescriptorSet(readFileSync("./descriptorset.binpb")); - const descFeatureSet = set.messages.get(FeatureSet.typeName); - assert(descFeatureSet !== undefined); - - describe("default features", () => { - const featureSetDefaults = FeatureResolver.compileDefaults( - Edition.EDITION_PROTO2, - Edition.EDITION_2023, - descFeatureSet, - ); - test("equals protoc", async () => { - const protocDefaults = FeatureSetDefaults.fromBinary( - await new UpstreamProtobuf().getFeatureSetDefaults("PROTO2", "2023"), - ); - expect(featureSetDefaults.equals(protocDefaults)).toBeTruthy(); - }); - test("EDITION_PROTO2", () => { - const { edition, features } = featureSetDefaults.defaults[0]; - expect(edition).toBe(Edition.EDITION_PROTO2); - const f = features ?? new FeatureSet(); - expect(f.fieldPresence).toBe(FeatureSet_FieldPresence.EXPLICIT); - expect(f.enumType).toBe(FeatureSet_EnumType.CLOSED); - expect(f.repeatedFieldEncoding).toBe( - FeatureSet_RepeatedFieldEncoding.EXPANDED, - ); - expect(f.utf8Validation).toBe(FeatureSet_Utf8Validation.NONE); - expect(f.messageEncoding).toBe( - FeatureSet_MessageEncoding.LENGTH_PREFIXED, - ); - expect(f.jsonFormat).toBe(FeatureSet_JsonFormat.LEGACY_BEST_EFFORT); - }); - test("EDITION_PROTO3", () => { - const { edition, features } = featureSetDefaults.defaults[1]; - expect(edition).toBe(Edition.EDITION_PROTO3); - const f = features ?? new FeatureSet(); - expect(f.fieldPresence).toBe(FeatureSet_FieldPresence.IMPLICIT); - expect(f.enumType).toBe(FeatureSet_EnumType.OPEN); - expect(f.repeatedFieldEncoding).toBe( - FeatureSet_RepeatedFieldEncoding.PACKED, - ); - expect(f.utf8Validation).toBe(FeatureSet_Utf8Validation.VERIFY); - expect(f.messageEncoding).toBe( - FeatureSet_MessageEncoding.LENGTH_PREFIXED, - ); - expect(f.jsonFormat).toBe(FeatureSet_JsonFormat.ALLOW); - }); - test("EDITION_2023", () => { - const { edition, features } = featureSetDefaults.defaults[2]; - expect(edition).toBe(Edition.EDITION_2023); - const f = features ?? new FeatureSet(); - expect(f.fieldPresence).toBe(FeatureSet_FieldPresence.EXPLICIT); - expect(f.enumType).toBe(FeatureSet_EnumType.OPEN); - expect(f.repeatedFieldEncoding).toBe( - FeatureSet_RepeatedFieldEncoding.PACKED, - ); - expect(f.utf8Validation).toBe(FeatureSet_Utf8Validation.VERIFY); - expect(f.messageEncoding).toBe( - FeatureSet_MessageEncoding.LENGTH_PREFIXED, - ); - expect(f.jsonFormat).toBe(FeatureSet_JsonFormat.ALLOW); - }); - }); - - // Tests ported from https://github.com/protocolbuffers/protobuf/blob/65cdac4ac5631163d0ffe08957838c754155750d/src/google/protobuf/feature_resolver_test.cc - // - // Not ported because we do not support extensions: - // - DefaultsTest2023 - // - DefaultsTestMessageExtension - // - DefaultsTestNestedExtension - // - DefaultsGeneratedPoolCustom - // - DefaultsFarFuture - // - DefaultsMiddleEdition - // - DefaultsMessageMerge - // - CompileDefaultsInvalidExtension - // - MergeFeaturesChildOverrideComplex - // - MergeFeaturesParentOverrides - // - MergeFeaturesExtensionEnumUnknown - // - CompileDefaultsInvalidNonMessage - // - CompileDefaultsInvalidRepeated - // - CompileDefaultsInvalidWithExtensions - // - CompileDefaultsInvalidWithOneof - // - CompileDefaultsInvalidWithRequired - // - CompileDefaultsInvalidWithRepeated - // - CompileDefaultsInvalidWithMissingTarget - // - CompileDefaultsInvalidDefaultsMessageParsingError - // - CompileDefaultsInvalidDefaultsMessageParsingErrorMerged - // - CompileDefaultsInvalidDefaultsMessageParsingErrorSkipped - // - CompileDefaultsInvalidDefaultsScalarParsingError - // - CompileDefaultsInvalidDefaultsScalarParsingErrorSkipped - // - CompileDefaultsInvalidDefaultsTooEarly - // - CompileDefaultsMinimumTooEarly - // - CompileDefaultsMinimumCovered - // - // Not ported because scenario does not apply: - // - CompileDefaultsMissingDescriptor - // - CompileDefaultsMissingExtension - describe("ported tests", () => { - function getDefaults( - edition: Edition, - compiledFeatureSetDefaults: FeatureSetDefaults, - ): FeatureSet; - function getDefaults( - edition: Edition, - descFeatureSet: DescMessage, - ...descExtensions: DescExtension[] - ): FeatureSet; - function getDefaults(edition: Edition, ...rest: unknown[]) { - if (isMessage(rest[0], FeatureSetDefaults)) { - const compiledFeatureSetDefaults = rest[0]; - const resolver = FeatureResolver.create( - edition, - compiledFeatureSetDefaults, - ); - return resolver.mergeFeatures(new FeatureSet(), new FeatureSet()); - } else { - const descFeatureSet = rest[0] as DescMessage; - const descExtensions = rest.slice(1) as DescExtension[]; - const compiledFeatureSetDefaults = FeatureResolver.compileDefaults( - Edition.EDITION_2023, - Edition.EDITION_99999_TEST_ONLY, - descFeatureSet, - ...descExtensions, - ); - return getDefaults(edition, compiledFeatureSetDefaults); - } - } - - function setupFeatureResolver( - edition: Edition, - descFeatureSet: DescMessage, - ...descExtensions: DescExtension[] - ) { - const defaults = FeatureResolver.compileDefaults( - Edition.EDITION_2023, - Edition.EDITION_99997_TEST_ONLY, - descFeatureSet, - ...descExtensions, - ); - return FeatureResolver.create(edition, defaults); - } - - test("DefaultsCore2023", function () { - const merged = getDefaults(Edition.EDITION_2023, descFeatureSet); - expect(merged.fieldPresence).toBe(FeatureSet_FieldPresence.EXPLICIT); - expect(merged.enumType).toBe(FeatureSet_EnumType.OPEN); - expect(merged.repeatedFieldEncoding).toBe( - FeatureSet_RepeatedFieldEncoding.PACKED, - ); - expect(merged.utf8Validation).toBe(FeatureSet_Utf8Validation.VERIFY); - expect(merged.messageEncoding).toBe( - FeatureSet_MessageEncoding.LENGTH_PREFIXED, - ); - expect(merged.jsonFormat).toBe(FeatureSet_JsonFormat.ALLOW); - }); - test("CreateFromUnsortedDefaults", () => { - const featureSetDefaults = FeatureResolver.compileDefaults( - Edition.EDITION_2023, - Edition.EDITION_99999_TEST_ONLY, - descFeatureSet, - ); - // swap elements 0 and 1 - const [d0, d1, ...drest] = featureSetDefaults.defaults; - featureSetDefaults.defaults = [d1, d0, ...drest]; - expect(() => - FeatureResolver.create(Edition.EDITION_2023, featureSetDefaults), - ).toThrowError( - "Feature set defaults are not strictly increasing. Edition EDITION_PROTO3 is greater than or equal to edition EDITION_PROTO2.", - ); - }); - test("CreateUnknownEdition", () => { - const featureSetDefaults = new FeatureSetDefaults({ - minimumEdition: Edition.EDITION_UNKNOWN, - maximumEdition: Edition.EDITION_99999_TEST_ONLY, - defaults: [{ edition: Edition.EDITION_UNKNOWN, features: {} }], - }); - expect(() => - FeatureResolver.create(Edition.EDITION_2023, featureSetDefaults), - ).toThrowError("Invalid edition EDITION_UNKNOWN specified."); - }); - test("CreateMissingEdition", () => { - const featureSetDefaults = new FeatureSetDefaults({ - minimumEdition: Edition.EDITION_UNKNOWN, - maximumEdition: Edition.EDITION_99999_TEST_ONLY, - defaults: [{ features: {} }], - }); - expect(() => - FeatureResolver.create(Edition.EDITION_2023, featureSetDefaults), - ).toThrowError("Invalid edition EDITION_UNKNOWN specified."); - }); - test("CreateUnknownEnumFeature", () => { - const validDefaults = FeatureResolver.compileDefaults( - Edition.EDITION_2023, - Edition.EDITION_2023, - descFeatureSet, - ); - - // Use reflection to walk through every feature field - for (const field of descFeatureSet.fields) { - const fieldLocalName = FeatureSet.fields.find(field.number)?.localName; - if (fieldLocalName === undefined) { - continue; - } - const defaults = validDefaults.clone(); - if (defaults.defaults.length === 0) { - continue; - } - const features = defaults.defaults[0].features; - if (features === undefined) { - continue; - } - // Clear the feature, which should be invalid - (features as AnyMessage)[fieldLocalName] = undefined; - expect(() => - FeatureResolver.create(Edition.EDITION_2023, defaults), - ).toThrow( - /Feature field google\.protobuf\.FeatureSet\..+ must resolve to a known value\./, - ); - // Also test zero-value - (features as AnyMessage)[fieldLocalName] = 0; - expect(() => - FeatureResolver.create(Edition.EDITION_2023, defaults), - ).toThrow( - /Feature field google\.protobuf\.FeatureSet\..+ must resolve to a known value\./, - ); - } - }); - test("CompileDefaultsMinimumLaterThanMaximum", () => { - expect(() => - FeatureResolver.compileDefaults( - Edition.EDITION_99999_TEST_ONLY, - Edition.EDITION_2023, - descFeatureSet, - ), - ).toThrowError( - "Invalid edition range, edition EDITION_99999_TEST_ONLY is newer than edition EDITION_2023.", - ); - }); - test("MergeFeaturesChildOverrideCore", () => { - const resolver = setupFeatureResolver( - Edition.EDITION_2023, - descFeatureSet, - ); - const child = new FeatureSet({ - fieldPresence: FeatureSet_FieldPresence.IMPLICIT, - repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding.EXPANDED, - }); - const merged = resolver.mergeFeatures(new FeatureSet(), child); - expect(merged.fieldPresence).toBe(FeatureSet_FieldPresence.IMPLICIT); - expect(merged.enumType).toBe(FeatureSet_EnumType.OPEN); - expect(merged.repeatedFieldEncoding).toBe( - FeatureSet_RepeatedFieldEncoding.EXPANDED, - ); - expect(merged.messageEncoding).toBe( - FeatureSet_MessageEncoding.LENGTH_PREFIXED, - ); - }); - test("MergeFeaturesUnknownEnumFeature", () => { - const resolver = setupFeatureResolver( - Edition.EDITION_2023, - descFeatureSet, - ); - for (const field of FeatureSet.fields.list()) { - const features = new FeatureSet(); - // Set the feature to a value of 0, which is unknown by convention. - (features as AnyMessage)[field.localName] = 0; - expect(() => - resolver.mergeFeatures(new FeatureSet(), features), - ).toThrow( - /Feature field google\.protobuf\.FeatureSet\..+ must resolve to a known value\./, - ); - } - }); - test("MergeFeaturesDistantPast", () => { - expect(() => - setupFeatureResolver(Edition.EDITION_1_TEST_ONLY, descFeatureSet), - ).toThrowError( - "Edition EDITION_1_TEST_ONLY is earlier than the minimum supported edition EDITION_2023", - ); - }); - test("MergeFeaturesDistantFuture", () => { - expect(() => - setupFeatureResolver(Edition.EDITION_99998_TEST_ONLY, descFeatureSet), - ).toThrowError( - "Edition EDITION_99998_TEST_ONLY is later than the maximum supported edition EDITION_99997_TEST_ONLY", - ); - }); - test("DefaultsTooEarly", () => { - const defaults = FeatureResolver.compileDefaults( - Edition.EDITION_2023, - Edition.EDITION_2023, - descFeatureSet, - ); - defaults.minimumEdition = Edition.EDITION_1_TEST_ONLY; - expect(() => - getDefaults(Edition.EDITION_1_TEST_ONLY, defaults), - ).toThrowError("No valid default found for edition EDITION_1_TEST_ONLY"); - }); - }); -}); diff --git a/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.d.ts index 3ccdb2530..ec98538eb 100644 --- a/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.d.ts @@ -56,7 +56,7 @@ export declare class ImplicitlyDeprecatedMessage extends Message; diff --git a/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.js b/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.js index c37c6ca2c..27ff7399a 100644 --- a/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.js +++ b/packages/protobuf-test/src/gen/js/extra/deprecation-implicit_pb.js @@ -41,11 +41,11 @@ export const ImplicitlyDeprecatedMessage = /*@__PURE__*/ proto3.makeMessageType( ); /** - * @generated from extension: int32 implicitly_deprecated_option = 2001; + * @generated from extension: int32 implicitly_deprecated_option = 2002; */ export const implicitly_deprecated_option = proto3.makeExtension( "spec.implicitly_deprecated_option", FieldOptions, - { no: 2001, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2002, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ); diff --git a/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.d.ts index 7359df512..a7e120ef8 100644 --- a/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.d.ts @@ -19,12 +19,12 @@ import type { Extension, FileOptions } from "@bufbuild/protobuf"; /** - * @generated from extension: uint32 uint32_ext = 1001; + * @generated from extension: uint32 uint32_ext = 7001; */ export declare const uint32_ext: Extension; /** - * @generated from extension: optional uint32 optional_uint32_ext = 1002; + * @generated from extension: optional uint32 optional_uint32_ext = 7002; */ export declare const optional_uint32_ext: Extension; diff --git a/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.js b/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.js index 1ba5bbef9..60fcc5d72 100644 --- a/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.js +++ b/packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.js @@ -19,21 +19,21 @@ import { FileOptions, proto3 } from "@bufbuild/protobuf"; /** - * @generated from extension: uint32 uint32_ext = 1001; + * @generated from extension: uint32 uint32_ext = 7001; */ export const uint32_ext = proto3.makeExtension( "proto3ext.uint32_ext", FileOptions, - { no: 1001, kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7001, kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ); /** - * @generated from extension: optional uint32 optional_uint32_ext = 1002; + * @generated from extension: optional uint32 optional_uint32_ext = 7002; */ export const optional_uint32_ext = proto3.makeExtension( "proto3ext.optional_uint32_ext", FileOptions, - { no: 1002, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { no: 7002, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, ); /** diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.d.ts index 43e58a5d5..5046100ec 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.d.ts @@ -40,6 +40,14 @@ export declare enum Edition { */ EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** * Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto @@ -1091,12 +1099,16 @@ export declare class FileOptions extends Message { javaGenerateEqualsAndHash?: boolean; /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; */ @@ -1532,6 +1544,11 @@ export declare class FieldOptions extends Message { */ features?: FeatureSet; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -1724,6 +1741,61 @@ export declare class FieldOptions_EditionDefault extends Message | undefined, b: FieldOptions_EditionDefault | PlainMessage | undefined): boolean; } +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export declare class FieldOptions_FeatureSupport extends Message { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: Edition; + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: Edition; + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: Edition; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FieldOptions.FeatureSupport"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions_FeatureSupport; + + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions_FeatureSupport; + + static fromJsonString(jsonString: string, options?: Partial): FieldOptions_FeatureSupport; + + static equals(a: FieldOptions_FeatureSupport | PlainMessage | undefined, b: FieldOptions_FeatureSupport | PlainMessage | undefined): boolean; +} + /** * @generated from message google.protobuf.OneofOptions */ @@ -1851,6 +1923,13 @@ export declare class EnumValueOptions extends Message { */ debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -2332,9 +2411,18 @@ export declare class FeatureSetDefaults_FeatureSetEditionDefault extends Message edition?: Edition; /** - * @generated from field: optional google.protobuf.FeatureSet features = 2; + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; */ - features?: FeatureSet; + overridableFeatures?: FeatureSet; + + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSet; constructor(data?: PartialMessage); diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.js index c72119772..db29c35e5 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.js +++ b/packages/protobuf-test/src/gen/js/google/protobuf/descriptor_pb.js @@ -35,6 +35,7 @@ export const Edition = /*@__PURE__*/ proto2.makeEnum( "google.protobuf.Edition", [ {no: 0, name: "EDITION_UNKNOWN"}, + {no: 900, name: "EDITION_LEGACY"}, {no: 998, name: "EDITION_PROTO2"}, {no: 999, name: "EDITION_PROTO3"}, {no: 1000, name: "EDITION_2023"}, @@ -408,6 +409,7 @@ export const FieldOptions = /*@__PURE__*/ proto2.makeMessageType( { no: 19, name: "targets", kind: "enum", T: proto2.getEnumType(FieldOptions_OptionTargetType), repeated: true }, { no: 20, name: "edition_defaults", kind: "message", T: FieldOptions_EditionDefault, repeated: true }, { no: 21, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 22, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ], ); @@ -488,6 +490,22 @@ export const FieldOptions_EditionDefault = /*@__PURE__*/ proto2.makeMessageType( {localName: "FieldOptions_EditionDefault"}, ); +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export const FieldOptions_FeatureSupport = /*@__PURE__*/ proto2.makeMessageType( + "google.protobuf.FieldOptions.FeatureSupport", + () => [ + { no: 1, name: "edition_introduced", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 2, name: "edition_deprecated", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 3, name: "deprecation_warning", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "edition_removed", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + ], + {localName: "FieldOptions_FeatureSupport"}, +); + /** * @generated from message google.protobuf.OneofOptions */ @@ -522,6 +540,7 @@ export const EnumValueOptions = /*@__PURE__*/ proto2.makeMessageType( { no: 1, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, { no: 3, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 4, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ], ); @@ -732,7 +751,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = /*@__PURE__*/ proto2. "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", () => [ { no: 3, name: "edition", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, - { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 4, name: "overridable_features", kind: "message", T: FeatureSet, opt: true }, + { no: 5, name: "fixed_features", kind: "message", T: FeatureSet, opt: true }, ], {localName: "FeatureSetDefaults_FeatureSetEditionDefault"}, ); diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.d.ts deleted file mode 100644 index 6952d2edc..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.d.ts +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/map_lite_unittest.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, Extension, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; -import type { ForeignMessageLite, TestAllExtensionsLite, TestAllTypesLite } from "./unittest_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumLite - */ -export declare enum Proto2MapEnumLite { - /** - * @generated from enum value: PROTO2_MAP_ENUM_FOO_LITE = 0; - */ - PROTO2_MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: PROTO2_MAP_ENUM_BAR_LITE = 1; - */ - PROTO2_MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: PROTO2_MAP_ENUM_BAZ_LITE = 2; - */ - PROTO2_MAP_ENUM_BAZ_LITE = 2, -} - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumPlusExtraLite - */ -export declare enum Proto2MapEnumPlusExtraLite { - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_FOO_LITE = 0; - */ - E_PROTO2_MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_BAR_LITE = 1; - */ - E_PROTO2_MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_BAZ_LITE = 2; - */ - E_PROTO2_MAP_ENUM_BAZ_LITE = 2, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_EXTRA_LITE = 3; - */ - E_PROTO2_MAP_ENUM_EXTRA_LITE = 3, -} - -/** - * @generated from enum protobuf_unittest.MapEnumLite - */ -export declare enum MapEnumLite { - /** - * @generated from enum value: MAP_ENUM_FOO_LITE = 0; - */ - MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: MAP_ENUM_BAR_LITE = 1; - */ - MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: MAP_ENUM_BAZ_LITE = 2; - */ - MAP_ENUM_BAZ_LITE = 2, -} - -/** - * @generated from message protobuf_unittest.TestMapLite - */ -export declare class TestMapLite extends Message { - /** - * @generated from field: map map_int32_int32 = 1; - */ - mapInt32Int32: { [key: number]: number }; - - /** - * @generated from field: map map_int64_int64 = 2; - */ - mapInt64Int64: { [key: string]: bigint }; - - /** - * @generated from field: map map_uint32_uint32 = 3; - */ - mapUint32Uint32: { [key: number]: number }; - - /** - * @generated from field: map map_uint64_uint64 = 4; - */ - mapUint64Uint64: { [key: string]: bigint }; - - /** - * @generated from field: map map_sint32_sint32 = 5; - */ - mapSint32Sint32: { [key: number]: number }; - - /** - * @generated from field: map map_sint64_sint64 = 6; - */ - mapSint64Sint64: { [key: string]: bigint }; - - /** - * @generated from field: map map_fixed32_fixed32 = 7; - */ - mapFixed32Fixed32: { [key: number]: number }; - - /** - * @generated from field: map map_fixed64_fixed64 = 8; - */ - mapFixed64Fixed64: { [key: string]: bigint }; - - /** - * @generated from field: map map_sfixed32_sfixed32 = 9; - */ - mapSfixed32Sfixed32: { [key: number]: number }; - - /** - * @generated from field: map map_sfixed64_sfixed64 = 10; - */ - mapSfixed64Sfixed64: { [key: string]: bigint }; - - /** - * @generated from field: map map_int32_float = 11; - */ - mapInt32Float: { [key: number]: number }; - - /** - * @generated from field: map map_int32_double = 12; - */ - mapInt32Double: { [key: number]: number }; - - /** - * @generated from field: map map_bool_bool = 13; - */ - mapBoolBool: { [key: string]: boolean }; - - /** - * @generated from field: map map_string_string = 14; - */ - mapStringString: { [key: string]: string }; - - /** - * @generated from field: map map_int32_bytes = 15; - */ - mapInt32Bytes: { [key: number]: Uint8Array }; - - /** - * @generated from field: map map_int32_enum = 16; - */ - mapInt32Enum: { [key: number]: MapEnumLite }; - - /** - * @generated from field: map map_int32_foreign_message = 17; - */ - mapInt32ForeignMessage: { [key: number]: ForeignMessageLite }; - - /** - * @generated from field: map teboring = 18; - */ - teboring: { [key: number]: number }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestMapLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMapLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMapLite; - - static fromJsonString(jsonString: string, options?: Partial): TestMapLite; - - static equals(a: TestMapLite | PlainMessage | undefined, b: TestMapLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestArenaMapLite - */ -export declare class TestArenaMapLite extends Message { - /** - * @generated from field: map map_int32_int32 = 1; - */ - mapInt32Int32: { [key: number]: number }; - - /** - * @generated from field: map map_int64_int64 = 2; - */ - mapInt64Int64: { [key: string]: bigint }; - - /** - * @generated from field: map map_uint32_uint32 = 3; - */ - mapUint32Uint32: { [key: number]: number }; - - /** - * @generated from field: map map_uint64_uint64 = 4; - */ - mapUint64Uint64: { [key: string]: bigint }; - - /** - * @generated from field: map map_sint32_sint32 = 5; - */ - mapSint32Sint32: { [key: number]: number }; - - /** - * @generated from field: map map_sint64_sint64 = 6; - */ - mapSint64Sint64: { [key: string]: bigint }; - - /** - * @generated from field: map map_fixed32_fixed32 = 7; - */ - mapFixed32Fixed32: { [key: number]: number }; - - /** - * @generated from field: map map_fixed64_fixed64 = 8; - */ - mapFixed64Fixed64: { [key: string]: bigint }; - - /** - * @generated from field: map map_sfixed32_sfixed32 = 9; - */ - mapSfixed32Sfixed32: { [key: number]: number }; - - /** - * @generated from field: map map_sfixed64_sfixed64 = 10; - */ - mapSfixed64Sfixed64: { [key: string]: bigint }; - - /** - * @generated from field: map map_int32_float = 11; - */ - mapInt32Float: { [key: number]: number }; - - /** - * @generated from field: map map_int32_double = 12; - */ - mapInt32Double: { [key: number]: number }; - - /** - * @generated from field: map map_bool_bool = 13; - */ - mapBoolBool: { [key: string]: boolean }; - - /** - * @generated from field: map map_string_string = 14; - */ - mapStringString: { [key: string]: string }; - - /** - * @generated from field: map map_int32_bytes = 15; - */ - mapInt32Bytes: { [key: number]: Uint8Array }; - - /** - * @generated from field: map map_int32_enum = 16; - */ - mapInt32Enum: { [key: number]: MapEnumLite }; - - /** - * @generated from field: map map_int32_foreign_message = 17; - */ - mapInt32ForeignMessage: { [key: number]: ForeignMessageArenaLite }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestArenaMapLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestArenaMapLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestArenaMapLite; - - static fromJsonString(jsonString: string, options?: Partial): TestArenaMapLite; - - static equals(a: TestArenaMapLite | PlainMessage | undefined, b: TestArenaMapLite | PlainMessage | undefined): boolean; -} - -/** - * Test embedded message with required fields - * - * @generated from message protobuf_unittest.TestRequiredMessageMapLite - */ -export declare class TestRequiredMessageMapLite extends Message { - /** - * @generated from field: map map_field = 1; - */ - mapField: { [key: number]: TestRequiredLite }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestRequiredMessageMapLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestRequiredMessageMapLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestRequiredMessageMapLite; - - static fromJsonString(jsonString: string, options?: Partial): TestRequiredMessageMapLite; - - static equals(a: TestRequiredMessageMapLite | PlainMessage | undefined, b: TestRequiredMessageMapLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestEnumMapLite - */ -export declare class TestEnumMapLite extends Message { - /** - * @generated from field: map known_map_field = 101; - */ - knownMapField: { [key: number]: Proto2MapEnumLite }; - - /** - * @generated from field: map unknown_map_field = 102; - */ - unknownMapField: { [key: number]: Proto2MapEnumLite }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestEnumMapLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEnumMapLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEnumMapLite; - - static fromJsonString(jsonString: string, options?: Partial): TestEnumMapLite; - - static equals(a: TestEnumMapLite | PlainMessage | undefined, b: TestEnumMapLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestEnumMapPlusExtraLite - */ -export declare class TestEnumMapPlusExtraLite extends Message { - /** - * @generated from field: map known_map_field = 101; - */ - knownMapField: { [key: number]: Proto2MapEnumPlusExtraLite }; - - /** - * @generated from field: map unknown_map_field = 102; - */ - unknownMapField: { [key: number]: Proto2MapEnumPlusExtraLite }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestEnumMapPlusExtraLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEnumMapPlusExtraLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEnumMapPlusExtraLite; - - static fromJsonString(jsonString: string, options?: Partial): TestEnumMapPlusExtraLite; - - static equals(a: TestEnumMapPlusExtraLite | PlainMessage | undefined, b: TestEnumMapPlusExtraLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestMessageMapLite - */ -export declare class TestMessageMapLite extends Message { - /** - * @generated from field: map map_int32_message = 1; - */ - mapInt32Message: { [key: number]: TestAllTypesLite }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestMessageMapLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMessageMapLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMessageMapLite; - - static fromJsonString(jsonString: string, options?: Partial): TestMessageMapLite; - - static equals(a: TestMessageMapLite | PlainMessage | undefined, b: TestMessageMapLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestRequiredLite - */ -export declare class TestRequiredLite extends Message { - /** - * @generated from field: required int32 a = 1; - */ - a?: number; - - /** - * @generated from field: required int32 b = 2; - */ - b?: number; - - /** - * @generated from field: required int32 c = 3; - */ - c?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestRequiredLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestRequiredLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestRequiredLite; - - static fromJsonString(jsonString: string, options?: Partial): TestRequiredLite; - - static equals(a: TestRequiredLite | PlainMessage | undefined, b: TestRequiredLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from extension: optional protobuf_unittest.TestRequiredLite single = 1000; - */ -export declare const TestRequiredLite_single: Extension; - -/** - * @generated from message protobuf_unittest.ForeignMessageArenaLite - */ -export declare class ForeignMessageArenaLite extends Message { - /** - * @generated from field: optional int32 c = 1; - */ - c?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.ForeignMessageArenaLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ForeignMessageArenaLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): ForeignMessageArenaLite; - - static fromJsonString(jsonString: string, options?: Partial): ForeignMessageArenaLite; - - static equals(a: ForeignMessageArenaLite | PlainMessage | undefined, b: ForeignMessageArenaLite | PlainMessage | undefined): boolean; -} - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.js deleted file mode 100644 index ff5c610c2..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/map_lite_unittest_pb.js +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/map_lite_unittest.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import { proto2 } from "@bufbuild/protobuf"; -import { ForeignMessageLite, TestAllExtensionsLite, TestAllTypesLite } from "./unittest_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumLite - */ -export const Proto2MapEnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.Proto2MapEnumLite", - [ - {no: 0, name: "PROTO2_MAP_ENUM_FOO_LITE"}, - {no: 1, name: "PROTO2_MAP_ENUM_BAR_LITE"}, - {no: 2, name: "PROTO2_MAP_ENUM_BAZ_LITE"}, - ], -); - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumPlusExtraLite - */ -export const Proto2MapEnumPlusExtraLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.Proto2MapEnumPlusExtraLite", - [ - {no: 0, name: "E_PROTO2_MAP_ENUM_FOO_LITE"}, - {no: 1, name: "E_PROTO2_MAP_ENUM_BAR_LITE"}, - {no: 2, name: "E_PROTO2_MAP_ENUM_BAZ_LITE"}, - {no: 3, name: "E_PROTO2_MAP_ENUM_EXTRA_LITE"}, - ], -); - -/** - * @generated from enum protobuf_unittest.MapEnumLite - */ -export const MapEnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.MapEnumLite", - [ - {no: 0, name: "MAP_ENUM_FOO_LITE"}, - {no: 1, name: "MAP_ENUM_BAR_LITE"}, - {no: 2, name: "MAP_ENUM_BAZ_LITE"}, - ], -); - -/** - * @generated from message protobuf_unittest.TestMapLite - */ -export const TestMapLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestMapLite", - () => [ - { no: 1, name: "map_int32_int32", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "map_int64_int64", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} }, - { no: 3, name: "map_uint32_uint32", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "scalar", T: 13 /* ScalarType.UINT32 */} }, - { no: 4, name: "map_uint64_uint64", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "scalar", T: 4 /* ScalarType.UINT64 */} }, - { no: 5, name: "map_sint32_sint32", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "scalar", T: 17 /* ScalarType.SINT32 */} }, - { no: 6, name: "map_sint64_sint64", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "scalar", T: 18 /* ScalarType.SINT64 */} }, - { no: 7, name: "map_fixed32_fixed32", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "scalar", T: 7 /* ScalarType.FIXED32 */} }, - { no: 8, name: "map_fixed64_fixed64", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "scalar", T: 6 /* ScalarType.FIXED64 */} }, - { no: 9, name: "map_sfixed32_sfixed32", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "scalar", T: 15 /* ScalarType.SFIXED32 */} }, - { no: 10, name: "map_sfixed64_sfixed64", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "scalar", T: 16 /* ScalarType.SFIXED64 */} }, - { no: 11, name: "map_int32_float", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 2 /* ScalarType.FLOAT */} }, - { no: 12, name: "map_int32_double", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 13, name: "map_bool_bool", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "scalar", T: 8 /* ScalarType.BOOL */} }, - { no: 14, name: "map_string_string", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 15, name: "map_int32_bytes", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, - { no: 16, name: "map_int32_enum", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(MapEnumLite)} }, - { no: 17, name: "map_int32_foreign_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: ForeignMessageLite} }, - { no: 18, name: "teboring", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - ], -); - -/** - * @generated from message protobuf_unittest.TestArenaMapLite - */ -export const TestArenaMapLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestArenaMapLite", - () => [ - { no: 1, name: "map_int32_int32", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "map_int64_int64", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} }, - { no: 3, name: "map_uint32_uint32", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "scalar", T: 13 /* ScalarType.UINT32 */} }, - { no: 4, name: "map_uint64_uint64", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "scalar", T: 4 /* ScalarType.UINT64 */} }, - { no: 5, name: "map_sint32_sint32", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "scalar", T: 17 /* ScalarType.SINT32 */} }, - { no: 6, name: "map_sint64_sint64", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "scalar", T: 18 /* ScalarType.SINT64 */} }, - { no: 7, name: "map_fixed32_fixed32", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "scalar", T: 7 /* ScalarType.FIXED32 */} }, - { no: 8, name: "map_fixed64_fixed64", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "scalar", T: 6 /* ScalarType.FIXED64 */} }, - { no: 9, name: "map_sfixed32_sfixed32", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "scalar", T: 15 /* ScalarType.SFIXED32 */} }, - { no: 10, name: "map_sfixed64_sfixed64", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "scalar", T: 16 /* ScalarType.SFIXED64 */} }, - { no: 11, name: "map_int32_float", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 2 /* ScalarType.FLOAT */} }, - { no: 12, name: "map_int32_double", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 13, name: "map_bool_bool", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "scalar", T: 8 /* ScalarType.BOOL */} }, - { no: 14, name: "map_string_string", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 15, name: "map_int32_bytes", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, - { no: 16, name: "map_int32_enum", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(MapEnumLite)} }, - { no: 17, name: "map_int32_foreign_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: ForeignMessageArenaLite} }, - ], -); - -/** - * Test embedded message with required fields - * - * @generated from message protobuf_unittest.TestRequiredMessageMapLite - */ -export const TestRequiredMessageMapLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestRequiredMessageMapLite", - () => [ - { no: 1, name: "map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestRequiredLite} }, - ], -); - -/** - * @generated from message protobuf_unittest.TestEnumMapLite - */ -export const TestEnumMapLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestEnumMapLite", - () => [ - { no: 101, name: "known_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumLite)} }, - { no: 102, name: "unknown_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumLite)} }, - ], -); - -/** - * @generated from message protobuf_unittest.TestEnumMapPlusExtraLite - */ -export const TestEnumMapPlusExtraLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestEnumMapPlusExtraLite", - () => [ - { no: 101, name: "known_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumPlusExtraLite)} }, - { no: 102, name: "unknown_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumPlusExtraLite)} }, - ], -); - -/** - * @generated from message protobuf_unittest.TestMessageMapLite - */ -export const TestMessageMapLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestMessageMapLite", - () => [ - { no: 1, name: "map_int32_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestAllTypesLite} }, - ], -); - -/** - * @generated from message protobuf_unittest.TestRequiredLite - */ -export const TestRequiredLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestRequiredLite", - () => [ - { no: 1, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "b", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 3, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - ], -); - -/** - * @generated from extension: optional protobuf_unittest.TestRequiredLite single = 1000; - */ -export const TestRequiredLite_single = proto2.makeExtension( - "protobuf_unittest.TestRequiredLite.single", - TestAllExtensionsLite, - () => ({ no: 1000, kind: "message", T: TestRequiredLite, opt: true }), -); - -/** - * @generated from message protobuf_unittest.ForeignMessageArenaLite - */ -export const ForeignMessageArenaLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.ForeignMessageArenaLite", - () => [ - { no: 1, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.d.ts index cd8d3327c..c6fb0d6d5 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.d.ts @@ -160,6 +160,85 @@ export declare class TestMap extends Message { static equals(a: TestMap | PlainMessage | undefined, b: TestMap | PlainMessage | undefined): boolean; } +/** + * @generated from message protobuf_unittest.TestMapWithMessages + */ +export declare class TestMapWithMessages extends Message { + /** + * @generated from field: map map_int32_all_types = 1; + */ + mapInt32AllTypes: { [key: number]: TestAllTypes }; + + /** + * @generated from field: map map_int64_all_types = 2; + */ + mapInt64AllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_uint32_all_types = 3; + */ + mapUint32AllTypes: { [key: number]: TestAllTypes }; + + /** + * @generated from field: map map_uint64_all_types = 4; + */ + mapUint64AllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_sint32_all_types = 5; + */ + mapSint32AllTypes: { [key: number]: TestAllTypes }; + + /** + * @generated from field: map map_sint64_all_types = 6; + */ + mapSint64AllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_fixed32_all_types = 7; + */ + mapFixed32AllTypes: { [key: number]: TestAllTypes }; + + /** + * @generated from field: map map_fixed64_all_types = 8; + */ + mapFixed64AllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_sfixed32_all_types = 9; + */ + mapSfixed32AllTypes: { [key: number]: TestAllTypes }; + + /** + * @generated from field: map map_sfixed64_all_types = 10; + */ + mapSfixed64AllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_bool_all_types = 11; + */ + mapBoolAllTypes: { [key: string]: TestAllTypes }; + + /** + * @generated from field: map map_string_all_types = 12; + */ + mapStringAllTypes: { [key: string]: TestAllTypes }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "protobuf_unittest.TestMapWithMessages"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): TestMapWithMessages; + + static fromJson(jsonValue: JsonValue, options?: Partial): TestMapWithMessages; + + static fromJsonString(jsonString: string, options?: Partial): TestMapWithMessages; + + static equals(a: TestMapWithMessages | PlainMessage | undefined, b: TestMapWithMessages | PlainMessage | undefined): boolean; +} + /** * @generated from message protobuf_unittest.TestMapSubmessage */ diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.js index 70387a8e1..c2a972def 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.js +++ b/packages/protobuf-test/src/gen/js/google/protobuf/map_unittest_pb.js @@ -65,6 +65,27 @@ export const TestMap = /*@__PURE__*/ proto3.makeMessageType( ], ); +/** + * @generated from message protobuf_unittest.TestMapWithMessages + */ +export const TestMapWithMessages = /*@__PURE__*/ proto3.makeMessageType( + "protobuf_unittest.TestMapWithMessages", + () => [ + { no: 1, name: "map_int32_all_types", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 2, name: "map_int64_all_types", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 3, name: "map_uint32_all_types", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 4, name: "map_uint64_all_types", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 5, name: "map_sint32_all_types", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 6, name: "map_sint64_all_types", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 7, name: "map_fixed32_all_types", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 8, name: "map_fixed64_all_types", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 9, name: "map_sfixed32_all_types", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 10, name: "map_sfixed64_all_types", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 11, name: "map_bool_all_types", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "message", T: TestAllTypes} }, + { no: 12, name: "map_string_all_types", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TestAllTypes} }, + ], +); + /** * @generated from message protobuf_unittest.TestMapSubmessage */ diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.d.ts index 4b8b1d152..e8ce55646 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.d.ts @@ -577,6 +577,11 @@ export declare class TestAllTypesProto2 extends Message { */ data?: TestAllTypesProto2_Data; + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField multiwordgroupfield = 204; + */ + multiwordgroupfield?: TestAllTypesProto2_MultiWordGroupField; + /** * default values * @@ -849,6 +854,35 @@ export declare class TestAllTypesProto2_Data extends Message | undefined, b: TestAllTypesProto2_Data | PlainMessage | undefined): boolean; } +/** + * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField + */ +export declare class TestAllTypesProto2_MultiWordGroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 205; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 206; + */ + groupUint32?: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto2; + static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesProto2_MultiWordGroupField; + + static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesProto2_MultiWordGroupField; + + static fromJsonString(jsonString: string, options?: Partial): TestAllTypesProto2_MultiWordGroupField; + + static equals(a: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined, b: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined): boolean; +} + /** * message_set test case. * @@ -952,6 +986,35 @@ export declare class ForeignMessageProto2 extends Message static equals(a: ForeignMessageProto2 | PlainMessage | undefined, b: ForeignMessageProto2 | PlainMessage | undefined): boolean; } +/** + * @generated from message protobuf_test_messages.proto2.GroupField + */ +export declare class GroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 122; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 123; + */ + groupUint32?: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto2; + static readonly typeName = "protobuf_test_messages.proto2.GroupField"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GroupField; + + static fromJson(jsonValue: JsonValue, options?: Partial): GroupField; + + static fromJsonString(jsonString: string, options?: Partial): GroupField; + + static equals(a: GroupField | PlainMessage | undefined, b: GroupField | PlainMessage | undefined): boolean; +} + /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes */ @@ -1530,3 +1593,8 @@ export declare const TestAllRequiredTypesProto2_MessageSetCorrectExtension2_mess */ export declare const extension_int32: Extension; +/** + * @generated from extension: optional protobuf_test_messages.proto2.GroupField groupfield = 121; + */ +export declare const groupfield: Extension; + diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.js index c2db31886..011856774 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.js +++ b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto2_pb.js @@ -146,6 +146,7 @@ export const TestAllTypesProto2 = /*@__PURE__*/ proto2.makeMessageType( { no: 118, name: "oneof_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "oneof_field" }, { no: 119, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), oneof: "oneof_field" }, { no: 201, name: "data", kind: "message", T: TestAllTypesProto2_Data, delimited: true, opt: true }, + { no: 204, name: "multiwordgroupfield", kind: "message", T: TestAllTypesProto2_MultiWordGroupField, delimited: true, opt: true }, { no: 241, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: -123456789 }, { no: 242, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("-9123456789123456789") }, { no: 243, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 2123456789 }, @@ -221,6 +222,18 @@ export const TestAllTypesProto2_Data = /*@__PURE__*/ proto2.makeMessageType( {localName: "TestAllTypesProto2_Data"}, ); +/** + * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField + */ +export const TestAllTypesProto2_MultiWordGroupField = /*@__PURE__*/ proto2.makeMessageType( + "protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField", + () => [ + { no: 205, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 206, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ], + {localName: "TestAllTypesProto2_MultiWordGroupField"}, +); + /** * message_set test case. * @@ -282,6 +295,17 @@ export const ForeignMessageProto2 = /*@__PURE__*/ proto2.makeMessageType( ], ); +/** + * @generated from message protobuf_test_messages.proto2.GroupField + */ +export const GroupField = /*@__PURE__*/ proto2.makeMessageType( + "protobuf_test_messages.proto2.GroupField", + () => [ + { no: 122, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 123, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ], +); + /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes */ @@ -505,3 +529,12 @@ export const extension_int32 = proto2.makeExtension( { no: 120, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, ); +/** + * @generated from extension: optional protobuf_test_messages.proto2.GroupField groupfield = 121; + */ +export const groupfield = proto2.makeExtension( + "protobuf_test_messages.proto2.groupfield", + TestAllTypesProto2, + () => ({ no: 121, kind: "message", T: GroupField, delimited: true, opt: true }), +); + diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.d.ts index 659cb8ce1..108d8d13d 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.d.ts @@ -19,6 +19,101 @@ import type { BinaryReadOptions, Extension, FeatureSet, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto2 } from "@bufbuild/protobuf"; +/** + * @generated from enum pb.EnumFeature + */ +export declare enum EnumFeature { + /** + * @generated from enum value: TEST_ENUM_FEATURE_UNKNOWN = 0; + */ + TEST_ENUM_FEATURE_UNKNOWN = 0, + + /** + * @generated from enum value: VALUE1 = 1; + */ + VALUE1 = 1, + + /** + * @generated from enum value: VALUE2 = 2; + */ + VALUE2 = 2, + + /** + * @generated from enum value: VALUE3 = 3; + */ + VALUE3 = 3, + + /** + * @generated from enum value: VALUE4 = 4; + */ + VALUE4 = 4, + + /** + * @generated from enum value: VALUE5 = 5; + */ + VALUE5 = 5, + + /** + * @generated from enum value: VALUE6 = 6; + */ + VALUE6 = 6, + + /** + * @generated from enum value: VALUE7 = 7; + */ + VALUE7 = 7, + + /** + * @generated from enum value: VALUE8 = 8; + */ + VALUE8 = 8, + + /** + * @generated from enum value: VALUE9 = 9; + */ + VALUE9 = 9, + + /** + * @generated from enum value: VALUE10 = 10; + */ + VALUE10 = 10, + + /** + * @generated from enum value: VALUE11 = 11; + */ + VALUE11 = 11, + + /** + * @generated from enum value: VALUE12 = 12; + */ + VALUE12 = 12, + + /** + * @generated from enum value: VALUE13 = 13; + */ + VALUE13 = 13, + + /** + * @generated from enum value: VALUE14 = 14; + */ + VALUE14 = 14, + + /** + * @generated from enum value: VALUE15 = 15; + */ + VALUE15 = 15, + + /** + * @generated from enum value: VALUE_EMPTY_SUPPORT = 98; + */ + VALUE_EMPTY_SUPPORT = 98, + + /** + * @generated from enum value: VALUE_FUTURE = 99; + */ + VALUE_FUTURE = 99, +} + /** * @generated from message pb.TestMessage */ @@ -72,54 +167,54 @@ export declare const TestMessage_test_message: Extension { /** - * @generated from field: optional int32 int_file_feature = 1; + * @generated from field: optional pb.EnumFeature file_feature = 1; */ - intFileFeature?: number; + fileFeature?: EnumFeature; /** - * @generated from field: optional int32 int_extension_range_feature = 2; + * @generated from field: optional pb.EnumFeature extension_range_feature = 2; */ - intExtensionRangeFeature?: number; + extensionRangeFeature?: EnumFeature; /** - * @generated from field: optional int32 int_message_feature = 3; + * @generated from field: optional pb.EnumFeature message_feature = 3; */ - intMessageFeature?: number; + messageFeature?: EnumFeature; /** - * @generated from field: optional int32 int_field_feature = 4; + * @generated from field: optional pb.EnumFeature field_feature = 4; */ - intFieldFeature?: number; + fieldFeature?: EnumFeature; /** - * @generated from field: optional int32 int_oneof_feature = 5; + * @generated from field: optional pb.EnumFeature oneof_feature = 5; */ - intOneofFeature?: number; + oneofFeature?: EnumFeature; /** - * @generated from field: optional int32 int_enum_feature = 6; + * @generated from field: optional pb.EnumFeature enum_feature = 6; */ - intEnumFeature?: number; + enumFeature?: EnumFeature; /** - * @generated from field: optional int32 int_enum_entry_feature = 7; + * @generated from field: optional pb.EnumFeature enum_entry_feature = 7; */ - intEnumEntryFeature?: number; + enumEntryFeature?: EnumFeature; /** - * @generated from field: optional int32 int_service_feature = 8; + * @generated from field: optional pb.EnumFeature service_feature = 8; */ - intServiceFeature?: number; + serviceFeature?: EnumFeature; /** - * @generated from field: optional int32 int_method_feature = 9; + * @generated from field: optional pb.EnumFeature method_feature = 9; */ - intMethodFeature?: number; + methodFeature?: EnumFeature; /** - * @generated from field: optional int32 int_multiple_feature = 10; + * @generated from field: optional pb.EnumFeature multiple_feature = 10; */ - intMultipleFeature?: number; + multipleFeature?: EnumFeature; /** * @generated from field: optional bool bool_field_feature = 11; @@ -127,29 +222,29 @@ export declare class TestFeatures extends Message { boolFieldFeature?: boolean; /** - * @generated from field: optional float float_field_feature = 12; + * @generated from field: optional pb.EnumFeature source_feature = 15; */ - floatFieldFeature?: number; + sourceFeature?: EnumFeature; /** - * @generated from field: optional pb.TestFeatures.MessageFeature message_field_feature = 13; + * @generated from field: optional pb.EnumFeature source_feature2 = 16; */ - messageFieldFeature?: TestFeatures_MessageFeature; + sourceFeature2?: EnumFeature; /** - * @generated from field: optional pb.TestFeatures.EnumFeature enum_field_feature = 14; + * @generated from field: optional pb.EnumFeature removed_feature = 17; */ - enumFieldFeature?: TestFeatures_EnumFeature; + removedFeature?: EnumFeature; /** - * @generated from field: optional int32 int_source_feature = 15; + * @generated from field: optional pb.EnumFeature future_feature = 18; */ - intSourceFeature?: number; + futureFeature?: EnumFeature; /** - * @generated from field: optional string string_source_feature = 16; + * @generated from field: optional pb.EnumFeature legacy_feature = 19; */ - stringSourceFeature?: string; + legacyFeature?: EnumFeature; constructor(data?: PartialMessage); @@ -166,80 +261,6 @@ export declare class TestFeatures extends Message { static equals(a: TestFeatures | PlainMessage | undefined, b: TestFeatures | PlainMessage | undefined): boolean; } -/** - * @generated from enum pb.TestFeatures.EnumFeature - */ -export declare enum TestFeatures_EnumFeature { - /** - * @generated from enum value: TEST_ENUM_FEATURE_UNKNOWN = 0; - */ - TEST_ENUM_FEATURE_UNKNOWN = 0, - - /** - * @generated from enum value: ENUM_VALUE1 = 1; - */ - ENUM_VALUE1 = 1, - - /** - * @generated from enum value: ENUM_VALUE2 = 2; - */ - ENUM_VALUE2 = 2, - - /** - * @generated from enum value: ENUM_VALUE3 = 3; - */ - ENUM_VALUE3 = 3, - - /** - * @generated from enum value: ENUM_VALUE4 = 4; - */ - ENUM_VALUE4 = 4, - - /** - * @generated from enum value: ENUM_VALUE5 = 5; - */ - ENUM_VALUE5 = 5, -} - -/** - * @generated from message pb.TestFeatures.MessageFeature - */ -export declare class TestFeatures_MessageFeature extends Message { - /** - * @generated from field: optional bool bool_field = 1; - */ - boolField?: boolean; - - /** - * @generated from field: optional int32 int_field = 2; - */ - intField?: number; - - /** - * @generated from field: optional float float_field = 3; - */ - floatField?: number; - - /** - * @generated from field: optional string string_field = 4; - */ - stringField?: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "pb.TestFeatures.MessageFeature"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestFeatures_MessageFeature; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestFeatures_MessageFeature; - - static fromJsonString(jsonString: string, options?: Partial): TestFeatures_MessageFeature; - - static equals(a: TestFeatures_MessageFeature | PlainMessage | undefined, b: TestFeatures_MessageFeature | PlainMessage | undefined): boolean; -} - /** * @generated from extension: optional pb.TestFeatures test = 9999; */ diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.js index 3eb818cc1..b557fe83c 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.js +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_features_pb.js @@ -18,6 +18,33 @@ import { FeatureSet, proto2 } from "@bufbuild/protobuf"; +/** + * @generated from enum pb.EnumFeature + */ +export const EnumFeature = /*@__PURE__*/ proto2.makeEnum( + "pb.EnumFeature", + [ + {no: 0, name: "TEST_ENUM_FEATURE_UNKNOWN"}, + {no: 1, name: "VALUE1"}, + {no: 2, name: "VALUE2"}, + {no: 3, name: "VALUE3"}, + {no: 4, name: "VALUE4"}, + {no: 5, name: "VALUE5"}, + {no: 6, name: "VALUE6"}, + {no: 7, name: "VALUE7"}, + {no: 8, name: "VALUE8"}, + {no: 9, name: "VALUE9"}, + {no: 10, name: "VALUE10"}, + {no: 11, name: "VALUE11"}, + {no: 12, name: "VALUE12"}, + {no: 13, name: "VALUE13"}, + {no: 14, name: "VALUE14"}, + {no: 15, name: "VALUE15"}, + {no: 98, name: "VALUE_EMPTY_SUPPORT"}, + {no: 99, name: "VALUE_FUTURE"}, + ], +); + /** * @generated from message pb.TestMessage */ @@ -59,52 +86,23 @@ export const TestMessage_test_message = proto2.makeExtension( export const TestFeatures = /*@__PURE__*/ proto2.makeMessageType( "pb.TestFeatures", () => [ - { no: 1, name: "int_file_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "int_extension_range_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 3, name: "int_message_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 4, name: "int_field_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 5, name: "int_oneof_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 6, name: "int_enum_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 7, name: "int_enum_entry_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 8, name: "int_service_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 9, name: "int_method_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 10, name: "int_multiple_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 1, name: "file_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 2, name: "extension_range_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 3, name: "message_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 4, name: "field_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 5, name: "oneof_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 6, name: "enum_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 7, name: "enum_entry_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 8, name: "service_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 9, name: "method_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 10, name: "multiple_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, { no: 11, name: "bool_field_feature", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 12, name: "float_field_feature", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 13, name: "message_field_feature", kind: "message", T: TestFeatures_MessageFeature, opt: true }, - { no: 14, name: "enum_field_feature", kind: "enum", T: proto2.getEnumType(TestFeatures_EnumFeature), opt: true }, - { no: 15, name: "int_source_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 16, name: "string_source_feature", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ], -); - -/** - * @generated from enum pb.TestFeatures.EnumFeature - */ -export const TestFeatures_EnumFeature = /*@__PURE__*/ proto2.makeEnum( - "pb.TestFeatures.EnumFeature", - [ - {no: 0, name: "TEST_ENUM_FEATURE_UNKNOWN"}, - {no: 1, name: "ENUM_VALUE1"}, - {no: 2, name: "ENUM_VALUE2"}, - {no: 3, name: "ENUM_VALUE3"}, - {no: 4, name: "ENUM_VALUE4"}, - {no: 5, name: "ENUM_VALUE5"}, - ], -); - -/** - * @generated from message pb.TestFeatures.MessageFeature - */ -export const TestFeatures_MessageFeature = /*@__PURE__*/ proto2.makeMessageType( - "pb.TestFeatures.MessageFeature", - () => [ - { no: 1, name: "bool_field", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 2, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 3, name: "float_field", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 4, name: "string_field", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 15, name: "source_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 16, name: "source_feature2", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 17, name: "removed_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 18, name: "future_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 19, name: "legacy_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, ], - {localName: "TestFeatures_MessageFeature"}, ); /** diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.d.ts deleted file mode 100644 index 4ca10d2ab..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_import_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from enum protobuf_unittest_import.ImportEnumLite - */ -export declare enum ImportEnumLite { - /** - * @generated from enum value: IMPORT_LITE_FOO = 7; - */ - IMPORT_LITE_FOO = 7, - - /** - * @generated from enum value: IMPORT_LITE_BAR = 8; - */ - IMPORT_LITE_BAR = 8, - - /** - * @generated from enum value: IMPORT_LITE_BAZ = 9; - */ - IMPORT_LITE_BAZ = 9, -} - -/** - * @generated from message protobuf_unittest_import.ImportMessageLite - */ -export declare class ImportMessageLite extends Message { - /** - * @generated from field: optional int32 d = 1; - */ - d?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest_import.ImportMessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ImportMessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): ImportMessageLite; - - static fromJsonString(jsonString: string, options?: Partial): ImportMessageLite; - - static equals(a: ImportMessageLite | PlainMessage | undefined, b: ImportMessageLite | PlainMessage | undefined): boolean; -} - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.js deleted file mode 100644 index a5462db46..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_lite_pb.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_import_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import { proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from enum protobuf_unittest_import.ImportEnumLite - */ -export const ImportEnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest_import.ImportEnumLite", - [ - {no: 7, name: "IMPORT_LITE_FOO"}, - {no: 8, name: "IMPORT_LITE_BAR"}, - {no: 9, name: "IMPORT_LITE_BAZ"}, - ], -); - -/** - * @generated from message protobuf_unittest_import.ImportMessageLite - */ -export const ImportMessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest_import.ImportMessageLite", - () => [ - { no: 1, name: "d", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.d.ts deleted file mode 100644 index 18bcef065..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: liujisi@google.com (Pherl Liu) - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_import_public_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from message protobuf_unittest_import.PublicImportMessageLite - */ -export declare class PublicImportMessageLite extends Message { - /** - * @generated from field: optional int32 e = 1; - */ - e?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest_import.PublicImportMessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): PublicImportMessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): PublicImportMessageLite; - - static fromJsonString(jsonString: string, options?: Partial): PublicImportMessageLite; - - static equals(a: PublicImportMessageLite | PlainMessage | undefined, b: PublicImportMessageLite | PlainMessage | undefined): boolean; -} - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.js deleted file mode 100644 index b495a25f9..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_import_public_lite_pb.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: liujisi@google.com (Pherl Liu) - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_import_public_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import { proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from message protobuf_unittest_import.PublicImportMessageLite - */ -export const PublicImportMessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest_import.PublicImportMessageLite", - () => [ - { no: 1, name: "e", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.d.ts deleted file mode 100644 index e0ddb60a5..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.d.ts +++ /dev/null @@ -1,2111 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_lite.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, Extension, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; -import type { ImportEnumLite, ImportMessageLite } from "./unittest_import_lite_pb.js"; -import type { PublicImportMessageLite } from "./unittest_import_public_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.ForeignEnumLite - */ -export declare enum ForeignEnumLite { - /** - * @generated from enum value: FOREIGN_LITE_FOO = 4; - */ - FOREIGN_LITE_FOO = 4, - - /** - * @generated from enum value: FOREIGN_LITE_BAZ = 6; - */ - FOREIGN_LITE_BAZ = 6, - - /** - * @generated from enum value: FOREIGN_LITE_BAR = 5; - */ - FOREIGN_LITE_BAR = 5, -} - -/** - * @generated from enum protobuf_unittest.V1EnumLite - */ -export declare enum V1EnumLite { - /** - * @generated from enum value: V1_FIRST = 1; - */ - V1_FIRST = 1, -} - -/** - * @generated from enum protobuf_unittest.V2EnumLite - */ -export declare enum V2EnumLite { - /** - * @generated from enum value: V2_FIRST = 1; - */ - V2_FIRST = 1, - - /** - * @generated from enum value: V2_SECOND = 2; - */ - V2_SECOND = 2, -} - -/** - * Same as TestAllTypes but with the lite runtime. - * - * @generated from message protobuf_unittest.TestAllTypesLite - */ -export declare class TestAllTypesLite extends Message { - /** - * Singular - * - * @generated from field: optional int32 optional_int32 = 1; - */ - optionalInt32?: number; - - /** - * @generated from field: optional int64 optional_int64 = 2; - */ - optionalInt64?: bigint; - - /** - * @generated from field: optional uint32 optional_uint32 = 3; - */ - optionalUint32?: number; - - /** - * @generated from field: optional uint64 optional_uint64 = 4; - */ - optionalUint64?: bigint; - - /** - * @generated from field: optional sint32 optional_sint32 = 5; - */ - optionalSint32?: number; - - /** - * @generated from field: optional sint64 optional_sint64 = 6; - */ - optionalSint64?: bigint; - - /** - * @generated from field: optional fixed32 optional_fixed32 = 7; - */ - optionalFixed32?: number; - - /** - * @generated from field: optional fixed64 optional_fixed64 = 8; - */ - optionalFixed64?: bigint; - - /** - * @generated from field: optional sfixed32 optional_sfixed32 = 9; - */ - optionalSfixed32?: number; - - /** - * @generated from field: optional sfixed64 optional_sfixed64 = 10; - */ - optionalSfixed64?: bigint; - - /** - * @generated from field: optional float optional_float = 11; - */ - optionalFloat?: number; - - /** - * @generated from field: optional double optional_double = 12; - */ - optionalDouble?: number; - - /** - * @generated from field: optional bool optional_bool = 13; - */ - optionalBool?: boolean; - - /** - * @generated from field: optional string optional_string = 14; - */ - optionalString?: string; - - /** - * @generated from field: optional bytes optional_bytes = 15; - */ - optionalBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.OptionalGroup optionalgroup = 16; - */ - optionalgroup?: TestAllTypesLite_OptionalGroup; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_nested_message = 18; - */ - optionalNestedMessage?: TestAllTypesLite_NestedMessage; - - /** - * @generated from field: optional protobuf_unittest.ForeignMessageLite optional_foreign_message = 19; - */ - optionalForeignMessage?: ForeignMessageLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportMessageLite optional_import_message = 20; - */ - optionalImportMessage?: ImportMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedEnum optional_nested_enum = 21; - */ - optionalNestedEnum?: TestAllTypesLite_NestedEnum; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite optional_foreign_enum = 22; - */ - optionalForeignEnum?: ForeignEnumLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - */ - optionalImportEnum?: ImportEnumLite; - - /** - * @generated from field: optional string optional_string_piece = 24; - */ - optionalStringPiece?: string; - - /** - * @generated from field: optional string optional_cord = 25; - */ - optionalCord?: string; - - /** - * Defined in unittest_import_public.proto - * - * @generated from field: optional protobuf_unittest_import.PublicImportMessageLite optional_public_import_message = 26; - */ - optionalPublicImportMessage?: PublicImportMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_lazy_message = 27; - */ - optionalLazyMessage?: TestAllTypesLite_NestedMessage; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_unverified_lazy_message = 28; - */ - optionalUnverifiedLazyMessage?: TestAllTypesLite_NestedMessage; - - /** - * Repeated - * - * @generated from field: repeated int32 repeated_int32 = 31; - */ - repeatedInt32: number[]; - - /** - * @generated from field: repeated int64 repeated_int64 = 32; - */ - repeatedInt64: bigint[]; - - /** - * @generated from field: repeated uint32 repeated_uint32 = 33; - */ - repeatedUint32: number[]; - - /** - * @generated from field: repeated uint64 repeated_uint64 = 34; - */ - repeatedUint64: bigint[]; - - /** - * @generated from field: repeated sint32 repeated_sint32 = 35; - */ - repeatedSint32: number[]; - - /** - * @generated from field: repeated sint64 repeated_sint64 = 36; - */ - repeatedSint64: bigint[]; - - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 37; - */ - repeatedFixed32: number[]; - - /** - * @generated from field: repeated fixed64 repeated_fixed64 = 38; - */ - repeatedFixed64: bigint[]; - - /** - * @generated from field: repeated sfixed32 repeated_sfixed32 = 39; - */ - repeatedSfixed32: number[]; - - /** - * @generated from field: repeated sfixed64 repeated_sfixed64 = 40; - */ - repeatedSfixed64: bigint[]; - - /** - * @generated from field: repeated float repeated_float = 41; - */ - repeatedFloat: number[]; - - /** - * @generated from field: repeated double repeated_double = 42; - */ - repeatedDouble: number[]; - - /** - * @generated from field: repeated bool repeated_bool = 43; - */ - repeatedBool: boolean[]; - - /** - * @generated from field: repeated string repeated_string = 44; - */ - repeatedString: string[]; - - /** - * @generated from field: repeated bytes repeated_bytes = 45; - */ - repeatedBytes: Uint8Array[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.RepeatedGroup repeatedgroup = 46; - */ - repeatedgroup: TestAllTypesLite_RepeatedGroup[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_nested_message = 48; - */ - repeatedNestedMessage: TestAllTypesLite_NestedMessage[]; - - /** - * @generated from field: repeated protobuf_unittest.ForeignMessageLite repeated_foreign_message = 49; - */ - repeatedForeignMessage: ForeignMessageLite[]; - - /** - * @generated from field: repeated protobuf_unittest_import.ImportMessageLite repeated_import_message = 50; - */ - repeatedImportMessage: ImportMessageLite[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedEnum repeated_nested_enum = 51; - */ - repeatedNestedEnum: TestAllTypesLite_NestedEnum[]; - - /** - * @generated from field: repeated protobuf_unittest.ForeignEnumLite repeated_foreign_enum = 52; - */ - repeatedForeignEnum: ForeignEnumLite[]; - - /** - * @generated from field: repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - */ - repeatedImportEnum: ImportEnumLite[]; - - /** - * @generated from field: repeated string repeated_string_piece = 54; - */ - repeatedStringPiece: string[]; - - /** - * @generated from field: repeated string repeated_cord = 55; - */ - repeatedCord: string[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_lazy_message = 57; - */ - repeatedLazyMessage: TestAllTypesLite_NestedMessage[]; - - /** - * Singular with defaults - * - * @generated from field: optional int32 default_int32 = 61 [default = 41]; - */ - defaultInt32?: number; - - /** - * @generated from field: optional int64 default_int64 = 62 [default = 42]; - */ - defaultInt64?: bigint; - - /** - * @generated from field: optional uint32 default_uint32 = 63 [default = 43]; - */ - defaultUint32?: number; - - /** - * @generated from field: optional uint64 default_uint64 = 64 [default = 44]; - */ - defaultUint64?: bigint; - - /** - * @generated from field: optional sint32 default_sint32 = 65 [default = -45]; - */ - defaultSint32?: number; - - /** - * @generated from field: optional sint64 default_sint64 = 66 [default = 46]; - */ - defaultSint64?: bigint; - - /** - * @generated from field: optional fixed32 default_fixed32 = 67 [default = 47]; - */ - defaultFixed32?: number; - - /** - * @generated from field: optional fixed64 default_fixed64 = 68 [default = 48]; - */ - defaultFixed64?: bigint; - - /** - * @generated from field: optional sfixed32 default_sfixed32 = 69 [default = 49]; - */ - defaultSfixed32?: number; - - /** - * @generated from field: optional sfixed64 default_sfixed64 = 70 [default = -50]; - */ - defaultSfixed64?: bigint; - - /** - * @generated from field: optional float default_float = 71 [default = 51.5]; - */ - defaultFloat?: number; - - /** - * @generated from field: optional double default_double = 72 [default = 52000]; - */ - defaultDouble?: number; - - /** - * @generated from field: optional bool default_bool = 73 [default = true]; - */ - defaultBool?: boolean; - - /** - * @generated from field: optional string default_string = 74 [default = "hello"]; - */ - defaultString?: string; - - /** - * @generated from field: optional bytes default_bytes = 75 [default = "world"]; - */ - defaultBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedEnum default_nested_enum = 81 [default = BAR]; - */ - defaultNestedEnum?: TestAllTypesLite_NestedEnum; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite default_foreign_enum = 82 [default = FOREIGN_LITE_BAR]; - */ - defaultForeignEnum?: ForeignEnumLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportEnumLite default_import_enum = 83 [default = IMPORT_LITE_BAR]; - */ - defaultImportEnum?: ImportEnumLite; - - /** - * @generated from field: optional string default_string_piece = 84 [default = "abc"]; - */ - defaultStringPiece?: string; - - /** - * @generated from field: optional string default_cord = 85 [default = "123"]; - */ - defaultCord?: string; - - /** - * For oneof test - * - * @generated from oneof protobuf_unittest.TestAllTypesLite.oneof_field - */ - oneofField: { - /** - * @generated from field: uint32 oneof_uint32 = 111; - */ - value: number; - case: "oneofUint32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage oneof_nested_message = 112; - */ - value: TestAllTypesLite_NestedMessage; - case: "oneofNestedMessage"; - } | { - /** - * @generated from field: string oneof_string = 113; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 114; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage oneof_lazy_nested_message = 115; - */ - value: TestAllTypesLite_NestedMessage; - case: "oneofLazyNestedMessage"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage2 oneof_nested_message2 = 117; - */ - value: TestAllTypesLite_NestedMessage2; - case: "oneofNestedMessage2"; - } | { case: undefined; value?: undefined }; - - /** - * Tests toString for non-repeated fields with a list suffix - * - * @generated from field: optional int32 deceptively_named_list = 116; - */ - deceptivelyNamedList?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite; - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite; - - static equals(a: TestAllTypesLite | PlainMessage | undefined, b: TestAllTypesLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from enum protobuf_unittest.TestAllTypesLite.NestedEnum - */ -export declare enum TestAllTypesLite_NestedEnum { - /** - * @generated from enum value: FOO = 1; - */ - FOO = 1, - - /** - * @generated from enum value: BAR = 2; - */ - BAR = 2, - - /** - * @generated from enum value: BAZ = 3; - */ - BAZ = 3, -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage - */ -export declare class TestAllTypesLite_NestedMessage extends Message { - /** - * @generated from field: optional int32 bb = 1; - */ - bb?: number; - - /** - * @generated from field: optional int64 cc = 2; - */ - cc?: bigint; - - /** - * @generated from field: repeated int32 dd = 3 [packed = true]; - */ - dd: number[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.NestedMessage"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_NestedMessage; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_NestedMessage; - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_NestedMessage; - - static equals(a: TestAllTypesLite_NestedMessage | PlainMessage | undefined, b: TestAllTypesLite_NestedMessage | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage2 - */ -export declare class TestAllTypesLite_NestedMessage2 extends Message { - /** - * @generated from field: optional int32 dd = 1; - */ - dd?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.NestedMessage2"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_NestedMessage2; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_NestedMessage2; - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_NestedMessage2; - - static equals(a: TestAllTypesLite_NestedMessage2 | PlainMessage | undefined, b: TestAllTypesLite_NestedMessage2 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.OptionalGroup - */ -export declare class TestAllTypesLite_OptionalGroup extends Message { - /** - * @generated from field: optional int32 a = 17; - */ - a?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.OptionalGroup"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_OptionalGroup; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_OptionalGroup; - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_OptionalGroup; - - static equals(a: TestAllTypesLite_OptionalGroup | PlainMessage | undefined, b: TestAllTypesLite_OptionalGroup | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.RepeatedGroup - */ -export declare class TestAllTypesLite_RepeatedGroup extends Message { - /** - * @generated from field: optional int32 a = 47; - */ - a?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.RepeatedGroup"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_RepeatedGroup; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_RepeatedGroup; - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_RepeatedGroup; - - static equals(a: TestAllTypesLite_RepeatedGroup | PlainMessage | undefined, b: TestAllTypesLite_RepeatedGroup | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.ForeignMessageLite - */ -export declare class ForeignMessageLite extends Message { - /** - * @generated from field: optional int32 c = 1; - */ - c?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.ForeignMessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ForeignMessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): ForeignMessageLite; - - static fromJsonString(jsonString: string, options?: Partial): ForeignMessageLite; - - static equals(a: ForeignMessageLite | PlainMessage | undefined, b: ForeignMessageLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestPackedTypesLite - */ -export declare class TestPackedTypesLite extends Message { - /** - * @generated from field: repeated int32 packed_int32 = 90 [packed = true]; - */ - packedInt32: number[]; - - /** - * @generated from field: repeated int64 packed_int64 = 91 [packed = true]; - */ - packedInt64: bigint[]; - - /** - * @generated from field: repeated uint32 packed_uint32 = 92 [packed = true]; - */ - packedUint32: number[]; - - /** - * @generated from field: repeated uint64 packed_uint64 = 93 [packed = true]; - */ - packedUint64: bigint[]; - - /** - * @generated from field: repeated sint32 packed_sint32 = 94 [packed = true]; - */ - packedSint32: number[]; - - /** - * @generated from field: repeated sint64 packed_sint64 = 95 [packed = true]; - */ - packedSint64: bigint[]; - - /** - * @generated from field: repeated fixed32 packed_fixed32 = 96 [packed = true]; - */ - packedFixed32: number[]; - - /** - * @generated from field: repeated fixed64 packed_fixed64 = 97 [packed = true]; - */ - packedFixed64: bigint[]; - - /** - * @generated from field: repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - */ - packedSfixed32: number[]; - - /** - * @generated from field: repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - */ - packedSfixed64: bigint[]; - - /** - * @generated from field: repeated float packed_float = 100 [packed = true]; - */ - packedFloat: number[]; - - /** - * @generated from field: repeated double packed_double = 101 [packed = true]; - */ - packedDouble: number[]; - - /** - * @generated from field: repeated bool packed_bool = 102 [packed = true]; - */ - packedBool: boolean[]; - - /** - * @generated from field: repeated protobuf_unittest.ForeignEnumLite packed_enum = 103 [packed = true]; - */ - packedEnum: ForeignEnumLite[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestPackedTypesLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestPackedTypesLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestPackedTypesLite; - - static fromJsonString(jsonString: string, options?: Partial): TestPackedTypesLite; - - static equals(a: TestPackedTypesLite | PlainMessage | undefined, b: TestPackedTypesLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestAllExtensionsLite - */ -export declare class TestAllExtensionsLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestAllExtensionsLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllExtensionsLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllExtensionsLite; - - static fromJsonString(jsonString: string, options?: Partial): TestAllExtensionsLite; - - static equals(a: TestAllExtensionsLite | PlainMessage | undefined, b: TestAllExtensionsLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.OptionalGroup_extension_lite - */ -export declare class OptionalGroup_extension_lite extends Message { - /** - * @generated from field: optional int32 a = 17; - */ - a?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.OptionalGroup_extension_lite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): OptionalGroup_extension_lite; - - static fromJson(jsonValue: JsonValue, options?: Partial): OptionalGroup_extension_lite; - - static fromJsonString(jsonString: string, options?: Partial): OptionalGroup_extension_lite; - - static equals(a: OptionalGroup_extension_lite | PlainMessage | undefined, b: OptionalGroup_extension_lite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.RepeatedGroup_extension_lite - */ -export declare class RepeatedGroup_extension_lite extends Message { - /** - * @generated from field: optional int32 a = 47; - */ - a?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.RepeatedGroup_extension_lite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RepeatedGroup_extension_lite; - - static fromJson(jsonValue: JsonValue, options?: Partial): RepeatedGroup_extension_lite; - - static fromJsonString(jsonString: string, options?: Partial): RepeatedGroup_extension_lite; - - static equals(a: RepeatedGroup_extension_lite | PlainMessage | undefined, b: RepeatedGroup_extension_lite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestPackedExtensionsLite - */ -export declare class TestPackedExtensionsLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestPackedExtensionsLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestPackedExtensionsLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestPackedExtensionsLite; - - static fromJsonString(jsonString: string, options?: Partial): TestPackedExtensionsLite; - - static equals(a: TestPackedExtensionsLite | PlainMessage | undefined, b: TestPackedExtensionsLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestNestedExtensionLite - */ -export declare class TestNestedExtensionLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestNestedExtensionLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestNestedExtensionLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestNestedExtensionLite; - - static fromJsonString(jsonString: string, options?: Partial): TestNestedExtensionLite; - - static equals(a: TestNestedExtensionLite | PlainMessage | undefined, b: TestNestedExtensionLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from extension: optional int32 nested_extension = 12345; - */ -export declare const TestNestedExtensionLite_nested_extension: Extension; - -/** - * Test that deprecated fields work. We only verify that they compile (at one - * point this failed). - * - * @generated from message protobuf_unittest.TestDeprecatedLite - */ -export declare class TestDeprecatedLite extends Message { - /** - * @generated from field: optional int32 deprecated_field = 1 [deprecated = true]; - * @deprecated - */ - deprecatedField?: number; - - /** - * @generated from field: required int32 deprecated_field2 = 2 [deprecated = true]; - * @deprecated - */ - deprecatedField2?: number; - - /** - * @generated from field: optional string deprecated_field3 = 3 [deprecated = true]; - * @deprecated - */ - deprecatedField3?: string; - - /** - * @generated from field: optional protobuf_unittest.TestDeprecatedLite deprecated_field4 = 4 [deprecated = true]; - * @deprecated - */ - deprecatedField4?: TestDeprecatedLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestDeprecatedLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestDeprecatedLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestDeprecatedLite; - - static fromJsonString(jsonString: string, options?: Partial): TestDeprecatedLite; - - static equals(a: TestDeprecatedLite | PlainMessage | undefined, b: TestDeprecatedLite | PlainMessage | undefined): boolean; -} - -/** - * See the comments of the same type in unittest.proto. - * - * @generated from message protobuf_unittest.TestParsingMergeLite - */ -export declare class TestParsingMergeLite extends Message { - /** - * @generated from field: required protobuf_unittest.TestAllTypesLite required_all_types = 1; - */ - requiredAllTypes?: TestAllTypesLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite optional_all_types = 2; - */ - optionalAllTypes?: TestAllTypesLite; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite repeated_all_types = 3; - */ - repeatedAllTypes: TestAllTypesLite[]; - - /** - * @generated from field: optional protobuf_unittest.TestParsingMergeLite.OptionalGroup optionalgroup = 10; - */ - optionalgroup?: TestParsingMergeLite_OptionalGroup; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedGroup repeatedgroup = 20; - */ - repeatedgroup: TestParsingMergeLite_RepeatedGroup[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite; - - static equals(a: TestParsingMergeLite | PlainMessage | undefined, b: TestParsingMergeLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator - */ -export declare class TestParsingMergeLite_RepeatedFieldsGenerator extends Message { - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field1 = 1; - */ - field1: TestAllTypesLite[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field2 = 2; - */ - field2: TestAllTypesLite[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field3 = 3; - */ - field3: TestAllTypesLite[]; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 group1 = 10; - */ - group1: TestParsingMergeLite_RepeatedFieldsGenerator_Group1[]; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 group2 = 20; - */ - group2: TestParsingMergeLite_RepeatedFieldsGenerator_Group2[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite ext1 = 1000; - */ - ext1: TestAllTypesLite[]; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite ext2 = 1001; - */ - ext2: TestAllTypesLite[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator; - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 - */ -export declare class TestParsingMergeLite_RepeatedFieldsGenerator_Group1 extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite field1 = 11; - */ - field1?: TestAllTypesLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1; - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator_Group1 | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator_Group1 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 - */ -export declare class TestParsingMergeLite_RepeatedFieldsGenerator_Group2 extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite field1 = 21; - */ - field1?: TestAllTypesLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2; - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator_Group2 | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator_Group2 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.OptionalGroup - */ -export declare class TestParsingMergeLite_OptionalGroup extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite optional_group_all_types = 11; - */ - optionalGroupAllTypes?: TestAllTypesLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.OptionalGroup"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_OptionalGroup; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_OptionalGroup; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_OptionalGroup; - - static equals(a: TestParsingMergeLite_OptionalGroup | PlainMessage | undefined, b: TestParsingMergeLite_OptionalGroup | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedGroup - */ -export declare class TestParsingMergeLite_RepeatedGroup extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite repeated_group_all_types = 21; - */ - repeatedGroupAllTypes?: TestAllTypesLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedGroup"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedGroup; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedGroup; - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedGroup; - - static equals(a: TestParsingMergeLite_RepeatedGroup | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedGroup | PlainMessage | undefined): boolean; -} - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite optional_ext = 1000; - */ -export declare const TestParsingMergeLite_optional_ext: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite repeated_ext = 1001; - */ -export declare const TestParsingMergeLite_repeated_ext: Extension; - -/** - * Test that the correct exception is thrown by parseFrom in a corner case - * involving merging, extensions, and required fields. - * - * @generated from message protobuf_unittest.TestMergeExceptionLite - */ -export declare class TestMergeExceptionLite extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllExtensionsLite all_extensions = 1; - */ - allExtensions?: TestAllExtensionsLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestMergeExceptionLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMergeExceptionLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMergeExceptionLite; - - static fromJsonString(jsonString: string, options?: Partial): TestMergeExceptionLite; - - static equals(a: TestMergeExceptionLite | PlainMessage | undefined, b: TestMergeExceptionLite | PlainMessage | undefined): boolean; -} - -/** - * TestEmptyMessageLite is used to test unknown fields support in lite mode. - * - * @generated from message protobuf_unittest.TestEmptyMessageLite - */ -export declare class TestEmptyMessageLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestEmptyMessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEmptyMessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEmptyMessageLite; - - static fromJsonString(jsonString: string, options?: Partial): TestEmptyMessageLite; - - static equals(a: TestEmptyMessageLite | PlainMessage | undefined, b: TestEmptyMessageLite | PlainMessage | undefined): boolean; -} - -/** - * Like above, but declare all field numbers as potential extensions. No - * actual extensions should ever be defined for this type. - * - * @generated from message protobuf_unittest.TestEmptyMessageWithExtensionsLite - */ -export declare class TestEmptyMessageWithExtensionsLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestEmptyMessageWithExtensionsLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEmptyMessageWithExtensionsLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEmptyMessageWithExtensionsLite; - - static fromJsonString(jsonString: string, options?: Partial): TestEmptyMessageWithExtensionsLite; - - static equals(a: TestEmptyMessageWithExtensionsLite | PlainMessage | undefined, b: TestEmptyMessageWithExtensionsLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.V1MessageLite - */ -export declare class V1MessageLite extends Message { - /** - * @generated from field: required int32 int_field = 1; - */ - intField?: number; - - /** - * @generated from field: optional protobuf_unittest.V1EnumLite enum_field = 2 [default = V1_FIRST]; - */ - enumField?: V1EnumLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.V1MessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): V1MessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): V1MessageLite; - - static fromJsonString(jsonString: string, options?: Partial): V1MessageLite; - - static equals(a: V1MessageLite | PlainMessage | undefined, b: V1MessageLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.V2MessageLite - */ -export declare class V2MessageLite extends Message { - /** - * @generated from field: required int32 int_field = 1; - */ - intField?: number; - - /** - * @generated from field: optional protobuf_unittest.V2EnumLite enum_field = 2 [default = V2_FIRST]; - */ - enumField?: V2EnumLite; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.V2MessageLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): V2MessageLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): V2MessageLite; - - static fromJsonString(jsonString: string, options?: Partial): V2MessageLite; - - static equals(a: V2MessageLite | PlainMessage | undefined, b: V2MessageLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite - */ -export declare class TestHugeFieldNumbersLite extends Message { - /** - * @generated from field: optional int32 optional_int32 = 536870000; - */ - optionalInt32?: number; - - /** - * @generated from field: optional int32 fixed_32 = 536870001; - */ - fixed32?: number; - - /** - * @generated from field: repeated int32 repeated_int32 = 536870002 [packed = false]; - */ - repeatedInt32: number[]; - - /** - * @generated from field: repeated int32 packed_int32 = 536870003 [packed = true]; - */ - packedInt32: number[]; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite optional_enum = 536870004; - */ - optionalEnum?: ForeignEnumLite; - - /** - * @generated from field: optional string optional_string = 536870005; - */ - optionalString?: string; - - /** - * @generated from field: optional bytes optional_bytes = 536870006; - */ - optionalBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.ForeignMessageLite optional_message = 536870007; - */ - optionalMessage?: ForeignMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup optionalgroup = 536870008; - */ - optionalgroup?: TestHugeFieldNumbersLite_OptionalGroup; - - /** - * @generated from field: map string_string_map = 536870010; - */ - stringStringMap: { [key: string]: string }; - - /** - * @generated from oneof protobuf_unittest.TestHugeFieldNumbersLite.oneof_field - */ - oneofField: { - /** - * @generated from field: uint32 oneof_uint32 = 536870011; - */ - value: number; - case: "oneofUint32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite oneof_test_all_types = 536870012; - */ - value: TestAllTypesLite; - case: "oneofTestAllTypes"; - } | { - /** - * @generated from field: string oneof_string = 536870013; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 536870014; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { case: undefined; value?: undefined }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestHugeFieldNumbersLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestHugeFieldNumbersLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestHugeFieldNumbersLite; - - static fromJsonString(jsonString: string, options?: Partial): TestHugeFieldNumbersLite; - - static equals(a: TestHugeFieldNumbersLite | PlainMessage | undefined, b: TestHugeFieldNumbersLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup - */ -export declare class TestHugeFieldNumbersLite_OptionalGroup extends Message { - /** - * @generated from field: optional int32 group_a = 536870009; - */ - groupA?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup; - - static fromJsonString(jsonString: string, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup; - - static equals(a: TestHugeFieldNumbersLite_OptionalGroup | PlainMessage | undefined, b: TestHugeFieldNumbersLite_OptionalGroup | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestOneofParsingLite - */ -export declare class TestOneofParsingLite extends Message { - /** - * @generated from oneof protobuf_unittest.TestOneofParsingLite.oneof_field - */ - oneofField: { - /** - * @generated from field: int32 oneof_int32 = 1; - */ - value: number; - case: "oneofInt32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite oneof_submessage = 2; - */ - value: TestAllTypesLite; - case: "oneofSubmessage"; - } | { - /** - * @generated from field: string oneof_string = 3; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 4 [default = "default bytes"]; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { - /** - * @generated from field: string oneof_string_cord = 5 [default = "default Cord"]; - */ - value: string; - case: "oneofStringCord"; - } | { - /** - * @generated from field: bytes oneof_bytes_cord = 6; - */ - value: Uint8Array; - case: "oneofBytesCord"; - } | { - /** - * @generated from field: string oneof_string_string_piece = 7; - */ - value: string; - case: "oneofStringStringPiece"; - } | { - /** - * @generated from field: bytes oneof_bytes_string_piece = 8 [default = "default StringPiece"]; - */ - value: Uint8Array; - case: "oneofBytesStringPiece"; - } | { - /** - * @generated from field: protobuf_unittest.V2EnumLite oneof_enum = 9; - */ - value: V2EnumLite; - case: "oneofEnum"; - } | { case: undefined; value?: undefined }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestOneofParsingLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestOneofParsingLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestOneofParsingLite; - - static fromJsonString(jsonString: string, options?: Partial): TestOneofParsingLite; - - static equals(a: TestOneofParsingLite | PlainMessage | undefined, b: TestOneofParsingLite | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.TestMessageSetLite - */ -export declare class TestMessageSetLite extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.TestMessageSetLite"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMessageSetLite; - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMessageSetLite; - - static fromJsonString(jsonString: string, options?: Partial): TestMessageSetLite; - - static equals(a: TestMessageSetLite | PlainMessage | undefined, b: TestMessageSetLite | PlainMessage | undefined): boolean; -} - -/** - * The following four messages are set up to test for wire compatibility between - * packed and non-packed repeated fields. We use the field number 2048, because - * that is large enough to require a 3-byte varint for the tag. - * - * @generated from message protobuf_unittest.PackedInt32 - */ -export declare class PackedInt32 extends Message { - /** - * @generated from field: repeated int32 repeated_int32 = 2048 [packed = true]; - */ - repeatedInt32: number[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.PackedInt32"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): PackedInt32; - - static fromJson(jsonValue: JsonValue, options?: Partial): PackedInt32; - - static fromJsonString(jsonString: string, options?: Partial): PackedInt32; - - static equals(a: PackedInt32 | PlainMessage | undefined, b: PackedInt32 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.NonPackedInt32 - */ -export declare class NonPackedInt32 extends Message { - /** - * @generated from field: repeated int32 repeated_int32 = 2048; - */ - repeatedInt32: number[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.NonPackedInt32"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): NonPackedInt32; - - static fromJson(jsonValue: JsonValue, options?: Partial): NonPackedInt32; - - static fromJsonString(jsonString: string, options?: Partial): NonPackedInt32; - - static equals(a: NonPackedInt32 | PlainMessage | undefined, b: NonPackedInt32 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.PackedFixed32 - */ -export declare class PackedFixed32 extends Message { - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 2048 [packed = true]; - */ - repeatedFixed32: number[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.PackedFixed32"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): PackedFixed32; - - static fromJson(jsonValue: JsonValue, options?: Partial): PackedFixed32; - - static fromJsonString(jsonString: string, options?: Partial): PackedFixed32; - - static equals(a: PackedFixed32 | PlainMessage | undefined, b: PackedFixed32 | PlainMessage | undefined): boolean; -} - -/** - * @generated from message protobuf_unittest.NonPackedFixed32 - */ -export declare class NonPackedFixed32 extends Message { - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 2048; - */ - repeatedFixed32: number[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.NonPackedFixed32"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): NonPackedFixed32; - - static fromJson(jsonValue: JsonValue, options?: Partial): NonPackedFixed32; - - static fromJsonString(jsonString: string, options?: Partial): NonPackedFixed32; - - static equals(a: NonPackedFixed32 | PlainMessage | undefined, b: NonPackedFixed32 | PlainMessage | undefined): boolean; -} - -/** - * Test an enum that has multiple values with the same number. - * - * @generated from message protobuf_unittest.DupEnum - */ -export declare class DupEnum extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.DupEnum"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DupEnum; - - static fromJson(jsonValue: JsonValue, options?: Partial): DupEnum; - - static fromJsonString(jsonString: string, options?: Partial): DupEnum; - - static equals(a: DupEnum | PlainMessage | undefined, b: DupEnum | PlainMessage | undefined): boolean; -} - -/** - * @generated from enum protobuf_unittest.DupEnum.TestEnumWithDupValueLite - */ -export declare enum DupEnum_TestEnumWithDupValueLite { - /** - * @generated from enum value: FOO1 = 1; - */ - FOO1 = 1, - - /** - * @generated from enum value: BAR1 = 2; - */ - BAR1 = 2, - - /** - * @generated from enum value: BAZ = 3; - */ - BAZ = 3, - - /** - * @generated from enum value: FOO2 = 1; - */ - FOO2 = 1, - - /** - * @generated from enum value: BAR2 = 2; - */ - BAR2 = 2, -} - -/** - * @generated from message protobuf_unittest.RecursiveMessage - */ -export declare class RecursiveMessage extends Message { - /** - * @generated from field: optional protobuf_unittest.RecursiveMessage recurse = 1; - */ - recurse?: RecursiveMessage; - - /** - * @generated from field: optional bytes payload = 2; - */ - payload?: Uint8Array; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto2; - static readonly typeName = "protobuf_unittest.RecursiveMessage"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RecursiveMessage; - - static fromJson(jsonValue: JsonValue, options?: Partial): RecursiveMessage; - - static fromJsonString(jsonString: string, options?: Partial): RecursiveMessage; - - static equals(a: RecursiveMessage | PlainMessage | undefined, b: RecursiveMessage | PlainMessage | undefined): boolean; -} - -/** - * Singular - * - * @generated from extension: optional int32 optional_int32_extension_lite = 1; - */ -export declare const optional_int32_extension_lite: Extension; - -/** - * @generated from extension: optional int64 optional_int64_extension_lite = 2; - */ -export declare const optional_int64_extension_lite: Extension; - -/** - * @generated from extension: optional uint32 optional_uint32_extension_lite = 3; - */ -export declare const optional_uint32_extension_lite: Extension; - -/** - * @generated from extension: optional uint64 optional_uint64_extension_lite = 4; - */ -export declare const optional_uint64_extension_lite: Extension; - -/** - * @generated from extension: optional sint32 optional_sint32_extension_lite = 5; - */ -export declare const optional_sint32_extension_lite: Extension; - -/** - * @generated from extension: optional sint64 optional_sint64_extension_lite = 6; - */ -export declare const optional_sint64_extension_lite: Extension; - -/** - * @generated from extension: optional fixed32 optional_fixed32_extension_lite = 7; - */ -export declare const optional_fixed32_extension_lite: Extension; - -/** - * @generated from extension: optional fixed64 optional_fixed64_extension_lite = 8; - */ -export declare const optional_fixed64_extension_lite: Extension; - -/** - * @generated from extension: optional sfixed32 optional_sfixed32_extension_lite = 9; - */ -export declare const optional_sfixed32_extension_lite: Extension; - -/** - * @generated from extension: optional sfixed64 optional_sfixed64_extension_lite = 10; - */ -export declare const optional_sfixed64_extension_lite: Extension; - -/** - * @generated from extension: optional float optional_float_extension_lite = 11; - */ -export declare const optional_float_extension_lite: Extension; - -/** - * @generated from extension: optional double optional_double_extension_lite = 12; - */ -export declare const optional_double_extension_lite: Extension; - -/** - * @generated from extension: optional bool optional_bool_extension_lite = 13; - */ -export declare const optional_bool_extension_lite: Extension; - -/** - * @generated from extension: optional string optional_string_extension_lite = 14; - */ -export declare const optional_string_extension_lite: Extension; - -/** - * @generated from extension: optional bytes optional_bytes_extension_lite = 15; - */ -export declare const optional_bytes_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.OptionalGroup_extension_lite optionalgroup_extension_lite = 16; - */ -export declare const optionalgroup_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_nested_message_extension_lite = 18; - */ -export declare const optional_nested_message_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.ForeignMessageLite optional_foreign_message_extension_lite = 19; - */ -export declare const optional_foreign_message_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest_import.ImportMessageLite optional_import_message_extension_lite = 20; - */ -export declare const optional_import_message_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - */ -export declare const optional_nested_enum_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite optional_foreign_enum_extension_lite = 22; - */ -export declare const optional_foreign_enum_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite optional_import_enum_extension_lite = 23; - */ -export declare const optional_import_enum_extension_lite: Extension; - -/** - * @generated from extension: optional string optional_string_piece_extension_lite = 24; - */ -export declare const optional_string_piece_extension_lite: Extension; - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string optional_cord_extension_lite = 25; - */ -export declare const optional_cord_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest_import.PublicImportMessageLite optional_public_import_message_extension_lite = 26; - */ -export declare const optional_public_import_message_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_lazy_message_extension_lite = 27; - */ -export declare const optional_lazy_message_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_unverified_lazy_message_extension_lite = 28; - */ -export declare const optional_unverified_lazy_message_extension_lite: Extension; - -/** - * Repeated - * - * @generated from extension: repeated int32 repeated_int32_extension_lite = 31; - */ -export declare const repeated_int32_extension_lite: Extension; - -/** - * @generated from extension: repeated int64 repeated_int64_extension_lite = 32; - */ -export declare const repeated_int64_extension_lite: Extension; - -/** - * @generated from extension: repeated uint32 repeated_uint32_extension_lite = 33; - */ -export declare const repeated_uint32_extension_lite: Extension; - -/** - * @generated from extension: repeated uint64 repeated_uint64_extension_lite = 34; - */ -export declare const repeated_uint64_extension_lite: Extension; - -/** - * @generated from extension: repeated sint32 repeated_sint32_extension_lite = 35; - */ -export declare const repeated_sint32_extension_lite: Extension; - -/** - * @generated from extension: repeated sint64 repeated_sint64_extension_lite = 36; - */ -export declare const repeated_sint64_extension_lite: Extension; - -/** - * @generated from extension: repeated fixed32 repeated_fixed32_extension_lite = 37; - */ -export declare const repeated_fixed32_extension_lite: Extension; - -/** - * @generated from extension: repeated fixed64 repeated_fixed64_extension_lite = 38; - */ -export declare const repeated_fixed64_extension_lite: Extension; - -/** - * @generated from extension: repeated sfixed32 repeated_sfixed32_extension_lite = 39; - */ -export declare const repeated_sfixed32_extension_lite: Extension; - -/** - * @generated from extension: repeated sfixed64 repeated_sfixed64_extension_lite = 40; - */ -export declare const repeated_sfixed64_extension_lite: Extension; - -/** - * @generated from extension: repeated float repeated_float_extension_lite = 41; - */ -export declare const repeated_float_extension_lite: Extension; - -/** - * @generated from extension: repeated double repeated_double_extension_lite = 42; - */ -export declare const repeated_double_extension_lite: Extension; - -/** - * @generated from extension: repeated bool repeated_bool_extension_lite = 43; - */ -export declare const repeated_bool_extension_lite: Extension; - -/** - * @generated from extension: repeated string repeated_string_extension_lite = 44; - */ -export declare const repeated_string_extension_lite: Extension; - -/** - * @generated from extension: repeated bytes repeated_bytes_extension_lite = 45; - */ -export declare const repeated_bytes_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.RepeatedGroup_extension_lite repeatedgroup_extension_lite = 46; - */ -export declare const repeatedgroup_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite = 48; - */ -export declare const repeated_nested_message_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.ForeignMessageLite repeated_foreign_message_extension_lite = 49; - */ -export declare const repeated_foreign_message_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportMessageLite repeated_import_message_extension_lite = 50; - */ -export declare const repeated_import_message_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - */ -export declare const repeated_nested_enum_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - */ -export declare const repeated_foreign_enum_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum_extension_lite = 53; - */ -export declare const repeated_import_enum_extension_lite: Extension; - -/** - * @generated from extension: repeated string repeated_string_piece_extension_lite = 54; - */ -export declare const repeated_string_piece_extension_lite: Extension; - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: repeated string repeated_cord_extension_lite = 55; - */ -export declare const repeated_cord_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_lazy_message_extension_lite = 57; - */ -export declare const repeated_lazy_message_extension_lite: Extension; - -/** - * Singular with defaults - * - * @generated from extension: optional int32 default_int32_extension_lite = 61 [default = 41]; - */ -export declare const default_int32_extension_lite: Extension; - -/** - * @generated from extension: optional int64 default_int64_extension_lite = 62 [default = 42]; - */ -export declare const default_int64_extension_lite: Extension; - -/** - * @generated from extension: optional uint32 default_uint32_extension_lite = 63 [default = 43]; - */ -export declare const default_uint32_extension_lite: Extension; - -/** - * @generated from extension: optional uint64 default_uint64_extension_lite = 64 [default = 44]; - */ -export declare const default_uint64_extension_lite: Extension; - -/** - * @generated from extension: optional sint32 default_sint32_extension_lite = 65 [default = -45]; - */ -export declare const default_sint32_extension_lite: Extension; - -/** - * @generated from extension: optional sint64 default_sint64_extension_lite = 66 [default = 46]; - */ -export declare const default_sint64_extension_lite: Extension; - -/** - * @generated from extension: optional fixed32 default_fixed32_extension_lite = 67 [default = 47]; - */ -export declare const default_fixed32_extension_lite: Extension; - -/** - * @generated from extension: optional fixed64 default_fixed64_extension_lite = 68 [default = 48]; - */ -export declare const default_fixed64_extension_lite: Extension; - -/** - * @generated from extension: optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49]; - */ -export declare const default_sfixed32_extension_lite: Extension; - -/** - * @generated from extension: optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50]; - */ -export declare const default_sfixed64_extension_lite: Extension; - -/** - * @generated from extension: optional float default_float_extension_lite = 71 [default = 51.5]; - */ -export declare const default_float_extension_lite: Extension; - -/** - * @generated from extension: optional double default_double_extension_lite = 72 [default = 52000]; - */ -export declare const default_double_extension_lite: Extension; - -/** - * @generated from extension: optional bool default_bool_extension_lite = 73 [default = true]; - */ -export declare const default_bool_extension_lite: Extension; - -/** - * @generated from extension: optional string default_string_extension_lite = 74 [default = "hello"]; - */ -export declare const default_string_extension_lite: Extension; - -/** - * @generated from extension: optional bytes default_bytes_extension_lite = 75 [default = "world"]; - */ -export declare const default_bytes_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum default_nested_enum_extension_lite = 81 [default = BAR]; - */ -export declare const default_nested_enum_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - */ -export declare const default_foreign_enum_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - */ -export declare const default_import_enum_extension_lite: Extension; - -/** - * @generated from extension: optional string default_string_piece_extension_lite = 84 [default = "abc"]; - */ -export declare const default_string_piece_extension_lite: Extension; - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string default_cord_extension_lite = 85 [default = "123"]; - */ -export declare const default_cord_extension_lite: Extension; - -/** - * For oneof test - * - * @generated from extension: optional uint32 oneof_uint32_extension_lite = 111; - */ -export declare const oneof_uint32_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage oneof_nested_message_extension_lite = 112; - */ -export declare const oneof_nested_message_extension_lite: Extension; - -/** - * @generated from extension: optional string oneof_string_extension_lite = 113; - */ -export declare const oneof_string_extension_lite: Extension; - -/** - * @generated from extension: optional bytes oneof_bytes_extension_lite = 114; - */ -export declare const oneof_bytes_extension_lite: Extension; - -/** - * @generated from extension: repeated int32 packed_int32_extension_lite = 90 [packed = true]; - */ -export declare const packed_int32_extension_lite: Extension; - -/** - * @generated from extension: repeated int64 packed_int64_extension_lite = 91 [packed = true]; - */ -export declare const packed_int64_extension_lite: Extension; - -/** - * @generated from extension: repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - */ -export declare const packed_uint32_extension_lite: Extension; - -/** - * @generated from extension: repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - */ -export declare const packed_uint64_extension_lite: Extension; - -/** - * @generated from extension: repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - */ -export declare const packed_sint32_extension_lite: Extension; - -/** - * @generated from extension: repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - */ -export declare const packed_sint64_extension_lite: Extension; - -/** - * @generated from extension: repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - */ -export declare const packed_fixed32_extension_lite: Extension; - -/** - * @generated from extension: repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - */ -export declare const packed_fixed64_extension_lite: Extension; - -/** - * @generated from extension: repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - */ -export declare const packed_sfixed32_extension_lite: Extension; - -/** - * @generated from extension: repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - */ -export declare const packed_sfixed64_extension_lite: Extension; - -/** - * @generated from extension: repeated float packed_float_extension_lite = 100 [packed = true]; - */ -export declare const packed_float_extension_lite: Extension; - -/** - * @generated from extension: repeated double packed_double_extension_lite = 101 [packed = true]; - */ -export declare const packed_double_extension_lite: Extension; - -/** - * @generated from extension: repeated bool packed_bool_extension_lite = 102 [packed = true]; - */ -export declare const packed_bool_extension_lite: Extension; - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; - */ -export declare const packed_enum_extension_lite: Extension; - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite test_all_types_lite = 536860000; - */ -export declare const test_all_types_lite: Extension; - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.js deleted file mode 100644 index 30c74afb8..000000000 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_lite_pb.js +++ /dev/null @@ -1,1435 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" -// @generated from file google/protobuf/unittest_lite.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import { proto2, protoInt64 } from "@bufbuild/protobuf"; -import { ImportEnumLite, ImportMessageLite } from "./unittest_import_lite_pb.js"; -import { PublicImportMessageLite } from "./unittest_import_public_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.ForeignEnumLite - */ -export const ForeignEnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.ForeignEnumLite", - [ - {no: 4, name: "FOREIGN_LITE_FOO"}, - {no: 6, name: "FOREIGN_LITE_BAZ"}, - {no: 5, name: "FOREIGN_LITE_BAR"}, - ], -); - -/** - * @generated from enum protobuf_unittest.V1EnumLite - */ -export const V1EnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.V1EnumLite", - [ - {no: 1, name: "V1_FIRST"}, - ], -); - -/** - * @generated from enum protobuf_unittest.V2EnumLite - */ -export const V2EnumLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.V2EnumLite", - [ - {no: 1, name: "V2_FIRST"}, - {no: 2, name: "V2_SECOND"}, - ], -); - -/** - * Same as TestAllTypes but with the lite runtime. - * - * @generated from message protobuf_unittest.TestAllTypesLite - */ -export const TestAllTypesLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllTypesLite", - () => [ - { no: 1, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "optional_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, - { no: 3, name: "optional_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 4, name: "optional_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, - { no: 5, name: "optional_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true }, - { no: 6, name: "optional_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true }, - { no: 7, name: "optional_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true }, - { no: 8, name: "optional_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true }, - { no: 9, name: "optional_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true }, - { no: 10, name: "optional_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true }, - { no: 11, name: "optional_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 12, name: "optional_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true }, - { no: 13, name: "optional_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 14, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 15, name: "optional_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 16, name: "optionalgroup", kind: "message", T: TestAllTypesLite_OptionalGroup, delimited: true, opt: true }, - { no: 18, name: "optional_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 19, name: "optional_foreign_message", kind: "message", T: ForeignMessageLite, opt: true }, - { no: 20, name: "optional_import_message", kind: "message", T: ImportMessageLite, opt: true }, - { no: 21, name: "optional_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true }, - { no: 22, name: "optional_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }, - { no: 23, name: "optional_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true }, - { no: 24, name: "optional_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 25, name: "optional_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 26, name: "optional_public_import_message", kind: "message", T: PublicImportMessageLite, opt: true }, - { no: 27, name: "optional_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 28, name: "optional_unverified_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 31, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - { no: 32, name: "repeated_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true }, - { no: 33, name: "repeated_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, - { no: 34, name: "repeated_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true }, - { no: 35, name: "repeated_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true }, - { no: 36, name: "repeated_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true }, - { no: 37, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, - { no: 38, name: "repeated_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true }, - { no: 39, name: "repeated_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true }, - { no: 40, name: "repeated_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true }, - { no: 41, name: "repeated_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true }, - { no: 42, name: "repeated_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true }, - { no: 43, name: "repeated_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true }, - { no: 44, name: "repeated_string", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 45, name: "repeated_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, repeated: true }, - { no: 46, name: "repeatedgroup", kind: "message", T: TestAllTypesLite_RepeatedGroup, delimited: true, repeated: true }, - { no: 48, name: "repeated_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }, - { no: 49, name: "repeated_foreign_message", kind: "message", T: ForeignMessageLite, repeated: true }, - { no: 50, name: "repeated_import_message", kind: "message", T: ImportMessageLite, repeated: true }, - { no: 51, name: "repeated_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), repeated: true }, - { no: 52, name: "repeated_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true }, - { no: 53, name: "repeated_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), repeated: true }, - { no: 54, name: "repeated_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 55, name: "repeated_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 57, name: "repeated_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }, - { no: 61, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: 41 }, - { no: 62, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("42") }, - { no: 63, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 43 }, - { no: 64, name: "default_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true, default: protoInt64.uParse("44") }, - { no: 65, name: "default_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true, default: -45 }, - { no: 66, name: "default_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true, default: protoInt64.parse("46") }, - { no: 67, name: "default_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true, default: 47 }, - { no: 68, name: "default_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true, default: protoInt64.uParse("48") }, - { no: 69, name: "default_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true, default: 49 }, - { no: 70, name: "default_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true, default: protoInt64.parse("-50") }, - { no: 71, name: "default_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true, default: 51.5 }, - { no: 72, name: "default_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true, default: 52000 }, - { no: 73, name: "default_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true }, - { no: 74, name: "default_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "hello" }, - { no: 75, name: "default_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true, default: new Uint8Array([0x77, 0x6F, 0x72, 0x6C, 0x64]) }, - { no: 81, name: "default_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true, default: TestAllTypesLite_NestedEnum.BAR }, - { no: 82, name: "default_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true, default: ForeignEnumLite.FOREIGN_LITE_BAR }, - { no: 83, name: "default_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true, default: ImportEnumLite.IMPORT_LITE_BAR }, - { no: 84, name: "default_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "abc" }, - { no: 85, name: "default_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "123" }, - { no: 111, name: "oneof_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, oneof: "oneof_field" }, - { no: 112, name: "oneof_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, oneof: "oneof_field" }, - { no: 113, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 114, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - { no: 115, name: "oneof_lazy_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, oneof: "oneof_field" }, - { no: 117, name: "oneof_nested_message2", kind: "message", T: TestAllTypesLite_NestedMessage2, oneof: "oneof_field" }, - { no: 116, name: "deceptively_named_list", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - -/** - * @generated from enum protobuf_unittest.TestAllTypesLite.NestedEnum - */ -export const TestAllTypesLite_NestedEnum = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.TestAllTypesLite.NestedEnum", - [ - {no: 1, name: "FOO"}, - {no: 2, name: "BAR"}, - {no: 3, name: "BAZ"}, - ], -); - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage - */ -export const TestAllTypesLite_NestedMessage = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllTypesLite.NestedMessage", - () => [ - { no: 1, name: "bb", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "cc", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, - { no: 3, name: "dd", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - ], - {localName: "TestAllTypesLite_NestedMessage"}, -); - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage2 - */ -export const TestAllTypesLite_NestedMessage2 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllTypesLite.NestedMessage2", - () => [ - { no: 1, name: "dd", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], - {localName: "TestAllTypesLite_NestedMessage2"}, -); - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.OptionalGroup - */ -export const TestAllTypesLite_OptionalGroup = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllTypesLite.OptionalGroup", - () => [ - { no: 17, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], - {localName: "TestAllTypesLite_OptionalGroup"}, -); - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.RepeatedGroup - */ -export const TestAllTypesLite_RepeatedGroup = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllTypesLite.RepeatedGroup", - () => [ - { no: 47, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], - {localName: "TestAllTypesLite_RepeatedGroup"}, -); - -/** - * @generated from message protobuf_unittest.ForeignMessageLite - */ -export const ForeignMessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.ForeignMessageLite", - () => [ - { no: 1, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - -/** - * @generated from message protobuf_unittest.TestPackedTypesLite - */ -export const TestPackedTypesLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestPackedTypesLite", - () => [ - { no: 90, name: "packed_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - { no: 91, name: "packed_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true, packed: true }, - { no: 92, name: "packed_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true, packed: true }, - { no: 93, name: "packed_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true, packed: true }, - { no: 94, name: "packed_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true, packed: true }, - { no: 95, name: "packed_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true, packed: true }, - { no: 96, name: "packed_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, - { no: 97, name: "packed_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true, packed: true }, - { no: 98, name: "packed_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true, packed: true }, - { no: 99, name: "packed_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true, packed: true }, - { no: 100, name: "packed_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true, packed: true }, - { no: 101, name: "packed_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true, packed: true }, - { no: 102, name: "packed_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true, packed: true }, - { no: 103, name: "packed_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true, packed: true }, - ], -); - -/** - * @generated from message protobuf_unittest.TestAllExtensionsLite - */ -export const TestAllExtensionsLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestAllExtensionsLite", - [], -); - -/** - * @generated from message protobuf_unittest.OptionalGroup_extension_lite - */ -export const OptionalGroup_extension_lite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.OptionalGroup_extension_lite", - () => [ - { no: 17, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - -/** - * @generated from message protobuf_unittest.RepeatedGroup_extension_lite - */ -export const RepeatedGroup_extension_lite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.RepeatedGroup_extension_lite", - () => [ - { no: 47, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - -/** - * @generated from message protobuf_unittest.TestPackedExtensionsLite - */ -export const TestPackedExtensionsLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestPackedExtensionsLite", - [], -); - -/** - * @generated from message protobuf_unittest.TestNestedExtensionLite - */ -export const TestNestedExtensionLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestNestedExtensionLite", - [], -); - -/** - * @generated from extension: optional int32 nested_extension = 12345; - */ -export const TestNestedExtensionLite_nested_extension = proto2.makeExtension( - "protobuf_unittest.TestNestedExtensionLite.nested_extension", - TestAllExtensionsLite, - { no: 12345, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, -); - -/** - * Test that deprecated fields work. We only verify that they compile (at one - * point this failed). - * - * @generated from message protobuf_unittest.TestDeprecatedLite - */ -export const TestDeprecatedLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestDeprecatedLite", - () => [ - { no: 1, name: "deprecated_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "deprecated_field2", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 3, name: "deprecated_field3", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 4, name: "deprecated_field4", kind: "message", T: TestDeprecatedLite, opt: true }, - ], -); - -/** - * See the comments of the same type in unittest.proto. - * - * @generated from message protobuf_unittest.TestParsingMergeLite - */ -export const TestParsingMergeLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite", - () => [ - { no: 1, name: "required_all_types", kind: "message", T: TestAllTypesLite, req: true }, - { no: 2, name: "optional_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - { no: 3, name: "repeated_all_types", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 10, name: "optionalgroup", kind: "message", T: TestParsingMergeLite_OptionalGroup, delimited: true, opt: true }, - { no: 20, name: "repeatedgroup", kind: "message", T: TestParsingMergeLite_RepeatedGroup, delimited: true, repeated: true }, - ], -); - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator - */ -export const TestParsingMergeLite_RepeatedFieldsGenerator = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator", - () => [ - { no: 1, name: "field1", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 2, name: "field2", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 3, name: "field3", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 10, name: "group1", kind: "message", T: TestParsingMergeLite_RepeatedFieldsGenerator_Group1, delimited: true, repeated: true }, - { no: 20, name: "group2", kind: "message", T: TestParsingMergeLite_RepeatedFieldsGenerator_Group2, delimited: true, repeated: true }, - { no: 1000, name: "ext1", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 1001, name: "ext2", kind: "message", T: TestAllTypesLite, repeated: true }, - ], - {localName: "TestParsingMergeLite_RepeatedFieldsGenerator"}, -); - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 - */ -export const TestParsingMergeLite_RepeatedFieldsGenerator_Group1 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1", - () => [ - { no: 11, name: "field1", kind: "message", T: TestAllTypesLite, opt: true }, - ], - {localName: "TestParsingMergeLite_RepeatedFieldsGenerator_Group1"}, -); - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 - */ -export const TestParsingMergeLite_RepeatedFieldsGenerator_Group2 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2", - () => [ - { no: 21, name: "field1", kind: "message", T: TestAllTypesLite, opt: true }, - ], - {localName: "TestParsingMergeLite_RepeatedFieldsGenerator_Group2"}, -); - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.OptionalGroup - */ -export const TestParsingMergeLite_OptionalGroup = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite.OptionalGroup", - () => [ - { no: 11, name: "optional_group_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - ], - {localName: "TestParsingMergeLite_OptionalGroup"}, -); - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedGroup - */ -export const TestParsingMergeLite_RepeatedGroup = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestParsingMergeLite.RepeatedGroup", - () => [ - { no: 21, name: "repeated_group_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - ], - {localName: "TestParsingMergeLite_RepeatedGroup"}, -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite optional_ext = 1000; - */ -export const TestParsingMergeLite_optional_ext = proto2.makeExtension( - "protobuf_unittest.TestParsingMergeLite.optional_ext", - TestParsingMergeLite, - () => ({ no: 1000, kind: "message", T: TestAllTypesLite, opt: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite repeated_ext = 1001; - */ -export const TestParsingMergeLite_repeated_ext = proto2.makeExtension( - "protobuf_unittest.TestParsingMergeLite.repeated_ext", - TestParsingMergeLite, - () => ({ no: 1001, kind: "message", T: TestAllTypesLite, repeated: true }), -); - -/** - * Test that the correct exception is thrown by parseFrom in a corner case - * involving merging, extensions, and required fields. - * - * @generated from message protobuf_unittest.TestMergeExceptionLite - */ -export const TestMergeExceptionLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestMergeExceptionLite", - () => [ - { no: 1, name: "all_extensions", kind: "message", T: TestAllExtensionsLite, opt: true }, - ], -); - -/** - * TestEmptyMessageLite is used to test unknown fields support in lite mode. - * - * @generated from message protobuf_unittest.TestEmptyMessageLite - */ -export const TestEmptyMessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestEmptyMessageLite", - [], -); - -/** - * Like above, but declare all field numbers as potential extensions. No - * actual extensions should ever be defined for this type. - * - * @generated from message protobuf_unittest.TestEmptyMessageWithExtensionsLite - */ -export const TestEmptyMessageWithExtensionsLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestEmptyMessageWithExtensionsLite", - [], -); - -/** - * @generated from message protobuf_unittest.V1MessageLite - */ -export const V1MessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.V1MessageLite", - () => [ - { no: 1, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "enum_field", kind: "enum", T: proto2.getEnumType(V1EnumLite), opt: true, default: V1EnumLite.V1_FIRST }, - ], -); - -/** - * @generated from message protobuf_unittest.V2MessageLite - */ -export const V2MessageLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.V2MessageLite", - () => [ - { no: 1, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "enum_field", kind: "enum", T: proto2.getEnumType(V2EnumLite), opt: true, default: V2EnumLite.V2_FIRST }, - ], -); - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite - */ -export const TestHugeFieldNumbersLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestHugeFieldNumbersLite", - () => [ - { no: 536870000, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 536870001, name: "fixed_32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 536870002, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - { no: 536870003, name: "packed_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - { no: 536870004, name: "optional_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }, - { no: 536870005, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 536870006, name: "optional_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 536870007, name: "optional_message", kind: "message", T: ForeignMessageLite, opt: true }, - { no: 536870008, name: "optionalgroup", kind: "message", T: TestHugeFieldNumbersLite_OptionalGroup, delimited: true, opt: true }, - { no: 536870010, name: "string_string_map", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 536870011, name: "oneof_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, oneof: "oneof_field" }, - { no: 536870012, name: "oneof_test_all_types", kind: "message", T: TestAllTypesLite, oneof: "oneof_field" }, - { no: 536870013, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 536870014, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - ], -); - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup - */ -export const TestHugeFieldNumbersLite_OptionalGroup = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup", - () => [ - { no: 536870009, name: "group_a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], - {localName: "TestHugeFieldNumbersLite_OptionalGroup"}, -); - -/** - * @generated from message protobuf_unittest.TestOneofParsingLite - */ -export const TestOneofParsingLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestOneofParsingLite", - () => [ - { no: 1, name: "oneof_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, oneof: "oneof_field" }, - { no: 2, name: "oneof_submessage", kind: "message", T: TestAllTypesLite, oneof: "oneof_field" }, - { no: 3, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 4, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, default: new Uint8Array([0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73]), oneof: "oneof_field" }, - { no: 5, name: "oneof_string_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, default: "default Cord", oneof: "oneof_field" }, - { no: 6, name: "oneof_bytes_cord", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - { no: 7, name: "oneof_string_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 8, name: "oneof_bytes_string_piece", kind: "scalar", T: 12 /* ScalarType.BYTES */, default: new Uint8Array([0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x50, 0x69, 0x65, 0x63, 0x65]), oneof: "oneof_field" }, - { no: 9, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(V2EnumLite), oneof: "oneof_field" }, - ], -); - -/** - * @generated from message protobuf_unittest.TestMessageSetLite - */ -export const TestMessageSetLite = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.TestMessageSetLite", - [], -); - -/** - * The following four messages are set up to test for wire compatibility between - * packed and non-packed repeated fields. We use the field number 2048, because - * that is large enough to require a 3-byte varint for the tag. - * - * @generated from message protobuf_unittest.PackedInt32 - */ -export const PackedInt32 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.PackedInt32", - () => [ - { no: 2048, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - ], -); - -/** - * @generated from message protobuf_unittest.NonPackedInt32 - */ -export const NonPackedInt32 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.NonPackedInt32", - () => [ - { no: 2048, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - ], -); - -/** - * @generated from message protobuf_unittest.PackedFixed32 - */ -export const PackedFixed32 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.PackedFixed32", - () => [ - { no: 2048, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, - ], -); - -/** - * @generated from message protobuf_unittest.NonPackedFixed32 - */ -export const NonPackedFixed32 = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.NonPackedFixed32", - () => [ - { no: 2048, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, - ], -); - -/** - * Test an enum that has multiple values with the same number. - * - * @generated from message protobuf_unittest.DupEnum - */ -export const DupEnum = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.DupEnum", - [], -); - -/** - * @generated from enum protobuf_unittest.DupEnum.TestEnumWithDupValueLite - */ -export const DupEnum_TestEnumWithDupValueLite = /*@__PURE__*/ proto2.makeEnum( - "protobuf_unittest.DupEnum.TestEnumWithDupValueLite", - [ - {no: 1, name: "FOO1"}, - {no: 2, name: "BAR1"}, - {no: 3, name: "BAZ"}, - {no: 1, name: "FOO2"}, - {no: 2, name: "BAR2"}, - ], -); - -/** - * @generated from message protobuf_unittest.RecursiveMessage - */ -export const RecursiveMessage = /*@__PURE__*/ proto2.makeMessageType( - "protobuf_unittest.RecursiveMessage", - () => [ - { no: 1, name: "recurse", kind: "message", T: RecursiveMessage, opt: true }, - { no: 2, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ], -); - -/** - * Singular - * - * @generated from extension: optional int32 optional_int32_extension_lite = 1; - */ -export const optional_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_int32_extension_lite", - TestAllExtensionsLite, - { no: 1, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, -); - -/** - * @generated from extension: optional int64 optional_int64_extension_lite = 2; - */ -export const optional_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_int64_extension_lite", - TestAllExtensionsLite, - { no: 2, kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, -); - -/** - * @generated from extension: optional uint32 optional_uint32_extension_lite = 3; - */ -export const optional_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_uint32_extension_lite", - TestAllExtensionsLite, - { no: 3, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, -); - -/** - * @generated from extension: optional uint64 optional_uint64_extension_lite = 4; - */ -export const optional_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_uint64_extension_lite", - TestAllExtensionsLite, - { no: 4, kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, -); - -/** - * @generated from extension: optional sint32 optional_sint32_extension_lite = 5; - */ -export const optional_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sint32_extension_lite", - TestAllExtensionsLite, - { no: 5, kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true }, -); - -/** - * @generated from extension: optional sint64 optional_sint64_extension_lite = 6; - */ -export const optional_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sint64_extension_lite", - TestAllExtensionsLite, - { no: 6, kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true }, -); - -/** - * @generated from extension: optional fixed32 optional_fixed32_extension_lite = 7; - */ -export const optional_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 7, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true }, -); - -/** - * @generated from extension: optional fixed64 optional_fixed64_extension_lite = 8; - */ -export const optional_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 8, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true }, -); - -/** - * @generated from extension: optional sfixed32 optional_sfixed32_extension_lite = 9; - */ -export const optional_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 9, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true }, -); - -/** - * @generated from extension: optional sfixed64 optional_sfixed64_extension_lite = 10; - */ -export const optional_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 10, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true }, -); - -/** - * @generated from extension: optional float optional_float_extension_lite = 11; - */ -export const optional_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_float_extension_lite", - TestAllExtensionsLite, - { no: 11, kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, -); - -/** - * @generated from extension: optional double optional_double_extension_lite = 12; - */ -export const optional_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_double_extension_lite", - TestAllExtensionsLite, - { no: 12, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true }, -); - -/** - * @generated from extension: optional bool optional_bool_extension_lite = 13; - */ -export const optional_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_bool_extension_lite", - TestAllExtensionsLite, - { no: 13, kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, -); - -/** - * @generated from extension: optional string optional_string_extension_lite = 14; - */ -export const optional_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_string_extension_lite", - TestAllExtensionsLite, - { no: 14, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional bytes optional_bytes_extension_lite = 15; - */ -export const optional_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_bytes_extension_lite", - TestAllExtensionsLite, - { no: 15, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest.OptionalGroup_extension_lite optionalgroup_extension_lite = 16; - */ -export const optionalgroup_extension_lite = proto2.makeExtension( - "protobuf_unittest.optionalgroup_extension_lite", - TestAllExtensionsLite, - () => ({ no: 16, kind: "message", T: OptionalGroup_extension_lite, delimited: true, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_nested_message_extension_lite = 18; - */ -export const optional_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 18, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignMessageLite optional_foreign_message_extension_lite = 19; - */ -export const optional_foreign_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_foreign_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 19, kind: "message", T: ForeignMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportMessageLite optional_import_message_extension_lite = 20; - */ -export const optional_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 20, kind: "message", T: ImportMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - */ -export const optional_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 21, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite optional_foreign_enum_extension_lite = 22; - */ -export const optional_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 22, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite optional_import_enum_extension_lite = 23; - */ -export const optional_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 23, kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true }), -); - -/** - * @generated from extension: optional string optional_string_piece_extension_lite = 24; - */ -export const optional_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 24, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string optional_cord_extension_lite = 25; - */ -export const optional_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_cord_extension_lite", - TestAllExtensionsLite, - { no: 25, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest_import.PublicImportMessageLite optional_public_import_message_extension_lite = 26; - */ -export const optional_public_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_public_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 26, kind: "message", T: PublicImportMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_lazy_message_extension_lite = 27; - */ -export const optional_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 27, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_unverified_lazy_message_extension_lite = 28; - */ -export const optional_unverified_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_unverified_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 28, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * Repeated - * - * @generated from extension: repeated int32 repeated_int32_extension_lite = 31; - */ -export const repeated_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_int32_extension_lite", - TestAllExtensionsLite, - { no: 31, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated int64 repeated_int64_extension_lite = 32; - */ -export const repeated_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_int64_extension_lite", - TestAllExtensionsLite, - { no: 32, kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated uint32 repeated_uint32_extension_lite = 33; - */ -export const repeated_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_uint32_extension_lite", - TestAllExtensionsLite, - { no: 33, kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated uint64 repeated_uint64_extension_lite = 34; - */ -export const repeated_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_uint64_extension_lite", - TestAllExtensionsLite, - { no: 34, kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated sint32 repeated_sint32_extension_lite = 35; - */ -export const repeated_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sint32_extension_lite", - TestAllExtensionsLite, - { no: 35, kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated sint64 repeated_sint64_extension_lite = 36; - */ -export const repeated_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sint64_extension_lite", - TestAllExtensionsLite, - { no: 36, kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated fixed32 repeated_fixed32_extension_lite = 37; - */ -export const repeated_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 37, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, -); - -/** - * @generated from extension: repeated fixed64 repeated_fixed64_extension_lite = 38; - */ -export const repeated_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 38, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true }, -); - -/** - * @generated from extension: repeated sfixed32 repeated_sfixed32_extension_lite = 39; - */ -export const repeated_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 39, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true }, -); - -/** - * @generated from extension: repeated sfixed64 repeated_sfixed64_extension_lite = 40; - */ -export const repeated_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 40, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true }, -); - -/** - * @generated from extension: repeated float repeated_float_extension_lite = 41; - */ -export const repeated_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_float_extension_lite", - TestAllExtensionsLite, - { no: 41, kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true }, -); - -/** - * @generated from extension: repeated double repeated_double_extension_lite = 42; - */ -export const repeated_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_double_extension_lite", - TestAllExtensionsLite, - { no: 42, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true }, -); - -/** - * @generated from extension: repeated bool repeated_bool_extension_lite = 43; - */ -export const repeated_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_bool_extension_lite", - TestAllExtensionsLite, - { no: 43, kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true }, -); - -/** - * @generated from extension: repeated string repeated_string_extension_lite = 44; - */ -export const repeated_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_string_extension_lite", - TestAllExtensionsLite, - { no: 44, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * @generated from extension: repeated bytes repeated_bytes_extension_lite = 45; - */ -export const repeated_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_bytes_extension_lite", - TestAllExtensionsLite, - { no: 45, kind: "scalar", T: 12 /* ScalarType.BYTES */, repeated: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.RepeatedGroup_extension_lite repeatedgroup_extension_lite = 46; - */ -export const repeatedgroup_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeatedgroup_extension_lite", - TestAllExtensionsLite, - () => ({ no: 46, kind: "message", T: RepeatedGroup_extension_lite, delimited: true, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite = 48; - */ -export const repeated_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 48, kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignMessageLite repeated_foreign_message_extension_lite = 49; - */ -export const repeated_foreign_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_foreign_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 49, kind: "message", T: ForeignMessageLite, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportMessageLite repeated_import_message_extension_lite = 50; - */ -export const repeated_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 50, kind: "message", T: ImportMessageLite, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - */ -export const repeated_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 51, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - */ -export const repeated_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 52, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum_extension_lite = 53; - */ -export const repeated_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 53, kind: "enum", T: proto2.getEnumType(ImportEnumLite), repeated: true }), -); - -/** - * @generated from extension: repeated string repeated_string_piece_extension_lite = 54; - */ -export const repeated_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 54, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: repeated string repeated_cord_extension_lite = 55; - */ -export const repeated_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_cord_extension_lite", - TestAllExtensionsLite, - { no: 55, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_lazy_message_extension_lite = 57; - */ -export const repeated_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 57, kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }), -); - -/** - * Singular with defaults - * - * @generated from extension: optional int32 default_int32_extension_lite = 61 [default = 41]; - */ -export const default_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_int32_extension_lite", - TestAllExtensionsLite, - { no: 61, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: 41 }, -); - -/** - * @generated from extension: optional int64 default_int64_extension_lite = 62 [default = 42]; - */ -export const default_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_int64_extension_lite", - TestAllExtensionsLite, - { no: 62, kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("42") }, -); - -/** - * @generated from extension: optional uint32 default_uint32_extension_lite = 63 [default = 43]; - */ -export const default_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_uint32_extension_lite", - TestAllExtensionsLite, - { no: 63, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 43 }, -); - -/** - * @generated from extension: optional uint64 default_uint64_extension_lite = 64 [default = 44]; - */ -export const default_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_uint64_extension_lite", - TestAllExtensionsLite, - { no: 64, kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true, default: protoInt64.uParse("44") }, -); - -/** - * @generated from extension: optional sint32 default_sint32_extension_lite = 65 [default = -45]; - */ -export const default_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sint32_extension_lite", - TestAllExtensionsLite, - { no: 65, kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true, default: -45 }, -); - -/** - * @generated from extension: optional sint64 default_sint64_extension_lite = 66 [default = 46]; - */ -export const default_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sint64_extension_lite", - TestAllExtensionsLite, - { no: 66, kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true, default: protoInt64.parse("46") }, -); - -/** - * @generated from extension: optional fixed32 default_fixed32_extension_lite = 67 [default = 47]; - */ -export const default_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 67, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true, default: 47 }, -); - -/** - * @generated from extension: optional fixed64 default_fixed64_extension_lite = 68 [default = 48]; - */ -export const default_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 68, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true, default: protoInt64.uParse("48") }, -); - -/** - * @generated from extension: optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49]; - */ -export const default_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 69, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true, default: 49 }, -); - -/** - * @generated from extension: optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50]; - */ -export const default_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 70, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true, default: protoInt64.parse("-50") }, -); - -/** - * @generated from extension: optional float default_float_extension_lite = 71 [default = 51.5]; - */ -export const default_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_float_extension_lite", - TestAllExtensionsLite, - { no: 71, kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true, default: 51.5 }, -); - -/** - * @generated from extension: optional double default_double_extension_lite = 72 [default = 52000]; - */ -export const default_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_double_extension_lite", - TestAllExtensionsLite, - { no: 72, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true, default: 52000 }, -); - -/** - * @generated from extension: optional bool default_bool_extension_lite = 73 [default = true]; - */ -export const default_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_bool_extension_lite", - TestAllExtensionsLite, - { no: 73, kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true }, -); - -/** - * @generated from extension: optional string default_string_extension_lite = 74 [default = "hello"]; - */ -export const default_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_string_extension_lite", - TestAllExtensionsLite, - { no: 74, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "hello" }, -); - -/** - * @generated from extension: optional bytes default_bytes_extension_lite = 75 [default = "world"]; - */ -export const default_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_bytes_extension_lite", - TestAllExtensionsLite, - { no: 75, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true, default: new Uint8Array([0x77, 0x6F, 0x72, 0x6C, 0x64]) }, -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum default_nested_enum_extension_lite = 81 [default = BAR]; - */ -export const default_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 81, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true, default: TestAllTypesLite_NestedEnum.BAR }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - */ -export const default_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 82, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true, default: ForeignEnumLite.FOREIGN_LITE_BAR }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - */ -export const default_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 83, kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true, default: ImportEnumLite.IMPORT_LITE_BAR }), -); - -/** - * @generated from extension: optional string default_string_piece_extension_lite = 84 [default = "abc"]; - */ -export const default_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 84, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "abc" }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string default_cord_extension_lite = 85 [default = "123"]; - */ -export const default_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_cord_extension_lite", - TestAllExtensionsLite, - { no: 85, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "123" }, -); - -/** - * For oneof test - * - * @generated from extension: optional uint32 oneof_uint32_extension_lite = 111; - */ -export const oneof_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_uint32_extension_lite", - TestAllExtensionsLite, - { no: 111, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage oneof_nested_message_extension_lite = 112; - */ -export const oneof_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 112, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional string oneof_string_extension_lite = 113; - */ -export const oneof_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_string_extension_lite", - TestAllExtensionsLite, - { no: 113, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional bytes oneof_bytes_extension_lite = 114; - */ -export const oneof_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_bytes_extension_lite", - TestAllExtensionsLite, - { no: 114, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, -); - -/** - * @generated from extension: repeated int32 packed_int32_extension_lite = 90 [packed = true]; - */ -export const packed_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_int32_extension_lite", - TestPackedExtensionsLite, - { no: 90, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated int64 packed_int64_extension_lite = 91 [packed = true]; - */ -export const packed_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_int64_extension_lite", - TestPackedExtensionsLite, - { no: 91, kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - */ -export const packed_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_uint32_extension_lite", - TestPackedExtensionsLite, - { no: 92, kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - */ -export const packed_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_uint64_extension_lite", - TestPackedExtensionsLite, - { no: 93, kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - */ -export const packed_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sint32_extension_lite", - TestPackedExtensionsLite, - { no: 94, kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - */ -export const packed_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sint64_extension_lite", - TestPackedExtensionsLite, - { no: 95, kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - */ -export const packed_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_fixed32_extension_lite", - TestPackedExtensionsLite, - { no: 96, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - */ -export const packed_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_fixed64_extension_lite", - TestPackedExtensionsLite, - { no: 97, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - */ -export const packed_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sfixed32_extension_lite", - TestPackedExtensionsLite, - { no: 98, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - */ -export const packed_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sfixed64_extension_lite", - TestPackedExtensionsLite, - { no: 99, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated float packed_float_extension_lite = 100 [packed = true]; - */ -export const packed_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_float_extension_lite", - TestPackedExtensionsLite, - { no: 100, kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated double packed_double_extension_lite = 101 [packed = true]; - */ -export const packed_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_double_extension_lite", - TestPackedExtensionsLite, - { no: 101, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated bool packed_bool_extension_lite = 102 [packed = true]; - */ -export const packed_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_bool_extension_lite", - TestPackedExtensionsLite, - { no: 102, kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; - */ -export const packed_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_enum_extension_lite", - TestPackedExtensionsLite, - () => ({ no: 103, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true, packed: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite test_all_types_lite = 536860000; - */ -export const test_all_types_lite = proto2.makeExtension( - "protobuf_unittest.test_all_types_lite", - TestHugeFieldNumbersLite, - () => ({ no: 536860000, kind: "message", T: TestAllTypesLite, opt: true }), -); - diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.d.ts index 3713bd8c7..37443c4b1 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.d.ts @@ -4313,6 +4313,11 @@ export declare class TestOneof2_NestedMessage extends Message); static readonly runtime: typeof proto2; diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.js index 473dc24c3..01f28fc3a 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.js +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_pb.js @@ -1538,6 +1538,7 @@ export const TestOneof2_NestedMessage = /*@__PURE__*/ proto2.makeMessageType( () => [ { no: 1, name: "moo_int", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, { no: 2, name: "corge_int", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + { no: 3, name: "child", kind: "message", T: TestOneof2_NestedMessage, opt: true }, ], {localName: "TestOneof2_NestedMessage"}, ); diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.d.ts new file mode 100644 index 000000000..b3d08ded6 --- /dev/null +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.d.ts @@ -0,0 +1,52 @@ +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" +// @generated from file google/protobuf/unittest_proto3_extensions.proto (package protobuf_unittest, syntax proto3) +/* eslint-disable */ + +import type { BinaryReadOptions, Extension, FieldList, FileOptions, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * For testing proto3 extension behaviors. + * + * @generated from message protobuf_unittest.Proto3FileExtensions + */ +export declare class Proto3FileExtensions extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "protobuf_unittest.Proto3FileExtensions"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Proto3FileExtensions; + + static fromJson(jsonValue: JsonValue, options?: Partial): Proto3FileExtensions; + + static fromJsonString(jsonString: string, options?: Partial): Proto3FileExtensions; + + static equals(a: Proto3FileExtensions | PlainMessage | undefined, b: Proto3FileExtensions | PlainMessage | undefined): boolean; +} + +/** + * @generated from extension: int32 singular_int = 1001; + */ +export declare const Proto3FileExtensions_singular_int: Extension; + +/** + * @generated from extension: repeated int32 repeated_int = 1002; + */ +export declare const Proto3FileExtensions_repeated_int: Extension; + diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.js b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.js new file mode 100644 index 000000000..cb149cff0 --- /dev/null +++ b/packages/protobuf-test/src/gen/js/google/protobuf/unittest_proto3_extensions_pb.js @@ -0,0 +1,48 @@ +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=js+dts" +// @generated from file google/protobuf/unittest_proto3_extensions.proto (package protobuf_unittest, syntax proto3) +/* eslint-disable */ + +import { FileOptions, proto3 } from "@bufbuild/protobuf"; + +/** + * For testing proto3 extension behaviors. + * + * @generated from message protobuf_unittest.Proto3FileExtensions + */ +export const Proto3FileExtensions = /*@__PURE__*/ proto3.makeMessageType( + "protobuf_unittest.Proto3FileExtensions", + [], +); + +/** + * @generated from extension: int32 singular_int = 1001; + */ +export const Proto3FileExtensions_singular_int = proto3.makeExtension( + "protobuf_unittest.Proto3FileExtensions.singular_int", + FileOptions, + { no: 1001, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, +); + +/** + * @generated from extension: repeated int32 repeated_int = 1002; + */ +export const Proto3FileExtensions_repeated_int = proto3.makeExtension( + "protobuf_unittest.Proto3FileExtensions.repeated_int", + FileOptions, + { no: 1002, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, +); + diff --git a/packages/protobuf-test/src/gen/ts/extra/deprecation-implicit_pb.ts b/packages/protobuf-test/src/gen/ts/extra/deprecation-implicit_pb.ts index da5d96cc3..d8805a1ab 100644 --- a/packages/protobuf-test/src/gen/ts/extra/deprecation-implicit_pb.ts +++ b/packages/protobuf-test/src/gen/ts/extra/deprecation-implicit_pb.ts @@ -73,11 +73,11 @@ export class ImplicitlyDeprecatedMessage extends Message( "spec.implicitly_deprecated_option", FieldOptions, - { no: 2001, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2002, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ); diff --git a/packages/protobuf-test/src/gen/ts/extra/extensions-proto3_pb.ts b/packages/protobuf-test/src/gen/ts/extra/extensions-proto3_pb.ts index 40aa61af3..2b46ba4cf 100644 --- a/packages/protobuf-test/src/gen/ts/extra/extensions-proto3_pb.ts +++ b/packages/protobuf-test/src/gen/ts/extra/extensions-proto3_pb.ts @@ -19,21 +19,21 @@ import { FileOptions, proto3 } from "@bufbuild/protobuf"; /** - * @generated from extension: uint32 uint32_ext = 1001; + * @generated from extension: uint32 uint32_ext = 7001; */ export const uint32_ext = proto3.makeExtension( "proto3ext.uint32_ext", FileOptions, - { no: 1001, kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7001, kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ); /** - * @generated from extension: optional uint32 optional_uint32_ext = 1002; + * @generated from extension: optional uint32 optional_uint32_ext = 7002; */ export const optional_uint32_ext = proto3.makeExtension( "proto3ext.optional_uint32_ext", FileOptions, - { no: 1002, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { no: 7002, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, ); /** diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/descriptor_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/descriptor_pb.ts index b356a78d3..73e488502 100644 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/descriptor_pb.ts +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/descriptor_pb.ts @@ -40,6 +40,14 @@ export enum Edition { */ EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** * Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto @@ -109,6 +117,7 @@ export enum Edition { // Retrieve enum metadata with: proto2.getEnumType(Edition) proto2.util.setEnumType(Edition, "google.protobuf.Edition", [ { no: 0, name: "EDITION_UNKNOWN" }, + { no: 900, name: "EDITION_LEGACY" }, { no: 998, name: "EDITION_PROTO2" }, { no: 999, name: "EDITION_PROTO3" }, { no: 1000, name: "EDITION_2023" }, @@ -1375,12 +1384,16 @@ export class FileOptions extends Message { javaGenerateEqualsAndHash?: boolean; /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; */ @@ -1874,6 +1887,11 @@ export class FieldOptions extends Message { */ features?: FeatureSet; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -1901,6 +1919,7 @@ export class FieldOptions extends Message { { no: 19, name: "targets", kind: "enum", T: proto2.getEnumType(FieldOptions_OptionTargetType), repeated: true }, { no: 20, name: "edition_defaults", kind: "message", T: FieldOptions_EditionDefault, repeated: true }, { no: 21, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 22, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ]); @@ -2136,6 +2155,77 @@ export class FieldOptions_EditionDefault extends Message { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: Edition; + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: Edition; + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: Edition; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "google.protobuf.FieldOptions.FeatureSupport"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "edition_introduced", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 2, name: "edition_deprecated", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 3, name: "deprecation_warning", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "edition_removed", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromJsonString(jsonString, options); + } + + static equals(a: FieldOptions_FeatureSupport | PlainMessage | undefined, b: FieldOptions_FeatureSupport | PlainMessage | undefined): boolean { + return proto2.util.equals(FieldOptions_FeatureSupport, a, b); + } +} + /** * @generated from message google.protobuf.OneofOptions */ @@ -2294,6 +2384,13 @@ export class EnumValueOptions extends Message { */ debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -2312,6 +2409,7 @@ export class EnumValueOptions extends Message { { no: 1, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, { no: 3, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 4, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ]); @@ -2931,9 +3029,18 @@ export class FeatureSetDefaults_FeatureSetEditionDefault extends Message) { super(); @@ -2944,7 +3051,8 @@ export class FeatureSetDefaults_FeatureSetEditionDefault extends Message [ { no: 3, name: "edition", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, - { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 4, name: "overridable_features", kind: "message", T: FeatureSet, opt: true }, + { no: 5, name: "fixed_features", kind: "message", T: FeatureSet, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FeatureSetDefaults_FeatureSetEditionDefault { diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/map_lite_unittest_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/map_lite_unittest_pb.ts deleted file mode 100644 index 26825e819..000000000 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/map_lite_unittest_pb.ts +++ /dev/null @@ -1,635 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file google/protobuf/map_lite_unittest.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; -import { ForeignMessageLite, TestAllExtensionsLite, TestAllTypesLite } from "./unittest_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumLite - */ -export enum Proto2MapEnumLite { - /** - * @generated from enum value: PROTO2_MAP_ENUM_FOO_LITE = 0; - */ - PROTO2_MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: PROTO2_MAP_ENUM_BAR_LITE = 1; - */ - PROTO2_MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: PROTO2_MAP_ENUM_BAZ_LITE = 2; - */ - PROTO2_MAP_ENUM_BAZ_LITE = 2, -} -// Retrieve enum metadata with: proto2.getEnumType(Proto2MapEnumLite) -proto2.util.setEnumType(Proto2MapEnumLite, "protobuf_unittest.Proto2MapEnumLite", [ - { no: 0, name: "PROTO2_MAP_ENUM_FOO_LITE" }, - { no: 1, name: "PROTO2_MAP_ENUM_BAR_LITE" }, - { no: 2, name: "PROTO2_MAP_ENUM_BAZ_LITE" }, -]); - -/** - * @generated from enum protobuf_unittest.Proto2MapEnumPlusExtraLite - */ -export enum Proto2MapEnumPlusExtraLite { - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_FOO_LITE = 0; - */ - E_PROTO2_MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_BAR_LITE = 1; - */ - E_PROTO2_MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_BAZ_LITE = 2; - */ - E_PROTO2_MAP_ENUM_BAZ_LITE = 2, - - /** - * @generated from enum value: E_PROTO2_MAP_ENUM_EXTRA_LITE = 3; - */ - E_PROTO2_MAP_ENUM_EXTRA_LITE = 3, -} -// Retrieve enum metadata with: proto2.getEnumType(Proto2MapEnumPlusExtraLite) -proto2.util.setEnumType(Proto2MapEnumPlusExtraLite, "protobuf_unittest.Proto2MapEnumPlusExtraLite", [ - { no: 0, name: "E_PROTO2_MAP_ENUM_FOO_LITE" }, - { no: 1, name: "E_PROTO2_MAP_ENUM_BAR_LITE" }, - { no: 2, name: "E_PROTO2_MAP_ENUM_BAZ_LITE" }, - { no: 3, name: "E_PROTO2_MAP_ENUM_EXTRA_LITE" }, -]); - -/** - * @generated from enum protobuf_unittest.MapEnumLite - */ -export enum MapEnumLite { - /** - * @generated from enum value: MAP_ENUM_FOO_LITE = 0; - */ - MAP_ENUM_FOO_LITE = 0, - - /** - * @generated from enum value: MAP_ENUM_BAR_LITE = 1; - */ - MAP_ENUM_BAR_LITE = 1, - - /** - * @generated from enum value: MAP_ENUM_BAZ_LITE = 2; - */ - MAP_ENUM_BAZ_LITE = 2, -} -// Retrieve enum metadata with: proto2.getEnumType(MapEnumLite) -proto2.util.setEnumType(MapEnumLite, "protobuf_unittest.MapEnumLite", [ - { no: 0, name: "MAP_ENUM_FOO_LITE" }, - { no: 1, name: "MAP_ENUM_BAR_LITE" }, - { no: 2, name: "MAP_ENUM_BAZ_LITE" }, -]); - -/** - * @generated from message protobuf_unittest.TestMapLite - */ -export class TestMapLite extends Message { - /** - * @generated from field: map map_int32_int32 = 1; - */ - mapInt32Int32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_int64_int64 = 2; - */ - mapInt64Int64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_uint32_uint32 = 3; - */ - mapUint32Uint32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_uint64_uint64 = 4; - */ - mapUint64Uint64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_sint32_sint32 = 5; - */ - mapSint32Sint32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_sint64_sint64 = 6; - */ - mapSint64Sint64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_fixed32_fixed32 = 7; - */ - mapFixed32Fixed32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_fixed64_fixed64 = 8; - */ - mapFixed64Fixed64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_sfixed32_sfixed32 = 9; - */ - mapSfixed32Sfixed32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_sfixed64_sfixed64 = 10; - */ - mapSfixed64Sfixed64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_int32_float = 11; - */ - mapInt32Float: { [key: number]: number } = {}; - - /** - * @generated from field: map map_int32_double = 12; - */ - mapInt32Double: { [key: number]: number } = {}; - - /** - * @generated from field: map map_bool_bool = 13; - */ - mapBoolBool: { [key: string]: boolean } = {}; - - /** - * @generated from field: map map_string_string = 14; - */ - mapStringString: { [key: string]: string } = {}; - - /** - * @generated from field: map map_int32_bytes = 15; - */ - mapInt32Bytes: { [key: number]: Uint8Array } = {}; - - /** - * @generated from field: map map_int32_enum = 16; - */ - mapInt32Enum: { [key: number]: MapEnumLite } = {}; - - /** - * @generated from field: map map_int32_foreign_message = 17; - */ - mapInt32ForeignMessage: { [key: number]: ForeignMessageLite } = {}; - - /** - * @generated from field: map teboring = 18; - */ - teboring: { [key: number]: number } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestMapLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "map_int32_int32", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "map_int64_int64", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} }, - { no: 3, name: "map_uint32_uint32", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "scalar", T: 13 /* ScalarType.UINT32 */} }, - { no: 4, name: "map_uint64_uint64", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "scalar", T: 4 /* ScalarType.UINT64 */} }, - { no: 5, name: "map_sint32_sint32", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "scalar", T: 17 /* ScalarType.SINT32 */} }, - { no: 6, name: "map_sint64_sint64", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "scalar", T: 18 /* ScalarType.SINT64 */} }, - { no: 7, name: "map_fixed32_fixed32", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "scalar", T: 7 /* ScalarType.FIXED32 */} }, - { no: 8, name: "map_fixed64_fixed64", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "scalar", T: 6 /* ScalarType.FIXED64 */} }, - { no: 9, name: "map_sfixed32_sfixed32", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "scalar", T: 15 /* ScalarType.SFIXED32 */} }, - { no: 10, name: "map_sfixed64_sfixed64", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "scalar", T: 16 /* ScalarType.SFIXED64 */} }, - { no: 11, name: "map_int32_float", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 2 /* ScalarType.FLOAT */} }, - { no: 12, name: "map_int32_double", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 13, name: "map_bool_bool", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "scalar", T: 8 /* ScalarType.BOOL */} }, - { no: 14, name: "map_string_string", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 15, name: "map_int32_bytes", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, - { no: 16, name: "map_int32_enum", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(MapEnumLite)} }, - { no: 17, name: "map_int32_foreign_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: ForeignMessageLite} }, - { no: 18, name: "teboring", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMapLite { - return new TestMapLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMapLite { - return new TestMapLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestMapLite { - return new TestMapLite().fromJsonString(jsonString, options); - } - - static equals(a: TestMapLite | PlainMessage | undefined, b: TestMapLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestMapLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestArenaMapLite - */ -export class TestArenaMapLite extends Message { - /** - * @generated from field: map map_int32_int32 = 1; - */ - mapInt32Int32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_int64_int64 = 2; - */ - mapInt64Int64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_uint32_uint32 = 3; - */ - mapUint32Uint32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_uint64_uint64 = 4; - */ - mapUint64Uint64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_sint32_sint32 = 5; - */ - mapSint32Sint32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_sint64_sint64 = 6; - */ - mapSint64Sint64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_fixed32_fixed32 = 7; - */ - mapFixed32Fixed32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_fixed64_fixed64 = 8; - */ - mapFixed64Fixed64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_sfixed32_sfixed32 = 9; - */ - mapSfixed32Sfixed32: { [key: number]: number } = {}; - - /** - * @generated from field: map map_sfixed64_sfixed64 = 10; - */ - mapSfixed64Sfixed64: { [key: string]: bigint } = {}; - - /** - * @generated from field: map map_int32_float = 11; - */ - mapInt32Float: { [key: number]: number } = {}; - - /** - * @generated from field: map map_int32_double = 12; - */ - mapInt32Double: { [key: number]: number } = {}; - - /** - * @generated from field: map map_bool_bool = 13; - */ - mapBoolBool: { [key: string]: boolean } = {}; - - /** - * @generated from field: map map_string_string = 14; - */ - mapStringString: { [key: string]: string } = {}; - - /** - * @generated from field: map map_int32_bytes = 15; - */ - mapInt32Bytes: { [key: number]: Uint8Array } = {}; - - /** - * @generated from field: map map_int32_enum = 16; - */ - mapInt32Enum: { [key: number]: MapEnumLite } = {}; - - /** - * @generated from field: map map_int32_foreign_message = 17; - */ - mapInt32ForeignMessage: { [key: number]: ForeignMessageArenaLite } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestArenaMapLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "map_int32_int32", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "map_int64_int64", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} }, - { no: 3, name: "map_uint32_uint32", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "scalar", T: 13 /* ScalarType.UINT32 */} }, - { no: 4, name: "map_uint64_uint64", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "scalar", T: 4 /* ScalarType.UINT64 */} }, - { no: 5, name: "map_sint32_sint32", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "scalar", T: 17 /* ScalarType.SINT32 */} }, - { no: 6, name: "map_sint64_sint64", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "scalar", T: 18 /* ScalarType.SINT64 */} }, - { no: 7, name: "map_fixed32_fixed32", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "scalar", T: 7 /* ScalarType.FIXED32 */} }, - { no: 8, name: "map_fixed64_fixed64", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "scalar", T: 6 /* ScalarType.FIXED64 */} }, - { no: 9, name: "map_sfixed32_sfixed32", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "scalar", T: 15 /* ScalarType.SFIXED32 */} }, - { no: 10, name: "map_sfixed64_sfixed64", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "scalar", T: 16 /* ScalarType.SFIXED64 */} }, - { no: 11, name: "map_int32_float", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 2 /* ScalarType.FLOAT */} }, - { no: 12, name: "map_int32_double", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 13, name: "map_bool_bool", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "scalar", T: 8 /* ScalarType.BOOL */} }, - { no: 14, name: "map_string_string", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 15, name: "map_int32_bytes", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, - { no: 16, name: "map_int32_enum", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(MapEnumLite)} }, - { no: 17, name: "map_int32_foreign_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: ForeignMessageArenaLite} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestArenaMapLite { - return new TestArenaMapLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestArenaMapLite { - return new TestArenaMapLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestArenaMapLite { - return new TestArenaMapLite().fromJsonString(jsonString, options); - } - - static equals(a: TestArenaMapLite | PlainMessage | undefined, b: TestArenaMapLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestArenaMapLite, a, b); - } -} - -/** - * Test embedded message with required fields - * - * @generated from message protobuf_unittest.TestRequiredMessageMapLite - */ -export class TestRequiredMessageMapLite extends Message { - /** - * @generated from field: map map_field = 1; - */ - mapField: { [key: number]: TestRequiredLite } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestRequiredMessageMapLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestRequiredLite} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestRequiredMessageMapLite { - return new TestRequiredMessageMapLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestRequiredMessageMapLite { - return new TestRequiredMessageMapLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestRequiredMessageMapLite { - return new TestRequiredMessageMapLite().fromJsonString(jsonString, options); - } - - static equals(a: TestRequiredMessageMapLite | PlainMessage | undefined, b: TestRequiredMessageMapLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestRequiredMessageMapLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestEnumMapLite - */ -export class TestEnumMapLite extends Message { - /** - * @generated from field: map known_map_field = 101; - */ - knownMapField: { [key: number]: Proto2MapEnumLite } = {}; - - /** - * @generated from field: map unknown_map_field = 102; - */ - unknownMapField: { [key: number]: Proto2MapEnumLite } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestEnumMapLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 101, name: "known_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumLite)} }, - { no: 102, name: "unknown_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumLite)} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEnumMapLite { - return new TestEnumMapLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEnumMapLite { - return new TestEnumMapLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestEnumMapLite { - return new TestEnumMapLite().fromJsonString(jsonString, options); - } - - static equals(a: TestEnumMapLite | PlainMessage | undefined, b: TestEnumMapLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestEnumMapLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestEnumMapPlusExtraLite - */ -export class TestEnumMapPlusExtraLite extends Message { - /** - * @generated from field: map known_map_field = 101; - */ - knownMapField: { [key: number]: Proto2MapEnumPlusExtraLite } = {}; - - /** - * @generated from field: map unknown_map_field = 102; - */ - unknownMapField: { [key: number]: Proto2MapEnumPlusExtraLite } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestEnumMapPlusExtraLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 101, name: "known_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumPlusExtraLite)} }, - { no: 102, name: "unknown_map_field", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "enum", T: proto2.getEnumType(Proto2MapEnumPlusExtraLite)} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEnumMapPlusExtraLite { - return new TestEnumMapPlusExtraLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEnumMapPlusExtraLite { - return new TestEnumMapPlusExtraLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestEnumMapPlusExtraLite { - return new TestEnumMapPlusExtraLite().fromJsonString(jsonString, options); - } - - static equals(a: TestEnumMapPlusExtraLite | PlainMessage | undefined, b: TestEnumMapPlusExtraLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestEnumMapPlusExtraLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestMessageMapLite - */ -export class TestMessageMapLite extends Message { - /** - * @generated from field: map map_int32_message = 1; - */ - mapInt32Message: { [key: number]: TestAllTypesLite } = {}; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestMessageMapLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "map_int32_message", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestAllTypesLite} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMessageMapLite { - return new TestMessageMapLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMessageMapLite { - return new TestMessageMapLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestMessageMapLite { - return new TestMessageMapLite().fromJsonString(jsonString, options); - } - - static equals(a: TestMessageMapLite | PlainMessage | undefined, b: TestMessageMapLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestMessageMapLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestRequiredLite - */ -export class TestRequiredLite extends Message { - /** - * @generated from field: required int32 a = 1; - */ - a?: number; - - /** - * @generated from field: required int32 b = 2; - */ - b?: number; - - /** - * @generated from field: required int32 c = 3; - */ - c?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestRequiredLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "b", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 3, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestRequiredLite { - return new TestRequiredLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestRequiredLite { - return new TestRequiredLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestRequiredLite { - return new TestRequiredLite().fromJsonString(jsonString, options); - } - - static equals(a: TestRequiredLite | PlainMessage | undefined, b: TestRequiredLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestRequiredLite, a, b); - } -} - -/** - * @generated from extension: optional protobuf_unittest.TestRequiredLite single = 1000; - */ -export const TestRequiredLite_single = proto2.makeExtension( - "protobuf_unittest.TestRequiredLite.single", - TestAllExtensionsLite, - () => ({ no: 1000, kind: "message", T: TestRequiredLite, opt: true }), -); - -/** - * @generated from message protobuf_unittest.ForeignMessageArenaLite - */ -export class ForeignMessageArenaLite extends Message { - /** - * @generated from field: optional int32 c = 1; - */ - c?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.ForeignMessageArenaLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ForeignMessageArenaLite { - return new ForeignMessageArenaLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ForeignMessageArenaLite { - return new ForeignMessageArenaLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ForeignMessageArenaLite { - return new ForeignMessageArenaLite().fromJsonString(jsonString, options); - } - - static equals(a: ForeignMessageArenaLite | PlainMessage | undefined, b: ForeignMessageArenaLite | PlainMessage | undefined): boolean { - return proto2.util.equals(ForeignMessageArenaLite, a, b); - } -} - diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/map_unittest_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/map_unittest_pb.ts index aaa753656..478405e40 100644 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/map_unittest_pb.ts +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/map_unittest_pb.ts @@ -197,6 +197,109 @@ export class TestMap extends Message { } } +/** + * @generated from message protobuf_unittest.TestMapWithMessages + */ +export class TestMapWithMessages extends Message { + /** + * @generated from field: map map_int32_all_types = 1; + */ + mapInt32AllTypes: { [key: number]: TestAllTypes } = {}; + + /** + * @generated from field: map map_int64_all_types = 2; + */ + mapInt64AllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_uint32_all_types = 3; + */ + mapUint32AllTypes: { [key: number]: TestAllTypes } = {}; + + /** + * @generated from field: map map_uint64_all_types = 4; + */ + mapUint64AllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_sint32_all_types = 5; + */ + mapSint32AllTypes: { [key: number]: TestAllTypes } = {}; + + /** + * @generated from field: map map_sint64_all_types = 6; + */ + mapSint64AllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_fixed32_all_types = 7; + */ + mapFixed32AllTypes: { [key: number]: TestAllTypes } = {}; + + /** + * @generated from field: map map_fixed64_all_types = 8; + */ + mapFixed64AllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_sfixed32_all_types = 9; + */ + mapSfixed32AllTypes: { [key: number]: TestAllTypes } = {}; + + /** + * @generated from field: map map_sfixed64_all_types = 10; + */ + mapSfixed64AllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_bool_all_types = 11; + */ + mapBoolAllTypes: { [key: string]: TestAllTypes } = {}; + + /** + * @generated from field: map map_string_all_types = 12; + */ + mapStringAllTypes: { [key: string]: TestAllTypes } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "protobuf_unittest.TestMapWithMessages"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "map_int32_all_types", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 2, name: "map_int64_all_types", kind: "map", K: 3 /* ScalarType.INT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 3, name: "map_uint32_all_types", kind: "map", K: 13 /* ScalarType.UINT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 4, name: "map_uint64_all_types", kind: "map", K: 4 /* ScalarType.UINT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 5, name: "map_sint32_all_types", kind: "map", K: 17 /* ScalarType.SINT32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 6, name: "map_sint64_all_types", kind: "map", K: 18 /* ScalarType.SINT64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 7, name: "map_fixed32_all_types", kind: "map", K: 7 /* ScalarType.FIXED32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 8, name: "map_fixed64_all_types", kind: "map", K: 6 /* ScalarType.FIXED64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 9, name: "map_sfixed32_all_types", kind: "map", K: 15 /* ScalarType.SFIXED32 */, V: {kind: "message", T: TestAllTypes} }, + { no: 10, name: "map_sfixed64_all_types", kind: "map", K: 16 /* ScalarType.SFIXED64 */, V: {kind: "message", T: TestAllTypes} }, + { no: 11, name: "map_bool_all_types", kind: "map", K: 8 /* ScalarType.BOOL */, V: {kind: "message", T: TestAllTypes} }, + { no: 12, name: "map_string_all_types", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TestAllTypes} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TestMapWithMessages { + return new TestMapWithMessages().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TestMapWithMessages { + return new TestMapWithMessages().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TestMapWithMessages { + return new TestMapWithMessages().fromJsonString(jsonString, options); + } + + static equals(a: TestMapWithMessages | PlainMessage | undefined, b: TestMapWithMessages | PlainMessage | undefined): boolean { + return proto3.util.equals(TestMapWithMessages, a, b); + } +} + /** * @generated from message protobuf_unittest.TestMapSubmessage */ diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/test_messages_proto2_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/test_messages_proto2_pb.ts index a57ebccee..6802fa78e 100644 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/test_messages_proto2_pb.ts +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/test_messages_proto2_pb.ts @@ -583,6 +583,11 @@ export class TestAllTypesProto2 extends Message { */ data?: TestAllTypesProto2_Data; + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField multiwordgroupfield = 204; + */ + multiwordgroupfield?: TestAllTypesProto2_MultiWordGroupField; + /** * default values * @@ -861,6 +866,7 @@ export class TestAllTypesProto2 extends Message { { no: 118, name: "oneof_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "oneof_field" }, { no: 119, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesProto2_NestedEnum), oneof: "oneof_field" }, { no: 201, name: "data", kind: "message", T: TestAllTypesProto2_Data, delimited: true, opt: true }, + { no: 204, name: "multiwordgroupfield", kind: "message", T: TestAllTypesProto2_MultiWordGroupField, delimited: true, opt: true }, { no: 241, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: -123456789 }, { no: 242, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("-9123456789123456789") }, { no: 243, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 2123456789 }, @@ -1035,6 +1041,49 @@ export class TestAllTypesProto2_Data extends Message { } } +/** + * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField + */ +export class TestAllTypesProto2_MultiWordGroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 205; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 206; + */ + groupUint32?: number; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 205, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 206, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TestAllTypesProto2_MultiWordGroupField { + return new TestAllTypesProto2_MultiWordGroupField().fromJsonString(jsonString, options); + } + + static equals(a: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined, b: TestAllTypesProto2_MultiWordGroupField | PlainMessage | undefined): boolean { + return proto2.util.equals(TestAllTypesProto2_MultiWordGroupField, a, b); + } +} + /** * message_set test case. * @@ -1197,6 +1246,49 @@ export class ForeignMessageProto2 extends Message { } } +/** + * @generated from message protobuf_test_messages.proto2.GroupField + */ +export class GroupField extends Message { + /** + * @generated from field: optional int32 group_int32 = 122; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 123; + */ + groupUint32?: number; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "protobuf_test_messages.proto2.GroupField"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 122, name: "group_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 123, name: "group_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GroupField { + return new GroupField().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GroupField { + return new GroupField().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GroupField { + return new GroupField().fromJsonString(jsonString, options); + } + + static equals(a: GroupField | PlainMessage | undefined, b: GroupField | PlainMessage | undefined): boolean { + return proto2.util.equals(GroupField, a, b); + } +} + /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes */ @@ -2000,3 +2092,12 @@ export const extension_int32 = proto2.makeExtension( { no: 120, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, ); +/** + * @generated from extension: optional protobuf_test_messages.proto2.GroupField groupfield = 121; + */ +export const groupfield = proto2.makeExtension( + "protobuf_test_messages.proto2.groupfield", + TestAllTypesProto2, + () => ({ no: 121, kind: "message", T: GroupField, delimited: true, opt: true }), +); + diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_features_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_features_pb.ts index 28f2033af..56a7b8ede 100644 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_features_pb.ts +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_features_pb.ts @@ -19,6 +19,122 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { FeatureSet, Message, proto2 } from "@bufbuild/protobuf"; +/** + * @generated from enum pb.EnumFeature + */ +export enum EnumFeature { + /** + * @generated from enum value: TEST_ENUM_FEATURE_UNKNOWN = 0; + */ + TEST_ENUM_FEATURE_UNKNOWN = 0, + + /** + * @generated from enum value: VALUE1 = 1; + */ + VALUE1 = 1, + + /** + * @generated from enum value: VALUE2 = 2; + */ + VALUE2 = 2, + + /** + * @generated from enum value: VALUE3 = 3; + */ + VALUE3 = 3, + + /** + * @generated from enum value: VALUE4 = 4; + */ + VALUE4 = 4, + + /** + * @generated from enum value: VALUE5 = 5; + */ + VALUE5 = 5, + + /** + * @generated from enum value: VALUE6 = 6; + */ + VALUE6 = 6, + + /** + * @generated from enum value: VALUE7 = 7; + */ + VALUE7 = 7, + + /** + * @generated from enum value: VALUE8 = 8; + */ + VALUE8 = 8, + + /** + * @generated from enum value: VALUE9 = 9; + */ + VALUE9 = 9, + + /** + * @generated from enum value: VALUE10 = 10; + */ + VALUE10 = 10, + + /** + * @generated from enum value: VALUE11 = 11; + */ + VALUE11 = 11, + + /** + * @generated from enum value: VALUE12 = 12; + */ + VALUE12 = 12, + + /** + * @generated from enum value: VALUE13 = 13; + */ + VALUE13 = 13, + + /** + * @generated from enum value: VALUE14 = 14; + */ + VALUE14 = 14, + + /** + * @generated from enum value: VALUE15 = 15; + */ + VALUE15 = 15, + + /** + * @generated from enum value: VALUE_EMPTY_SUPPORT = 98; + */ + VALUE_EMPTY_SUPPORT = 98, + + /** + * @generated from enum value: VALUE_FUTURE = 99; + */ + VALUE_FUTURE = 99, +} +// Retrieve enum metadata with: proto2.getEnumType(EnumFeature) +proto2.util.setEnumType(EnumFeature, "pb.EnumFeature", [ + { no: 0, name: "TEST_ENUM_FEATURE_UNKNOWN" }, + { no: 1, name: "VALUE1" }, + { no: 2, name: "VALUE2" }, + { no: 3, name: "VALUE3" }, + { no: 4, name: "VALUE4" }, + { no: 5, name: "VALUE5" }, + { no: 6, name: "VALUE6" }, + { no: 7, name: "VALUE7" }, + { no: 8, name: "VALUE8" }, + { no: 9, name: "VALUE9" }, + { no: 10, name: "VALUE10" }, + { no: 11, name: "VALUE11" }, + { no: 12, name: "VALUE12" }, + { no: 13, name: "VALUE13" }, + { no: 14, name: "VALUE14" }, + { no: 15, name: "VALUE15" }, + { no: 98, name: "VALUE_EMPTY_SUPPORT" }, + { no: 99, name: "VALUE_FUTURE" }, +]); + /** * @generated from message pb.TestMessage */ @@ -104,54 +220,54 @@ export const TestMessage_test_message = proto2.makeExtension { /** - * @generated from field: optional int32 int_file_feature = 1; + * @generated from field: optional pb.EnumFeature file_feature = 1; */ - intFileFeature?: number; + fileFeature?: EnumFeature; /** - * @generated from field: optional int32 int_extension_range_feature = 2; + * @generated from field: optional pb.EnumFeature extension_range_feature = 2; */ - intExtensionRangeFeature?: number; + extensionRangeFeature?: EnumFeature; /** - * @generated from field: optional int32 int_message_feature = 3; + * @generated from field: optional pb.EnumFeature message_feature = 3; */ - intMessageFeature?: number; + messageFeature?: EnumFeature; /** - * @generated from field: optional int32 int_field_feature = 4; + * @generated from field: optional pb.EnumFeature field_feature = 4; */ - intFieldFeature?: number; + fieldFeature?: EnumFeature; /** - * @generated from field: optional int32 int_oneof_feature = 5; + * @generated from field: optional pb.EnumFeature oneof_feature = 5; */ - intOneofFeature?: number; + oneofFeature?: EnumFeature; /** - * @generated from field: optional int32 int_enum_feature = 6; + * @generated from field: optional pb.EnumFeature enum_feature = 6; */ - intEnumFeature?: number; + enumFeature?: EnumFeature; /** - * @generated from field: optional int32 int_enum_entry_feature = 7; + * @generated from field: optional pb.EnumFeature enum_entry_feature = 7; */ - intEnumEntryFeature?: number; + enumEntryFeature?: EnumFeature; /** - * @generated from field: optional int32 int_service_feature = 8; + * @generated from field: optional pb.EnumFeature service_feature = 8; */ - intServiceFeature?: number; + serviceFeature?: EnumFeature; /** - * @generated from field: optional int32 int_method_feature = 9; + * @generated from field: optional pb.EnumFeature method_feature = 9; */ - intMethodFeature?: number; + methodFeature?: EnumFeature; /** - * @generated from field: optional int32 int_multiple_feature = 10; + * @generated from field: optional pb.EnumFeature multiple_feature = 10; */ - intMultipleFeature?: number; + multipleFeature?: EnumFeature; /** * @generated from field: optional bool bool_field_feature = 11; @@ -159,29 +275,29 @@ export class TestFeatures extends Message { boolFieldFeature?: boolean; /** - * @generated from field: optional float float_field_feature = 12; + * @generated from field: optional pb.EnumFeature source_feature = 15; */ - floatFieldFeature?: number; + sourceFeature?: EnumFeature; /** - * @generated from field: optional pb.TestFeatures.MessageFeature message_field_feature = 13; + * @generated from field: optional pb.EnumFeature source_feature2 = 16; */ - messageFieldFeature?: TestFeatures_MessageFeature; + sourceFeature2?: EnumFeature; /** - * @generated from field: optional pb.TestFeatures.EnumFeature enum_field_feature = 14; + * @generated from field: optional pb.EnumFeature removed_feature = 17; */ - enumFieldFeature?: TestFeatures_EnumFeature; + removedFeature?: EnumFeature; /** - * @generated from field: optional int32 int_source_feature = 15; + * @generated from field: optional pb.EnumFeature future_feature = 18; */ - intSourceFeature?: number; + futureFeature?: EnumFeature; /** - * @generated from field: optional string string_source_feature = 16; + * @generated from field: optional pb.EnumFeature legacy_feature = 19; */ - stringSourceFeature?: string; + legacyFeature?: EnumFeature; constructor(data?: PartialMessage) { super(); @@ -191,22 +307,22 @@ export class TestFeatures extends Message { static readonly runtime: typeof proto2 = proto2; static readonly typeName = "pb.TestFeatures"; static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "int_file_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "int_extension_range_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 3, name: "int_message_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 4, name: "int_field_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 5, name: "int_oneof_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 6, name: "int_enum_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 7, name: "int_enum_entry_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 8, name: "int_service_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 9, name: "int_method_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 10, name: "int_multiple_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 1, name: "file_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 2, name: "extension_range_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 3, name: "message_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 4, name: "field_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 5, name: "oneof_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 6, name: "enum_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 7, name: "enum_entry_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 8, name: "service_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 9, name: "method_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 10, name: "multiple_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, { no: 11, name: "bool_field_feature", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 12, name: "float_field_feature", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 13, name: "message_field_feature", kind: "message", T: TestFeatures_MessageFeature, opt: true }, - { no: 14, name: "enum_field_feature", kind: "enum", T: proto2.getEnumType(TestFeatures_EnumFeature), opt: true }, - { no: 15, name: "int_source_feature", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 16, name: "string_source_feature", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 15, name: "source_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 16, name: "source_feature2", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 17, name: "removed_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 18, name: "future_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, + { no: 19, name: "legacy_feature", kind: "enum", T: proto2.getEnumType(EnumFeature), opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TestFeatures { @@ -226,105 +342,6 @@ export class TestFeatures extends Message { } } -/** - * @generated from enum pb.TestFeatures.EnumFeature - */ -export enum TestFeatures_EnumFeature { - /** - * @generated from enum value: TEST_ENUM_FEATURE_UNKNOWN = 0; - */ - TEST_ENUM_FEATURE_UNKNOWN = 0, - - /** - * @generated from enum value: ENUM_VALUE1 = 1; - */ - ENUM_VALUE1 = 1, - - /** - * @generated from enum value: ENUM_VALUE2 = 2; - */ - ENUM_VALUE2 = 2, - - /** - * @generated from enum value: ENUM_VALUE3 = 3; - */ - ENUM_VALUE3 = 3, - - /** - * @generated from enum value: ENUM_VALUE4 = 4; - */ - ENUM_VALUE4 = 4, - - /** - * @generated from enum value: ENUM_VALUE5 = 5; - */ - ENUM_VALUE5 = 5, -} -// Retrieve enum metadata with: proto2.getEnumType(TestFeatures_EnumFeature) -proto2.util.setEnumType(TestFeatures_EnumFeature, "pb.TestFeatures.EnumFeature", [ - { no: 0, name: "TEST_ENUM_FEATURE_UNKNOWN" }, - { no: 1, name: "ENUM_VALUE1" }, - { no: 2, name: "ENUM_VALUE2" }, - { no: 3, name: "ENUM_VALUE3" }, - { no: 4, name: "ENUM_VALUE4" }, - { no: 5, name: "ENUM_VALUE5" }, -]); - -/** - * @generated from message pb.TestFeatures.MessageFeature - */ -export class TestFeatures_MessageFeature extends Message { - /** - * @generated from field: optional bool bool_field = 1; - */ - boolField?: boolean; - - /** - * @generated from field: optional int32 int_field = 2; - */ - intField?: number; - - /** - * @generated from field: optional float float_field = 3; - */ - floatField?: number; - - /** - * @generated from field: optional string string_field = 4; - */ - stringField?: string; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "pb.TestFeatures.MessageFeature"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "bool_field", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 2, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 3, name: "float_field", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 4, name: "string_field", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestFeatures_MessageFeature { - return new TestFeatures_MessageFeature().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestFeatures_MessageFeature { - return new TestFeatures_MessageFeature().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestFeatures_MessageFeature { - return new TestFeatures_MessageFeature().fromJsonString(jsonString, options); - } - - static equals(a: TestFeatures_MessageFeature | PlainMessage | undefined, b: TestFeatures_MessageFeature | PlainMessage | undefined): boolean { - return proto2.util.equals(TestFeatures_MessageFeature, a, b); - } -} - /** * @generated from extension: optional pb.TestFeatures test = 9999; */ diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_lite_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_lite_pb.ts deleted file mode 100644 index 6de1084b7..000000000 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_lite_pb.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file google/protobuf/unittest_import_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from enum protobuf_unittest_import.ImportEnumLite - */ -export enum ImportEnumLite { - /** - * @generated from enum value: IMPORT_LITE_FOO = 7; - */ - IMPORT_LITE_FOO = 7, - - /** - * @generated from enum value: IMPORT_LITE_BAR = 8; - */ - IMPORT_LITE_BAR = 8, - - /** - * @generated from enum value: IMPORT_LITE_BAZ = 9; - */ - IMPORT_LITE_BAZ = 9, -} -// Retrieve enum metadata with: proto2.getEnumType(ImportEnumLite) -proto2.util.setEnumType(ImportEnumLite, "protobuf_unittest_import.ImportEnumLite", [ - { no: 7, name: "IMPORT_LITE_FOO" }, - { no: 8, name: "IMPORT_LITE_BAR" }, - { no: 9, name: "IMPORT_LITE_BAZ" }, -]); - -/** - * @generated from message protobuf_unittest_import.ImportMessageLite - */ -export class ImportMessageLite extends Message { - /** - * @generated from field: optional int32 d = 1; - */ - d?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest_import.ImportMessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "d", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ImportMessageLite { - return new ImportMessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ImportMessageLite { - return new ImportMessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ImportMessageLite { - return new ImportMessageLite().fromJsonString(jsonString, options); - } - - static equals(a: ImportMessageLite | PlainMessage | undefined, b: ImportMessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(ImportMessageLite, a, b); - } -} - diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_public_lite_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_public_lite_pb.ts deleted file mode 100644 index 723460049..000000000 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_import_public_lite_pb.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: liujisi@google.com (Pherl Liu) - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file google/protobuf/unittest_import_public_lite.proto (package protobuf_unittest_import, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; - -/** - * @generated from message protobuf_unittest_import.PublicImportMessageLite - */ -export class PublicImportMessageLite extends Message { - /** - * @generated from field: optional int32 e = 1; - */ - e?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest_import.PublicImportMessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "e", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PublicImportMessageLite { - return new PublicImportMessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PublicImportMessageLite { - return new PublicImportMessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublicImportMessageLite { - return new PublicImportMessageLite().fromJsonString(jsonString, options); - } - - static equals(a: PublicImportMessageLite | PlainMessage | undefined, b: PublicImportMessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(PublicImportMessageLite, a, b); - } -} - diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_lite_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_lite_pb.ts deleted file mode 100644 index 7e53ae026..000000000 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_lite_pb.ts +++ /dev/null @@ -1,3081 +0,0 @@ -// Copyright 2021-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file google/protobuf/unittest_lite.proto (package protobuf_unittest, syntax proto2) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2, protoInt64 } from "@bufbuild/protobuf"; -import { ImportEnumLite, ImportMessageLite } from "./unittest_import_lite_pb.js"; -import { PublicImportMessageLite } from "./unittest_import_public_lite_pb.js"; - -/** - * @generated from enum protobuf_unittest.ForeignEnumLite - */ -export enum ForeignEnumLite { - /** - * @generated from enum value: FOREIGN_LITE_FOO = 4; - */ - FOREIGN_LITE_FOO = 4, - - /** - * @generated from enum value: FOREIGN_LITE_BAZ = 6; - */ - FOREIGN_LITE_BAZ = 6, - - /** - * @generated from enum value: FOREIGN_LITE_BAR = 5; - */ - FOREIGN_LITE_BAR = 5, -} -// Retrieve enum metadata with: proto2.getEnumType(ForeignEnumLite) -proto2.util.setEnumType(ForeignEnumLite, "protobuf_unittest.ForeignEnumLite", [ - { no: 4, name: "FOREIGN_LITE_FOO" }, - { no: 6, name: "FOREIGN_LITE_BAZ" }, - { no: 5, name: "FOREIGN_LITE_BAR" }, -]); - -/** - * @generated from enum protobuf_unittest.V1EnumLite - */ -export enum V1EnumLite { - /** - * @generated from enum value: V1_FIRST = 1; - */ - V1_FIRST = 1, -} -// Retrieve enum metadata with: proto2.getEnumType(V1EnumLite) -proto2.util.setEnumType(V1EnumLite, "protobuf_unittest.V1EnumLite", [ - { no: 1, name: "V1_FIRST" }, -]); - -/** - * @generated from enum protobuf_unittest.V2EnumLite - */ -export enum V2EnumLite { - /** - * @generated from enum value: V2_FIRST = 1; - */ - V2_FIRST = 1, - - /** - * @generated from enum value: V2_SECOND = 2; - */ - V2_SECOND = 2, -} -// Retrieve enum metadata with: proto2.getEnumType(V2EnumLite) -proto2.util.setEnumType(V2EnumLite, "protobuf_unittest.V2EnumLite", [ - { no: 1, name: "V2_FIRST" }, - { no: 2, name: "V2_SECOND" }, -]); - -/** - * Same as TestAllTypes but with the lite runtime. - * - * @generated from message protobuf_unittest.TestAllTypesLite - */ -export class TestAllTypesLite extends Message { - /** - * Singular - * - * @generated from field: optional int32 optional_int32 = 1; - */ - optionalInt32?: number; - - /** - * @generated from field: optional int64 optional_int64 = 2; - */ - optionalInt64?: bigint; - - /** - * @generated from field: optional uint32 optional_uint32 = 3; - */ - optionalUint32?: number; - - /** - * @generated from field: optional uint64 optional_uint64 = 4; - */ - optionalUint64?: bigint; - - /** - * @generated from field: optional sint32 optional_sint32 = 5; - */ - optionalSint32?: number; - - /** - * @generated from field: optional sint64 optional_sint64 = 6; - */ - optionalSint64?: bigint; - - /** - * @generated from field: optional fixed32 optional_fixed32 = 7; - */ - optionalFixed32?: number; - - /** - * @generated from field: optional fixed64 optional_fixed64 = 8; - */ - optionalFixed64?: bigint; - - /** - * @generated from field: optional sfixed32 optional_sfixed32 = 9; - */ - optionalSfixed32?: number; - - /** - * @generated from field: optional sfixed64 optional_sfixed64 = 10; - */ - optionalSfixed64?: bigint; - - /** - * @generated from field: optional float optional_float = 11; - */ - optionalFloat?: number; - - /** - * @generated from field: optional double optional_double = 12; - */ - optionalDouble?: number; - - /** - * @generated from field: optional bool optional_bool = 13; - */ - optionalBool?: boolean; - - /** - * @generated from field: optional string optional_string = 14; - */ - optionalString?: string; - - /** - * @generated from field: optional bytes optional_bytes = 15; - */ - optionalBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.OptionalGroup optionalgroup = 16; - */ - optionalgroup?: TestAllTypesLite_OptionalGroup; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_nested_message = 18; - */ - optionalNestedMessage?: TestAllTypesLite_NestedMessage; - - /** - * @generated from field: optional protobuf_unittest.ForeignMessageLite optional_foreign_message = 19; - */ - optionalForeignMessage?: ForeignMessageLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportMessageLite optional_import_message = 20; - */ - optionalImportMessage?: ImportMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedEnum optional_nested_enum = 21; - */ - optionalNestedEnum?: TestAllTypesLite_NestedEnum; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite optional_foreign_enum = 22; - */ - optionalForeignEnum?: ForeignEnumLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - */ - optionalImportEnum?: ImportEnumLite; - - /** - * @generated from field: optional string optional_string_piece = 24; - */ - optionalStringPiece?: string; - - /** - * @generated from field: optional string optional_cord = 25; - */ - optionalCord?: string; - - /** - * Defined in unittest_import_public.proto - * - * @generated from field: optional protobuf_unittest_import.PublicImportMessageLite optional_public_import_message = 26; - */ - optionalPublicImportMessage?: PublicImportMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_lazy_message = 27; - */ - optionalLazyMessage?: TestAllTypesLite_NestedMessage; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_unverified_lazy_message = 28; - */ - optionalUnverifiedLazyMessage?: TestAllTypesLite_NestedMessage; - - /** - * Repeated - * - * @generated from field: repeated int32 repeated_int32 = 31; - */ - repeatedInt32: number[] = []; - - /** - * @generated from field: repeated int64 repeated_int64 = 32; - */ - repeatedInt64: bigint[] = []; - - /** - * @generated from field: repeated uint32 repeated_uint32 = 33; - */ - repeatedUint32: number[] = []; - - /** - * @generated from field: repeated uint64 repeated_uint64 = 34; - */ - repeatedUint64: bigint[] = []; - - /** - * @generated from field: repeated sint32 repeated_sint32 = 35; - */ - repeatedSint32: number[] = []; - - /** - * @generated from field: repeated sint64 repeated_sint64 = 36; - */ - repeatedSint64: bigint[] = []; - - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 37; - */ - repeatedFixed32: number[] = []; - - /** - * @generated from field: repeated fixed64 repeated_fixed64 = 38; - */ - repeatedFixed64: bigint[] = []; - - /** - * @generated from field: repeated sfixed32 repeated_sfixed32 = 39; - */ - repeatedSfixed32: number[] = []; - - /** - * @generated from field: repeated sfixed64 repeated_sfixed64 = 40; - */ - repeatedSfixed64: bigint[] = []; - - /** - * @generated from field: repeated float repeated_float = 41; - */ - repeatedFloat: number[] = []; - - /** - * @generated from field: repeated double repeated_double = 42; - */ - repeatedDouble: number[] = []; - - /** - * @generated from field: repeated bool repeated_bool = 43; - */ - repeatedBool: boolean[] = []; - - /** - * @generated from field: repeated string repeated_string = 44; - */ - repeatedString: string[] = []; - - /** - * @generated from field: repeated bytes repeated_bytes = 45; - */ - repeatedBytes: Uint8Array[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.RepeatedGroup repeatedgroup = 46; - */ - repeatedgroup: TestAllTypesLite_RepeatedGroup[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_nested_message = 48; - */ - repeatedNestedMessage: TestAllTypesLite_NestedMessage[] = []; - - /** - * @generated from field: repeated protobuf_unittest.ForeignMessageLite repeated_foreign_message = 49; - */ - repeatedForeignMessage: ForeignMessageLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest_import.ImportMessageLite repeated_import_message = 50; - */ - repeatedImportMessage: ImportMessageLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedEnum repeated_nested_enum = 51; - */ - repeatedNestedEnum: TestAllTypesLite_NestedEnum[] = []; - - /** - * @generated from field: repeated protobuf_unittest.ForeignEnumLite repeated_foreign_enum = 52; - */ - repeatedForeignEnum: ForeignEnumLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - */ - repeatedImportEnum: ImportEnumLite[] = []; - - /** - * @generated from field: repeated string repeated_string_piece = 54; - */ - repeatedStringPiece: string[] = []; - - /** - * @generated from field: repeated string repeated_cord = 55; - */ - repeatedCord: string[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_lazy_message = 57; - */ - repeatedLazyMessage: TestAllTypesLite_NestedMessage[] = []; - - /** - * Singular with defaults - * - * @generated from field: optional int32 default_int32 = 61 [default = 41]; - */ - defaultInt32?: number; - - /** - * @generated from field: optional int64 default_int64 = 62 [default = 42]; - */ - defaultInt64?: bigint; - - /** - * @generated from field: optional uint32 default_uint32 = 63 [default = 43]; - */ - defaultUint32?: number; - - /** - * @generated from field: optional uint64 default_uint64 = 64 [default = 44]; - */ - defaultUint64?: bigint; - - /** - * @generated from field: optional sint32 default_sint32 = 65 [default = -45]; - */ - defaultSint32?: number; - - /** - * @generated from field: optional sint64 default_sint64 = 66 [default = 46]; - */ - defaultSint64?: bigint; - - /** - * @generated from field: optional fixed32 default_fixed32 = 67 [default = 47]; - */ - defaultFixed32?: number; - - /** - * @generated from field: optional fixed64 default_fixed64 = 68 [default = 48]; - */ - defaultFixed64?: bigint; - - /** - * @generated from field: optional sfixed32 default_sfixed32 = 69 [default = 49]; - */ - defaultSfixed32?: number; - - /** - * @generated from field: optional sfixed64 default_sfixed64 = 70 [default = -50]; - */ - defaultSfixed64?: bigint; - - /** - * @generated from field: optional float default_float = 71 [default = 51.5]; - */ - defaultFloat?: number; - - /** - * @generated from field: optional double default_double = 72 [default = 52000]; - */ - defaultDouble?: number; - - /** - * @generated from field: optional bool default_bool = 73 [default = true]; - */ - defaultBool?: boolean; - - /** - * @generated from field: optional string default_string = 74 [default = "hello"]; - */ - defaultString?: string; - - /** - * @generated from field: optional bytes default_bytes = 75 [default = "world"]; - */ - defaultBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite.NestedEnum default_nested_enum = 81 [default = BAR]; - */ - defaultNestedEnum?: TestAllTypesLite_NestedEnum; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite default_foreign_enum = 82 [default = FOREIGN_LITE_BAR]; - */ - defaultForeignEnum?: ForeignEnumLite; - - /** - * @generated from field: optional protobuf_unittest_import.ImportEnumLite default_import_enum = 83 [default = IMPORT_LITE_BAR]; - */ - defaultImportEnum?: ImportEnumLite; - - /** - * @generated from field: optional string default_string_piece = 84 [default = "abc"]; - */ - defaultStringPiece?: string; - - /** - * @generated from field: optional string default_cord = 85 [default = "123"]; - */ - defaultCord?: string; - - /** - * For oneof test - * - * @generated from oneof protobuf_unittest.TestAllTypesLite.oneof_field - */ - oneofField: { - /** - * @generated from field: uint32 oneof_uint32 = 111; - */ - value: number; - case: "oneofUint32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage oneof_nested_message = 112; - */ - value: TestAllTypesLite_NestedMessage; - case: "oneofNestedMessage"; - } | { - /** - * @generated from field: string oneof_string = 113; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 114; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage oneof_lazy_nested_message = 115; - */ - value: TestAllTypesLite_NestedMessage; - case: "oneofLazyNestedMessage"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite.NestedMessage2 oneof_nested_message2 = 117; - */ - value: TestAllTypesLite_NestedMessage2; - case: "oneofNestedMessage2"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - /** - * Tests toString for non-repeated fields with a list suffix - * - * @generated from field: optional int32 deceptively_named_list = 116; - */ - deceptivelyNamedList?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "optional_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, - { no: 3, name: "optional_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 4, name: "optional_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, - { no: 5, name: "optional_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true }, - { no: 6, name: "optional_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true }, - { no: 7, name: "optional_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true }, - { no: 8, name: "optional_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true }, - { no: 9, name: "optional_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true }, - { no: 10, name: "optional_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true }, - { no: 11, name: "optional_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, - { no: 12, name: "optional_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true }, - { no: 13, name: "optional_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 14, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 15, name: "optional_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 16, name: "optionalgroup", kind: "message", T: TestAllTypesLite_OptionalGroup, delimited: true, opt: true }, - { no: 18, name: "optional_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 19, name: "optional_foreign_message", kind: "message", T: ForeignMessageLite, opt: true }, - { no: 20, name: "optional_import_message", kind: "message", T: ImportMessageLite, opt: true }, - { no: 21, name: "optional_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true }, - { no: 22, name: "optional_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }, - { no: 23, name: "optional_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true }, - { no: 24, name: "optional_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 25, name: "optional_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 26, name: "optional_public_import_message", kind: "message", T: PublicImportMessageLite, opt: true }, - { no: 27, name: "optional_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 28, name: "optional_unverified_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }, - { no: 31, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - { no: 32, name: "repeated_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true }, - { no: 33, name: "repeated_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, - { no: 34, name: "repeated_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true }, - { no: 35, name: "repeated_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true }, - { no: 36, name: "repeated_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true }, - { no: 37, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, - { no: 38, name: "repeated_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true }, - { no: 39, name: "repeated_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true }, - { no: 40, name: "repeated_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true }, - { no: 41, name: "repeated_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true }, - { no: 42, name: "repeated_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true }, - { no: 43, name: "repeated_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true }, - { no: 44, name: "repeated_string", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 45, name: "repeated_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, repeated: true }, - { no: 46, name: "repeatedgroup", kind: "message", T: TestAllTypesLite_RepeatedGroup, delimited: true, repeated: true }, - { no: 48, name: "repeated_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }, - { no: 49, name: "repeated_foreign_message", kind: "message", T: ForeignMessageLite, repeated: true }, - { no: 50, name: "repeated_import_message", kind: "message", T: ImportMessageLite, repeated: true }, - { no: 51, name: "repeated_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), repeated: true }, - { no: 52, name: "repeated_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true }, - { no: 53, name: "repeated_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), repeated: true }, - { no: 54, name: "repeated_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 55, name: "repeated_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 57, name: "repeated_lazy_message", kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }, - { no: 61, name: "default_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: 41 }, - { no: 62, name: "default_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("42") }, - { no: 63, name: "default_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 43 }, - { no: 64, name: "default_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true, default: protoInt64.uParse("44") }, - { no: 65, name: "default_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true, default: -45 }, - { no: 66, name: "default_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true, default: protoInt64.parse("46") }, - { no: 67, name: "default_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true, default: 47 }, - { no: 68, name: "default_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true, default: protoInt64.uParse("48") }, - { no: 69, name: "default_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true, default: 49 }, - { no: 70, name: "default_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true, default: protoInt64.parse("-50") }, - { no: 71, name: "default_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true, default: 51.5 }, - { no: 72, name: "default_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true, default: 52000 }, - { no: 73, name: "default_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true }, - { no: 74, name: "default_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "hello" }, - { no: 75, name: "default_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true, default: new Uint8Array([0x77, 0x6F, 0x72, 0x6C, 0x64]) }, - { no: 81, name: "default_nested_enum", kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true, default: TestAllTypesLite_NestedEnum.BAR }, - { no: 82, name: "default_foreign_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true, default: ForeignEnumLite.FOREIGN_LITE_BAR }, - { no: 83, name: "default_import_enum", kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true, default: ImportEnumLite.IMPORT_LITE_BAR }, - { no: 84, name: "default_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "abc" }, - { no: 85, name: "default_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "123" }, - { no: 111, name: "oneof_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, oneof: "oneof_field" }, - { no: 112, name: "oneof_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, oneof: "oneof_field" }, - { no: 113, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 114, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - { no: 115, name: "oneof_lazy_nested_message", kind: "message", T: TestAllTypesLite_NestedMessage, oneof: "oneof_field" }, - { no: 117, name: "oneof_nested_message2", kind: "message", T: TestAllTypesLite_NestedMessage2, oneof: "oneof_field" }, - { no: 116, name: "deceptively_named_list", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite { - return new TestAllTypesLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite { - return new TestAllTypesLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite { - return new TestAllTypesLite().fromJsonString(jsonString, options); - } - - static equals(a: TestAllTypesLite | PlainMessage | undefined, b: TestAllTypesLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllTypesLite, a, b); - } -} - -/** - * @generated from enum protobuf_unittest.TestAllTypesLite.NestedEnum - */ -export enum TestAllTypesLite_NestedEnum { - /** - * @generated from enum value: FOO = 1; - */ - FOO = 1, - - /** - * @generated from enum value: BAR = 2; - */ - BAR = 2, - - /** - * @generated from enum value: BAZ = 3; - */ - BAZ = 3, -} -// Retrieve enum metadata with: proto2.getEnumType(TestAllTypesLite_NestedEnum) -proto2.util.setEnumType(TestAllTypesLite_NestedEnum, "protobuf_unittest.TestAllTypesLite.NestedEnum", [ - { no: 1, name: "FOO" }, - { no: 2, name: "BAR" }, - { no: 3, name: "BAZ" }, -]); - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage - */ -export class TestAllTypesLite_NestedMessage extends Message { - /** - * @generated from field: optional int32 bb = 1; - */ - bb?: number; - - /** - * @generated from field: optional int64 cc = 2; - */ - cc?: bigint; - - /** - * @generated from field: repeated int32 dd = 3 [packed = true]; - */ - dd: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.NestedMessage"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "bb", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "cc", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, - { no: 3, name: "dd", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_NestedMessage { - return new TestAllTypesLite_NestedMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_NestedMessage { - return new TestAllTypesLite_NestedMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_NestedMessage { - return new TestAllTypesLite_NestedMessage().fromJsonString(jsonString, options); - } - - static equals(a: TestAllTypesLite_NestedMessage | PlainMessage | undefined, b: TestAllTypesLite_NestedMessage | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllTypesLite_NestedMessage, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.NestedMessage2 - */ -export class TestAllTypesLite_NestedMessage2 extends Message { - /** - * @generated from field: optional int32 dd = 1; - */ - dd?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.NestedMessage2"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "dd", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_NestedMessage2 { - return new TestAllTypesLite_NestedMessage2().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_NestedMessage2 { - return new TestAllTypesLite_NestedMessage2().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_NestedMessage2 { - return new TestAllTypesLite_NestedMessage2().fromJsonString(jsonString, options); - } - - static equals(a: TestAllTypesLite_NestedMessage2 | PlainMessage | undefined, b: TestAllTypesLite_NestedMessage2 | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllTypesLite_NestedMessage2, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.OptionalGroup - */ -export class TestAllTypesLite_OptionalGroup extends Message { - /** - * @generated from field: optional int32 a = 17; - */ - a?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.OptionalGroup"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 17, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_OptionalGroup { - return new TestAllTypesLite_OptionalGroup().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_OptionalGroup { - return new TestAllTypesLite_OptionalGroup().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_OptionalGroup { - return new TestAllTypesLite_OptionalGroup().fromJsonString(jsonString, options); - } - - static equals(a: TestAllTypesLite_OptionalGroup | PlainMessage | undefined, b: TestAllTypesLite_OptionalGroup | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllTypesLite_OptionalGroup, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestAllTypesLite.RepeatedGroup - */ -export class TestAllTypesLite_RepeatedGroup extends Message { - /** - * @generated from field: optional int32 a = 47; - */ - a?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllTypesLite.RepeatedGroup"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 47, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllTypesLite_RepeatedGroup { - return new TestAllTypesLite_RepeatedGroup().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllTypesLite_RepeatedGroup { - return new TestAllTypesLite_RepeatedGroup().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllTypesLite_RepeatedGroup { - return new TestAllTypesLite_RepeatedGroup().fromJsonString(jsonString, options); - } - - static equals(a: TestAllTypesLite_RepeatedGroup | PlainMessage | undefined, b: TestAllTypesLite_RepeatedGroup | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllTypesLite_RepeatedGroup, a, b); - } -} - -/** - * @generated from message protobuf_unittest.ForeignMessageLite - */ -export class ForeignMessageLite extends Message { - /** - * @generated from field: optional int32 c = 1; - */ - c?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.ForeignMessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "c", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ForeignMessageLite { - return new ForeignMessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ForeignMessageLite { - return new ForeignMessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ForeignMessageLite { - return new ForeignMessageLite().fromJsonString(jsonString, options); - } - - static equals(a: ForeignMessageLite | PlainMessage | undefined, b: ForeignMessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(ForeignMessageLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestPackedTypesLite - */ -export class TestPackedTypesLite extends Message { - /** - * @generated from field: repeated int32 packed_int32 = 90 [packed = true]; - */ - packedInt32: number[] = []; - - /** - * @generated from field: repeated int64 packed_int64 = 91 [packed = true]; - */ - packedInt64: bigint[] = []; - - /** - * @generated from field: repeated uint32 packed_uint32 = 92 [packed = true]; - */ - packedUint32: number[] = []; - - /** - * @generated from field: repeated uint64 packed_uint64 = 93 [packed = true]; - */ - packedUint64: bigint[] = []; - - /** - * @generated from field: repeated sint32 packed_sint32 = 94 [packed = true]; - */ - packedSint32: number[] = []; - - /** - * @generated from field: repeated sint64 packed_sint64 = 95 [packed = true]; - */ - packedSint64: bigint[] = []; - - /** - * @generated from field: repeated fixed32 packed_fixed32 = 96 [packed = true]; - */ - packedFixed32: number[] = []; - - /** - * @generated from field: repeated fixed64 packed_fixed64 = 97 [packed = true]; - */ - packedFixed64: bigint[] = []; - - /** - * @generated from field: repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - */ - packedSfixed32: number[] = []; - - /** - * @generated from field: repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - */ - packedSfixed64: bigint[] = []; - - /** - * @generated from field: repeated float packed_float = 100 [packed = true]; - */ - packedFloat: number[] = []; - - /** - * @generated from field: repeated double packed_double = 101 [packed = true]; - */ - packedDouble: number[] = []; - - /** - * @generated from field: repeated bool packed_bool = 102 [packed = true]; - */ - packedBool: boolean[] = []; - - /** - * @generated from field: repeated protobuf_unittest.ForeignEnumLite packed_enum = 103 [packed = true]; - */ - packedEnum: ForeignEnumLite[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestPackedTypesLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 90, name: "packed_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - { no: 91, name: "packed_int64", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true, packed: true }, - { no: 92, name: "packed_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true, packed: true }, - { no: 93, name: "packed_uint64", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true, packed: true }, - { no: 94, name: "packed_sint32", kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true, packed: true }, - { no: 95, name: "packed_sint64", kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true, packed: true }, - { no: 96, name: "packed_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, - { no: 97, name: "packed_fixed64", kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true, packed: true }, - { no: 98, name: "packed_sfixed32", kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true, packed: true }, - { no: 99, name: "packed_sfixed64", kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true, packed: true }, - { no: 100, name: "packed_float", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true, packed: true }, - { no: 101, name: "packed_double", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true, packed: true }, - { no: 102, name: "packed_bool", kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true, packed: true }, - { no: 103, name: "packed_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true, packed: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestPackedTypesLite { - return new TestPackedTypesLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestPackedTypesLite { - return new TestPackedTypesLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestPackedTypesLite { - return new TestPackedTypesLite().fromJsonString(jsonString, options); - } - - static equals(a: TestPackedTypesLite | PlainMessage | undefined, b: TestPackedTypesLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestPackedTypesLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestAllExtensionsLite - */ -export class TestAllExtensionsLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestAllExtensionsLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestAllExtensionsLite { - return new TestAllExtensionsLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestAllExtensionsLite { - return new TestAllExtensionsLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestAllExtensionsLite { - return new TestAllExtensionsLite().fromJsonString(jsonString, options); - } - - static equals(a: TestAllExtensionsLite | PlainMessage | undefined, b: TestAllExtensionsLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestAllExtensionsLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.OptionalGroup_extension_lite - */ -export class OptionalGroup_extension_lite extends Message { - /** - * @generated from field: optional int32 a = 17; - */ - a?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.OptionalGroup_extension_lite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 17, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OptionalGroup_extension_lite { - return new OptionalGroup_extension_lite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OptionalGroup_extension_lite { - return new OptionalGroup_extension_lite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OptionalGroup_extension_lite { - return new OptionalGroup_extension_lite().fromJsonString(jsonString, options); - } - - static equals(a: OptionalGroup_extension_lite | PlainMessage | undefined, b: OptionalGroup_extension_lite | PlainMessage | undefined): boolean { - return proto2.util.equals(OptionalGroup_extension_lite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.RepeatedGroup_extension_lite - */ -export class RepeatedGroup_extension_lite extends Message { - /** - * @generated from field: optional int32 a = 47; - */ - a?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.RepeatedGroup_extension_lite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 47, name: "a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RepeatedGroup_extension_lite { - return new RepeatedGroup_extension_lite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RepeatedGroup_extension_lite { - return new RepeatedGroup_extension_lite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RepeatedGroup_extension_lite { - return new RepeatedGroup_extension_lite().fromJsonString(jsonString, options); - } - - static equals(a: RepeatedGroup_extension_lite | PlainMessage | undefined, b: RepeatedGroup_extension_lite | PlainMessage | undefined): boolean { - return proto2.util.equals(RepeatedGroup_extension_lite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestPackedExtensionsLite - */ -export class TestPackedExtensionsLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestPackedExtensionsLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestPackedExtensionsLite { - return new TestPackedExtensionsLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestPackedExtensionsLite { - return new TestPackedExtensionsLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestPackedExtensionsLite { - return new TestPackedExtensionsLite().fromJsonString(jsonString, options); - } - - static equals(a: TestPackedExtensionsLite | PlainMessage | undefined, b: TestPackedExtensionsLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestPackedExtensionsLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestNestedExtensionLite - */ -export class TestNestedExtensionLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestNestedExtensionLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestNestedExtensionLite { - return new TestNestedExtensionLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestNestedExtensionLite { - return new TestNestedExtensionLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestNestedExtensionLite { - return new TestNestedExtensionLite().fromJsonString(jsonString, options); - } - - static equals(a: TestNestedExtensionLite | PlainMessage | undefined, b: TestNestedExtensionLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestNestedExtensionLite, a, b); - } -} - -/** - * @generated from extension: optional int32 nested_extension = 12345; - */ -export const TestNestedExtensionLite_nested_extension = proto2.makeExtension( - "protobuf_unittest.TestNestedExtensionLite.nested_extension", - TestAllExtensionsLite, - { no: 12345, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, -); - -/** - * Test that deprecated fields work. We only verify that they compile (at one - * point this failed). - * - * @generated from message protobuf_unittest.TestDeprecatedLite - */ -export class TestDeprecatedLite extends Message { - /** - * @generated from field: optional int32 deprecated_field = 1 [deprecated = true]; - * @deprecated - */ - deprecatedField?: number; - - /** - * @generated from field: required int32 deprecated_field2 = 2 [deprecated = true]; - * @deprecated - */ - deprecatedField2?: number; - - /** - * @generated from field: optional string deprecated_field3 = 3 [deprecated = true]; - * @deprecated - */ - deprecatedField3?: string; - - /** - * @generated from field: optional protobuf_unittest.TestDeprecatedLite deprecated_field4 = 4 [deprecated = true]; - * @deprecated - */ - deprecatedField4?: TestDeprecatedLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestDeprecatedLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "deprecated_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 2, name: "deprecated_field2", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 3, name: "deprecated_field3", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 4, name: "deprecated_field4", kind: "message", T: TestDeprecatedLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestDeprecatedLite { - return new TestDeprecatedLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestDeprecatedLite { - return new TestDeprecatedLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestDeprecatedLite { - return new TestDeprecatedLite().fromJsonString(jsonString, options); - } - - static equals(a: TestDeprecatedLite | PlainMessage | undefined, b: TestDeprecatedLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestDeprecatedLite, a, b); - } -} - -/** - * See the comments of the same type in unittest.proto. - * - * @generated from message protobuf_unittest.TestParsingMergeLite - */ -export class TestParsingMergeLite extends Message { - /** - * @generated from field: required protobuf_unittest.TestAllTypesLite required_all_types = 1; - */ - requiredAllTypes?: TestAllTypesLite; - - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite optional_all_types = 2; - */ - optionalAllTypes?: TestAllTypesLite; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite repeated_all_types = 3; - */ - repeatedAllTypes: TestAllTypesLite[] = []; - - /** - * @generated from field: optional protobuf_unittest.TestParsingMergeLite.OptionalGroup optionalgroup = 10; - */ - optionalgroup?: TestParsingMergeLite_OptionalGroup; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedGroup repeatedgroup = 20; - */ - repeatedgroup: TestParsingMergeLite_RepeatedGroup[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "required_all_types", kind: "message", T: TestAllTypesLite, req: true }, - { no: 2, name: "optional_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - { no: 3, name: "repeated_all_types", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 10, name: "optionalgroup", kind: "message", T: TestParsingMergeLite_OptionalGroup, delimited: true, opt: true }, - { no: 20, name: "repeatedgroup", kind: "message", T: TestParsingMergeLite_RepeatedGroup, delimited: true, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite { - return new TestParsingMergeLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite { - return new TestParsingMergeLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite { - return new TestParsingMergeLite().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite | PlainMessage | undefined, b: TestParsingMergeLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator - */ -export class TestParsingMergeLite_RepeatedFieldsGenerator extends Message { - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field1 = 1; - */ - field1: TestAllTypesLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field2 = 2; - */ - field2: TestAllTypesLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite field3 = 3; - */ - field3: TestAllTypesLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 group1 = 10; - */ - group1: TestParsingMergeLite_RepeatedFieldsGenerator_Group1[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 group2 = 20; - */ - group2: TestParsingMergeLite_RepeatedFieldsGenerator_Group2[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite ext1 = 1000; - */ - ext1: TestAllTypesLite[] = []; - - /** - * @generated from field: repeated protobuf_unittest.TestAllTypesLite ext2 = 1001; - */ - ext2: TestAllTypesLite[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "field1", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 2, name: "field2", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 3, name: "field3", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 10, name: "group1", kind: "message", T: TestParsingMergeLite_RepeatedFieldsGenerator_Group1, delimited: true, repeated: true }, - { no: 20, name: "group2", kind: "message", T: TestParsingMergeLite_RepeatedFieldsGenerator_Group2, delimited: true, repeated: true }, - { no: 1000, name: "ext1", kind: "message", T: TestAllTypesLite, repeated: true }, - { no: 1001, name: "ext2", kind: "message", T: TestAllTypesLite, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator { - return new TestParsingMergeLite_RepeatedFieldsGenerator().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator { - return new TestParsingMergeLite_RepeatedFieldsGenerator().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator { - return new TestParsingMergeLite_RepeatedFieldsGenerator().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite_RepeatedFieldsGenerator, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 - */ -export class TestParsingMergeLite_RepeatedFieldsGenerator_Group1 extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite field1 = 11; - */ - field1?: TestAllTypesLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 11, name: "field1", kind: "message", T: TestAllTypesLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group1().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group1().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group1 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group1().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator_Group1 | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator_Group1 | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite_RepeatedFieldsGenerator_Group1, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 - */ -export class TestParsingMergeLite_RepeatedFieldsGenerator_Group2 extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite field1 = 21; - */ - field1?: TestAllTypesLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 21, name: "field1", kind: "message", T: TestAllTypesLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group2().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group2().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedFieldsGenerator_Group2 { - return new TestParsingMergeLite_RepeatedFieldsGenerator_Group2().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite_RepeatedFieldsGenerator_Group2 | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedFieldsGenerator_Group2 | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite_RepeatedFieldsGenerator_Group2, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.OptionalGroup - */ -export class TestParsingMergeLite_OptionalGroup extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite optional_group_all_types = 11; - */ - optionalGroupAllTypes?: TestAllTypesLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.OptionalGroup"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 11, name: "optional_group_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_OptionalGroup { - return new TestParsingMergeLite_OptionalGroup().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_OptionalGroup { - return new TestParsingMergeLite_OptionalGroup().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_OptionalGroup { - return new TestParsingMergeLite_OptionalGroup().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite_OptionalGroup | PlainMessage | undefined, b: TestParsingMergeLite_OptionalGroup | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite_OptionalGroup, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestParsingMergeLite.RepeatedGroup - */ -export class TestParsingMergeLite_RepeatedGroup extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllTypesLite repeated_group_all_types = 21; - */ - repeatedGroupAllTypes?: TestAllTypesLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestParsingMergeLite.RepeatedGroup"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 21, name: "repeated_group_all_types", kind: "message", T: TestAllTypesLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestParsingMergeLite_RepeatedGroup { - return new TestParsingMergeLite_RepeatedGroup().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestParsingMergeLite_RepeatedGroup { - return new TestParsingMergeLite_RepeatedGroup().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestParsingMergeLite_RepeatedGroup { - return new TestParsingMergeLite_RepeatedGroup().fromJsonString(jsonString, options); - } - - static equals(a: TestParsingMergeLite_RepeatedGroup | PlainMessage | undefined, b: TestParsingMergeLite_RepeatedGroup | PlainMessage | undefined): boolean { - return proto2.util.equals(TestParsingMergeLite_RepeatedGroup, a, b); - } -} - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite optional_ext = 1000; - */ -export const TestParsingMergeLite_optional_ext = proto2.makeExtension( - "protobuf_unittest.TestParsingMergeLite.optional_ext", - TestParsingMergeLite, - () => ({ no: 1000, kind: "message", T: TestAllTypesLite, opt: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite repeated_ext = 1001; - */ -export const TestParsingMergeLite_repeated_ext = proto2.makeExtension( - "protobuf_unittest.TestParsingMergeLite.repeated_ext", - TestParsingMergeLite, - () => ({ no: 1001, kind: "message", T: TestAllTypesLite, repeated: true }), -); - -/** - * Test that the correct exception is thrown by parseFrom in a corner case - * involving merging, extensions, and required fields. - * - * @generated from message protobuf_unittest.TestMergeExceptionLite - */ -export class TestMergeExceptionLite extends Message { - /** - * @generated from field: optional protobuf_unittest.TestAllExtensionsLite all_extensions = 1; - */ - allExtensions?: TestAllExtensionsLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestMergeExceptionLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "all_extensions", kind: "message", T: TestAllExtensionsLite, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMergeExceptionLite { - return new TestMergeExceptionLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMergeExceptionLite { - return new TestMergeExceptionLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestMergeExceptionLite { - return new TestMergeExceptionLite().fromJsonString(jsonString, options); - } - - static equals(a: TestMergeExceptionLite | PlainMessage | undefined, b: TestMergeExceptionLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestMergeExceptionLite, a, b); - } -} - -/** - * TestEmptyMessageLite is used to test unknown fields support in lite mode. - * - * @generated from message protobuf_unittest.TestEmptyMessageLite - */ -export class TestEmptyMessageLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestEmptyMessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEmptyMessageLite { - return new TestEmptyMessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEmptyMessageLite { - return new TestEmptyMessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestEmptyMessageLite { - return new TestEmptyMessageLite().fromJsonString(jsonString, options); - } - - static equals(a: TestEmptyMessageLite | PlainMessage | undefined, b: TestEmptyMessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestEmptyMessageLite, a, b); - } -} - -/** - * Like above, but declare all field numbers as potential extensions. No - * actual extensions should ever be defined for this type. - * - * @generated from message protobuf_unittest.TestEmptyMessageWithExtensionsLite - */ -export class TestEmptyMessageWithExtensionsLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestEmptyMessageWithExtensionsLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestEmptyMessageWithExtensionsLite { - return new TestEmptyMessageWithExtensionsLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestEmptyMessageWithExtensionsLite { - return new TestEmptyMessageWithExtensionsLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestEmptyMessageWithExtensionsLite { - return new TestEmptyMessageWithExtensionsLite().fromJsonString(jsonString, options); - } - - static equals(a: TestEmptyMessageWithExtensionsLite | PlainMessage | undefined, b: TestEmptyMessageWithExtensionsLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestEmptyMessageWithExtensionsLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.V1MessageLite - */ -export class V1MessageLite extends Message { - /** - * @generated from field: required int32 int_field = 1; - */ - intField?: number; - - /** - * @generated from field: optional protobuf_unittest.V1EnumLite enum_field = 2 [default = V1_FIRST]; - */ - enumField?: V1EnumLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.V1MessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "enum_field", kind: "enum", T: proto2.getEnumType(V1EnumLite), opt: true, default: V1EnumLite.V1_FIRST }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): V1MessageLite { - return new V1MessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): V1MessageLite { - return new V1MessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): V1MessageLite { - return new V1MessageLite().fromJsonString(jsonString, options); - } - - static equals(a: V1MessageLite | PlainMessage | undefined, b: V1MessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(V1MessageLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.V2MessageLite - */ -export class V2MessageLite extends Message { - /** - * @generated from field: required int32 int_field = 1; - */ - intField?: number; - - /** - * @generated from field: optional protobuf_unittest.V2EnumLite enum_field = 2 [default = V2_FIRST]; - */ - enumField?: V2EnumLite; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.V2MessageLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "int_field", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 2, name: "enum_field", kind: "enum", T: proto2.getEnumType(V2EnumLite), opt: true, default: V2EnumLite.V2_FIRST }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): V2MessageLite { - return new V2MessageLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): V2MessageLite { - return new V2MessageLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): V2MessageLite { - return new V2MessageLite().fromJsonString(jsonString, options); - } - - static equals(a: V2MessageLite | PlainMessage | undefined, b: V2MessageLite | PlainMessage | undefined): boolean { - return proto2.util.equals(V2MessageLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite - */ -export class TestHugeFieldNumbersLite extends Message { - /** - * @generated from field: optional int32 optional_int32 = 536870000; - */ - optionalInt32?: number; - - /** - * @generated from field: optional int32 fixed_32 = 536870001; - */ - fixed32?: number; - - /** - * @generated from field: repeated int32 repeated_int32 = 536870002 [packed = false]; - */ - repeatedInt32: number[] = []; - - /** - * @generated from field: repeated int32 packed_int32 = 536870003 [packed = true]; - */ - packedInt32: number[] = []; - - /** - * @generated from field: optional protobuf_unittest.ForeignEnumLite optional_enum = 536870004; - */ - optionalEnum?: ForeignEnumLite; - - /** - * @generated from field: optional string optional_string = 536870005; - */ - optionalString?: string; - - /** - * @generated from field: optional bytes optional_bytes = 536870006; - */ - optionalBytes?: Uint8Array; - - /** - * @generated from field: optional protobuf_unittest.ForeignMessageLite optional_message = 536870007; - */ - optionalMessage?: ForeignMessageLite; - - /** - * @generated from field: optional protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup optionalgroup = 536870008; - */ - optionalgroup?: TestHugeFieldNumbersLite_OptionalGroup; - - /** - * @generated from field: map string_string_map = 536870010; - */ - stringStringMap: { [key: string]: string } = {}; - - /** - * @generated from oneof protobuf_unittest.TestHugeFieldNumbersLite.oneof_field - */ - oneofField: { - /** - * @generated from field: uint32 oneof_uint32 = 536870011; - */ - value: number; - case: "oneofUint32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite oneof_test_all_types = 536870012; - */ - value: TestAllTypesLite; - case: "oneofTestAllTypes"; - } | { - /** - * @generated from field: string oneof_string = 536870013; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 536870014; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestHugeFieldNumbersLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 536870000, name: "optional_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 536870001, name: "fixed_32", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - { no: 536870002, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - { no: 536870003, name: "packed_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - { no: 536870004, name: "optional_enum", kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }, - { no: 536870005, name: "optional_string", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 536870006, name: "optional_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 536870007, name: "optional_message", kind: "message", T: ForeignMessageLite, opt: true }, - { no: 536870008, name: "optionalgroup", kind: "message", T: TestHugeFieldNumbersLite_OptionalGroup, delimited: true, opt: true }, - { no: 536870010, name: "string_string_map", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 536870011, name: "oneof_uint32", kind: "scalar", T: 13 /* ScalarType.UINT32 */, oneof: "oneof_field" }, - { no: 536870012, name: "oneof_test_all_types", kind: "message", T: TestAllTypesLite, oneof: "oneof_field" }, - { no: 536870013, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 536870014, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestHugeFieldNumbersLite { - return new TestHugeFieldNumbersLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestHugeFieldNumbersLite { - return new TestHugeFieldNumbersLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestHugeFieldNumbersLite { - return new TestHugeFieldNumbersLite().fromJsonString(jsonString, options); - } - - static equals(a: TestHugeFieldNumbersLite | PlainMessage | undefined, b: TestHugeFieldNumbersLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestHugeFieldNumbersLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup - */ -export class TestHugeFieldNumbersLite_OptionalGroup extends Message { - /** - * @generated from field: optional int32 group_a = 536870009; - */ - groupA?: number; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestHugeFieldNumbersLite.OptionalGroup"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 536870009, name: "group_a", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup { - return new TestHugeFieldNumbersLite_OptionalGroup().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup { - return new TestHugeFieldNumbersLite_OptionalGroup().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestHugeFieldNumbersLite_OptionalGroup { - return new TestHugeFieldNumbersLite_OptionalGroup().fromJsonString(jsonString, options); - } - - static equals(a: TestHugeFieldNumbersLite_OptionalGroup | PlainMessage | undefined, b: TestHugeFieldNumbersLite_OptionalGroup | PlainMessage | undefined): boolean { - return proto2.util.equals(TestHugeFieldNumbersLite_OptionalGroup, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestOneofParsingLite - */ -export class TestOneofParsingLite extends Message { - /** - * @generated from oneof protobuf_unittest.TestOneofParsingLite.oneof_field - */ - oneofField: { - /** - * @generated from field: int32 oneof_int32 = 1; - */ - value: number; - case: "oneofInt32"; - } | { - /** - * @generated from field: protobuf_unittest.TestAllTypesLite oneof_submessage = 2; - */ - value: TestAllTypesLite; - case: "oneofSubmessage"; - } | { - /** - * @generated from field: string oneof_string = 3; - */ - value: string; - case: "oneofString"; - } | { - /** - * @generated from field: bytes oneof_bytes = 4 [default = "default bytes"]; - */ - value: Uint8Array; - case: "oneofBytes"; - } | { - /** - * @generated from field: string oneof_string_cord = 5 [default = "default Cord"]; - */ - value: string; - case: "oneofStringCord"; - } | { - /** - * @generated from field: bytes oneof_bytes_cord = 6; - */ - value: Uint8Array; - case: "oneofBytesCord"; - } | { - /** - * @generated from field: string oneof_string_string_piece = 7; - */ - value: string; - case: "oneofStringStringPiece"; - } | { - /** - * @generated from field: bytes oneof_bytes_string_piece = 8 [default = "default StringPiece"]; - */ - value: Uint8Array; - case: "oneofBytesStringPiece"; - } | { - /** - * @generated from field: protobuf_unittest.V2EnumLite oneof_enum = 9; - */ - value: V2EnumLite; - case: "oneofEnum"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestOneofParsingLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "oneof_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, oneof: "oneof_field" }, - { no: 2, name: "oneof_submessage", kind: "message", T: TestAllTypesLite, oneof: "oneof_field" }, - { no: 3, name: "oneof_string", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 4, name: "oneof_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, default: new Uint8Array([0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73]), oneof: "oneof_field" }, - { no: 5, name: "oneof_string_cord", kind: "scalar", T: 9 /* ScalarType.STRING */, default: "default Cord", oneof: "oneof_field" }, - { no: 6, name: "oneof_bytes_cord", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "oneof_field" }, - { no: 7, name: "oneof_string_string_piece", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "oneof_field" }, - { no: 8, name: "oneof_bytes_string_piece", kind: "scalar", T: 12 /* ScalarType.BYTES */, default: new Uint8Array([0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x50, 0x69, 0x65, 0x63, 0x65]), oneof: "oneof_field" }, - { no: 9, name: "oneof_enum", kind: "enum", T: proto2.getEnumType(V2EnumLite), oneof: "oneof_field" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestOneofParsingLite { - return new TestOneofParsingLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestOneofParsingLite { - return new TestOneofParsingLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestOneofParsingLite { - return new TestOneofParsingLite().fromJsonString(jsonString, options); - } - - static equals(a: TestOneofParsingLite | PlainMessage | undefined, b: TestOneofParsingLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestOneofParsingLite, a, b); - } -} - -/** - * @generated from message protobuf_unittest.TestMessageSetLite - */ -export class TestMessageSetLite extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.TestMessageSetLite"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TestMessageSetLite { - return new TestMessageSetLite().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TestMessageSetLite { - return new TestMessageSetLite().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TestMessageSetLite { - return new TestMessageSetLite().fromJsonString(jsonString, options); - } - - static equals(a: TestMessageSetLite | PlainMessage | undefined, b: TestMessageSetLite | PlainMessage | undefined): boolean { - return proto2.util.equals(TestMessageSetLite, a, b); - } -} - -/** - * The following four messages are set up to test for wire compatibility between - * packed and non-packed repeated fields. We use the field number 2048, because - * that is large enough to require a 3-byte varint for the tag. - * - * @generated from message protobuf_unittest.PackedInt32 - */ -export class PackedInt32 extends Message { - /** - * @generated from field: repeated int32 repeated_int32 = 2048 [packed = true]; - */ - repeatedInt32: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.PackedInt32"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2048, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PackedInt32 { - return new PackedInt32().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PackedInt32 { - return new PackedInt32().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PackedInt32 { - return new PackedInt32().fromJsonString(jsonString, options); - } - - static equals(a: PackedInt32 | PlainMessage | undefined, b: PackedInt32 | PlainMessage | undefined): boolean { - return proto2.util.equals(PackedInt32, a, b); - } -} - -/** - * @generated from message protobuf_unittest.NonPackedInt32 - */ -export class NonPackedInt32 extends Message { - /** - * @generated from field: repeated int32 repeated_int32 = 2048; - */ - repeatedInt32: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.NonPackedInt32"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2048, name: "repeated_int32", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NonPackedInt32 { - return new NonPackedInt32().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NonPackedInt32 { - return new NonPackedInt32().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NonPackedInt32 { - return new NonPackedInt32().fromJsonString(jsonString, options); - } - - static equals(a: NonPackedInt32 | PlainMessage | undefined, b: NonPackedInt32 | PlainMessage | undefined): boolean { - return proto2.util.equals(NonPackedInt32, a, b); - } -} - -/** - * @generated from message protobuf_unittest.PackedFixed32 - */ -export class PackedFixed32 extends Message { - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 2048 [packed = true]; - */ - repeatedFixed32: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.PackedFixed32"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2048, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PackedFixed32 { - return new PackedFixed32().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PackedFixed32 { - return new PackedFixed32().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PackedFixed32 { - return new PackedFixed32().fromJsonString(jsonString, options); - } - - static equals(a: PackedFixed32 | PlainMessage | undefined, b: PackedFixed32 | PlainMessage | undefined): boolean { - return proto2.util.equals(PackedFixed32, a, b); - } -} - -/** - * @generated from message protobuf_unittest.NonPackedFixed32 - */ -export class NonPackedFixed32 extends Message { - /** - * @generated from field: repeated fixed32 repeated_fixed32 = 2048; - */ - repeatedFixed32: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.NonPackedFixed32"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2048, name: "repeated_fixed32", kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NonPackedFixed32 { - return new NonPackedFixed32().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NonPackedFixed32 { - return new NonPackedFixed32().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NonPackedFixed32 { - return new NonPackedFixed32().fromJsonString(jsonString, options); - } - - static equals(a: NonPackedFixed32 | PlainMessage | undefined, b: NonPackedFixed32 | PlainMessage | undefined): boolean { - return proto2.util.equals(NonPackedFixed32, a, b); - } -} - -/** - * Test an enum that has multiple values with the same number. - * - * @generated from message protobuf_unittest.DupEnum - */ -export class DupEnum extends Message { - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.DupEnum"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DupEnum { - return new DupEnum().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DupEnum { - return new DupEnum().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DupEnum { - return new DupEnum().fromJsonString(jsonString, options); - } - - static equals(a: DupEnum | PlainMessage | undefined, b: DupEnum | PlainMessage | undefined): boolean { - return proto2.util.equals(DupEnum, a, b); - } -} - -/** - * @generated from enum protobuf_unittest.DupEnum.TestEnumWithDupValueLite - */ -export enum DupEnum_TestEnumWithDupValueLite { - /** - * @generated from enum value: FOO1 = 1; - */ - FOO1 = 1, - - /** - * @generated from enum value: BAR1 = 2; - */ - BAR1 = 2, - - /** - * @generated from enum value: BAZ = 3; - */ - BAZ = 3, - - /** - * @generated from enum value: FOO2 = 1; - */ - FOO2 = 1, - - /** - * @generated from enum value: BAR2 = 2; - */ - BAR2 = 2, -} -// Retrieve enum metadata with: proto2.getEnumType(DupEnum_TestEnumWithDupValueLite) -proto2.util.setEnumType(DupEnum_TestEnumWithDupValueLite, "protobuf_unittest.DupEnum.TestEnumWithDupValueLite", [ - { no: 1, name: "FOO1" }, - { no: 2, name: "BAR1" }, - { no: 3, name: "BAZ" }, - { no: 1, name: "FOO2" }, - { no: 2, name: "BAR2" }, -]); - -/** - * @generated from message protobuf_unittest.RecursiveMessage - */ -export class RecursiveMessage extends Message { - /** - * @generated from field: optional protobuf_unittest.RecursiveMessage recurse = 1; - */ - recurse?: RecursiveMessage; - - /** - * @generated from field: optional bytes payload = 2; - */ - payload?: Uint8Array; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "protobuf_unittest.RecursiveMessage"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "recurse", kind: "message", T: RecursiveMessage, opt: true }, - { no: 2, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RecursiveMessage { - return new RecursiveMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RecursiveMessage { - return new RecursiveMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RecursiveMessage { - return new RecursiveMessage().fromJsonString(jsonString, options); - } - - static equals(a: RecursiveMessage | PlainMessage | undefined, b: RecursiveMessage | PlainMessage | undefined): boolean { - return proto2.util.equals(RecursiveMessage, a, b); - } -} - -/** - * Singular - * - * @generated from extension: optional int32 optional_int32_extension_lite = 1; - */ -export const optional_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_int32_extension_lite", - TestAllExtensionsLite, - { no: 1, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, -); - -/** - * @generated from extension: optional int64 optional_int64_extension_lite = 2; - */ -export const optional_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_int64_extension_lite", - TestAllExtensionsLite, - { no: 2, kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, -); - -/** - * @generated from extension: optional uint32 optional_uint32_extension_lite = 3; - */ -export const optional_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_uint32_extension_lite", - TestAllExtensionsLite, - { no: 3, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, -); - -/** - * @generated from extension: optional uint64 optional_uint64_extension_lite = 4; - */ -export const optional_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_uint64_extension_lite", - TestAllExtensionsLite, - { no: 4, kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, -); - -/** - * @generated from extension: optional sint32 optional_sint32_extension_lite = 5; - */ -export const optional_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sint32_extension_lite", - TestAllExtensionsLite, - { no: 5, kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true }, -); - -/** - * @generated from extension: optional sint64 optional_sint64_extension_lite = 6; - */ -export const optional_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sint64_extension_lite", - TestAllExtensionsLite, - { no: 6, kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true }, -); - -/** - * @generated from extension: optional fixed32 optional_fixed32_extension_lite = 7; - */ -export const optional_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 7, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true }, -); - -/** - * @generated from extension: optional fixed64 optional_fixed64_extension_lite = 8; - */ -export const optional_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 8, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true }, -); - -/** - * @generated from extension: optional sfixed32 optional_sfixed32_extension_lite = 9; - */ -export const optional_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 9, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true }, -); - -/** - * @generated from extension: optional sfixed64 optional_sfixed64_extension_lite = 10; - */ -export const optional_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 10, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true }, -); - -/** - * @generated from extension: optional float optional_float_extension_lite = 11; - */ -export const optional_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_float_extension_lite", - TestAllExtensionsLite, - { no: 11, kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true }, -); - -/** - * @generated from extension: optional double optional_double_extension_lite = 12; - */ -export const optional_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_double_extension_lite", - TestAllExtensionsLite, - { no: 12, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true }, -); - -/** - * @generated from extension: optional bool optional_bool_extension_lite = 13; - */ -export const optional_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_bool_extension_lite", - TestAllExtensionsLite, - { no: 13, kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, -); - -/** - * @generated from extension: optional string optional_string_extension_lite = 14; - */ -export const optional_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_string_extension_lite", - TestAllExtensionsLite, - { no: 14, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional bytes optional_bytes_extension_lite = 15; - */ -export const optional_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_bytes_extension_lite", - TestAllExtensionsLite, - { no: 15, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest.OptionalGroup_extension_lite optionalgroup_extension_lite = 16; - */ -export const optionalgroup_extension_lite = proto2.makeExtension( - "protobuf_unittest.optionalgroup_extension_lite", - TestAllExtensionsLite, - () => ({ no: 16, kind: "message", T: OptionalGroup_extension_lite, delimited: true, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_nested_message_extension_lite = 18; - */ -export const optional_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 18, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignMessageLite optional_foreign_message_extension_lite = 19; - */ -export const optional_foreign_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_foreign_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 19, kind: "message", T: ForeignMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportMessageLite optional_import_message_extension_lite = 20; - */ -export const optional_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 20, kind: "message", T: ImportMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - */ -export const optional_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 21, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite optional_foreign_enum_extension_lite = 22; - */ -export const optional_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 22, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite optional_import_enum_extension_lite = 23; - */ -export const optional_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 23, kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true }), -); - -/** - * @generated from extension: optional string optional_string_piece_extension_lite = 24; - */ -export const optional_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 24, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string optional_cord_extension_lite = 25; - */ -export const optional_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_cord_extension_lite", - TestAllExtensionsLite, - { no: 25, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest_import.PublicImportMessageLite optional_public_import_message_extension_lite = 26; - */ -export const optional_public_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_public_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 26, kind: "message", T: PublicImportMessageLite, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_lazy_message_extension_lite = 27; - */ -export const optional_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 27, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage optional_unverified_lazy_message_extension_lite = 28; - */ -export const optional_unverified_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.optional_unverified_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 28, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * Repeated - * - * @generated from extension: repeated int32 repeated_int32_extension_lite = 31; - */ -export const repeated_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_int32_extension_lite", - TestAllExtensionsLite, - { no: 31, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated int64 repeated_int64_extension_lite = 32; - */ -export const repeated_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_int64_extension_lite", - TestAllExtensionsLite, - { no: 32, kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated uint32 repeated_uint32_extension_lite = 33; - */ -export const repeated_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_uint32_extension_lite", - TestAllExtensionsLite, - { no: 33, kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated uint64 repeated_uint64_extension_lite = 34; - */ -export const repeated_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_uint64_extension_lite", - TestAllExtensionsLite, - { no: 34, kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated sint32 repeated_sint32_extension_lite = 35; - */ -export const repeated_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sint32_extension_lite", - TestAllExtensionsLite, - { no: 35, kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true }, -); - -/** - * @generated from extension: repeated sint64 repeated_sint64_extension_lite = 36; - */ -export const repeated_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sint64_extension_lite", - TestAllExtensionsLite, - { no: 36, kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true }, -); - -/** - * @generated from extension: repeated fixed32 repeated_fixed32_extension_lite = 37; - */ -export const repeated_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 37, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true }, -); - -/** - * @generated from extension: repeated fixed64 repeated_fixed64_extension_lite = 38; - */ -export const repeated_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 38, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true }, -); - -/** - * @generated from extension: repeated sfixed32 repeated_sfixed32_extension_lite = 39; - */ -export const repeated_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 39, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true }, -); - -/** - * @generated from extension: repeated sfixed64 repeated_sfixed64_extension_lite = 40; - */ -export const repeated_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 40, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true }, -); - -/** - * @generated from extension: repeated float repeated_float_extension_lite = 41; - */ -export const repeated_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_float_extension_lite", - TestAllExtensionsLite, - { no: 41, kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true }, -); - -/** - * @generated from extension: repeated double repeated_double_extension_lite = 42; - */ -export const repeated_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_double_extension_lite", - TestAllExtensionsLite, - { no: 42, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true }, -); - -/** - * @generated from extension: repeated bool repeated_bool_extension_lite = 43; - */ -export const repeated_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_bool_extension_lite", - TestAllExtensionsLite, - { no: 43, kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true }, -); - -/** - * @generated from extension: repeated string repeated_string_extension_lite = 44; - */ -export const repeated_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_string_extension_lite", - TestAllExtensionsLite, - { no: 44, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * @generated from extension: repeated bytes repeated_bytes_extension_lite = 45; - */ -export const repeated_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_bytes_extension_lite", - TestAllExtensionsLite, - { no: 45, kind: "scalar", T: 12 /* ScalarType.BYTES */, repeated: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.RepeatedGroup_extension_lite repeatedgroup_extension_lite = 46; - */ -export const repeatedgroup_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeatedgroup_extension_lite", - TestAllExtensionsLite, - () => ({ no: 46, kind: "message", T: RepeatedGroup_extension_lite, delimited: true, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite = 48; - */ -export const repeated_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 48, kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignMessageLite repeated_foreign_message_extension_lite = 49; - */ -export const repeated_foreign_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_foreign_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 49, kind: "message", T: ForeignMessageLite, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportMessageLite repeated_import_message_extension_lite = 50; - */ -export const repeated_import_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_import_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 50, kind: "message", T: ImportMessageLite, repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - */ -export const repeated_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 51, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - */ -export const repeated_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 52, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true }), -); - -/** - * @generated from extension: repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum_extension_lite = 53; - */ -export const repeated_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 53, kind: "enum", T: proto2.getEnumType(ImportEnumLite), repeated: true }), -); - -/** - * @generated from extension: repeated string repeated_string_piece_extension_lite = 54; - */ -export const repeated_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 54, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: repeated string repeated_cord_extension_lite = 55; - */ -export const repeated_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_cord_extension_lite", - TestAllExtensionsLite, - { no: 55, kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.TestAllTypesLite.NestedMessage repeated_lazy_message_extension_lite = 57; - */ -export const repeated_lazy_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.repeated_lazy_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 57, kind: "message", T: TestAllTypesLite_NestedMessage, repeated: true }), -); - -/** - * Singular with defaults - * - * @generated from extension: optional int32 default_int32_extension_lite = 61 [default = 41]; - */ -export const default_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_int32_extension_lite", - TestAllExtensionsLite, - { no: 61, kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true, default: 41 }, -); - -/** - * @generated from extension: optional int64 default_int64_extension_lite = 62 [default = 42]; - */ -export const default_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_int64_extension_lite", - TestAllExtensionsLite, - { no: 62, kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true, default: protoInt64.parse("42") }, -); - -/** - * @generated from extension: optional uint32 default_uint32_extension_lite = 63 [default = 43]; - */ -export const default_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_uint32_extension_lite", - TestAllExtensionsLite, - { no: 63, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true, default: 43 }, -); - -/** - * @generated from extension: optional uint64 default_uint64_extension_lite = 64 [default = 44]; - */ -export const default_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_uint64_extension_lite", - TestAllExtensionsLite, - { no: 64, kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true, default: protoInt64.uParse("44") }, -); - -/** - * @generated from extension: optional sint32 default_sint32_extension_lite = 65 [default = -45]; - */ -export const default_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sint32_extension_lite", - TestAllExtensionsLite, - { no: 65, kind: "scalar", T: 17 /* ScalarType.SINT32 */, opt: true, default: -45 }, -); - -/** - * @generated from extension: optional sint64 default_sint64_extension_lite = 66 [default = 46]; - */ -export const default_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sint64_extension_lite", - TestAllExtensionsLite, - { no: 66, kind: "scalar", T: 18 /* ScalarType.SINT64 */, opt: true, default: protoInt64.parse("46") }, -); - -/** - * @generated from extension: optional fixed32 default_fixed32_extension_lite = 67 [default = 47]; - */ -export const default_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_fixed32_extension_lite", - TestAllExtensionsLite, - { no: 67, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, opt: true, default: 47 }, -); - -/** - * @generated from extension: optional fixed64 default_fixed64_extension_lite = 68 [default = 48]; - */ -export const default_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_fixed64_extension_lite", - TestAllExtensionsLite, - { no: 68, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, opt: true, default: protoInt64.uParse("48") }, -); - -/** - * @generated from extension: optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49]; - */ -export const default_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sfixed32_extension_lite", - TestAllExtensionsLite, - { no: 69, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, opt: true, default: 49 }, -); - -/** - * @generated from extension: optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50]; - */ -export const default_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_sfixed64_extension_lite", - TestAllExtensionsLite, - { no: 70, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, opt: true, default: protoInt64.parse("-50") }, -); - -/** - * @generated from extension: optional float default_float_extension_lite = 71 [default = 51.5]; - */ -export const default_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_float_extension_lite", - TestAllExtensionsLite, - { no: 71, kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true, default: 51.5 }, -); - -/** - * @generated from extension: optional double default_double_extension_lite = 72 [default = 52000]; - */ -export const default_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_double_extension_lite", - TestAllExtensionsLite, - { no: 72, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true, default: 52000 }, -); - -/** - * @generated from extension: optional bool default_bool_extension_lite = 73 [default = true]; - */ -export const default_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_bool_extension_lite", - TestAllExtensionsLite, - { no: 73, kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true }, -); - -/** - * @generated from extension: optional string default_string_extension_lite = 74 [default = "hello"]; - */ -export const default_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_string_extension_lite", - TestAllExtensionsLite, - { no: 74, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "hello" }, -); - -/** - * @generated from extension: optional bytes default_bytes_extension_lite = 75 [default = "world"]; - */ -export const default_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_bytes_extension_lite", - TestAllExtensionsLite, - { no: 75, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true, default: new Uint8Array([0x77, 0x6F, 0x72, 0x6C, 0x64]) }, -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedEnum default_nested_enum_extension_lite = 81 [default = BAR]; - */ -export const default_nested_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_nested_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 81, kind: "enum", T: proto2.getEnumType(TestAllTypesLite_NestedEnum), opt: true, default: TestAllTypesLite_NestedEnum.BAR }), -); - -/** - * @generated from extension: optional protobuf_unittest.ForeignEnumLite default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - */ -export const default_foreign_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_foreign_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 82, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), opt: true, default: ForeignEnumLite.FOREIGN_LITE_BAR }), -); - -/** - * @generated from extension: optional protobuf_unittest_import.ImportEnumLite default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - */ -export const default_import_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_import_enum_extension_lite", - TestAllExtensionsLite, - () => ({ no: 83, kind: "enum", T: proto2.getEnumType(ImportEnumLite), opt: true, default: ImportEnumLite.IMPORT_LITE_BAR }), -); - -/** - * @generated from extension: optional string default_string_piece_extension_lite = 84 [default = "abc"]; - */ -export const default_string_piece_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_string_piece_extension_lite", - TestAllExtensionsLite, - { no: 84, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "abc" }, -); - -/** - * TODO: ctype=CORD is not supported for extension. Add - * ctype=CORD option back after it is supported. - * - * @generated from extension: optional string default_cord_extension_lite = 85 [default = "123"]; - */ -export const default_cord_extension_lite = proto2.makeExtension( - "protobuf_unittest.default_cord_extension_lite", - TestAllExtensionsLite, - { no: 85, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true, default: "123" }, -); - -/** - * For oneof test - * - * @generated from extension: optional uint32 oneof_uint32_extension_lite = 111; - */ -export const oneof_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_uint32_extension_lite", - TestAllExtensionsLite, - { no: 111, kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite.NestedMessage oneof_nested_message_extension_lite = 112; - */ -export const oneof_nested_message_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_nested_message_extension_lite", - TestAllExtensionsLite, - () => ({ no: 112, kind: "message", T: TestAllTypesLite_NestedMessage, opt: true }), -); - -/** - * @generated from extension: optional string oneof_string_extension_lite = 113; - */ -export const oneof_string_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_string_extension_lite", - TestAllExtensionsLite, - { no: 113, kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, -); - -/** - * @generated from extension: optional bytes oneof_bytes_extension_lite = 114; - */ -export const oneof_bytes_extension_lite = proto2.makeExtension( - "protobuf_unittest.oneof_bytes_extension_lite", - TestAllExtensionsLite, - { no: 114, kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, -); - -/** - * @generated from extension: repeated int32 packed_int32_extension_lite = 90 [packed = true]; - */ -export const packed_int32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_int32_extension_lite", - TestPackedExtensionsLite, - { no: 90, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated int64 packed_int64_extension_lite = 91 [packed = true]; - */ -export const packed_int64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_int64_extension_lite", - TestPackedExtensionsLite, - { no: 91, kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - */ -export const packed_uint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_uint32_extension_lite", - TestPackedExtensionsLite, - { no: 92, kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - */ -export const packed_uint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_uint64_extension_lite", - TestPackedExtensionsLite, - { no: 93, kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - */ -export const packed_sint32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sint32_extension_lite", - TestPackedExtensionsLite, - { no: 94, kind: "scalar", T: 17 /* ScalarType.SINT32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - */ -export const packed_sint64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sint64_extension_lite", - TestPackedExtensionsLite, - { no: 95, kind: "scalar", T: 18 /* ScalarType.SINT64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - */ -export const packed_fixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_fixed32_extension_lite", - TestPackedExtensionsLite, - { no: 96, kind: "scalar", T: 7 /* ScalarType.FIXED32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - */ -export const packed_fixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_fixed64_extension_lite", - TestPackedExtensionsLite, - { no: 97, kind: "scalar", T: 6 /* ScalarType.FIXED64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - */ -export const packed_sfixed32_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sfixed32_extension_lite", - TestPackedExtensionsLite, - { no: 98, kind: "scalar", T: 15 /* ScalarType.SFIXED32 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - */ -export const packed_sfixed64_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_sfixed64_extension_lite", - TestPackedExtensionsLite, - { no: 99, kind: "scalar", T: 16 /* ScalarType.SFIXED64 */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated float packed_float_extension_lite = 100 [packed = true]; - */ -export const packed_float_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_float_extension_lite", - TestPackedExtensionsLite, - { no: 100, kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated double packed_double_extension_lite = 101 [packed = true]; - */ -export const packed_double_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_double_extension_lite", - TestPackedExtensionsLite, - { no: 101, kind: "scalar", T: 1 /* ScalarType.DOUBLE */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated bool packed_bool_extension_lite = 102 [packed = true]; - */ -export const packed_bool_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_bool_extension_lite", - TestPackedExtensionsLite, - { no: 102, kind: "scalar", T: 8 /* ScalarType.BOOL */, repeated: true, packed: true }, -); - -/** - * @generated from extension: repeated protobuf_unittest.ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; - */ -export const packed_enum_extension_lite = proto2.makeExtension( - "protobuf_unittest.packed_enum_extension_lite", - TestPackedExtensionsLite, - () => ({ no: 103, kind: "enum", T: proto2.getEnumType(ForeignEnumLite), repeated: true, packed: true }), -); - -/** - * @generated from extension: optional protobuf_unittest.TestAllTypesLite test_all_types_lite = 536860000; - */ -export const test_all_types_lite = proto2.makeExtension( - "protobuf_unittest.test_all_types_lite", - TestHugeFieldNumbersLite, - () => ({ no: 536860000, kind: "message", T: TestAllTypesLite, opt: true }), -); - diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_pb.ts index f4ebca5d2..7143cfb39 100644 --- a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_pb.ts +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_pb.ts @@ -5859,6 +5859,11 @@ export class TestOneof2_NestedMessage extends Message */ corgeInt: number[] = []; + /** + * @generated from field: optional protobuf_unittest.TestOneof2.NestedMessage child = 3; + */ + child?: TestOneof2_NestedMessage; + constructor(data?: PartialMessage) { super(); proto2.util.initPartial(data, this); @@ -5869,6 +5874,7 @@ export class TestOneof2_NestedMessage extends Message static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "moo_int", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, { no: 2, name: "corge_int", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + { no: 3, name: "child", kind: "message", T: TestOneof2_NestedMessage, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TestOneof2_NestedMessage { diff --git a/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_proto3_extensions_pb.ts b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_proto3_extensions_pb.ts new file mode 100644 index 000000000..f18b8610b --- /dev/null +++ b/packages/protobuf-test/src/gen/ts/google/protobuf/unittest_proto3_extensions_pb.ts @@ -0,0 +1,72 @@ +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.9.0 with parameter "ts_nocheck=false,target=ts" +// @generated from file google/protobuf/unittest_proto3_extensions.proto (package protobuf_unittest, syntax proto3) +/* eslint-disable */ + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { FileOptions, Message, proto3 } from "@bufbuild/protobuf"; + +/** + * For testing proto3 extension behaviors. + * + * @generated from message protobuf_unittest.Proto3FileExtensions + */ +export class Proto3FileExtensions extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "protobuf_unittest.Proto3FileExtensions"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Proto3FileExtensions { + return new Proto3FileExtensions().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Proto3FileExtensions { + return new Proto3FileExtensions().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Proto3FileExtensions { + return new Proto3FileExtensions().fromJsonString(jsonString, options); + } + + static equals(a: Proto3FileExtensions | PlainMessage | undefined, b: Proto3FileExtensions | PlainMessage | undefined): boolean { + return proto3.util.equals(Proto3FileExtensions, a, b); + } +} + +/** + * @generated from extension: int32 singular_int = 1001; + */ +export const Proto3FileExtensions_singular_int = proto3.makeExtension( + "protobuf_unittest.Proto3FileExtensions.singular_int", + FileOptions, + { no: 1001, kind: "scalar", T: 5 /* ScalarType.INT32 */ }, +); + +/** + * @generated from extension: repeated int32 repeated_int = 1002; + */ +export const Proto3FileExtensions_repeated_int = proto3.makeExtension( + "protobuf_unittest.Proto3FileExtensions.repeated_int", + FileOptions, + { no: 1002, kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, +); + diff --git a/packages/protobuf/src/google/protobuf/descriptor_pb.ts b/packages/protobuf/src/google/protobuf/descriptor_pb.ts index 8874ad307..6d2772351 100644 --- a/packages/protobuf/src/google/protobuf/descriptor_pb.ts +++ b/packages/protobuf/src/google/protobuf/descriptor_pb.ts @@ -44,6 +44,14 @@ export enum Edition { */ EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** * Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto @@ -113,6 +121,7 @@ export enum Edition { // Retrieve enum metadata with: proto2.getEnumType(Edition) proto2.util.setEnumType(Edition, "google.protobuf.Edition", [ { no: 0, name: "EDITION_UNKNOWN" }, + { no: 900, name: "EDITION_LEGACY" }, { no: 998, name: "EDITION_PROTO2" }, { no: 999, name: "EDITION_PROTO3" }, { no: 1000, name: "EDITION_2023" }, @@ -1379,12 +1388,16 @@ export class FileOptions extends Message { javaGenerateEqualsAndHash?: boolean; /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; */ @@ -1878,6 +1891,11 @@ export class FieldOptions extends Message { */ features?: FeatureSet; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -1905,6 +1923,7 @@ export class FieldOptions extends Message { { no: 19, name: "targets", kind: "enum", T: proto2.getEnumType(FieldOptions_OptionTargetType), repeated: true }, { no: 20, name: "edition_defaults", kind: "message", T: FieldOptions_EditionDefault, repeated: true }, { no: 21, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 22, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ]); @@ -2140,6 +2159,77 @@ export class FieldOptions_EditionDefault extends Message { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: Edition; + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: Edition; + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: Edition; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "google.protobuf.FieldOptions.FeatureSupport"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "edition_introduced", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 2, name: "edition_deprecated", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + { no: 3, name: "deprecation_warning", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "edition_removed", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FieldOptions_FeatureSupport { + return new FieldOptions_FeatureSupport().fromJsonString(jsonString, options); + } + + static equals(a: FieldOptions_FeatureSupport | PlainMessage | undefined, b: FieldOptions_FeatureSupport | PlainMessage | undefined): boolean { + return proto2.util.equals(FieldOptions_FeatureSupport, a, b); + } +} + /** * @generated from message google.protobuf.OneofOptions */ @@ -2298,6 +2388,13 @@ export class EnumValueOptions extends Message { */ debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** * The parser stores options it doesn't recognize here. See above. * @@ -2316,6 +2413,7 @@ export class EnumValueOptions extends Message { { no: 1, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, { no: 3, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 4, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, ]); @@ -2935,9 +3033,18 @@ export class FeatureSetDefaults_FeatureSetEditionDefault extends Message) { super(); @@ -2948,7 +3055,8 @@ export class FeatureSetDefaults_FeatureSetEditionDefault extends Message [ { no: 3, name: "edition", kind: "enum", T: proto2.getEnumType(Edition), opt: true }, - { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 4, name: "overridable_features", kind: "message", T: FeatureSet, opt: true }, + { no: 5, name: "fixed_features", kind: "message", T: FeatureSet, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FeatureSetDefaults_FeatureSetEditionDefault { diff --git a/packages/protobuf/src/private/feature-set.ts b/packages/protobuf/src/private/feature-set.ts index 8ad867f6a..9900fd0c3 100644 --- a/packages/protobuf/src/private/feature-set.ts +++ b/packages/protobuf/src/private/feature-set.ts @@ -31,7 +31,7 @@ function getFeatureSetDefaults( ): FeatureSetDefaults { return FeatureSetDefaults.fromBinary( protoBase64.dec( - /*upstream-inject-feature-defaults-start*/ "ChESDAgBEAIYAiADKAEwAhjmBwoREgwIAhABGAEgAigBMAEY5wcKERIMCAEQARgBIAIoATABGOgHIOYHKOgH" /*upstream-inject-feature-defaults-end*/, + /*upstream-inject-feature-defaults-start*/ "ChMY5gciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH" /*upstream-inject-feature-defaults-end*/, ), options, ); @@ -93,9 +93,20 @@ export function createFeatureResolver( if (highestMatch !== undefined && highestMatch.e > e) { continue; } + let f: FeatureSet; + if (c.fixedFeatures && c.overridableFeatures) { + f = c.fixedFeatures; + f.fromBinary(c.overridableFeatures.toBinary()); + } else if (c.fixedFeatures) { + f = c.fixedFeatures; + } else if (c.overridableFeatures) { + f = c.overridableFeatures; + } else { + f = new FeatureSet(); + } highestMatch = { e, - f: c.features ?? new FeatureSet(), + f, }; } if (highestMatch === undefined) { diff --git a/packages/upstream-protobuf/bin/protoc-gen-dumpcodegenreq.mjs b/packages/upstream-protobuf/bin/protoc-gen-dumpcodegenreq.mjs index 1993d203f..f53b15200 100755 --- a/packages/upstream-protobuf/bin/protoc-gen-dumpcodegenreq.mjs +++ b/packages/upstream-protobuf/bin/protoc-gen-dumpcodegenreq.mjs @@ -21,8 +21,20 @@ import { stdin, stdout } from "node:process"; stdin.pipe(createWriteStream("dumpcodegenreq.binpb")); // Write a minimal a google.protobuf.CodeGenerateResponse to stdout. -// This is just the field supported_features set to a bitwise "or" of -// FEATURE_PROTO3_OPTIONAL and FEATURE_SUPPORTS_EDITIONS. See the code snippet -// below. -const minimalResponse = new Uint8Array([16, 3]); +/* +import {CodeGeneratorResponse_Feature, CodeGeneratorResponse, Edition} from "@bufbuild/protobuf"; +const res = new CodeGeneratorResponse({ + supportedFeatures: BigInt( + CodeGeneratorResponse_Feature.SUPPORTS_EDITIONS | CodeGeneratorResponse_Feature.PROTO3_OPTIONAL + ), + minimumEdition: Edition.EDITION_LEGACY, + maximumEdition: Edition.EDITION_MAX, +}); +console.log( + res.toBinary() +); +*/ +const minimalResponse = new Uint8Array([ + 16, 3, 24, 132, 7, 32, 255, 255, 255, 255, 7, +]); stdout.write(minimalResponse); diff --git a/packages/upstream-protobuf/index.mjs b/packages/upstream-protobuf/index.mjs index 6bd3adf05..f42d7c3e1 100644 --- a/packages/upstream-protobuf/index.mjs +++ b/packages/upstream-protobuf/index.mjs @@ -61,16 +61,6 @@ export class UpstreamProtobuf { "!google/protobuf/*_features.proto", ]; - // TODO add the following files again once we have sufficient support for editions: - // - google/protobuf/unittest_preserve_unknown_enum2.proto - // - google/protobuf/unittest_preserve_unknown_enum.proto - // - google/protobuf/unittest_no_field_presence.proto - // - google/protobuf/unittest_lazy_dependencies_enum.proto - // - google/protobuf/unittest_lazy_dependencies.proto - // - google/protobuf/unittest_arena.proto - // - google/protobuf/unittest_drop_unknown_fields.proto - // - google/protobuf/unittest_lazy_dependencies_custom_option.proto - // - google/protobuf/unittest_legacy_features.proto /** * Relevant proto files for testing in upstream protobuf. * @@ -79,8 +69,15 @@ export class UpstreamProtobuf { #testprotos = [ "src/google/protobuf/test_messages_*.proto", "src/google/protobuf/*unittest*.proto", - "src/google/protobuf/editions/**/*.proto", + "!src/google/protobuf/edition_unittest.proto", "!src/google/protobuf/map_proto3_unittest.proto", + "!src/google/protobuf/unittest_lite.proto", + "!src/google/protobuf/unittest_import_public_lite.proto", + "!src/google/protobuf/unittest_import_lite.proto", + "!src/google/protobuf/map_lite_unittest.proto", + "!src/google/protobuf/unittest_delimited.proto", + "!src/google/protobuf/unittest_delimited_import.proto", + "!src/google/protobuf/unittest_string_view.proto", "!src/google/protobuf/editions/**/*.proto", "!src/google/protobuf/unittest_arena.proto", "!src/google/protobuf/unittest_drop_unknown_fields.proto", @@ -154,7 +151,6 @@ export class UpstreamProtobuf { writeTree(Object.entries(files), tempDir); const outPath = joinPath(tempDir, "desc.binpb"); const args = [ - "--experimental_editions", "--descriptor_set_out", outPath, "--proto_path", @@ -199,7 +195,6 @@ export class UpstreamProtobuf { try { writeTree(Object.entries(files), tempDir); const args = [ - "--experimental_editions", "--dumpcodegenreq_out", ".", "--proto_path", @@ -243,16 +238,16 @@ export class UpstreamProtobuf { try { writeTree(Object.entries(files), tempDir); const args = [ - "--experimental_edition_defaults_out", + "--edition_defaults_out", "defaults.binpb", "google/protobuf/descriptor.proto", ...Object.keys(files), ]; if (minimumEdition !== undefined) { - args.push("--experimental_edition_defaults_minimum", minimumEdition); + args.push("--edition_defaults_minimum", minimumEdition); } if (maximumEdition !== undefined) { - args.push("--experimental_edition_defaults_maximum", maximumEdition); + args.push("--edition_defaults_maximum", maximumEdition); } execFileSync(protocPath, args, { shell: false, diff --git a/packages/upstream-protobuf/version.txt b/packages/upstream-protobuf/version.txt index dfa88c8eb..a0d6856db 100644 --- a/packages/upstream-protobuf/version.txt +++ b/packages/upstream-protobuf/version.txt @@ -1 +1 @@ -26.1 +27.0