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