From 9654fd54b0e108156415f31f217f4797739675e8 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Thu, 30 May 2024 17:18:41 +0200 Subject: [PATCH 01/11] Roughly implement JSON typings Signed-off-by: Timo Stamm --- .../src/gen/js/extra/comments_pb.d.ts | 98 +- .../gen/js/extra/deprecation-explicit_pb.d.ts | 43 +- .../gen/js/extra/deprecation-implicit_pb.d.ts | 19 +- .../js/extra/edition2023-map-encoding_pb.d.ts | 25 +- .../gen/js/extra/edition2023-proto2_pb.d.ts | 88 +- .../gen/js/extra/edition2023-proto3_pb.d.ts | 44 +- .../src/gen/js/extra/edition2023_pb.d.ts | 573 +- .../src/gen/js/extra/example_pb.d.ts | 37 +- .../gen/js/extra/extensions-proto2_pb.d.ts | 81 +- .../gen/js/extra/extensions-proto3_pb.d.ts | 12 +- .../src/gen/js/extra/jstype-proto2_pb.d.ts | 228 +- .../src/gen/js/extra/msg-json-names_pb.d.ts | 37 +- .../src/gen/js/extra/msg-maps_pb.d.ts | 84 +- .../src/gen/js/extra/msg-message_pb.d.ts | 29 +- .../src/gen/js/extra/msg-oneof_pb.d.ts | 83 +- .../src/gen/js/extra/msg-scalar_pb.d.ts | 164 +- .../src/gen/js/extra/name-clash_pb.d.ts | 528 +- .../src/gen/js/extra/option-usage_pb.d.ts | 24 +- .../src/gen/js/extra/perf_pb.d.ts | 214 +- .../src/gen/js/extra/proto2_pb.d.ts | 520 +- .../src/gen/js/extra/proto3_pb.d.ts | 301 +- .../src/gen/js/extra/service-example_pb.d.ts | 61 +- .../src/gen/js/extra/wkt-wrappers_pb.d.ts | 189 +- .../protobuf/map_proto2_unittest_pb.d.ts | 290 +- .../protobuf/test_messages_proto2_pb.d.ts | 1203 ++- .../protobuf/test_messages_proto3_pb.d.ts | 837 +- .../src/gen/js/google/protobuf/type_pb.d.ts | 198 +- .../protobuf/unittest_custom_options_pb.d.ts | 397 +- .../unittest_embed_optimize_for_pb.d.ts | 19 +- .../unittest_enormous_descriptor_pb.d.ts | 5007 ++++++++- .../protobuf/unittest_extension_set_pb.d.ts | 20 +- .../google/protobuf/unittest_features_pb.d.ts | 110 +- .../google/protobuf/unittest_import_pb.d.ts | 26 +- .../protobuf/unittest_import_public_pb.d.ts | 12 +- .../unittest_invalid_features_pb.d.ts | 12 +- .../unittest_lite_imports_nonlite_pb.d.ts | 19 +- .../js/google/protobuf/unittest_mset_pb.d.ts | 138 +- .../unittest_mset_wire_format_pb.d.ts | 20 +- .../unittest_no_generic_services_pb.d.ts | 19 +- .../protobuf/unittest_optimize_for_pb.d.ts | 53 +- .../gen/js/google/protobuf/unittest_pb.d.ts | 9188 +++++++++++----- .../unittest_proto3_bad_macros_pb.d.ts | 21 +- .../protobuf/unittest_proto3_optional_pb.d.ts | 168 +- .../google/protobuf/unittest_proto3_pb.d.ts | 524 +- .../protobuf/unittest_retention_pb.d.ts | 69 +- .../unittest_well_known_types_pb.d.ts | 397 +- .../src/gen/ts/extra/comments_pb.ts | 98 +- .../gen/ts/extra/deprecation-explicit_pb.ts | 43 +- .../gen/ts/extra/deprecation-implicit_pb.ts | 19 +- .../ts/extra/edition2023-map-encoding_pb.ts | 25 +- .../src/gen/ts/extra/edition2023-proto2_pb.ts | 88 +- .../src/gen/ts/extra/edition2023-proto3_pb.ts | 44 +- .../src/gen/ts/extra/edition2023_pb.ts | 573 +- .../src/gen/ts/extra/example_pb.ts | 37 +- .../src/gen/ts/extra/extensions-proto2_pb.ts | 81 +- .../src/gen/ts/extra/extensions-proto3_pb.ts | 12 +- .../src/gen/ts/extra/jstype-proto2_pb.ts | 228 +- .../src/gen/ts/extra/msg-json-names_pb.ts | 37 +- .../src/gen/ts/extra/msg-maps_pb.ts | 84 +- .../src/gen/ts/extra/msg-message_pb.ts | 29 +- .../src/gen/ts/extra/msg-oneof_pb.ts | 83 +- .../src/gen/ts/extra/msg-scalar_pb.ts | 164 +- .../src/gen/ts/extra/name-clash_pb.ts | 528 +- .../src/gen/ts/extra/option-usage_pb.ts | 24 +- .../protobuf-test/src/gen/ts/extra/perf_pb.ts | 214 +- .../src/gen/ts/extra/proto2_pb.ts | 520 +- .../src/gen/ts/extra/proto3_pb.ts | 301 +- .../src/gen/ts/extra/service-example_pb.ts | 61 +- .../src/gen/ts/extra/wkt-wrappers_pb.ts | 189 +- .../google/protobuf/map_proto2_unittest_pb.ts | 290 +- .../protobuf/test_messages_proto2_pb.ts | 1203 ++- .../protobuf/test_messages_proto3_pb.ts | 837 +- .../src/gen/ts/google/protobuf/type_pb.ts | 198 +- .../protobuf/unittest_custom_options_pb.ts | 397 +- .../unittest_embed_optimize_for_pb.ts | 19 +- .../unittest_enormous_descriptor_pb.ts | 5007 ++++++++- .../protobuf/unittest_extension_set_pb.ts | 20 +- .../google/protobuf/unittest_features_pb.ts | 110 +- .../ts/google/protobuf/unittest_import_pb.ts | 26 +- .../protobuf/unittest_import_public_pb.ts | 12 +- .../protobuf/unittest_invalid_features_pb.ts | 12 +- .../unittest_lite_imports_nonlite_pb.ts | 19 +- .../ts/google/protobuf/unittest_mset_pb.ts | 138 +- .../protobuf/unittest_mset_wire_format_pb.ts | 20 +- .../unittest_no_generic_services_pb.ts | 19 +- .../protobuf/unittest_optimize_for_pb.ts | 53 +- .../src/gen/ts/google/protobuf/unittest_pb.ts | 9596 ++++++++++++----- .../protobuf/unittest_proto3_bad_macros_pb.ts | 21 +- .../protobuf/unittest_proto3_optional_pb.ts | 168 +- .../ts/google/protobuf/unittest_proto3_pb.ts | 524 +- .../google/protobuf/unittest_retention_pb.ts | 69 +- .../protobuf/unittest_well_known_types_pb.ts | 397 +- .../protobuf-test/src/generate-code.test.ts | 14 + packages/protobuf-test/src/json.test.ts | 86 +- packages/protobuf/src/codegenv1/enum.ts | 10 +- packages/protobuf/src/codegenv1/message.ts | 11 +- packages/protobuf/src/codegenv1/scalar.ts | 35 + packages/protobuf/src/codegenv1/symbols.ts | 2 + packages/protobuf/src/codegenv1/types.ts | 12 +- packages/protobuf/src/from-json.ts | 28 +- packages/protobuf/src/to-json.ts | 42 +- packages/protobuf/src/types.ts | 13 + .../protoc-gen-es/src/protoc-gen-es-plugin.ts | 124 +- packages/protoc-gen-es/src/util.ts | 78 +- packages/protoplugin/src/generated-file.ts | 14 + packages/protoplugin/src/names.ts | 33 +- packages/protoplugin/src/printable.ts | 6 + packages/protoplugin/src/schema.ts | 14 +- 108 files changed, 39539 insertions(+), 5849 deletions(-) diff --git a/packages/protobuf-test/src/gen/js/extra/comments_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/comments_pb.d.ts index bb35eac40..338e37746 100644 --- a/packages/protobuf-test/src/gen/js/extra/comments_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/comments_pb.d.ts @@ -88,11 +88,41 @@ export declare type MessageWithComments = Message<"spec.MessageWithComments"> & thisFieldIsDeprecated: string; }; +/** + * JSON type for the message spec.MessageWithComments. + */ +export declare type MessageWithCommentsJson = { + /** + * @generated from field: string foo = 1; + */ + foo?: string; + + /** + * @generated from field: int32 value = 2; + */ + value?: number; + + /** + * @generated from field: string error = 3; + */ + error?: string; + + /** + * @generated from field: string this_field_has_an_empty_comment = 4; + */ + thisFieldHasAnEmptyComment?: string; + + /** + * @generated from field: string this_field_is_deprecated = 5 [json_name = "sdf", deprecated = true]; + */ + sdf?: string; +}; + /** * Describes the message spec.MessageWithComments. * Use `create(MessageWithCommentsDesc)` to create a new message. */ -export declare const MessageWithCommentsDesc: GenDescMessage; +export declare const MessageWithCommentsDesc: GenDescMessage; /** * Comment within empty message. @@ -102,11 +132,17 @@ export declare const MessageWithCommentsDesc: GenDescMessage & { }; +/** + * JSON type for the message spec.EmptyMessageWithComment. + */ +export declare type EmptyMessageWithCommentJson = { +}; + /** * Describes the message spec.EmptyMessageWithComment. * Use `create(EmptyMessageWithCommentDesc)` to create a new message. */ -export declare const EmptyMessageWithCommentDesc: GenDescMessage; +export declare const EmptyMessageWithCommentDesc: GenDescMessage; /** * see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto @@ -163,11 +199,46 @@ export declare type GoogleCommentExample = Message<"spec.GoogleCommentExample"> grault: number; }; +/** + * JSON type for the message spec.GoogleCommentExample. + */ +export declare type GoogleCommentExampleJson = { + /** + * @generated from field: int32 foo = 1; + */ + foo?: number; + + /** + * @generated from field: int32 bar = 2; + */ + bar?: number; + + /** + * @generated from field: string baz = 3; + */ + baz?: string; + + /** + * @generated from field: double qux = 4; + */ + qux?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: string corge = 5; + */ + corge?: string; + + /** + * @generated from field: int32 grault = 6; + */ + grault?: number; +}; + /** * Describes the message spec.GoogleCommentExample. * Use `create(GoogleCommentExampleDesc)` to create a new message. */ -export declare const GoogleCommentExampleDesc: GenDescMessage; +export declare const GoogleCommentExampleDesc: GenDescMessage; /** * Leading comment for enum. @@ -187,10 +258,15 @@ export enum EnumWithComments { VALUE = 0, } +/** + * JSON type for the enum spec.EnumWithComments. + */ +export declare type EnumWithCommentsJson = "VALUE"; + /** * Describes the enum spec.EnumWithComments. */ -export declare const EnumWithCommentsDesc: GenDescEnum; +export declare const EnumWithCommentsDesc: GenDescEnum; /** * Leading comment for deprecated enum @@ -210,11 +286,16 @@ export enum DeprecatedEnumWithComment { B = 1, } +/** + * JSON type for the enum spec.DeprecatedEnumWithComment. + */ +export declare type DeprecatedEnumWithCommentJson = "DEPRECATED_ENUM_WITH_COMMENT_A" | "DEPRECATED_ENUM_WITH_COMMENT_B"; + /** * Describes the enum spec.DeprecatedEnumWithComment. * @deprecated */ -export declare const DeprecatedEnumWithCommentDesc: GenDescEnum; +export declare const DeprecatedEnumWithCommentDesc: GenDescEnum; /** * @generated from enum spec.DeprecatedEnumNoComment @@ -232,9 +313,14 @@ export enum DeprecatedEnumNoComment { B = 1, } +/** + * JSON type for the enum spec.DeprecatedEnumNoComment. + */ +export declare type DeprecatedEnumNoCommentJson = "DEPRECATED_ENUM_NO_COMMENT_A" | "DEPRECATED_ENUM_NO_COMMENT_B"; + /** * Describes the enum spec.DeprecatedEnumNoComment. * @deprecated */ -export declare const DeprecatedEnumNoCommentDesc: GenDescEnum; +export declare const DeprecatedEnumNoCommentDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/deprecation-explicit_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/deprecation-explicit_pb.d.ts index 3562b0ddc..660ec57ed 100644 --- a/packages/protobuf-test/src/gen/js/extra/deprecation-explicit_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/deprecation-explicit_pb.d.ts @@ -38,12 +38,22 @@ export declare type DeprecatedMessage = Message<"spec.DeprecatedMessage"> & { field: string; }; +/** + * JSON type for the message spec.DeprecatedMessage. + */ +export declare type DeprecatedMessageJson = { + /** + * @generated from field: string field = 1; + */ + field?: string; +}; + /** * Describes the message spec.DeprecatedMessage. * Use `create(DeprecatedMessageDesc)` to create a new message. * @deprecated */ -export declare const DeprecatedMessageDesc: GenDescMessage; +export declare const DeprecatedMessageDesc: GenDescMessage; /** * A single field of this message is deprecated @@ -67,11 +77,26 @@ export declare type DeprecatedFieldMessage = Message<"spec.DeprecatedFieldMessag currentField: string; }; +/** + * JSON type for the message spec.DeprecatedFieldMessage. + */ +export declare type DeprecatedFieldMessageJson = { + /** + * @generated from field: string deprecated_field = 1 [deprecated = true]; + */ + deprecatedField?: string; + + /** + * @generated from field: string current_field = 2; + */ + currentField?: string; +}; + /** * Describes the message spec.DeprecatedFieldMessage. * Use `create(DeprecatedFieldMessageDesc)` to create a new message. */ -export declare const DeprecatedFieldMessageDesc: GenDescMessage; +export declare const DeprecatedFieldMessageDesc: GenDescMessage; /** * The entire enum is deprecated @@ -91,11 +116,16 @@ export enum DeprecatedEnum { B = 1, } +/** + * JSON type for the enum spec.DeprecatedEnum. + */ +export declare type DeprecatedEnumJson = "DEPRECATED_ENUM_A" | "DEPRECATED_ENUM_B"; + /** * Describes the enum spec.DeprecatedEnum. * @deprecated */ -export declare const DeprecatedEnumDesc: GenDescEnum; +export declare const DeprecatedEnumDesc: GenDescEnum; /** * Only a single enum value is deprecated @@ -115,10 +145,15 @@ export enum DeprecatedValueEnum { DEPRECATED_VALUE = 1, } +/** + * JSON type for the enum spec.DeprecatedValueEnum. + */ +export declare type DeprecatedValueEnumJson = "DEPRECATED_VALUE_ENUM_UNSPECIFIED" | "DEPRECATED_VALUE_ENUM_DEPRECATED_VALUE"; + /** * Describes the enum spec.DeprecatedValueEnum. */ -export declare const DeprecatedValueEnumDesc: GenDescEnum; +export declare const DeprecatedValueEnumDesc: GenDescEnum; /** * The entire service is deprecated 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 f4d278f83..db43c0e34 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 @@ -37,12 +37,22 @@ export declare type ImplicitlyDeprecatedMessage = Message<"spec.ImplicitlyDeprec implicitlyDeprecatedField: string; }; +/** + * JSON type for the message spec.ImplicitlyDeprecatedMessage. + */ +export declare type ImplicitlyDeprecatedMessageJson = { + /** + * @generated from field: string implicitly_deprecated_field = 1; + */ + implicitlyDeprecatedField?: string; +}; + /** * Describes the message spec.ImplicitlyDeprecatedMessage. * Use `create(ImplicitlyDeprecatedMessageDesc)` to create a new message. * @deprecated */ -export declare const ImplicitlyDeprecatedMessageDesc: GenDescMessage; +export declare const ImplicitlyDeprecatedMessageDesc: GenDescMessage; /** * @generated from enum spec.ImplicitlyDeprecatedEnum @@ -55,11 +65,16 @@ export enum ImplicitlyDeprecatedEnum { UNSPECIFIED = 0, } +/** + * JSON type for the enum spec.ImplicitlyDeprecatedEnum. + */ +export declare type ImplicitlyDeprecatedEnumJson = "IMPLICITLY_DEPRECATED_ENUM_UNSPECIFIED"; + /** * Describes the enum spec.ImplicitlyDeprecatedEnum. * @deprecated */ -export declare const ImplicitlyDeprecatedEnumDesc: GenDescEnum; +export declare const ImplicitlyDeprecatedEnumDesc: GenDescEnum; /** * @generated from service spec.ImplicitlyDeprecatedService diff --git a/packages/protobuf-test/src/gen/js/extra/edition2023-map-encoding_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/edition2023-map-encoding_pb.d.ts index eb363acdc..d5ecf1966 100644 --- a/packages/protobuf-test/src/gen/js/extra/edition2023-map-encoding_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/edition2023-map-encoding_pb.d.ts @@ -45,11 +45,26 @@ export declare type Edition2023MapEncodingMessage = Message<"spec.Edition2023Map messageMap: { [key: number]: Edition2023MapEncodingMessage_Child }; }; +/** + * JSON type for the message spec.Edition2023MapEncodingMessage. + */ +export declare type Edition2023MapEncodingMessageJson = { + /** + * @generated from field: map string_map = 77; + */ + stringMap?: { [key: number]: string }; + + /** + * @generated from field: map message_map = 88; + */ + messageMap?: { [key: number]: Edition2023MapEncodingMessage_ChildJson }; +}; + /** * Describes the message spec.Edition2023MapEncodingMessage. * Use `create(Edition2023MapEncodingMessageDesc)` to create a new message. */ -export declare const Edition2023MapEncodingMessageDesc: GenDescMessage; +export declare const Edition2023MapEncodingMessageDesc: GenDescMessage; /** * @generated from message spec.Edition2023MapEncodingMessage.Child @@ -57,9 +72,15 @@ export declare const Edition2023MapEncodingMessageDesc: GenDescMessage & { }; +/** + * JSON type for the message spec.Edition2023MapEncodingMessage.Child. + */ +export declare type Edition2023MapEncodingMessage_ChildJson = { +}; + /** * Describes the message spec.Edition2023MapEncodingMessage.Child. * Use `create(Edition2023MapEncodingMessage_ChildDesc)` to create a new message. */ -export declare const Edition2023MapEncodingMessage_ChildDesc: GenDescMessage; +export declare const Edition2023MapEncodingMessage_ChildDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/edition2023-proto2_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/edition2023-proto2_pb.d.ts index 66681ba6f..40a460866 100644 --- a/packages/protobuf-test/src/gen/js/extra/edition2023-proto2_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/edition2023-proto2_pb.d.ts @@ -81,11 +81,66 @@ export declare type Proto2MessageForEdition2023 = Message<"spec.Proto2MessageFor unpackedDoubleField: number[]; }; +/** + * JSON type for the message spec.Proto2MessageForEdition2023. + */ +export declare type Proto2MessageForEdition2023Json = { + /** + * @generated from field: optional bool optional_bool_field = 1; + */ + optionalBoolField?: boolean; + + /** + * @generated from field: optional spec.Proto2EnumForEdition2023 optional_closed_enum_field = 2; + */ + optionalClosedEnumField?: Proto2EnumForEdition2023Json; + + /** + * @generated from field: optional string optional_string_field_with_default = 3 [default = ""]; + */ + optionalStringFieldWithDefault?: string; + + /** + * @generated from field: optional spec.Proto2MessageForEdition2023.OptionalGroup optionalgroup = 4; + */ + optionalgroup?: Proto2MessageForEdition2023_OptionalGroupJson; + + /** + * @generated from field: required bool required_bool_field = 5; + */ + requiredBoolField?: boolean; + + /** + * @generated from field: required spec.Proto2EnumForEdition2023 required_closed_enum_field = 6; + */ + requiredClosedEnumField?: Proto2EnumForEdition2023Json; + + /** + * @generated from field: required string required_string_field_with_default = 7 [default = "hello \" *\/ "]; + */ + requiredStringFieldWithDefault?: string; + + /** + * @generated from field: required spec.Proto2MessageForEdition2023.RequiredGroup requiredgroup = 8; + */ + requiredgroup?: Proto2MessageForEdition2023_RequiredGroupJson; + + /** + * @generated from field: repeated double packed_double_field = 9 [packed = true]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double_field = 10 [packed = false]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; +}; + /** * Describes the message spec.Proto2MessageForEdition2023. * Use `create(Proto2MessageForEdition2023Desc)` to create a new message. */ -export declare const Proto2MessageForEdition2023Desc: GenDescMessage; +export declare const Proto2MessageForEdition2023Desc: GenDescMessage; /** * @generated from message spec.Proto2MessageForEdition2023.OptionalGroup @@ -97,11 +152,21 @@ export declare type Proto2MessageForEdition2023_OptionalGroup = Message<"spec.Pr int32Field: number; }; +/** + * JSON type for the message spec.Proto2MessageForEdition2023.OptionalGroup. + */ +export declare type Proto2MessageForEdition2023_OptionalGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2MessageForEdition2023.OptionalGroup. * Use `create(Proto2MessageForEdition2023_OptionalGroupDesc)` to create a new message. */ -export declare const Proto2MessageForEdition2023_OptionalGroupDesc: GenDescMessage; +export declare const Proto2MessageForEdition2023_OptionalGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2MessageForEdition2023.RequiredGroup @@ -113,11 +178,21 @@ export declare type Proto2MessageForEdition2023_RequiredGroup = Message<"spec.Pr int32Field: number; }; +/** + * JSON type for the message spec.Proto2MessageForEdition2023.RequiredGroup. + */ +export declare type Proto2MessageForEdition2023_RequiredGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2MessageForEdition2023.RequiredGroup. * Use `create(Proto2MessageForEdition2023_RequiredGroupDesc)` to create a new message. */ -export declare const Proto2MessageForEdition2023_RequiredGroupDesc: GenDescMessage; +export declare const Proto2MessageForEdition2023_RequiredGroupDesc: GenDescMessage; /** * @generated from enum spec.Proto2EnumForEdition2023 @@ -129,8 +204,13 @@ export enum Proto2EnumForEdition2023 { A = 1, } +/** + * JSON type for the enum spec.Proto2EnumForEdition2023. + */ +export declare type Proto2EnumForEdition2023Json = "PROTO2_ENUM_FOR_EDITION2023_A"; + /** * Describes the enum spec.Proto2EnumForEdition2023. */ -export declare const Proto2EnumForEdition2023Desc: GenDescEnum; +export declare const Proto2EnumForEdition2023Desc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/edition2023-proto3_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/edition2023-proto3_pb.d.ts index af4677e58..d71929251 100644 --- a/packages/protobuf-test/src/gen/js/extra/edition2023-proto3_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/edition2023-proto3_pb.d.ts @@ -61,11 +61,46 @@ export declare type Proto3MessageForEdition2023 = Message<"spec.Proto3MessageFor unpackedDoubleField: number[]; }; +/** + * JSON type for the message spec.Proto3MessageForEdition2023. + */ +export declare type Proto3MessageForEdition2023Json = { + /** + * @generated from field: bool implicit_bool_field = 1; + */ + implicitBoolField?: boolean; + + /** + * @generated from field: spec.Proto3EnumForEdition2023 implicit_open_enum_field = 2; + */ + implicitOpenEnumField?: Proto3EnumForEdition2023Json; + + /** + * @generated from field: optional bool explicit_bool_field = 5; + */ + explicitBoolField?: boolean; + + /** + * @generated from field: optional spec.Proto3EnumForEdition2023 explicit_open_enum_field = 6; + */ + explicitOpenEnumField?: Proto3EnumForEdition2023Json; + + /** + * @generated from field: repeated double packed_double_field = 9 [packed = true]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double_field = 10 [packed = false]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; +}; + /** * Describes the message spec.Proto3MessageForEdition2023. * Use `create(Proto3MessageForEdition2023Desc)` to create a new message. */ -export declare const Proto3MessageForEdition2023Desc: GenDescMessage; +export declare const Proto3MessageForEdition2023Desc: GenDescMessage; /** * @generated from enum spec.Proto3EnumForEdition2023 @@ -82,8 +117,13 @@ export enum Proto3EnumForEdition2023 { A = 1, } +/** + * JSON type for the enum spec.Proto3EnumForEdition2023. + */ +export declare type Proto3EnumForEdition2023Json = "PROTO3_ENUM_FOR_EDITION2023_UNSPECIFIED" | "PROTO3_ENUM_FOR_EDITION2023_A"; + /** * Describes the enum spec.Proto3EnumForEdition2023. */ -export declare const Proto3EnumForEdition2023Desc: GenDescEnum; +export declare const Proto3EnumForEdition2023Desc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/edition2023_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/edition2023_pb.d.ts index 69a212791..4fda0720b 100644 --- a/packages/protobuf-test/src/gen/js/extra/edition2023_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/edition2023_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { UInt32Value } from "@bufbuild/protobuf/wkt"; +import type { UInt32Value, UInt32ValueJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file extra/edition2023.proto. @@ -470,11 +470,436 @@ export declare type Edition2023Message = Message<"spec.Edition2023Message"> & { mapInt32WrappedUint32Field: { [key: number]: UInt32Value }; }; +/** + * JSON type for the message spec.Edition2023Message. + */ +export declare type Edition2023MessageJson = { + /** + * @generated from field: string explicit_string_field = 301; + */ + explicitStringField?: string; + + /** + * @generated from field: bytes explicit_bytes_field = 302; + */ + explicitBytesField?: string; + + /** + * @generated from field: int32 explicit_int32_field = 303; + */ + explicitInt32Field?: number; + + /** + * @generated from field: int64 explicit_int64_field = 304; + */ + explicitInt64Field?: string; + + /** + * @generated from field: int64 explicit_int64_js_number_field = 305 [jstype = JS_NUMBER]; + */ + explicitInt64JsNumberField?: string; + + /** + * @generated from field: int64 explicit_int64_js_string_field = 306 [jstype = JS_STRING]; + */ + explicitInt64JsStringField?: string; + + /** + * @generated from field: float explicit_float_field = 307; + */ + explicitFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool explicit_bool_field = 308; + */ + explicitBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen explicit_enum_open_field = 309; + */ + explicitEnumOpenField?: Edition2023EnumOpenJson; + + /** + * @generated from field: spec.Edition2023EnumClosed explicit_enum_closed_field = 310; + */ + explicitEnumClosedField?: Edition2023EnumClosedJson; + + /** + * @generated from field: spec.Edition2023Message explicit_message_field = 311; + */ + explicitMessageField?: Edition2023MessageJson; + + /** + * @generated from field: spec.Edition2023Message explicit_message_delimited_field = 312 [features.message_encoding = DELIMITED]; + */ + explicitMessageDelimitedField?: Edition2023MessageJson; + + /** + * @generated from field: google.protobuf.UInt32Value explicit_wrapped_uint32_field = 313; + */ + explicitWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: string implicit_string_field = 201 [features.field_presence = IMPLICIT]; + */ + implicitStringField?: string; + + /** + * @generated from field: bytes implicit_bytes_field = 202 [features.field_presence = IMPLICIT]; + */ + implicitBytesField?: string; + + /** + * @generated from field: int32 implicit_int32_field = 203 [features.field_presence = IMPLICIT]; + */ + implicitInt32Field?: number; + + /** + * @generated from field: int64 implicit_int64_field = 204 [features.field_presence = IMPLICIT]; + */ + implicitInt64Field?: string; + + /** + * @generated from field: int64 implicit_int64_js_number_field = 205 [jstype = JS_NUMBER, features.field_presence = IMPLICIT]; + */ + implicitInt64JsNumberField?: string; + + /** + * @generated from field: int64 implicit_int64_js_string_field = 206 [jstype = JS_STRING, features.field_presence = IMPLICIT]; + */ + implicitInt64JsStringField?: string; + + /** + * @generated from field: float implicit_float_field = 207 [features.field_presence = IMPLICIT]; + */ + implicitFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool implicit_bool_field = 208 [features.field_presence = IMPLICIT]; + */ + implicitBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen implicit_enum_open_field = 209 [features.field_presence = IMPLICIT]; + */ + implicitEnumOpenField?: Edition2023EnumOpenJson; + + /** + * @generated from field: string required_string_field = 1 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredStringField?: string; + + /** + * @generated from field: bytes required_bytes_field = 2 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredBytesField?: string; + + /** + * @generated from field: int32 required_int32_field = 3 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredInt32Field?: number; + + /** + * @generated from field: int64 required_int64_field = 4 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredInt64Field?: string; + + /** + * @generated from field: int64 required_int64_js_number_field = 5 [jstype = JS_NUMBER, features.field_presence = LEGACY_REQUIRED]; + */ + requiredInt64JsNumberField?: string; + + /** + * @generated from field: int64 required_int64_js_string_field = 6 [jstype = JS_STRING, features.field_presence = LEGACY_REQUIRED]; + */ + requiredInt64JsStringField?: string; + + /** + * @generated from field: float required_float_field = 7 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool required_bool_field = 8 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen required_enum_open_field = 9 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredEnumOpenField?: Edition2023EnumOpenJson; + + /** + * @generated from field: spec.Edition2023EnumClosed required_enum_closed_field = 10 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredEnumClosedField?: Edition2023EnumClosedJson; + + /** + * @generated from field: spec.Edition2023Message.Child required_message_field = 11 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredMessageField?: Edition2023Message_ChildJson; + + /** + * @generated from field: spec.Edition2023Message.Child required_message_delimited_field = 12 [features.field_presence = LEGACY_REQUIRED, features.message_encoding = DELIMITED]; + */ + requiredMessageDelimitedField?: Edition2023Message_ChildJson; + + /** + * @generated from field: google.protobuf.UInt32Value required_wrapped_uint32_field = 13 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: string required_default_string_field = 101 [default = "hello \" *\/ ", features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultStringField?: string; + + /** + * @generated from field: bytes required_default_bytes_field = 102 [default = "\000x\\x\\"x\'AAAAAA\010\014\n\r\t\013", features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultBytesField?: string; + + /** + * @generated from field: int32 required_default_int32_field = 103 [default = 128, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultInt32Field?: number; + + /** + * @generated from field: int64 required_default_int64_field = 104 [default = -256, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultInt64Field?: string; + + /** + * @generated from field: int64 required_default_int64_js_number_field = 105 [default = -256, jstype = JS_NUMBER, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultInt64JsNumberField?: string; + + /** + * @generated from field: int64 required_default_int64_js_string_field = 106 [default = -256, jstype = JS_STRING, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultInt64JsStringField?: string; + + /** + * @generated from field: float required_default_float_field = 107 [default = -512.13, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool required_default_bool_field = 108 [default = true, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen required_default_enum_open_field = 109 [default = EDITION2023_ENUM_OPEN_A, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultEnumOpenField?: Edition2023EnumOpenJson; + + /** + * @generated from field: spec.Edition2023EnumClosed required_default_enum_closed_field = 110 [default = EDITION2023_ENUM_CLOSED_A, features.field_presence = LEGACY_REQUIRED]; + */ + requiredDefaultEnumClosedField?: Edition2023EnumClosedJson; + + /** + * @generated from field: repeated string repeated_string_field = 401; + */ + repeatedStringField?: string[]; + + /** + * @generated from field: repeated bytes repeated_bytes_field = 402; + */ + repeatedBytesField?: string[]; + + /** + * @generated from field: repeated int32 repeated_int32_field = 403; + */ + repeatedInt32Field?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 404; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_number_field = 405 [jstype = JS_NUMBER]; + */ + repeatedInt64JsNumberField?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_string_field = 406 [jstype = JS_STRING]; + */ + repeatedInt64JsStringField?: string[]; + + /** + * @generated from field: repeated float repeated_float_field = 407; + */ + repeatedFloatField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool repeated_bool_field = 408; + */ + repeatedBoolField?: boolean[]; + + /** + * @generated from field: repeated spec.Edition2023EnumOpen repeated_enum_open_field = 409; + */ + repeatedEnumOpenField?: Edition2023EnumOpenJson[]; + + /** + * @generated from field: repeated spec.Edition2023EnumClosed repeated_enum_closed_field = 410; + */ + repeatedEnumClosedField?: Edition2023EnumClosedJson[]; + + /** + * @generated from field: repeated spec.Edition2023Message repeated_message_field = 411; + */ + repeatedMessageField?: Edition2023MessageJson[]; + + /** + * @generated from field: repeated spec.Edition2023Message repeated_message_delimited_field = 412 [features.message_encoding = DELIMITED]; + */ + repeatedMessageDelimitedField?: Edition2023MessageJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt32Value repeated_wrapped_uint32_field = 413; + */ + repeatedWrappedUint32Field?: UInt32ValueJson[]; + + /** + * @generated from field: repeated double packed_double_field = 414 [features.repeated_field_encoding = PACKED]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 packed_uint32_field = 415 [features.repeated_field_encoding = PACKED]; + */ + packedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 packed_uint64_field = 416 [features.repeated_field_encoding = PACKED]; + */ + packedUint64Field?: string[]; + + /** + * @generated from field: repeated double unpacked_double_field = 417 [features.repeated_field_encoding = EXPANDED]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 unpacked_uint32_field = 418 [features.repeated_field_encoding = EXPANDED]; + */ + unpackedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 unpacked_uint64_field = 419 [features.repeated_field_encoding = EXPANDED]; + */ + unpackedUint64Field?: string[]; + + /** + * @generated from field: string oneof_string_field = 501; + */ + oneofStringField?: string; + + /** + * @generated from field: bytes oneof_bytes_field = 502; + */ + oneofBytesField?: string; + + /** + * @generated from field: int32 oneof_int32_field = 503; + */ + oneofInt32Field?: number; + + /** + * @generated from field: int64 oneof_int64_field = 504; + */ + oneofInt64Field?: string; + + /** + * @generated from field: int64 oneof_int64_js_number_field = 505 [jstype = JS_NUMBER]; + */ + oneofInt64JsNumberField?: string; + + /** + * @generated from field: int64 oneof_int64_js_string_field = 506 [jstype = JS_STRING]; + */ + oneofInt64JsStringField?: string; + + /** + * @generated from field: float oneof_float_field = 507; + */ + oneofFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool oneof_bool_field = 508; + */ + oneofBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen oneof_enum_open_field = 509; + */ + oneofEnumOpenField?: Edition2023EnumOpenJson; + + /** + * @generated from field: spec.Edition2023EnumClosed oneof_enum_closed_field = 510; + */ + oneofEnumClosedField?: Edition2023EnumClosedJson; + + /** + * @generated from field: spec.Edition2023Message oneof_message_field = 511; + */ + oneofMessageField?: Edition2023MessageJson; + + /** + * @generated from field: spec.Edition2023Message oneof_message_delimited_field = 512 [features.message_encoding = DELIMITED]; + */ + oneofMessageDelimitedField?: Edition2023MessageJson; + + /** + * @generated from field: google.protobuf.UInt32Value oneof_wrapped_uint32_field = 513; + */ + oneofWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: map map_string_string_field = 601; + */ + mapStringStringField?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_int32_field = 602; + */ + mapInt32Int32Field?: { [key: number]: number }; + + /** + * @generated from field: map map_bool_bool_field = 603; + */ + mapBoolBoolField?: { [key: string]: boolean }; + + /** + * @generated from field: map map_int64_int64_field = 604; + */ + mapInt64Int64Field?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_enum_open_field = 605; + */ + mapInt32EnumOpenField?: { [key: number]: Edition2023EnumOpenJson }; + + /** + * @generated from field: map map_int32_message_field = 607; + */ + mapInt32MessageField?: { [key: number]: Edition2023MessageJson }; + + /** + * @generated from field: map map_int32_wrapped_uint32_field = 608; + */ + mapInt32WrappedUint32Field?: { [key: number]: UInt32ValueJson }; +}; + /** * Describes the message spec.Edition2023Message. * Use `create(Edition2023MessageDesc)` to create a new message. */ -export declare const Edition2023MessageDesc: GenDescMessage; +export declare const Edition2023MessageDesc: GenDescMessage; /** * message for use in required fields above to avoid circular reference @@ -488,11 +913,21 @@ export declare type Edition2023Message_Child = Message<"spec.Edition2023Message. f: number; }; +/** + * JSON type for the message spec.Edition2023Message.Child. + */ +export declare type Edition2023Message_ChildJson = { + /** + * @generated from field: int32 f = 1; + */ + f?: number; +}; + /** * Describes the message spec.Edition2023Message.Child. * Use `create(Edition2023Message_ChildDesc)` to create a new message. */ -export declare const Edition2023Message_ChildDesc: GenDescMessage; +export declare const Edition2023Message_ChildDesc: GenDescMessage; /** * this is an exact replication of spec.Proto3MessageForEdition2023 in editions @@ -552,11 +987,66 @@ export declare type Edition2023FromProto2Message = Message<"spec.Edition2023From unpackedDoubleField: number[]; }; +/** + * JSON type for the message spec.Edition2023FromProto2Message. + */ +export declare type Edition2023FromProto2MessageJson = { + /** + * @generated from field: bool optional_bool_field = 1; + */ + optionalBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumClosed optional_closed_enum_field = 2; + */ + optionalClosedEnumField?: Edition2023EnumClosedJson; + + /** + * @generated from field: string optional_string_field_with_default = 3 [default = "hello \" *\/ "]; + */ + optionalStringFieldWithDefault?: string; + + /** + * @generated from field: spec.Edition2023FromProto2Message.OptionalGroup optionalgroup = 4 [features.message_encoding = DELIMITED]; + */ + optionalgroup?: Edition2023FromProto2Message_OptionalGroupJson; + + /** + * @generated from field: bool required_bool_field = 5 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumClosed required_closed_enum_field = 6 [features.field_presence = LEGACY_REQUIRED]; + */ + requiredClosedEnumField?: Edition2023EnumClosedJson; + + /** + * @generated from field: string required_string_field_with_default = 7 [default = "", features.field_presence = LEGACY_REQUIRED]; + */ + requiredStringFieldWithDefault?: string; + + /** + * @generated from field: spec.Edition2023FromProto2Message.RequiredGroup requiredgroup = 8 [features.message_encoding = DELIMITED]; + */ + requiredgroup?: Edition2023FromProto2Message_RequiredGroupJson; + + /** + * @generated from field: repeated double packed_double_field = 9 [features.repeated_field_encoding = PACKED]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double_field = 10 [features.repeated_field_encoding = EXPANDED]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; +}; + /** * Describes the message spec.Edition2023FromProto2Message. * Use `create(Edition2023FromProto2MessageDesc)` to create a new message. */ -export declare const Edition2023FromProto2MessageDesc: GenDescMessage; +export declare const Edition2023FromProto2MessageDesc: GenDescMessage; /** * @generated from message spec.Edition2023FromProto2Message.OptionalGroup @@ -568,11 +1058,21 @@ export declare type Edition2023FromProto2Message_OptionalGroup = Message<"spec.E int32Field: number; }; +/** + * JSON type for the message spec.Edition2023FromProto2Message.OptionalGroup. + */ +export declare type Edition2023FromProto2Message_OptionalGroupJson = { + /** + * @generated from field: int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Edition2023FromProto2Message.OptionalGroup. * Use `create(Edition2023FromProto2Message_OptionalGroupDesc)` to create a new message. */ -export declare const Edition2023FromProto2Message_OptionalGroupDesc: GenDescMessage; +export declare const Edition2023FromProto2Message_OptionalGroupDesc: GenDescMessage; /** * @generated from message spec.Edition2023FromProto2Message.RequiredGroup @@ -584,11 +1084,21 @@ export declare type Edition2023FromProto2Message_RequiredGroup = Message<"spec.E int32Field: number; }; +/** + * JSON type for the message spec.Edition2023FromProto2Message.RequiredGroup. + */ +export declare type Edition2023FromProto2Message_RequiredGroupJson = { + /** + * @generated from field: int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Edition2023FromProto2Message.RequiredGroup. * Use `create(Edition2023FromProto2Message_RequiredGroupDesc)` to create a new message. */ -export declare const Edition2023FromProto2Message_RequiredGroupDesc: GenDescMessage; +export declare const Edition2023FromProto2Message_RequiredGroupDesc: GenDescMessage; /** * this is an exact replication of spec.Proto2MessageForEdition2023 in editions @@ -628,11 +1138,46 @@ export declare type Edition2023FromProto3Message = Message<"spec.Edition2023From unpackedDoubleField: number[]; }; +/** + * JSON type for the message spec.Edition2023FromProto3Message. + */ +export declare type Edition2023FromProto3MessageJson = { + /** + * @generated from field: bool implicit_bool_field = 1 [features.field_presence = IMPLICIT]; + */ + implicitBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen implicit_open_enum_field = 2 [features.field_presence = IMPLICIT]; + */ + implicitOpenEnumField?: Edition2023EnumOpenJson; + + /** + * @generated from field: bool explicit_bool_field = 5 [features.field_presence = EXPLICIT]; + */ + explicitBoolField?: boolean; + + /** + * @generated from field: spec.Edition2023EnumOpen explicit_open_enum_field = 6 [features.field_presence = EXPLICIT]; + */ + explicitOpenEnumField?: Edition2023EnumOpenJson; + + /** + * @generated from field: repeated double packed_double_field = 9 [features.repeated_field_encoding = PACKED]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double_field = 10 [features.repeated_field_encoding = EXPANDED]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; +}; + /** * Describes the message spec.Edition2023FromProto3Message. * Use `create(Edition2023FromProto3MessageDesc)` to create a new message. */ -export declare const Edition2023FromProto3MessageDesc: GenDescMessage; +export declare const Edition2023FromProto3MessageDesc: GenDescMessage; /** * @generated from enum spec.Edition2023EnumOpen @@ -649,10 +1194,15 @@ export enum Edition2023EnumOpen { A = 1, } +/** + * JSON type for the enum spec.Edition2023EnumOpen. + */ +export declare type Edition2023EnumOpenJson = "EDITION2023_ENUM_OPEN_UNSPECIFIED" | "EDITION2023_ENUM_OPEN_A"; + /** * Describes the enum spec.Edition2023EnumOpen. */ -export declare const Edition2023EnumOpenDesc: GenDescEnum; +export declare const Edition2023EnumOpenDesc: GenDescEnum; /** * @generated from enum spec.Edition2023EnumClosed @@ -665,8 +1215,13 @@ export enum Edition2023EnumClosed { A = 1, } +/** + * JSON type for the enum spec.Edition2023EnumClosed. + */ +export declare type Edition2023EnumClosedJson = "EDITION2023_ENUM_CLOSED_A"; + /** * Describes the enum spec.Edition2023EnumClosed. */ -export declare const Edition2023EnumClosedDesc: GenDescEnum; +export declare const Edition2023EnumClosedDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/example_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/example_pb.d.ts index a349ee683..2756ad48b 100644 --- a/packages/protobuf-test/src/gen/js/extra/example_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/example_pb.d.ts @@ -59,9 +59,44 @@ export declare type User = Message<"docs.User"> & { projects: { [key: string]: string }; }; +/** + * JSON type for the message docs.User. + */ +export declare type UserJson = { + /** + * @generated from field: string first_name = 1; + */ + firstName?: string; + + /** + * @generated from field: string last_name = 2; + */ + lastName?: string; + + /** + * @generated from field: bool active = 3; + */ + active?: boolean; + + /** + * @generated from field: docs.User manager = 4; + */ + manager?: UserJson; + + /** + * @generated from field: repeated string locations = 5; + */ + locations?: string[]; + + /** + * @generated from field: map projects = 6; + */ + projects?: { [key: string]: string }; +}; + /** * Describes the message docs.User. * Use `create(UserDesc)` to create a new message. */ -export declare const UserDesc: GenDescMessage; +export declare const UserDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/extensions-proto2_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/extensions-proto2_pb.d.ts index a237b62bc..301599cd6 100644 --- a/packages/protobuf-test/src/gen/js/extra/extensions-proto2_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/extensions-proto2_pb.d.ts @@ -37,11 +37,21 @@ export declare type Proto2Extendee = Message<"proto2ext.Proto2Extendee"> & { ownField: number; }; +/** + * JSON type for the message proto2ext.Proto2Extendee. + */ +export declare type Proto2ExtendeeJson = { + /** + * @generated from field: optional int32 own_field = 1; + */ + ownField?: number; +}; + /** * Describes the message proto2ext.Proto2Extendee. * Use `create(Proto2ExtendeeDesc)` to create a new message. */ -export declare const Proto2ExtendeeDesc: GenDescMessage; +export declare const Proto2ExtendeeDesc: GenDescMessage; /** * A message used in extensions @@ -55,11 +65,21 @@ export declare type Proto2ExtMessage = Message<"proto2ext.Proto2ExtMessage"> & { stringField: string; }; +/** + * JSON type for the message proto2ext.Proto2ExtMessage. + */ +export declare type Proto2ExtMessageJson = { + /** + * @generated from field: optional string string_field = 1; + */ + stringField?: string; +}; + /** * Describes the message proto2ext.Proto2ExtMessage. * Use `create(Proto2ExtMessageDesc)` to create a new message. */ -export declare const Proto2ExtMessageDesc: GenDescMessage; +export declare const Proto2ExtMessageDesc: GenDescMessage; /** * @generated from message proto2ext.GroupExt @@ -76,11 +96,26 @@ export declare type GroupExt = Message<"proto2ext.GroupExt"> & { b: number; }; +/** + * JSON type for the message proto2ext.GroupExt. + */ +export declare type GroupExtJson = { + /** + * @generated from field: optional int32 a = 1; + */ + a?: number; + + /** + * @generated from field: optional int32 b = 2; + */ + b?: number; +}; + /** * Describes the message proto2ext.GroupExt. * Use `create(GroupExtDesc)` to create a new message. */ -export declare const GroupExtDesc: GenDescMessage; +export declare const GroupExtDesc: GenDescMessage; /** * @generated from message proto2ext.RepeatedGroupExt @@ -97,11 +132,26 @@ export declare type RepeatedGroupExt = Message<"proto2ext.RepeatedGroupExt"> & { b: number; }; +/** + * JSON type for the message proto2ext.RepeatedGroupExt. + */ +export declare type RepeatedGroupExtJson = { + /** + * @generated from field: optional int32 a = 1; + */ + a?: number; + + /** + * @generated from field: optional int32 b = 2; + */ + b?: number; +}; + /** * Describes the message proto2ext.RepeatedGroupExt. * Use `create(RepeatedGroupExtDesc)` to create a new message. */ -export declare const RepeatedGroupExtDesc: GenDescMessage; +export declare const RepeatedGroupExtDesc: GenDescMessage; /** * A container for nested extensions @@ -111,11 +161,17 @@ export declare const RepeatedGroupExtDesc: GenDescMessage; export declare type Proto2ExtContainer = Message<"proto2ext.Proto2ExtContainer"> & { }; +/** + * JSON type for the message proto2ext.Proto2ExtContainer. + */ +export declare type Proto2ExtContainerJson = { +}; + /** * Describes the message proto2ext.Proto2ExtContainer. * Use `create(Proto2ExtContainerDesc)` to create a new message. */ -export declare const Proto2ExtContainerDesc: GenDescMessage; +export declare const Proto2ExtContainerDesc: GenDescMessage; /** * @generated from message proto2ext.Proto2ExtContainer.Child @@ -123,11 +179,17 @@ export declare const Proto2ExtContainerDesc: GenDescMessage; export declare type Proto2ExtContainer_Child = Message<"proto2ext.Proto2ExtContainer.Child"> & { }; +/** + * JSON type for the message proto2ext.Proto2ExtContainer.Child. + */ +export declare type Proto2ExtContainer_ChildJson = { +}; + /** * Describes the message proto2ext.Proto2ExtContainer.Child. * Use `create(Proto2ExtContainer_ChildDesc)` to create a new message. */ -export declare const Proto2ExtContainer_ChildDesc: GenDescMessage; +export declare const Proto2ExtContainer_ChildDesc: GenDescMessage; /** * @generated from extension: optional uint32 uint32_ext = 9010; @@ -156,10 +218,15 @@ export enum Proto2ExtEnum { NO = 2, } +/** + * JSON type for the enum proto2ext.Proto2ExtEnum. + */ +export declare type Proto2ExtEnumJson = "PROTO2_EXT_ENUM_YES" | "PROTO2_EXT_ENUM_NO"; + /** * Describes the enum proto2ext.Proto2ExtEnum. */ -export declare const Proto2ExtEnumDesc: GenDescEnum; +export declare const Proto2ExtEnumDesc: GenDescEnum; /** * @generated from extension: optional uint32 uint32_ext = 1001; 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 4468ae5e5..5d32f70fb 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 @@ -37,11 +37,21 @@ export declare type Proto3ExtMessage = Message<"proto3ext.Proto3ExtMessage"> & { stringField: string; }; +/** + * JSON type for the message proto3ext.Proto3ExtMessage. + */ +export declare type Proto3ExtMessageJson = { + /** + * @generated from field: string string_field = 1; + */ + stringField?: string; +}; + /** * Describes the message proto3ext.Proto3ExtMessage. * Use `create(Proto3ExtMessageDesc)` to create a new message. */ -export declare const Proto3ExtMessageDesc: GenDescMessage; +export declare const Proto3ExtMessageDesc: GenDescMessage; /** * @generated from extension: uint32 uint32_ext = 1001; diff --git a/packages/protobuf-test/src/gen/js/extra/jstype-proto2_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/jstype-proto2_pb.d.ts index 3c4e3d27e..02f8d9319 100644 --- a/packages/protobuf-test/src/gen/js/extra/jstype-proto2_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/jstype-proto2_pb.d.ts @@ -79,11 +79,66 @@ export declare type JSTypeProto2OmittedMessage = Message<"spec.JSTypeProto2Omitt repeatedUint64Field: bigint[]; }; +/** + * JSON type for the message spec.JSTypeProto2OmittedMessage. + */ +export declare type JSTypeProto2OmittedMessageJson = { + /** + * @generated from field: optional fixed64 fixed64_field = 1; + */ + fixed64Field?: string; + + /** + * @generated from field: optional int64 int64_field = 3; + */ + int64Field?: string; + + /** + * @generated from field: optional sfixed64 sfixed64_field = 4; + */ + sfixed64Field?: string; + + /** + * @generated from field: optional sint64 sint64_field = 5; + */ + sint64Field?: string; + + /** + * @generated from field: optional uint64 uint64_field = 6; + */ + uint64Field?: string; + + /** + * @generated from field: repeated fixed64 repeated_fixed64_field = 11; + */ + repeatedFixed64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 12; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64_field = 13; + */ + repeatedSfixed64Field?: string[]; + + /** + * @generated from field: repeated sint64 repeated_sint64_field = 14; + */ + repeatedSint64Field?: string[]; + + /** + * @generated from field: repeated uint64 repeated_uint64_field = 15; + */ + repeatedUint64Field?: string[]; +}; + /** * Describes the message spec.JSTypeProto2OmittedMessage. * Use `create(JSTypeProto2OmittedMessageDesc)` to create a new message. */ -export declare const JSTypeProto2OmittedMessageDesc: GenDescMessage; +export declare const JSTypeProto2OmittedMessageDesc: GenDescMessage; /** * @generated from message spec.JSTypeProto2NormalMessage @@ -140,11 +195,66 @@ export declare type JSTypeProto2NormalMessage = Message<"spec.JSTypeProto2Normal repeatedUint64Field: bigint[]; }; +/** + * JSON type for the message spec.JSTypeProto2NormalMessage. + */ +export declare type JSTypeProto2NormalMessageJson = { + /** + * @generated from field: optional fixed64 fixed64_field = 1 [jstype = JS_NORMAL]; + */ + fixed64Field?: string; + + /** + * @generated from field: optional int64 int64_field = 3 [jstype = JS_NORMAL]; + */ + int64Field?: string; + + /** + * @generated from field: optional sfixed64 sfixed64_field = 4 [jstype = JS_NORMAL]; + */ + sfixed64Field?: string; + + /** + * @generated from field: optional sint64 sint64_field = 5 [jstype = JS_NORMAL]; + */ + sint64Field?: string; + + /** + * @generated from field: optional uint64 uint64_field = 6 [jstype = JS_NORMAL]; + */ + uint64Field?: string; + + /** + * @generated from field: repeated fixed64 repeated_fixed64_field = 11 [jstype = JS_NORMAL]; + */ + repeatedFixed64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 12 [jstype = JS_NORMAL]; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64_field = 13 [jstype = JS_NORMAL]; + */ + repeatedSfixed64Field?: string[]; + + /** + * @generated from field: repeated sint64 repeated_sint64_field = 14 [jstype = JS_NORMAL]; + */ + repeatedSint64Field?: string[]; + + /** + * @generated from field: repeated uint64 repeated_uint64_field = 15 [jstype = JS_NORMAL]; + */ + repeatedUint64Field?: string[]; +}; + /** * Describes the message spec.JSTypeProto2NormalMessage. * Use `create(JSTypeProto2NormalMessageDesc)` to create a new message. */ -export declare const JSTypeProto2NormalMessageDesc: GenDescMessage; +export declare const JSTypeProto2NormalMessageDesc: GenDescMessage; /** * @generated from message spec.JSTypeProto2StringMessage @@ -201,11 +311,66 @@ export declare type JSTypeProto2StringMessage = Message<"spec.JSTypeProto2String repeatedUint64Field: string[]; }; +/** + * JSON type for the message spec.JSTypeProto2StringMessage. + */ +export declare type JSTypeProto2StringMessageJson = { + /** + * @generated from field: optional fixed64 fixed64_field = 1 [jstype = JS_STRING]; + */ + fixed64Field?: string; + + /** + * @generated from field: optional int64 int64_field = 3 [jstype = JS_STRING]; + */ + int64Field?: string; + + /** + * @generated from field: optional sfixed64 sfixed64_field = 4 [jstype = JS_STRING]; + */ + sfixed64Field?: string; + + /** + * @generated from field: optional sint64 sint64_field = 5 [jstype = JS_STRING]; + */ + sint64Field?: string; + + /** + * @generated from field: optional uint64 uint64_field = 6 [jstype = JS_STRING]; + */ + uint64Field?: string; + + /** + * @generated from field: repeated fixed64 repeated_fixed64_field = 11 [jstype = JS_STRING]; + */ + repeatedFixed64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 12 [jstype = JS_STRING]; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64_field = 13 [jstype = JS_STRING]; + */ + repeatedSfixed64Field?: string[]; + + /** + * @generated from field: repeated sint64 repeated_sint64_field = 14 [jstype = JS_STRING]; + */ + repeatedSint64Field?: string[]; + + /** + * @generated from field: repeated uint64 repeated_uint64_field = 15 [jstype = JS_STRING]; + */ + repeatedUint64Field?: string[]; +}; + /** * Describes the message spec.JSTypeProto2StringMessage. * Use `create(JSTypeProto2StringMessageDesc)` to create a new message. */ -export declare const JSTypeProto2StringMessageDesc: GenDescMessage; +export declare const JSTypeProto2StringMessageDesc: GenDescMessage; /** * @generated from message spec.JSTypeProto2NumberMessage @@ -262,9 +427,64 @@ export declare type JSTypeProto2NumberMessage = Message<"spec.JSTypeProto2Number repeatedUint64Field: bigint[]; }; +/** + * JSON type for the message spec.JSTypeProto2NumberMessage. + */ +export declare type JSTypeProto2NumberMessageJson = { + /** + * @generated from field: optional fixed64 fixed64_field = 1 [jstype = JS_NUMBER]; + */ + fixed64Field?: string; + + /** + * @generated from field: optional int64 int64_field = 3 [jstype = JS_NUMBER]; + */ + int64Field?: string; + + /** + * @generated from field: optional sfixed64 sfixed64_field = 4 [jstype = JS_NUMBER]; + */ + sfixed64Field?: string; + + /** + * @generated from field: optional sint64 sint64_field = 5 [jstype = JS_NUMBER]; + */ + sint64Field?: string; + + /** + * @generated from field: optional uint64 uint64_field = 6 [jstype = JS_NUMBER]; + */ + uint64Field?: string; + + /** + * @generated from field: repeated fixed64 repeated_fixed64_field = 11 [jstype = JS_NUMBER]; + */ + repeatedFixed64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 12 [jstype = JS_NUMBER]; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64_field = 13 [jstype = JS_NUMBER]; + */ + repeatedSfixed64Field?: string[]; + + /** + * @generated from field: repeated sint64 repeated_sint64_field = 14 [jstype = JS_NUMBER]; + */ + repeatedSint64Field?: string[]; + + /** + * @generated from field: repeated uint64 repeated_uint64_field = 15 [jstype = JS_NUMBER]; + */ + repeatedUint64Field?: string[]; +}; + /** * Describes the message spec.JSTypeProto2NumberMessage. * Use `create(JSTypeProto2NumberMessageDesc)` to create a new message. */ -export declare const JSTypeProto2NumberMessageDesc: GenDescMessage; +export declare const JSTypeProto2NumberMessageDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/msg-json-names_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/msg-json-names_pb.d.ts index cb7ac29e5..8957fbbcd 100644 --- a/packages/protobuf-test/src/gen/js/extra/msg-json-names_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/msg-json-names_pb.d.ts @@ -59,9 +59,44 @@ export declare type JsonNamesMessage = Message<"spec.JsonNamesMessage"> & { d: string; }; +/** + * JSON type for the message spec.JsonNamesMessage. + */ +export declare type JsonNamesMessageJson = { + /** + * @generated from field: string scalar_field = 1 [json_name = "scalarFieldJsonName"]; + */ + scalarFieldJsonName?: string; + + /** + * @generated from field: repeated string repeated_scalar_field = 2 [json_name = "repeatedScalarFieldJsonName"]; + */ + repeatedScalarFieldJsonName?: string[]; + + /** + * @generated from field: string a = 3; + */ + a?: string; + + /** + * @generated from field: string b = 4 [json_name = ""]; + */ + ""?: string; + + /** + * @generated from field: string c = 5 [json_name = "@type"]; + */ + "@type"?: string; + + /** + * @generated from field: string d = 6 [json_name = "1d"]; + */ + "1d"?: string; +}; + /** * Describes the message spec.JsonNamesMessage. * Use `create(JsonNamesMessageDesc)` to create a new message. */ -export declare const JsonNamesMessageDesc: GenDescMessage; +export declare const JsonNamesMessageDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/msg-maps_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/msg-maps_pb.d.ts index 1ff885794..b63518e7e 100644 --- a/packages/protobuf-test/src/gen/js/extra/msg-maps_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/msg-maps_pb.d.ts @@ -99,11 +99,86 @@ export declare type MapsMessage = Message<"spec.MapsMessage"> & { int64EnuField: { [key: string]: MapsEnum }; }; +/** + * JSON type for the message spec.MapsMessage. + */ +export declare type MapsMessageJson = { + /** + * @generated from field: map str_str_field = 1; + */ + strStrField?: { [key: string]: string }; + + /** + * @generated from field: map str_int32_field = 2; + */ + strInt32Field?: { [key: string]: number }; + + /** + * @generated from field: map str_int64_field = 3; + */ + strInt64Field?: { [key: string]: string }; + + /** + * @generated from field: map str_bool_field = 4; + */ + strBoolField?: { [key: string]: boolean }; + + /** + * @generated from field: map str_bytes_field = 5; + */ + strBytesField?: { [key: string]: string }; + + /** + * @generated from field: map int32_str_field = 6; + */ + int32StrField?: { [key: number]: string }; + + /** + * @generated from field: map int64_str_field = 7; + */ + int64StrField?: { [key: string]: string }; + + /** + * @generated from field: map bool_str_field = 8; + */ + boolStrField?: { [key: string]: string }; + + /** + * @generated from field: map str_msg_field = 9; + */ + strMsgField?: { [key: string]: MapsMessageJson }; + + /** + * @generated from field: map int32_msg_field = 10; + */ + int32MsgField?: { [key: number]: MapsMessageJson }; + + /** + * @generated from field: map int64_msg_field = 11; + */ + int64MsgField?: { [key: string]: MapsMessageJson }; + + /** + * @generated from field: map str_enu_field = 12; + */ + strEnuField?: { [key: string]: MapsEnumJson }; + + /** + * @generated from field: map int32_enu_field = 13; + */ + int32EnuField?: { [key: number]: MapsEnumJson }; + + /** + * @generated from field: map int64_enu_field = 14; + */ + int64EnuField?: { [key: string]: MapsEnumJson }; +}; + /** * Describes the message spec.MapsMessage. * Use `create(MapsMessageDesc)` to create a new message. */ -export declare const MapsMessageDesc: GenDescMessage; +export declare const MapsMessageDesc: GenDescMessage; /** * @generated from enum spec.MapsEnum @@ -125,8 +200,13 @@ export enum MapsEnum { NO = 2, } +/** + * JSON type for the enum spec.MapsEnum. + */ +export declare type MapsEnumJson = "MAPS_ENUM_ANY" | "MAPS_ENUM_YES" | "MAPS_ENUM_NO"; + /** * Describes the enum spec.MapsEnum. */ -export declare const MapsEnumDesc: GenDescEnum; +export declare const MapsEnumDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/msg-message_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/msg-message_pb.d.ts index 25c597f63..504c84a0c 100644 --- a/packages/protobuf-test/src/gen/js/extra/msg-message_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/msg-message_pb.d.ts @@ -39,11 +39,26 @@ export declare type MessageFieldMessage = Message<"spec.MessageFieldMessage"> & repeatedMessageField: MessageFieldMessage_TestMessage[]; }; +/** + * JSON type for the message spec.MessageFieldMessage. + */ +export declare type MessageFieldMessageJson = { + /** + * @generated from field: spec.MessageFieldMessage.TestMessage message_field = 1; + */ + messageField?: MessageFieldMessage_TestMessageJson; + + /** + * @generated from field: repeated spec.MessageFieldMessage.TestMessage repeated_message_field = 2; + */ + repeatedMessageField?: MessageFieldMessage_TestMessageJson[]; +}; + /** * Describes the message spec.MessageFieldMessage. * Use `create(MessageFieldMessageDesc)` to create a new message. */ -export declare const MessageFieldMessageDesc: GenDescMessage; +export declare const MessageFieldMessageDesc: GenDescMessage; /** * @generated from message spec.MessageFieldMessage.TestMessage @@ -55,9 +70,19 @@ export declare type MessageFieldMessage_TestMessage = Message<"spec.MessageField name: string; }; +/** + * JSON type for the message spec.MessageFieldMessage.TestMessage. + */ +export declare type MessageFieldMessage_TestMessageJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; +}; + /** * Describes the message spec.MessageFieldMessage.TestMessage. * Use `create(MessageFieldMessage_TestMessageDesc)` to create a new message. */ -export declare const MessageFieldMessage_TestMessageDesc: GenDescMessage; +export declare const MessageFieldMessage_TestMessageDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/msg-oneof_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/msg-oneof_pb.d.ts index 619ae2871..4ae57de16 100644 --- a/packages/protobuf-test/src/gen/js/extra/msg-oneof_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/msg-oneof_pb.d.ts @@ -86,11 +86,51 @@ export declare type OneofMessage = Message<"spec.OneofMessage"> & { } | { case: undefined; value?: undefined }; }; +/** + * JSON type for the message spec.OneofMessage. + */ +export declare type OneofMessageJson = { + /** + * @generated from field: int32 value = 1; + */ + value?: number; + + /** + * @generated from field: string error = 2; + */ + error?: string; + + /** + * @generated from field: bytes bytes = 3; + */ + bytes?: string; + + /** + * @generated from field: spec.OneofMessageFoo foo = 11; + */ + foo?: OneofMessageFooJson; + + /** + * @generated from field: spec.OneofMessageBar bar = 12; + */ + bar?: OneofMessageBarJson; + + /** + * @generated from field: spec.OneofMessageBar baz = 13; + */ + baz?: OneofMessageBarJson; + + /** + * @generated from field: spec.OneofEnum e = 21; + */ + e?: OneofEnumJson; +}; + /** * Describes the message spec.OneofMessage. * Use `create(OneofMessageDesc)` to create a new message. */ -export declare const OneofMessageDesc: GenDescMessage; +export declare const OneofMessageDesc: GenDescMessage; /** * @generated from message spec.OneofMessageFoo @@ -107,11 +147,26 @@ export declare type OneofMessageFoo = Message<"spec.OneofMessageFoo"> & { toggle: boolean; }; +/** + * JSON type for the message spec.OneofMessageFoo. + */ +export declare type OneofMessageFooJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; + + /** + * @generated from field: bool toggle = 2; + */ + toggle?: boolean; +}; + /** * Describes the message spec.OneofMessageFoo. * Use `create(OneofMessageFooDesc)` to create a new message. */ -export declare const OneofMessageFooDesc: GenDescMessage; +export declare const OneofMessageFooDesc: GenDescMessage; /** * @generated from message spec.OneofMessageBar @@ -128,11 +183,26 @@ export declare type OneofMessageBar = Message<"spec.OneofMessageBar"> & { b: number; }; +/** + * JSON type for the message spec.OneofMessageBar. + */ +export declare type OneofMessageBarJson = { + /** + * @generated from field: int32 a = 1; + */ + a?: number; + + /** + * @generated from field: int32 b = 2; + */ + b?: number; +}; + /** * Describes the message spec.OneofMessageBar. * Use `create(OneofMessageBarDesc)` to create a new message. */ -export declare const OneofMessageBarDesc: GenDescMessage; +export declare const OneofMessageBarDesc: GenDescMessage; /** * @generated from enum spec.OneofEnum @@ -154,8 +224,13 @@ export enum OneofEnum { B = 2, } +/** + * JSON type for the enum spec.OneofEnum. + */ +export declare type OneofEnumJson = "ONEOF_ENUM_UNSPECIFIED" | "ONEOF_ENUM_A" | "ONEOF_ENUM_B"; + /** * Describes the enum spec.OneofEnum. */ -export declare const OneofEnumDesc: GenDescEnum; +export declare const OneofEnumDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/msg-scalar_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/msg-scalar_pb.d.ts index 642508252..a0711ce9b 100644 --- a/packages/protobuf-test/src/gen/js/extra/msg-scalar_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/msg-scalar_pb.d.ts @@ -104,11 +104,91 @@ export declare type ScalarValuesMessage = Message<"spec.ScalarValuesMessage"> & sint64Field: bigint; }; +/** + * JSON type for the message spec.ScalarValuesMessage. + */ +export declare type ScalarValuesMessageJson = { + /** + * @generated from field: double double_field = 1; + */ + doubleField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: float float_field = 2; + */ + floatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: int64 int64_field = 3; + */ + int64Field?: string; + + /** + * @generated from field: uint64 uint64_field = 4; + */ + uint64Field?: string; + + /** + * @generated from field: int32 int32_field = 5; + */ + int32Field?: number; + + /** + * @generated from field: fixed64 fixed64_field = 6; + */ + fixed64Field?: string; + + /** + * @generated from field: fixed32 fixed32_field = 7; + */ + fixed32Field?: number; + + /** + * @generated from field: bool bool_field = 8; + */ + boolField?: boolean; + + /** + * @generated from field: string string_field = 9; + */ + stringField?: string; + + /** + * @generated from field: bytes bytes_field = 11; + */ + bytesField?: string; + + /** + * @generated from field: uint32 uint32_field = 12; + */ + uint32Field?: number; + + /** + * @generated from field: sfixed32 sfixed32_field = 14; + */ + sfixed32Field?: number; + + /** + * @generated from field: sfixed64 sfixed64_field = 15; + */ + sfixed64Field?: string; + + /** + * @generated from field: sint32 sint32_field = 16; + */ + sint32Field?: number; + + /** + * @generated from field: sint64 sint64_field = 17; + */ + sint64Field?: string; +}; + /** * Describes the message spec.ScalarValuesMessage. * Use `create(ScalarValuesMessageDesc)` to create a new message. */ -export declare const ScalarValuesMessageDesc: GenDescMessage; +export declare const ScalarValuesMessageDesc: GenDescMessage; /** * @generated from message spec.RepeatedScalarValuesMessage @@ -190,9 +270,89 @@ export declare type RepeatedScalarValuesMessage = Message<"spec.RepeatedScalarVa sint64Field: bigint[]; }; +/** + * JSON type for the message spec.RepeatedScalarValuesMessage. + */ +export declare type RepeatedScalarValuesMessageJson = { + /** + * @generated from field: repeated double double_field = 1; + */ + doubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated float float_field = 2; + */ + floatField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated int64 int64_field = 3; + */ + int64Field?: string[]; + + /** + * @generated from field: repeated uint64 uint64_field = 4; + */ + uint64Field?: string[]; + + /** + * @generated from field: repeated int32 int32_field = 5; + */ + int32Field?: number[]; + + /** + * @generated from field: repeated fixed64 fixed64_field = 6; + */ + fixed64Field?: string[]; + + /** + * @generated from field: repeated fixed32 fixed32_field = 7; + */ + fixed32Field?: number[]; + + /** + * @generated from field: repeated bool bool_field = 8; + */ + boolField?: boolean[]; + + /** + * @generated from field: repeated string string_field = 9; + */ + stringField?: string[]; + + /** + * @generated from field: repeated bytes bytes_field = 11; + */ + bytesField?: string[]; + + /** + * @generated from field: repeated uint32 uint32_field = 12; + */ + uint32Field?: number[]; + + /** + * @generated from field: repeated sfixed32 sfixed32_field = 14; + */ + sfixed32Field?: number[]; + + /** + * @generated from field: repeated sfixed64 sfixed64_field = 15; + */ + sfixed64Field?: string[]; + + /** + * @generated from field: repeated sint32 sint32_field = 16; + */ + sint32Field?: number[]; + + /** + * @generated from field: repeated sint64 sint64_field = 17; + */ + sint64Field?: string[]; +}; + /** * Describes the message spec.RepeatedScalarValuesMessage. * Use `create(RepeatedScalarValuesMessageDesc)` to create a new message. */ -export declare const RepeatedScalarValuesMessageDesc: GenDescMessage; +export declare const RepeatedScalarValuesMessageDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/extra/name-clash_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/name-clash_pb.d.ts index 3e85afed2..30b247f41 100644 --- a/packages/protobuf-test/src/gen/js/extra/name-clash_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/name-clash_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage, GenDescService } from "@bufbuild/protobuf/codegenv1"; import type { Message as Message$1 } from "@bufbuild/protobuf"; -import type { User as User$1 } from "./example_pb.js"; +import type { User as User$1, UserJson as UserJson$1 } from "./example_pb.js"; /** * Describes the file extra/name-clash.proto. @@ -39,11 +39,21 @@ export declare type User = Message$1<"spec.User"> & { u?: User$1; }; +/** + * JSON type for the message spec.User. + */ +export declare type UserJson = { + /** + * @generated from field: docs.User u = 1; + */ + u?: UserJson$1; +}; + /** * Describes the message spec.User. * Use `create(UserDesc)` to create a new message. */ -export declare const UserDesc: GenDescMessage; +export declare const UserDesc: GenDescMessage; /** * @generated from message spec.ReservedPropertyNames @@ -51,11 +61,17 @@ export declare const UserDesc: GenDescMessage; export declare type ReservedPropertyNames = Message$1<"spec.ReservedPropertyNames"> & { }; +/** + * JSON type for the message spec.ReservedPropertyNames. + */ +export declare type ReservedPropertyNamesJson = { +}; + /** * Describes the message spec.ReservedPropertyNames. * Use `create(ReservedPropertyNamesDesc)` to create a new message. */ -export declare const ReservedPropertyNamesDesc: GenDescMessage; +export declare const ReservedPropertyNamesDesc: GenDescMessage; /** * @generated from message spec.ReservedPropertyNames.BuiltIn @@ -90,11 +106,36 @@ export declare type ReservedPropertyNames_BuiltIn = Message$1<"spec.ReservedProp valueOf$: string; }; +/** + * JSON type for the message spec.ReservedPropertyNames.BuiltIn. + */ +export declare type ReservedPropertyNames_BuiltInJson = { + /** + * @generated from field: string constructor = 2; + */ + constructor?: string; + + /** + * @generated from field: string to_string = 3; + */ + toString?: string; + + /** + * @generated from field: string to_JSON = 4; + */ + toJSON?: string; + + /** + * @generated from field: string value_of = 5; + */ + valueOf?: string; +}; + /** * Describes the message spec.ReservedPropertyNames.BuiltIn. * Use `create(ReservedPropertyNames_BuiltInDesc)` to create a new message. */ -export declare const ReservedPropertyNames_BuiltInDesc: GenDescMessage; +export declare const ReservedPropertyNames_BuiltInDesc: GenDescMessage; /** * @generated from message spec.ReservedPropertyNames.Runtime @@ -164,11 +205,61 @@ export declare type ReservedPropertyNames_Runtime = Message$1<"spec.ReservedProp toJsonString: string; }; +/** + * JSON type for the message spec.ReservedPropertyNames.Runtime. + */ +export declare type ReservedPropertyNames_RuntimeJson = { + /** + * @generated from field: string to_json = 4; + */ + toJson?: string; + + /** + * @generated from field: string type = 6; + */ + type?: string; + + /** + * @generated from field: string clone = 7; + */ + clone?: string; + + /** + * @generated from field: string equals = 8; + */ + equals?: string; + + /** + * @generated from field: string from_binary = 9; + */ + fromBinary?: string; + + /** + * @generated from field: string from_json = 10; + */ + fromJson?: string; + + /** + * @generated from field: string from_json_string = 11; + */ + fromJsonString?: string; + + /** + * @generated from field: string to_binary = 12; + */ + toBinary?: string; + + /** + * @generated from field: string to_json_string = 14; + */ + toJsonString?: string; +}; + /** * Describes the message spec.ReservedPropertyNames.Runtime. * Use `create(ReservedPropertyNames_RuntimeDesc)` to create a new message. */ -export declare const ReservedPropertyNames_RuntimeDesc: GenDescMessage; +export declare const ReservedPropertyNames_RuntimeDesc: GenDescMessage; /** * @generated from message spec.ReservedPropertyNames.OneofBultIn @@ -204,11 +295,36 @@ export declare type ReservedPropertyNames_OneofBultIn = Message$1<"spec.Reserved } | { case: undefined; value?: undefined }; }; +/** + * JSON type for the message spec.ReservedPropertyNames.OneofBultIn. + */ +export declare type ReservedPropertyNames_OneofBultInJson = { + /** + * @generated from field: string constructor = 1; + */ + constructor?: string; + + /** + * @generated from field: string to_string = 2; + */ + toString?: string; + + /** + * @generated from field: string to_JSON = 3; + */ + toJSON?: string; + + /** + * @generated from field: string value_of = 4; + */ + valueOf?: string; +}; + /** * Describes the message spec.ReservedPropertyNames.OneofBultIn. * Use `create(ReservedPropertyNames_OneofBultInDesc)` to create a new message. */ -export declare const ReservedPropertyNames_OneofBultInDesc: GenDescMessage; +export declare const ReservedPropertyNames_OneofBultInDesc: GenDescMessage; /** * @generated from message spec.ReservedPropertyNames.OneofRuntime @@ -274,11 +390,61 @@ export declare type ReservedPropertyNames_OneofRuntime = Message$1<"spec.Reserve } | { case: undefined; value?: undefined }; }; +/** + * JSON type for the message spec.ReservedPropertyNames.OneofRuntime. + */ +export declare type ReservedPropertyNames_OneofRuntimeJson = { + /** + * @generated from field: string to_json = 5; + */ + toJson?: string; + + /** + * @generated from field: string type = 6; + */ + type?: string; + + /** + * @generated from field: string clone = 7; + */ + clone?: string; + + /** + * @generated from field: string equals = 8; + */ + equals?: string; + + /** + * @generated from field: string from_binary = 9; + */ + fromBinary?: string; + + /** + * @generated from field: string from_json = 10; + */ + fromJson?: string; + + /** + * @generated from field: string from_json_string = 11; + */ + fromJsonString?: string; + + /** + * @generated from field: string to_binary = 12; + */ + toBinary?: string; + + /** + * @generated from field: string to_json_string = 14; + */ + toJsonString?: string; +}; + /** * Describes the message spec.ReservedPropertyNames.OneofRuntime. * Use `create(ReservedPropertyNames_OneofRuntimeDesc)` to create a new message. */ -export declare const ReservedPropertyNames_OneofRuntimeDesc: GenDescMessage; +export declare const ReservedPropertyNames_OneofRuntimeDesc: GenDescMessage; /** * @generated from enum spec.ReservedPropertyNames.EnumBuiltIn @@ -305,10 +471,15 @@ export enum ReservedPropertyNames_EnumBuiltIn { valueOf$ = 3, } +/** + * JSON type for the enum spec.ReservedPropertyNames.EnumBuiltIn. + */ +export declare type ReservedPropertyNames_EnumBuiltInJson = "constructor" | "toString" | "toJSON" | "valueOf"; + /** * Describes the enum spec.ReservedPropertyNames.EnumBuiltIn. */ -export declare const ReservedPropertyNames_EnumBuiltInDesc: GenDescEnum; +export declare const ReservedPropertyNames_EnumBuiltInDesc: GenDescEnum; /** * @generated from enum spec.ReservedPropertyNames.EnumBuiltInPrefixed @@ -335,10 +506,15 @@ export enum ReservedPropertyNames_EnumBuiltInPrefixed { valueOf$ = 3, } +/** + * JSON type for the enum spec.ReservedPropertyNames.EnumBuiltInPrefixed. + */ +export declare type ReservedPropertyNames_EnumBuiltInPrefixedJson = "ENUM_BUILT_IN_PREFIXED_constructor" | "ENUM_BUILT_IN_PREFIXED_toString" | "ENUM_BUILT_IN_PREFIXED_toJSON" | "ENUM_BUILT_IN_PREFIXED_valueOf"; + /** * Describes the enum spec.ReservedPropertyNames.EnumBuiltInPrefixed. */ -export declare const ReservedPropertyNames_EnumBuiltInPrefixedDesc: GenDescEnum; +export declare const ReservedPropertyNames_EnumBuiltInPrefixedDesc: GenDescEnum; /** * @generated from enum spec.ReservedPropertyNames.EnumRuntime @@ -390,10 +566,15 @@ export enum ReservedPropertyNames_EnumRuntime { toJsonString = 14, } +/** + * JSON type for the enum spec.ReservedPropertyNames.EnumRuntime. + */ +export declare type ReservedPropertyNames_EnumRuntimeJson = "toJson" | "type" | "clone" | "equals" | "fromBinary" | "fromJson" | "fromJsonString" | "toBinary" | "toJsonString"; + /** * Describes the enum spec.ReservedPropertyNames.EnumRuntime. */ -export declare const ReservedPropertyNames_EnumRuntimeDesc: GenDescEnum; +export declare const ReservedPropertyNames_EnumRuntimeDesc: GenDescEnum; /** * reserved identifier @@ -403,11 +584,17 @@ export declare const ReservedPropertyNames_EnumRuntimeDesc: GenDescEnum & { }; +/** + * JSON type for the message spec.interface. + */ +export declare type interface$Json = { +}; + /** * Describes the message spec.interface. * Use `create(interface$Desc)` to create a new message. */ -export declare const interface$Desc: GenDescMessage; +export declare const interface$Desc: GenDescMessage; /** * reserved identifier @@ -417,11 +604,17 @@ export declare const interface$Desc: GenDescMessage; export declare type function$ = Message$1<"spec.function"> & { }; +/** + * JSON type for the message spec.function. + */ +export declare type function$Json = { +}; + /** * Describes the message spec.function. * Use `create(function$Desc)` to create a new message. */ -export declare const function$Desc: GenDescMessage; +export declare const function$Desc: GenDescMessage; /** * reserved identifier @@ -431,11 +624,17 @@ export declare const function$Desc: GenDescMessage; export declare type instanceof$ = Message$1<"spec.instanceof"> & { }; +/** + * JSON type for the message spec.instanceof. + */ +export declare type instanceof$Json = { +}; + /** * Describes the message spec.instanceof. * Use `create(instanceof$Desc)` to create a new message. */ -export declare const instanceof$Desc: GenDescMessage; +export declare const instanceof$Desc: GenDescMessage; /** * reserved identifier @@ -445,11 +644,17 @@ export declare const instanceof$Desc: GenDescMessage; export declare type switch$ = Message$1<"spec.switch"> & { }; +/** + * JSON type for the message spec.switch. + */ +export declare type switch$Json = { +}; + /** * Describes the message spec.switch. * Use `create(switch$Desc)` to create a new message. */ -export declare const switch$Desc: GenDescMessage; +export declare const switch$Desc: GenDescMessage; /** * reserved identifier @@ -459,11 +664,17 @@ export declare const switch$Desc: GenDescMessage; export declare type case$ = Message$1<"spec.case"> & { }; +/** + * JSON type for the message spec.case. + */ +export declare type case$Json = { +}; + /** * Describes the message spec.case. * Use `create(case$Desc)` to create a new message. */ -export declare const case$Desc: GenDescMessage; +export declare const case$Desc: GenDescMessage; /** * reserved identifier @@ -473,11 +684,17 @@ export declare const case$Desc: GenDescMessage; export declare type return$ = Message$1<"spec.return"> & { }; +/** + * JSON type for the message spec.return. + */ +export declare type return$Json = { +}; + /** * Describes the message spec.return. * Use `create(return$Desc)` to create a new message. */ -export declare const return$Desc: GenDescMessage; +export declare const return$Desc: GenDescMessage; /** * used by runtime @@ -487,11 +704,17 @@ export declare const return$Desc: GenDescMessage; export declare type Message = Message$1<"spec.Message"> & { }; +/** + * JSON type for the message spec.Message. + */ +export declare type MessageJson = { +}; + /** * Describes the message spec.Message. * Use `create(MessageDesc)` to create a new message. */ -export declare const MessageDesc: GenDescMessage; +export declare const MessageDesc: GenDescMessage; /** * used by runtime @@ -501,11 +724,17 @@ export declare const MessageDesc: GenDescMessage; export declare type PartialMessage = Message$1<"spec.PartialMessage"> & { }; +/** + * JSON type for the message spec.PartialMessage. + */ +export declare type PartialMessageJson = { +}; + /** * Describes the message spec.PartialMessage. * Use `create(PartialMessageDesc)` to create a new message. */ -export declare const PartialMessageDesc: GenDescMessage; +export declare const PartialMessageDesc: GenDescMessage; /** * used by runtime @@ -515,11 +744,17 @@ export declare const PartialMessageDesc: GenDescMessage; export declare type PlainMessage = Message$1<"spec.PlainMessage"> & { }; +/** + * JSON type for the message spec.PlainMessage. + */ +export declare type PlainMessageJson = { +}; + /** * Describes the message spec.PlainMessage. * Use `create(PlainMessageDesc)` to create a new message. */ -export declare const PlainMessageDesc: GenDescMessage; +export declare const PlainMessageDesc: GenDescMessage; /** * clash with global type "Error" @@ -540,11 +775,26 @@ export declare type Error = Message$1<"spec.Error"> & { message: string; }; +/** + * JSON type for the message spec.Error. + */ +export declare type ErrorJson = { + /** + * @generated from field: string field_name = 1; + */ + fieldName?: string; + + /** + * @generated from field: string message = 2; + */ + message?: string; +}; + /** * Describes the message spec.Error. * Use `create(ErrorDesc)` to create a new message. */ -export declare const ErrorDesc: GenDescMessage; +export declare const ErrorDesc: GenDescMessage; /** * clash with global type @@ -554,11 +804,17 @@ export declare const ErrorDesc: GenDescMessage; export declare type Object$ = Message$1<"spec.Object"> & { }; +/** + * JSON type for the message spec.Object. + */ +export declare type Object$Json = { +}; + /** * Describes the message spec.Object. * Use `create(Object$Desc)` to create a new message. */ -export declare const Object$Desc: GenDescMessage; +export declare const Object$Desc: GenDescMessage; /** * @generated from message spec.object @@ -566,11 +822,17 @@ export declare const Object$Desc: GenDescMessage; export declare type object$ = Message$1<"spec.object"> & { }; +/** + * JSON type for the message spec.object. + */ +export declare type object$Json = { +}; + /** * Describes the message spec.object. * Use `create(object$Desc)` to create a new message. */ -export declare const object$Desc: GenDescMessage; +export declare const object$Desc: GenDescMessage; /** * clash with global type @@ -580,11 +842,17 @@ export declare const object$Desc: GenDescMessage; export declare type array = Message$1<"spec.array"> & { }; +/** + * JSON type for the message spec.array. + */ +export declare type arrayJson = { +}; + /** * Describes the message spec.array. * Use `create(arrayDesc)` to create a new message. */ -export declare const arrayDesc: GenDescMessage; +export declare const arrayDesc: GenDescMessage; /** * clash with global type @@ -594,11 +862,17 @@ export declare const arrayDesc: GenDescMessage; export declare type string$ = Message$1<"spec.string"> & { }; +/** + * JSON type for the message spec.string. + */ +export declare type string$Json = { +}; + /** * Describes the message spec.string. * Use `create(string$Desc)` to create a new message. */ -export declare const string$Desc: GenDescMessage; +export declare const string$Desc: GenDescMessage; /** * clash with global type @@ -608,11 +882,17 @@ export declare const string$Desc: GenDescMessage; export declare type number$ = Message$1<"spec.number"> & { }; +/** + * JSON type for the message spec.number. + */ +export declare type number$Json = { +}; + /** * Describes the message spec.number. * Use `create(number$Desc)` to create a new message. */ -export declare const number$Desc: GenDescMessage; +export declare const number$Desc: GenDescMessage; /** * clash with global type @@ -622,11 +902,17 @@ export declare const number$Desc: GenDescMessage; export declare type boolean$ = Message$1<"spec.boolean"> & { }; +/** + * JSON type for the message spec.boolean. + */ +export declare type boolean$Json = { +}; + /** * Describes the message spec.boolean. * Use `create(boolean$Desc)` to create a new message. */ -export declare const boolean$Desc: GenDescMessage; +export declare const boolean$Desc: GenDescMessage; /** * clash with global type @@ -636,11 +922,17 @@ export declare const boolean$Desc: GenDescMessage; export declare type bigint$ = Message$1<"spec.bigint"> & { }; +/** + * JSON type for the message spec.bigint. + */ +export declare type bigint$Json = { +}; + /** * Describes the message spec.bigint. * Use `create(bigint$Desc)` to create a new message. */ -export declare const bigint$Desc: GenDescMessage; +export declare const bigint$Desc: GenDescMessage; /** * clash with global type @@ -650,11 +942,17 @@ export declare const bigint$Desc: GenDescMessage; export declare type Uint8Array$ = Message$1<"spec.Uint8Array"> & { }; +/** + * JSON type for the message spec.Uint8Array. + */ +export declare type Uint8Array$Json = { +}; + /** * Describes the message spec.Uint8Array. * Use `create(Uint8Array$Desc)` to create a new message. */ -export declare const Uint8Array$Desc: GenDescMessage; +export declare const Uint8Array$Desc: GenDescMessage; /** * clash with global type @@ -664,11 +962,17 @@ export declare const Uint8Array$Desc: GenDescMessage; export declare type Array = Message$1<"spec.Array"> & { }; +/** + * JSON type for the message spec.Array. + */ +export declare type ArrayJson = { +}; + /** * Describes the message spec.Array. * Use `create(ArrayDesc)` to create a new message. */ -export declare const ArrayDesc: GenDescMessage; +export declare const ArrayDesc: GenDescMessage; /** * clash with global type @@ -678,11 +982,17 @@ export declare const ArrayDesc: GenDescMessage; export declare type String = Message$1<"spec.String"> & { }; +/** + * JSON type for the message spec.String. + */ +export declare type StringJson = { +}; + /** * Describes the message spec.String. * Use `create(StringDesc)` to create a new message. */ -export declare const StringDesc: GenDescMessage; +export declare const StringDesc: GenDescMessage; /** * clash with global type @@ -692,11 +1002,17 @@ export declare const StringDesc: GenDescMessage; export declare type Number = Message$1<"spec.Number"> & { }; +/** + * JSON type for the message spec.Number. + */ +export declare type NumberJson = { +}; + /** * Describes the message spec.Number. * Use `create(NumberDesc)` to create a new message. */ -export declare const NumberDesc: GenDescMessage; +export declare const NumberDesc: GenDescMessage; /** * clash with global type @@ -706,11 +1022,17 @@ export declare const NumberDesc: GenDescMessage; export declare type Boolean = Message$1<"spec.Boolean"> & { }; +/** + * JSON type for the message spec.Boolean. + */ +export declare type BooleanJson = { +}; + /** * Describes the message spec.Boolean. * Use `create(BooleanDesc)` to create a new message. */ -export declare const BooleanDesc: GenDescMessage; +export declare const BooleanDesc: GenDescMessage; /** * clash with global type @@ -720,11 +1042,17 @@ export declare const BooleanDesc: GenDescMessage; export declare type BigInt = Message$1<"spec.BigInt"> & { }; +/** + * JSON type for the message spec.BigInt. + */ +export declare type BigIntJson = { +}; + /** * Describes the message spec.BigInt. * Use `create(BigIntDesc)` to create a new message. */ -export declare const BigIntDesc: GenDescMessage; +export declare const BigIntDesc: GenDescMessage; /** * @generated from message spec.ClashParent @@ -732,11 +1060,17 @@ export declare const BigIntDesc: GenDescMessage; export declare type ClashParent = Message$1<"spec.ClashParent"> & { }; +/** + * JSON type for the message spec.ClashParent. + */ +export declare type ClashParentJson = { +}; + /** * Describes the message spec.ClashParent. * Use `create(ClashParentDesc)` to create a new message. */ -export declare const ClashParentDesc: GenDescMessage; +export declare const ClashParentDesc: GenDescMessage; /** * should clash with message ClashParent_ClashChild @@ -746,11 +1080,17 @@ export declare const ClashParentDesc: GenDescMessage; export declare type ClashParent_ClashChild = Message$1<"spec.ClashParent.ClashChild"> & { }; +/** + * JSON type for the message spec.ClashParent.ClashChild. + */ +export declare type ClashParent_ClashChildJson = { +}; + /** * Describes the message spec.ClashParent.ClashChild. * Use `create(ClashParent_ClashChildDesc)` to create a new message. */ -export declare const ClashParent_ClashChildDesc: GenDescMessage; +export declare const ClashParent_ClashChildDesc: GenDescMessage; /** * @generated from message spec.NoClashFields @@ -799,11 +1139,46 @@ export declare type NoClashFields = Message$1<"spec.NoClashFields"> & { return: string; }; +/** + * JSON type for the message spec.NoClashFields. + */ +export declare type NoClashFieldsJson = { + /** + * @generated from field: string const = 1; + */ + const?: string; + + /** + * @generated from field: string switch = 2; + */ + switch?: string; + + /** + * @generated from field: string case = 3; + */ + case?: string; + + /** + * @generated from field: string function = 4; + */ + function?: string; + + /** + * @generated from field: string interface = 5; + */ + interface?: string; + + /** + * @generated from field: string return = 6; + */ + return?: string; +}; + /** * Describes the message spec.NoClashFields. * Use `create(NoClashFieldsDesc)` to create a new message. */ -export declare const NoClashFieldsDesc: GenDescMessage; +export declare const NoClashFieldsDesc: GenDescMessage; /** * @generated from message spec.NoClashOneof @@ -863,11 +1238,46 @@ export declare type NoClashOneof = Message$1<"spec.NoClashOneof"> & { } | { case: undefined; value?: undefined }; }; +/** + * JSON type for the message spec.NoClashOneof. + */ +export declare type NoClashOneofJson = { + /** + * @generated from field: string const = 1; + */ + const?: string; + + /** + * @generated from field: string switch = 2; + */ + switch?: string; + + /** + * @generated from field: string case = 3; + */ + case?: string; + + /** + * @generated from field: string function = 4; + */ + function?: string; + + /** + * @generated from field: string interface = 5; + */ + interface?: string; + + /** + * @generated from field: string return = 6; + */ + return?: string; +}; + /** * Describes the message spec.NoClashOneof. * Use `create(NoClashOneofDesc)` to create a new message. */ -export declare const NoClashOneofDesc: GenDescMessage; +export declare const NoClashOneofDesc: GenDescMessage; /** * @generated from message spec.NoClashOneofADT @@ -879,11 +1289,21 @@ export declare type NoClashOneofADT = Message$1<"spec.NoClashOneofADT"> & { m?: NoClashOneofADT_M; }; +/** + * JSON type for the message spec.NoClashOneofADT. + */ +export declare type NoClashOneofADTJson = { + /** + * @generated from field: spec.NoClashOneofADT.M m = 1; + */ + m?: NoClashOneofADT_MJson; +}; + /** * Describes the message spec.NoClashOneofADT. * Use `create(NoClashOneofADTDesc)` to create a new message. */ -export declare const NoClashOneofADTDesc: GenDescMessage; +export declare const NoClashOneofADTDesc: GenDescMessage; /** * @generated from message spec.NoClashOneofADT.M @@ -900,11 +1320,26 @@ export declare type NoClashOneofADT_M = Message$1<"spec.NoClashOneofADT.M"> & { value?: string; }; +/** + * JSON type for the message spec.NoClashOneofADT.M. + */ +export declare type NoClashOneofADT_MJson = { + /** + * @generated from field: string case = 1; + */ + case?: string; + + /** + * @generated from field: optional string value = 2; + */ + value?: string; +}; + /** * Describes the message spec.NoClashOneofADT.M. * Use `create(NoClashOneofADT_MDesc)` to create a new message. */ -export declare const NoClashOneofADT_MDesc: GenDescMessage; +export declare const NoClashOneofADT_MDesc: GenDescMessage; /** * just here as a "namespace" for the enum @@ -914,11 +1349,17 @@ export declare const NoClashOneofADT_MDesc: GenDescMessage; export declare type NoClashEnumWrap = Message$1<"spec.NoClashEnumWrap"> & { }; +/** + * JSON type for the message spec.NoClashEnumWrap. + */ +export declare type NoClashEnumWrapJson = { +}; + /** * Describes the message spec.NoClashEnumWrap. * Use `create(NoClashEnumWrapDesc)` to create a new message. */ -export declare const NoClashEnumWrapDesc: GenDescMessage; +export declare const NoClashEnumWrapDesc: GenDescMessage; /** * @generated from enum spec.NoClashEnumWrap.X @@ -967,10 +1408,15 @@ export enum NoClashEnumWrap_X { return = 6, } +/** + * JSON type for the enum spec.NoClashEnumWrap.X. + */ +export declare type NoClashEnumWrap_XJson = "instanceof" | "switch" | "case" | "function" | "interface" | "return"; + /** * Describes the enum spec.NoClashEnumWrap.X. */ -export declare const NoClashEnumWrap_XDesc: GenDescEnum; +export declare const NoClashEnumWrap_XDesc: GenDescEnum; /** * @generated from service spec.ReservedPropertyNamesService diff --git a/packages/protobuf-test/src/gen/js/extra/option-usage_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/option-usage_pb.d.ts index 162c0a9d9..02b61d31c 100644 --- a/packages/protobuf-test/src/gen/js/extra/option-usage_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/option-usage_pb.d.ts @@ -45,11 +45,26 @@ export declare type MessageWithOptions = Message<"spec.MessageWithOptions"> & { } | { case: undefined; value?: undefined }; }; +/** + * JSON type for the message spec.MessageWithOptions. + */ +export declare type MessageWithOptionsJson = { + /** + * @generated from field: int32 field = 1; + */ + field?: number; + + /** + * @generated from field: int32 oneof_field = 2; + */ + oneofField?: number; +}; + /** * Describes the message spec.MessageWithOptions. * Use `create(MessageWithOptionsDesc)` to create a new message. */ -export declare const MessageWithOptionsDesc: GenDescMessage; +export declare const MessageWithOptionsDesc: GenDescMessage; /** * @generated from enum spec.EnumWithOptions @@ -61,10 +76,15 @@ export enum EnumWithOptions { UNSPECIFIED = 0, } +/** + * JSON type for the enum spec.EnumWithOptions. + */ +export declare type EnumWithOptionsJson = "ENUM_WITH_OPTIONS_UNSPECIFIED"; + /** * Describes the enum spec.EnumWithOptions. */ -export declare const EnumWithOptionsDesc: GenDescEnum; +export declare const EnumWithOptionsDesc: GenDescEnum; /** * @generated from service spec.ServiceWithOptions diff --git a/packages/protobuf-test/src/gen/js/extra/perf_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/perf_pb.d.ts index 6f76c2db6..d3f62dfb4 100644 --- a/packages/protobuf-test/src/gen/js/extra/perf_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/perf_pb.d.ts @@ -250,11 +250,216 @@ export declare type PerfMessage = Message<"perf.v1.PerfMessage"> & { id: number; }; +/** + * JSON type for the message perf.v1.PerfMessage. + */ +export declare type PerfMessageJson = { + /** + * @generated from field: double double_field = 1; + */ + doubleField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: int32 int32_field = 2; + */ + int32Field?: number; + + /** + * @generated from field: uint32 uint32_field = 3333; + */ + uint32Field?: number; + + /** + * @generated from field: optional int64 int64_field = 3; + */ + int64Field?: string; + + /** + * @generated from field: optional bool bool_field = 4; + */ + boolField?: boolean; + + /** + * @generated from field: string string_field = 5; + */ + stringField?: string; + + /** + * @generated from field: bytes bytes_field = 6; + */ + bytesField?: string; + + /** + * @generated from field: perf.v1.PerfEnum enum_field = 7; + */ + enumField?: PerfEnumJson; + + /** + * @generated from field: perf.v1.PerfMessage small_message_field = 8; + */ + smallMessageField?: PerfMessageJson; + + /** + * @generated from field: int32 unused_field_1 = 9; + */ + unusedField1?: number; + + /** + * @generated from field: int32 unused_field_2 = 10; + */ + unusedField2?: number; + + /** + * @generated from field: int32 unused_field_3 = 11; + */ + unusedField3?: number; + + /** + * @generated from field: int32 unused_field_4 = 12; + */ + unusedField4?: number; + + /** + * @generated from field: int32 unused_field_5 = 13; + */ + unusedField5?: number; + + /** + * @generated from field: int32 unused_field_6 = 14; + */ + unusedField6?: number; + + /** + * @generated from field: int32 unused_field_7 = 15; + */ + unusedField7?: number; + + /** + * @generated from field: int32 unused_field_8 = 16; + */ + unusedField8?: number; + + /** + * @generated from field: int32 unused_field_9 = 17; + */ + unusedField9?: number; + + /** + * @generated from field: int32 unused_field_10 = 18; + */ + unusedField10?: number; + + /** + * @generated from field: repeated double repeated_double_field = 19; + */ + repeatedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated int32 repeated_int32_field = 20; + */ + repeatedInt32Field?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 41; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated bool repeated_bool_field = 22; + */ + repeatedBoolField?: boolean[]; + + /** + * @generated from field: repeated string repeated_short_string_field = 23; + */ + repeatedShortStringField?: string[]; + + /** + * @generated from field: repeated string repeated_long_string_field = 24; + */ + repeatedLongStringField?: string[]; + + /** + * @generated from field: repeated bytes repeated_short_bytes_field = 25; + */ + repeatedShortBytesField?: string[]; + + /** + * @generated from field: repeated bytes repeated_long_bytes_field = 26; + */ + repeatedLongBytesField?: string[]; + + /** + * @generated from field: repeated perf.v1.PerfEnum repeated_enum_field = 27; + */ + repeatedEnumField?: PerfEnumJson[]; + + /** + * @generated from field: repeated perf.v1.PerfMessage repeated_small_message_field = 28; + */ + repeatedSmallMessageField?: PerfMessageJson[]; + + /** + * @generated from field: map map_int32_int32 = 30; + */ + mapInt32Int32?: { [key: number]: number }; + + /** + * @generated from field: map map_int64_int64 = 31; + */ + mapInt64Int64?: { [key: string]: string }; + + /** + * @generated from field: map map_string_message = 32; + */ + mapStringMessage?: { [key: string]: PerfMessageJson }; + + /** + * @generated from field: map map_string_enum = 33; + */ + mapStringEnum?: { [key: string]: PerfEnumJson }; + + /** + * @generated from field: perf.v1.PerfEnum oneof_enum_verified = 34; + */ + oneofEnumVerified?: PerfEnumJson; + + /** + * @generated from field: perf.v1.PerfEnum oneof_enum_cromulent = 35; + */ + oneofEnumCromulent?: PerfEnumJson; + + /** + * @generated from field: perf.v1.PerfMessage oneof_message_field = 36; + */ + oneofMessageField?: PerfMessageJson; + + /** + * @generated from field: perf.v1.PerfMessage oneof_small_message_field = 37; + */ + oneofSmallMessageField?: PerfMessageJson; + + /** + * @generated from field: int32 oneof_int32_field = 38; + */ + oneofInt32Field?: number; + + /** + * @generated from field: bool oneof_bool_field = 39; + */ + oneofBoolField?: boolean; + + /** + * @generated from field: uint32 id = 40; + */ + id?: number; +}; + /** * Describes the message perf.v1.PerfMessage. * Use `create(PerfMessageDesc)` to create a new message. */ -export declare const PerfMessageDesc: GenDescMessage; +export declare const PerfMessageDesc: GenDescMessage; /** * @generated from enum perf.v1.PerfEnum @@ -276,8 +481,13 @@ export enum PerfEnum { NO = 2, } +/** + * JSON type for the enum perf.v1.PerfEnum. + */ +export declare type PerfEnumJson = "PERF_ENUM_UNSPECIFIED" | "PERF_ENUM_YES" | "PERF_ENUM_NO"; + /** * Describes the enum perf.v1.PerfEnum. */ -export declare const PerfEnumDesc: GenDescEnum; +export declare const PerfEnumDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/proto2_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/proto2_pb.d.ts index 4a0f3eb25..421c0ec3b 100644 --- a/packages/protobuf-test/src/gen/js/extra/proto2_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/proto2_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { UInt32Value } from "@bufbuild/protobuf/wkt"; +import type { UInt32Value, UInt32ValueJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file extra/proto2.proto. @@ -474,11 +474,441 @@ export declare type Proto2Message = Message<"spec.Proto2Message"> & { mapInt32WrappedUint32Field: { [key: number]: UInt32Value }; }; +/** + * JSON type for the message spec.Proto2Message. + */ +export declare type Proto2MessageJson = { + /** + * @generated from field: required string required_string_field = 1; + */ + requiredStringField?: string; + + /** + * @generated from field: required bytes required_bytes_field = 2; + */ + requiredBytesField?: string; + + /** + * @generated from field: required int32 required_int32_field = 3; + */ + requiredInt32Field?: number; + + /** + * @generated from field: required int64 required_int64_field = 4; + */ + requiredInt64Field?: string; + + /** + * @generated from field: required int64 required_int64_js_number_field = 103 [jstype = JS_NUMBER]; + */ + requiredInt64JsNumberField?: string; + + /** + * @generated from field: required int64 required_int64_js_string_field = 102 [jstype = JS_STRING]; + */ + requiredInt64JsStringField?: string; + + /** + * @generated from field: required float required_float_field = 5; + */ + requiredFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required bool required_bool_field = 6; + */ + requiredBoolField?: boolean; + + /** + * @generated from field: required spec.Proto2Enum required_enum_field = 7; + */ + requiredEnumField?: Proto2EnumJson; + + /** + * @generated from field: required spec.Proto2Message required_message_field = 8; + */ + requiredMessageField?: Proto2MessageJson; + + /** + * @generated from field: required spec.Proto2Message.RequiredGroup requiredgroup = 9; + */ + requiredgroup?: Proto2Message_RequiredGroupJson; + + /** + * @generated from field: required google.protobuf.UInt32Value required_wrapped_uint32_field = 201; + */ + requiredWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: required string required_default_string_field = 10 [default = "hello \" *\/ "]; + */ + requiredDefaultStringField?: string; + + /** + * @generated from field: required bytes required_default_bytes_field = 11 [default = "\000x\\x\\"x\'AAAAAA\010\014\n\r\t\013"]; + */ + requiredDefaultBytesField?: string; + + /** + * @generated from field: required int32 required_default_int32_field = 12 [default = 128]; + */ + requiredDefaultInt32Field?: number; + + /** + * @generated from field: required int64 required_default_int64_field = 13 [default = -256]; + */ + requiredDefaultInt64Field?: string; + + /** + * @generated from field: required int64 required_default_int64_js_number_field = 110 [default = -256, jstype = JS_NUMBER]; + */ + requiredDefaultInt64JsNumberField?: string; + + /** + * @generated from field: required int64 required_default_int64_js_string_field = 113 [default = -256, jstype = JS_STRING]; + */ + requiredDefaultInt64JsStringField?: string; + + /** + * @generated from field: required float required_default_float_field = 14 [default = -512.13]; + */ + requiredDefaultFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required bool required_default_bool_field = 15 [default = true]; + */ + requiredDefaultBoolField?: boolean; + + /** + * @generated from field: required spec.Proto2Enum required_default_enum_field = 16 [default = PROTO2_ENUM_YES]; + */ + requiredDefaultEnumField?: Proto2EnumJson; + + /** + * @generated from field: required spec.Proto2Message required_default_message_field = 17; + */ + requiredDefaultMessageField?: Proto2MessageJson; + + /** + * @generated from field: required spec.Proto2Message.RequiredDefaultGroup requireddefaultgroup = 18; + */ + requireddefaultgroup?: Proto2Message_RequiredDefaultGroupJson; + + /** + * @generated from field: required google.protobuf.UInt32Value required_default_wrapped_uint32_field = 202; + */ + requiredDefaultWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: optional string optional_string_field = 19; + */ + optionalStringField?: string; + + /** + * @generated from field: optional bytes optional_bytes_field = 20; + */ + optionalBytesField?: string; + + /** + * @generated from field: optional int32 optional_int32_field = 21; + */ + optionalInt32Field?: number; + + /** + * @generated from field: optional int64 optional_int64_field = 22; + */ + optionalInt64Field?: string; + + /** + * @generated from field: optional int64 optional_int64_js_number_field = 106 [jstype = JS_NUMBER]; + */ + optionalInt64JsNumberField?: string; + + /** + * @generated from field: optional int64 optional_int64_js_string_field = 105 [jstype = JS_STRING]; + */ + optionalInt64JsStringField?: string; + + /** + * @generated from field: optional float optional_float_field = 23; + */ + optionalFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: optional bool optional_bool_field = 24; + */ + optionalBoolField?: boolean; + + /** + * @generated from field: optional spec.Proto2Enum optional_enum_field = 25; + */ + optionalEnumField?: Proto2EnumJson; + + /** + * @generated from field: optional spec.Proto2Message optional_message_field = 26; + */ + optionalMessageField?: Proto2MessageJson; + + /** + * @generated from field: optional spec.Proto2Message.OptionalGroup optionalgroup = 27; + */ + optionalgroup?: Proto2Message_OptionalGroupJson; + + /** + * @generated from field: required google.protobuf.UInt32Value optional_wrapped_uint32_field = 207; + */ + optionalWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: required string optional_default_string_field = 28 [default = "hello \" *\/ "]; + */ + optionalDefaultStringField?: string; + + /** + * @generated from field: required bytes optional_default_bytes_field = 29 [default = "\000x\\x\\"x\'AAAAAA\010\014\n\r\t\013"]; + */ + optionalDefaultBytesField?: string; + + /** + * @generated from field: required int32 optional_default_int32_field = 30 [default = 128]; + */ + optionalDefaultInt32Field?: number; + + /** + * @generated from field: required int64 optional_default_int64_field = 31 [default = -256]; + */ + optionalDefaultInt64Field?: string; + + /** + * @generated from field: optional int64 optional_default_int64_js_number_field = 120 [default = -256, jstype = JS_NUMBER]; + */ + optionalDefaultInt64JsNumberField?: string; + + /** + * @generated from field: optional int64 optional_default_int64_js_string_field = 121 [default = -256, jstype = JS_STRING]; + */ + optionalDefaultInt64JsStringField?: string; + + /** + * @generated from field: required float optional_default_float_field = 32 [default = -512.13]; + */ + optionalDefaultFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required bool optional_default_bool_field = 33 [default = true]; + */ + optionalDefaultBoolField?: boolean; + + /** + * @generated from field: required spec.Proto2Enum optional_default_enum_field = 34 [default = PROTO2_ENUM_YES]; + */ + optionalDefaultEnumField?: Proto2EnumJson; + + /** + * @generated from field: optional spec.Proto2Message optional_default_message_field = 35; + */ + optionalDefaultMessageField?: Proto2MessageJson; + + /** + * @generated from field: optional spec.Proto2Message.OptionalDefaultGroup optionaldefaultgroup = 36; + */ + optionaldefaultgroup?: Proto2Message_OptionalDefaultGroupJson; + + /** + * @generated from field: required google.protobuf.UInt32Value optional_default_wrapped_uint32_field = 203; + */ + optionalDefaultWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: repeated string repeated_string_field = 37; + */ + repeatedStringField?: string[]; + + /** + * @generated from field: repeated bytes repeated_bytes_field = 38; + */ + repeatedBytesField?: string[]; + + /** + * @generated from field: repeated int32 repeated_int32_field = 39; + */ + repeatedInt32Field?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 40; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_number_field = 109 [jstype = JS_NUMBER]; + */ + repeatedInt64JsNumberField?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_string_field = 108 [jstype = JS_STRING]; + */ + repeatedInt64JsStringField?: string[]; + + /** + * @generated from field: repeated float repeated_float_field = 41; + */ + repeatedFloatField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool repeated_bool_field = 42; + */ + repeatedBoolField?: boolean[]; + + /** + * @generated from field: repeated spec.Proto2Enum repeated_enum_field = 43; + */ + repeatedEnumField?: Proto2EnumJson[]; + + /** + * @generated from field: repeated spec.Proto2Message repeated_message_field = 44; + */ + repeatedMessageField?: Proto2MessageJson[]; + + /** + * @generated from field: repeated spec.Proto2Message.RepeatedGroup repeatedgroup = 45; + */ + repeatedgroup?: Proto2Message_RepeatedGroupJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt32Value repeated_wrapped_uint32_field = 204; + */ + repeatedWrappedUint32Field?: UInt32ValueJson[]; + + /** + * @generated from field: repeated double packed_double_field = 46 [packed = true]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 packed_uint32_field = 47 [packed = true]; + */ + packedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 packed_uint64_field = 48 [packed = true]; + */ + packedUint64Field?: string[]; + + /** + * @generated from field: repeated double unpacked_double_field = 49 [packed = false]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 unpacked_uint32_field = 50 [packed = false]; + */ + unpackedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 unpacked_uint64_field = 51 [packed = false]; + */ + unpackedUint64Field?: string[]; + + /** + * @generated from field: string oneof_string_field = 52; + */ + oneofStringField?: string; + + /** + * @generated from field: bytes oneof_bytes_field = 53; + */ + oneofBytesField?: string; + + /** + * @generated from field: int32 oneof_int32_field = 54; + */ + oneofInt32Field?: number; + + /** + * @generated from field: int64 oneof_int64_field = 55; + */ + oneofInt64Field?: string; + + /** + * @generated from field: int64 oneof_int64_js_number_field = 112 [jstype = JS_NUMBER]; + */ + oneofInt64JsNumberField?: string; + + /** + * @generated from field: int64 oneof_int64_js_string_field = 111 [jstype = JS_STRING]; + */ + oneofInt64JsStringField?: string; + + /** + * @generated from field: float oneof_float_field = 56; + */ + oneofFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool oneof_bool_field = 57; + */ + oneofBoolField?: boolean; + + /** + * @generated from field: spec.Proto2Enum oneof_enum_field = 58; + */ + oneofEnumField?: Proto2EnumJson; + + /** + * @generated from field: spec.Proto2Message oneof_message_field = 59; + */ + oneofMessageField?: Proto2MessageJson; + + /** + * @generated from field: spec.Proto2Message.OneofGroup oneofgroup = 60; + */ + oneofgroup?: Proto2Message_OneofGroupJson; + + /** + * @generated from field: google.protobuf.UInt32Value oneof_wrapped_uint32_field = 205; + */ + oneofWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: map map_string_string_field = 70; + */ + mapStringStringField?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_int32_field = 71; + */ + mapInt32Int32Field?: { [key: number]: number }; + + /** + * @generated from field: map map_bool_bool_field = 72; + */ + mapBoolBoolField?: { [key: string]: boolean }; + + /** + * @generated from field: map map_int64_int64_field = 73; + */ + mapInt64Int64Field?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_enum_field = 74; + */ + mapInt32EnumField?: { [key: number]: Proto2EnumWithZeroJson }; + + /** + * @generated from field: map map_int32_message_field = 75; + */ + mapInt32MessageField?: { [key: number]: Proto2MessageJson }; + + /** + * @generated from field: map map_int32_wrapped_uint32_field = 209; + */ + mapInt32WrappedUint32Field?: { [key: number]: UInt32ValueJson }; +}; + /** * Describes the message spec.Proto2Message. * Use `create(Proto2MessageDesc)` to create a new message. */ -export declare const Proto2MessageDesc: GenDescMessage; +export declare const Proto2MessageDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.RequiredGroup @@ -490,11 +920,21 @@ export declare type Proto2Message_RequiredGroup = Message<"spec.Proto2Message.Re int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.RequiredGroup. + */ +export declare type Proto2Message_RequiredGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.RequiredGroup. * Use `create(Proto2Message_RequiredGroupDesc)` to create a new message. */ -export declare const Proto2Message_RequiredGroupDesc: GenDescMessage; +export declare const Proto2Message_RequiredGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.RequiredDefaultGroup @@ -506,11 +946,21 @@ export declare type Proto2Message_RequiredDefaultGroup = Message<"spec.Proto2Mes int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.RequiredDefaultGroup. + */ +export declare type Proto2Message_RequiredDefaultGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.RequiredDefaultGroup. * Use `create(Proto2Message_RequiredDefaultGroupDesc)` to create a new message. */ -export declare const Proto2Message_RequiredDefaultGroupDesc: GenDescMessage; +export declare const Proto2Message_RequiredDefaultGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.OptionalGroup @@ -522,11 +972,21 @@ export declare type Proto2Message_OptionalGroup = Message<"spec.Proto2Message.Op int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.OptionalGroup. + */ +export declare type Proto2Message_OptionalGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.OptionalGroup. * Use `create(Proto2Message_OptionalGroupDesc)` to create a new message. */ -export declare const Proto2Message_OptionalGroupDesc: GenDescMessage; +export declare const Proto2Message_OptionalGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.OptionalDefaultGroup @@ -538,11 +998,21 @@ export declare type Proto2Message_OptionalDefaultGroup = Message<"spec.Proto2Mes int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.OptionalDefaultGroup. + */ +export declare type Proto2Message_OptionalDefaultGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.OptionalDefaultGroup. * Use `create(Proto2Message_OptionalDefaultGroupDesc)` to create a new message. */ -export declare const Proto2Message_OptionalDefaultGroupDesc: GenDescMessage; +export declare const Proto2Message_OptionalDefaultGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.RepeatedGroup @@ -554,11 +1024,21 @@ export declare type Proto2Message_RepeatedGroup = Message<"spec.Proto2Message.Re int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.RepeatedGroup. + */ +export declare type Proto2Message_RepeatedGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.RepeatedGroup. * Use `create(Proto2Message_RepeatedGroupDesc)` to create a new message. */ -export declare const Proto2Message_RepeatedGroupDesc: GenDescMessage; +export declare const Proto2Message_RepeatedGroupDesc: GenDescMessage; /** * @generated from message spec.Proto2Message.OneofGroup @@ -570,11 +1050,21 @@ export declare type Proto2Message_OneofGroup = Message<"spec.Proto2Message.Oneof int32Field: number; }; +/** + * JSON type for the message spec.Proto2Message.OneofGroup. + */ +export declare type Proto2Message_OneofGroupJson = { + /** + * @generated from field: optional int32 int32_field = 1; + */ + int32Field?: number; +}; + /** * Describes the message spec.Proto2Message.OneofGroup. * Use `create(Proto2Message_OneofGroupDesc)` to create a new message. */ -export declare const Proto2Message_OneofGroupDesc: GenDescMessage; +export declare const Proto2Message_OneofGroupDesc: GenDescMessage; /** * @generated from enum spec.Proto2Enum @@ -591,10 +1081,15 @@ export enum Proto2Enum { NO = 2, } +/** + * JSON type for the enum spec.Proto2Enum. + */ +export declare type Proto2EnumJson = "PROTO2_ENUM_YES" | "PROTO2_ENUM_NO"; + /** * Describes the enum spec.Proto2Enum. */ -export declare const Proto2EnumDesc: GenDescEnum; +export declare const Proto2EnumDesc: GenDescEnum; /** * First enum value must be 0 when used as map value type @@ -613,8 +1108,13 @@ export enum Proto2EnumWithZero { ONE = 1, } +/** + * JSON type for the enum spec.Proto2EnumWithZero. + */ +export declare type Proto2EnumWithZeroJson = "PROTO2_ENUM_WITH_ZERO_ZERO" | "PROTO2_ENUM_WITH_ZERO_ONE"; + /** * Describes the enum spec.Proto2EnumWithZero. */ -export declare const Proto2EnumWithZeroDesc: GenDescEnum; +export declare const Proto2EnumWithZeroDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/proto3_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/proto3_pb.d.ts index 020397235..6385aa8b9 100644 --- a/packages/protobuf-test/src/gen/js/extra/proto3_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/proto3_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { UInt32Value } from "@bufbuild/protobuf/wkt"; +import type { UInt32Value, UInt32ValueJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file extra/proto3.proto. @@ -333,11 +333,301 @@ export declare type Proto3Message = Message<"spec.Proto3Message"> & { mapInt32WrappedUint32Field: { [key: number]: UInt32Value }; }; +/** + * JSON type for the message spec.Proto3Message. + */ +export declare type Proto3MessageJson = { + /** + * @generated from field: string singular_string_field = 1; + */ + singularStringField?: string; + + /** + * @generated from field: bytes singular_bytes_field = 2; + */ + singularBytesField?: string; + + /** + * @generated from field: int32 singular_int32_field = 3; + */ + singularInt32Field?: number; + + /** + * @generated from field: int64 singular_int64_field = 4; + */ + singularInt64Field?: string; + + /** + * @generated from field: int64 singular_int64_js_number_field = 103 [jstype = JS_NUMBER]; + */ + singularInt64JsNumberField?: string; + + /** + * @generated from field: int64 singular_int64_js_string_field = 102 [jstype = JS_STRING]; + */ + singularInt64JsStringField?: string; + + /** + * @generated from field: float singular_float_field = 5; + */ + singularFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool singular_bool_field = 6; + */ + singularBoolField?: boolean; + + /** + * @generated from field: spec.Proto3Enum singular_enum_field = 7; + */ + singularEnumField?: Proto3EnumJson; + + /** + * @generated from field: spec.Proto3Message singular_message_field = 8; + */ + singularMessageField?: Proto3MessageJson; + + /** + * @generated from field: google.protobuf.UInt32Value singular_wrapped_uint32_field = 211; + */ + singularWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: optional string optional_string_field = 9; + */ + optionalStringField?: string; + + /** + * @generated from field: optional bytes optional_bytes_field = 10; + */ + optionalBytesField?: string; + + /** + * @generated from field: optional int32 optional_int32_field = 11; + */ + optionalInt32Field?: number; + + /** + * @generated from field: optional int64 optional_int64_field = 12; + */ + optionalInt64Field?: string; + + /** + * @generated from field: optional int64 optional_int64_js_number_field = 106 [jstype = JS_NUMBER]; + */ + optionalInt64JsNumberField?: string; + + /** + * @generated from field: optional int64 optional_int64_js_string_field = 105 [jstype = JS_STRING]; + */ + optionalInt64JsStringField?: string; + + /** + * @generated from field: optional float optional_float_field = 13; + */ + optionalFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: optional bool optional_bool_field = 14; + */ + optionalBoolField?: boolean; + + /** + * @generated from field: optional spec.Proto3Enum optional_enum_field = 15; + */ + optionalEnumField?: Proto3EnumJson; + + /** + * @generated from field: optional spec.Proto3Message optional_message_field = 16; + */ + optionalMessageField?: Proto3MessageJson; + + /** + * @generated from field: optional google.protobuf.UInt32Value optional_wrapped_uint32_field = 212; + */ + optionalWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: repeated string repeated_string_field = 17; + */ + repeatedStringField?: string[]; + + /** + * @generated from field: repeated bytes repeated_bytes_field = 18; + */ + repeatedBytesField?: string[]; + + /** + * @generated from field: repeated int32 repeated_int32_field = 19; + */ + repeatedInt32Field?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64_field = 20; + */ + repeatedInt64Field?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_number_field = 109 [jstype = JS_NUMBER]; + */ + repeatedInt64JsNumberField?: string[]; + + /** + * @generated from field: repeated int64 repeated_int64_js_string_field = 108 [jstype = JS_STRING]; + */ + repeatedInt64JsStringField?: string[]; + + /** + * @generated from field: repeated float repeated_float_field = 21; + */ + repeatedFloatField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool repeated_bool_field = 22; + */ + repeatedBoolField?: boolean[]; + + /** + * @generated from field: repeated spec.Proto3Enum repeated_enum_field = 23; + */ + repeatedEnumField?: Proto3EnumJson[]; + + /** + * @generated from field: repeated spec.Proto3Message repeated_message_field = 24; + */ + repeatedMessageField?: Proto3MessageJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt32Value repeated_wrapped_uint32_field = 213; + */ + repeatedWrappedUint32Field?: UInt32ValueJson[]; + + /** + * @generated from field: repeated double packed_double_field = 25 [packed = true]; + */ + packedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 packed_uint32_field = 26 [packed = true]; + */ + packedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 packed_uint64_field = 27 [packed = true]; + */ + packedUint64Field?: string[]; + + /** + * @generated from field: repeated double unpacked_double_field = 28 [packed = false]; + */ + unpackedDoubleField?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated uint32 unpacked_uint32_field = 29 [packed = false]; + */ + unpackedUint32Field?: number[]; + + /** + * @generated from field: repeated uint64 unpacked_uint64_field = 30 [packed = false]; + */ + unpackedUint64Field?: string[]; + + /** + * @generated from field: string oneof_string_field = 31; + */ + oneofStringField?: string; + + /** + * @generated from field: bytes oneof_bytes_field = 32; + */ + oneofBytesField?: string; + + /** + * @generated from field: int32 oneof_int32_field = 33; + */ + oneofInt32Field?: number; + + /** + * @generated from field: int64 oneof_int64_field = 34; + */ + oneofInt64Field?: string; + + /** + * @generated from field: int64 oneof_int64_js_number_field = 112 [jstype = JS_NUMBER]; + */ + oneofInt64JsNumberField?: string; + + /** + * @generated from field: int64 oneof_int64_js_string_field = 111 [jstype = JS_STRING]; + */ + oneofInt64JsStringField?: string; + + /** + * @generated from field: float oneof_float_field = 35; + */ + oneofFloatField?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool oneof_bool_field = 36; + */ + oneofBoolField?: boolean; + + /** + * @generated from field: spec.Proto3Enum oneof_enum_field = 37; + */ + oneofEnumField?: Proto3EnumJson; + + /** + * @generated from field: spec.Proto3Message oneof_message_field = 38; + */ + oneofMessageField?: Proto3MessageJson; + + /** + * @generated from field: google.protobuf.UInt32Value oneof_wrapped_uint32_field = 204; + */ + oneofWrappedUint32Field?: UInt32ValueJson; + + /** + * @generated from field: map map_string_string_field = 39; + */ + mapStringStringField?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_int32_field = 40; + */ + mapInt32Int32Field?: { [key: number]: number }; + + /** + * @generated from field: map map_bool_bool_field = 41; + */ + mapBoolBoolField?: { [key: string]: boolean }; + + /** + * @generated from field: map map_int64_int64_field = 42; + */ + mapInt64Int64Field?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_enum_field = 43; + */ + mapInt32EnumField?: { [key: number]: Proto3EnumJson }; + + /** + * @generated from field: map map_int32_message_field = 44; + */ + mapInt32MessageField?: { [key: number]: Proto3MessageJson }; + + /** + * @generated from field: map map_int32_wrapped_uint32_field = 205; + */ + mapInt32WrappedUint32Field?: { [key: number]: UInt32ValueJson }; +}; + /** * Describes the message spec.Proto3Message. * Use `create(Proto3MessageDesc)` to create a new message. */ -export declare const Proto3MessageDesc: GenDescMessage; +export declare const Proto3MessageDesc: GenDescMessage; /** * @generated from enum spec.Proto3Enum @@ -359,8 +649,13 @@ export enum Proto3Enum { NO = 2, } +/** + * JSON type for the enum spec.Proto3Enum. + */ +export declare type Proto3EnumJson = "PROTO3_ENUM_UNSPECIFIED" | "PROTO3_ENUM_YES" | "PROTO3_ENUM_NO"; + /** * Describes the enum spec.Proto3Enum. */ -export declare const Proto3EnumDesc: GenDescEnum; +export declare const Proto3EnumDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/extra/service-example_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/service-example_pb.d.ts index fb12f06f2..86e2b064c 100644 --- a/packages/protobuf-test/src/gen/js/extra/service-example_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/service-example_pb.d.ts @@ -59,12 +59,37 @@ export declare type ExampleRequest = Message<"spec.ExampleRequest"> & { disableSendingExampleResponseHeaders: boolean; }; +/** + * JSON type for the message spec.ExampleRequest. + */ +export declare type ExampleRequestJson = { + /** + * @generated from field: string question = 1; + */ + question?: string; + + /** + * @generated from field: spec.FailRequest please_fail = 2; + */ + pleaseFail?: FailRequestJson; + + /** + * @generated from field: int32 please_delay_response_ms = 3; + */ + pleaseDelayResponseMs?: number; + + /** + * @generated from field: bool disable_sending_example_response_headers = 4; + */ + disableSendingExampleResponseHeaders?: boolean; +}; + /** * Describes the message spec.ExampleRequest. * Use `create(ExampleRequestDesc)` to create a new message. * @deprecated */ -export declare const ExampleRequestDesc: GenDescMessage; +export declare const ExampleRequestDesc: GenDescMessage; /** * @generated from message spec.ExampleResponse @@ -100,12 +125,37 @@ export declare type ExampleResponse = Message<"spec.ExampleResponse"> & { yourFailRequest: FailRequest; }; +/** + * JSON type for the message spec.ExampleResponse. + */ +export declare type ExampleResponseJson = { + /** + * @generated from field: string answer = 1; + */ + answer?: string; + + /** + * @generated from field: map your_request_headers = 2; + */ + yourRequestHeaders?: { [key: string]: string }; + + /** + * @generated from field: string your_deadline = 3; + */ + yourDeadline?: string; + + /** + * @generated from field: spec.FailRequest your_fail_request = 4; + */ + yourFailRequest?: FailRequestJson; +}; + /** * Describes the message spec.ExampleResponse. * Use `create(ExampleResponseDesc)` to create a new message. * @deprecated */ -export declare const ExampleResponseDesc: GenDescMessage; +export declare const ExampleResponseDesc: GenDescMessage; /** * @generated from enum spec.FailRequest @@ -134,11 +184,16 @@ export enum FailRequest { ERROR_STATUS_ONLY = 2, } +/** + * JSON type for the enum spec.FailRequest. + */ +export declare type FailRequestJson = "FAIL_REQUEST_NONE" | "MESSAGE_THEN_ERROR_STATUS" | "ERROR_STATUS_ONLY"; + /** * Describes the enum spec.FailRequest. * @deprecated */ -export declare const FailRequestDesc: GenDescEnum; +export declare const FailRequestDesc: GenDescEnum; /** * @generated from service spec.ExampleService diff --git a/packages/protobuf-test/src/gen/js/extra/wkt-wrappers_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/wkt-wrappers_pb.d.ts index 91c622f0f..8e4763660 100644 --- a/packages/protobuf-test/src/gen/js/extra/wkt-wrappers_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/wkt-wrappers_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { BoolValue, BytesValue, DoubleValue, FloatValue, Int32Value, Int64Value, StringValue, UInt32Value, UInt64Value } from "@bufbuild/protobuf/wkt"; +import type { BoolValue, BoolValueJson, BytesValue, BytesValueJson, DoubleValue, DoubleValueJson, FloatValue, FloatValueJson, Int32Value, Int32ValueJson, Int64Value, Int64ValueJson, StringValue, StringValueJson, UInt32Value, UInt32ValueJson, UInt64Value, UInt64ValueJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file extra/wkt-wrappers.proto. @@ -227,10 +227,195 @@ export declare type WrappersMessage = Message<"spec.WrappersMessage"> & { mapBytesValueField: { [key: string]: BytesValue }; }; +/** + * JSON type for the message spec.WrappersMessage. + */ +export declare type WrappersMessageJson = { + /** + * @generated from field: google.protobuf.DoubleValue double_value_field = 1; + */ + doubleValueField?: DoubleValueJson; + + /** + * @generated from field: google.protobuf.BoolValue bool_value_field = 2; + */ + boolValueField?: BoolValueJson; + + /** + * @generated from field: google.protobuf.FloatValue float_value_field = 3; + */ + floatValueField?: FloatValueJson; + + /** + * @generated from field: google.protobuf.Int64Value int64_value_field = 4; + */ + int64ValueField?: Int64ValueJson; + + /** + * @generated from field: google.protobuf.UInt64Value uint64_value_field = 5; + */ + uint64ValueField?: UInt64ValueJson; + + /** + * @generated from field: google.protobuf.Int32Value int32_value_field = 6; + */ + int32ValueField?: Int32ValueJson; + + /** + * @generated from field: google.protobuf.UInt32Value uint32_value_field = 7; + */ + uint32ValueField?: UInt32ValueJson; + + /** + * @generated from field: google.protobuf.StringValue string_value_field = 8; + */ + stringValueField?: StringValueJson; + + /** + * @generated from field: google.protobuf.BytesValue bytes_value_field = 9; + */ + bytesValueField?: BytesValueJson; + + /** + * @generated from field: google.protobuf.DoubleValue oneof_double_value_field = 11; + */ + oneofDoubleValueField?: DoubleValueJson; + + /** + * @generated from field: google.protobuf.BoolValue oneof_bool_value_field = 12; + */ + oneofBoolValueField?: BoolValueJson; + + /** + * @generated from field: google.protobuf.FloatValue oneof_float_value_field = 13; + */ + oneofFloatValueField?: FloatValueJson; + + /** + * @generated from field: google.protobuf.Int64Value oneof_int64_value_field = 14; + */ + oneofInt64ValueField?: Int64ValueJson; + + /** + * @generated from field: google.protobuf.UInt64Value oneof_uint64_value_field = 15; + */ + oneofUint64ValueField?: UInt64ValueJson; + + /** + * @generated from field: google.protobuf.Int32Value oneof_int32_value_field = 16; + */ + oneofInt32ValueField?: Int32ValueJson; + + /** + * @generated from field: google.protobuf.UInt32Value oneof_uint32_value_field = 17; + */ + oneofUint32ValueField?: UInt32ValueJson; + + /** + * @generated from field: google.protobuf.StringValue oneof_string_value_field = 18; + */ + oneofStringValueField?: StringValueJson; + + /** + * @generated from field: google.protobuf.BytesValue oneof_bytes_value_field = 19; + */ + oneofBytesValueField?: BytesValueJson; + + /** + * @generated from field: repeated google.protobuf.DoubleValue repeated_double_value_field = 21; + */ + repeatedDoubleValueField?: DoubleValueJson[]; + + /** + * @generated from field: repeated google.protobuf.BoolValue repeated_bool_value_field = 22; + */ + repeatedBoolValueField?: BoolValueJson[]; + + /** + * @generated from field: repeated google.protobuf.FloatValue repeated_float_value_field = 23; + */ + repeatedFloatValueField?: FloatValueJson[]; + + /** + * @generated from field: repeated google.protobuf.Int64Value repeated_int64_value_field = 24; + */ + repeatedInt64ValueField?: Int64ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt64Value repeated_uint64_value_field = 25; + */ + repeatedUint64ValueField?: UInt64ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.Int32Value repeated_int32_value_field = 26; + */ + repeatedInt32ValueField?: Int32ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt32Value repeated_uint32_value_field = 27; + */ + repeatedUint32ValueField?: UInt32ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.StringValue repeated_string_value_field = 28; + */ + repeatedStringValueField?: StringValueJson[]; + + /** + * @generated from field: repeated google.protobuf.BytesValue repeated_bytes_value_field = 29; + */ + repeatedBytesValueField?: BytesValueJson[]; + + /** + * @generated from field: map map_double_value_field = 31; + */ + mapDoubleValueField?: { [key: string]: DoubleValueJson }; + + /** + * @generated from field: map map_bool_value_field = 32; + */ + mapBoolValueField?: { [key: string]: BoolValueJson }; + + /** + * @generated from field: map map_float_value_field = 33; + */ + mapFloatValueField?: { [key: string]: FloatValueJson }; + + /** + * @generated from field: map map_int64_value_field = 34; + */ + mapInt64ValueField?: { [key: string]: Int64ValueJson }; + + /** + * @generated from field: map map_uint64_value_field = 35; + */ + mapUint64ValueField?: { [key: string]: UInt64ValueJson }; + + /** + * @generated from field: map map_int32_value_field = 36; + */ + mapInt32ValueField?: { [key: string]: Int32ValueJson }; + + /** + * @generated from field: map map_uint32_value_field = 37; + */ + mapUint32ValueField?: { [key: string]: UInt32ValueJson }; + + /** + * @generated from field: map map_string_value_field = 38; + */ + mapStringValueField?: { [key: string]: StringValueJson }; + + /** + * @generated from field: map map_bytes_value_field = 39; + */ + mapBytesValueField?: { [key: string]: BytesValueJson }; +}; + /** * Describes the message spec.WrappersMessage. * Use `create(WrappersMessageDesc)` to create a new message. * @deprecated */ -export declare const WrappersMessageDesc: GenDescMessage; +export declare const WrappersMessageDesc: GenDescMessage; diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/map_proto2_unittest_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/map_proto2_unittest_pb.d.ts index 61a0fe1b6..3593c70ad 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/map_proto2_unittest_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/map_proto2_unittest_pb.d.ts @@ -22,7 +22,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { ImportEnumForMap } from "./unittest_import_pb.js"; +import type { ImportEnumForMap, ImportEnumForMapJson } from "./unittest_import_pb.js"; /** * Describes the file google/protobuf/map_proto2_unittest.proto. @@ -106,11 +106,86 @@ export declare type TestEnumMap = Message<"protobuf_unittest.TestEnumMap"> & { unknownMapFieldSfixed64: { [key: string]: Proto2MapEnum }; }; +/** + * JSON type for the message protobuf_unittest.TestEnumMap. + */ +export declare type TestEnumMapJson = { + /** + * @generated from field: map known_map_field = 101; + */ + knownMapField?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field = 102; + */ + unknownMapField?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_int64 = 200; + */ + unknownMapFieldInt64?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_uint64 = 201; + */ + unknownMapFieldUint64?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_int32 = 202; + */ + unknownMapFieldInt32?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_uint32 = 203; + */ + unknownMapFieldUint32?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_fixed32 = 204; + */ + unknownMapFieldFixed32?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_fixed64 = 205; + */ + unknownMapFieldFixed64?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_bool = 206; + */ + unknownMapFieldBool?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_string = 207; + */ + unknownMapFieldString?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_sint32 = 208; + */ + unknownMapFieldSint32?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_sint64 = 209; + */ + unknownMapFieldSint64?: { [key: string]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_sfixed32 = 210; + */ + unknownMapFieldSfixed32?: { [key: number]: Proto2MapEnumJson }; + + /** + * @generated from field: map unknown_map_field_sfixed64 = 211; + */ + unknownMapFieldSfixed64?: { [key: string]: Proto2MapEnumJson }; +}; + /** * Describes the message protobuf_unittest.TestEnumMap. * Use `create(TestEnumMapDesc)` to create a new message. */ -export declare const TestEnumMapDesc: GenDescMessage; +export declare const TestEnumMapDesc: GenDescMessage; /** * @generated from message protobuf_unittest.TestEnumMapPlusExtra @@ -189,11 +264,86 @@ export declare type TestEnumMapPlusExtra = Message<"protobuf_unittest.TestEnumMa unknownMapFieldSfixed64: { [key: string]: Proto2MapEnumPlusExtra }; }; +/** + * JSON type for the message protobuf_unittest.TestEnumMapPlusExtra. + */ +export declare type TestEnumMapPlusExtraJson = { + /** + * @generated from field: map known_map_field = 101; + */ + knownMapField?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field = 102; + */ + unknownMapField?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_int64 = 200; + */ + unknownMapFieldInt64?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_uint64 = 201; + */ + unknownMapFieldUint64?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_int32 = 202; + */ + unknownMapFieldInt32?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_uint32 = 203; + */ + unknownMapFieldUint32?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_fixed32 = 204; + */ + unknownMapFieldFixed32?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_fixed64 = 205; + */ + unknownMapFieldFixed64?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_bool = 206; + */ + unknownMapFieldBool?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_string = 207; + */ + unknownMapFieldString?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_sint32 = 208; + */ + unknownMapFieldSint32?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_sint64 = 209; + */ + unknownMapFieldSint64?: { [key: string]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_sfixed32 = 210; + */ + unknownMapFieldSfixed32?: { [key: number]: Proto2MapEnumPlusExtraJson }; + + /** + * @generated from field: map unknown_map_field_sfixed64 = 211; + */ + unknownMapFieldSfixed64?: { [key: string]: Proto2MapEnumPlusExtraJson }; +}; + /** * Describes the message protobuf_unittest.TestEnumMapPlusExtra. * Use `create(TestEnumMapPlusExtraDesc)` to create a new message. */ -export declare const TestEnumMapPlusExtraDesc: GenDescMessage; +export declare const TestEnumMapPlusExtraDesc: GenDescMessage; /** * @generated from message protobuf_unittest.TestImportEnumMap @@ -205,11 +355,21 @@ export declare type TestImportEnumMap = Message<"protobuf_unittest.TestImportEnu importEnumAmp: { [key: number]: ImportEnumForMap }; }; +/** + * JSON type for the message protobuf_unittest.TestImportEnumMap. + */ +export declare type TestImportEnumMapJson = { + /** + * @generated from field: map import_enum_amp = 1; + */ + importEnumAmp?: { [key: number]: ImportEnumForMapJson }; +}; + /** * Describes the message protobuf_unittest.TestImportEnumMap. * Use `create(TestImportEnumMapDesc)` to create a new message. */ -export declare const TestImportEnumMapDesc: GenDescMessage; +export declare const TestImportEnumMapDesc: GenDescMessage; /** * @generated from message protobuf_unittest.TestIntIntMap @@ -221,11 +381,21 @@ export declare type TestIntIntMap = Message<"protobuf_unittest.TestIntIntMap"> & m: { [key: number]: number }; }; +/** + * JSON type for the message protobuf_unittest.TestIntIntMap. + */ +export declare type TestIntIntMapJson = { + /** + * @generated from field: map m = 1; + */ + m?: { [key: number]: number }; +}; + /** * Describes the message protobuf_unittest.TestIntIntMap. * Use `create(TestIntIntMapDesc)` to create a new message. */ -export declare const TestIntIntMapDesc: GenDescMessage; +export declare const TestIntIntMapDesc: GenDescMessage; /** * Test all key types: string, plus the non-floating-point scalars. @@ -294,11 +464,76 @@ export declare type TestMaps = Message<"protobuf_unittest.TestMaps"> & { mString: { [key: string]: TestIntIntMap }; }; +/** + * JSON type for the message protobuf_unittest.TestMaps. + */ +export declare type TestMapsJson = { + /** + * @generated from field: map m_int32 = 1; + */ + mInt32?: { [key: number]: TestIntIntMapJson }; + + /** + * @generated from field: map m_int64 = 2; + */ + mInt64?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_uint32 = 3; + */ + mUint32?: { [key: number]: TestIntIntMapJson }; + + /** + * @generated from field: map m_uint64 = 4; + */ + mUint64?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_sint32 = 5; + */ + mSint32?: { [key: number]: TestIntIntMapJson }; + + /** + * @generated from field: map m_sint64 = 6; + */ + mSint64?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_fixed32 = 7; + */ + mFixed32?: { [key: number]: TestIntIntMapJson }; + + /** + * @generated from field: map m_fixed64 = 8; + */ + mFixed64?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_sfixed32 = 9; + */ + mSfixed32?: { [key: number]: TestIntIntMapJson }; + + /** + * @generated from field: map m_sfixed64 = 10; + */ + mSfixed64?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_bool = 11; + */ + mBool?: { [key: string]: TestIntIntMapJson }; + + /** + * @generated from field: map m_string = 12; + */ + mString?: { [key: string]: TestIntIntMapJson }; +}; + /** * Describes the message protobuf_unittest.TestMaps. * Use `create(TestMapsDesc)` to create a new message. */ -export declare const TestMapsDesc: GenDescMessage; +export declare const TestMapsDesc: GenDescMessage; /** * Test maps in submessages. @@ -312,11 +547,21 @@ export declare type TestSubmessageMaps = Message<"protobuf_unittest.TestSubmessa m?: TestMaps; }; +/** + * JSON type for the message protobuf_unittest.TestSubmessageMaps. + */ +export declare type TestSubmessageMapsJson = { + /** + * @generated from field: optional protobuf_unittest.TestMaps m = 1; + */ + m?: TestMapsJson; +}; + /** * Describes the message protobuf_unittest.TestSubmessageMaps. * Use `create(TestSubmessageMapsDesc)` to create a new message. */ -export declare const TestSubmessageMapsDesc: GenDescMessage; +export declare const TestSubmessageMapsDesc: GenDescMessage; /** * @generated from message protobuf_unittest.TestProto2BytesMap @@ -333,11 +578,26 @@ export declare type TestProto2BytesMap = Message<"protobuf_unittest.TestProto2By mapString: { [key: number]: string }; }; +/** + * JSON type for the message protobuf_unittest.TestProto2BytesMap. + */ +export declare type TestProto2BytesMapJson = { + /** + * @generated from field: map map_bytes = 1; + */ + mapBytes?: { [key: number]: string }; + + /** + * @generated from field: map map_string = 2; + */ + mapString?: { [key: number]: string }; +}; + /** * Describes the message protobuf_unittest.TestProto2BytesMap. * Use `create(TestProto2BytesMapDesc)` to create a new message. */ -export declare const TestProto2BytesMapDesc: GenDescMessage; +export declare const TestProto2BytesMapDesc: GenDescMessage; /** * @generated from enum protobuf_unittest.Proto2MapEnum @@ -359,10 +619,15 @@ export enum Proto2MapEnum { BAZ = 2, } +/** + * JSON type for the enum protobuf_unittest.Proto2MapEnum. + */ +export declare type Proto2MapEnumJson = "PROTO2_MAP_ENUM_FOO" | "PROTO2_MAP_ENUM_BAR" | "PROTO2_MAP_ENUM_BAZ"; + /** * Describes the enum protobuf_unittest.Proto2MapEnum. */ -export declare const Proto2MapEnumDesc: GenDescEnum; +export declare const Proto2MapEnumDesc: GenDescEnum; /** * @generated from enum protobuf_unittest.Proto2MapEnumPlusExtra @@ -389,8 +654,13 @@ export enum Proto2MapEnumPlusExtra { E_PROTO2_MAP_ENUM_EXTRA = 3, } +/** + * JSON type for the enum protobuf_unittest.Proto2MapEnumPlusExtra. + */ +export declare type Proto2MapEnumPlusExtraJson = "E_PROTO2_MAP_ENUM_FOO" | "E_PROTO2_MAP_ENUM_BAR" | "E_PROTO2_MAP_ENUM_BAZ" | "E_PROTO2_MAP_ENUM_EXTRA"; + /** * Describes the enum protobuf_unittest.Proto2MapEnumPlusExtra. */ -export declare const Proto2MapEnumPlusExtraDesc: GenDescEnum; +export declare const Proto2MapEnumPlusExtraDesc: GenDescEnum; 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 1b4f24fdc..e4db0e597 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 @@ -738,11 +738,686 @@ export declare type TestAllTypesProto2 = Message<"protobuf_test_messages.proto2. FieldName18: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2. + */ +export declare type TestAllTypesProto2Json = { + /** + * @generated from field: optional int32 optional_int32 = 1; + */ + optionalInt32?: number; + + /** + * @generated from field: optional int64 optional_int64 = 2; + */ + optionalInt64?: string; + + /** + * @generated from field: optional uint32 optional_uint32 = 3; + */ + optionalUint32?: number; + + /** + * @generated from field: optional uint64 optional_uint64 = 4; + */ + optionalUint64?: string; + + /** + * @generated from field: optional sint32 optional_sint32 = 5; + */ + optionalSint32?: number; + + /** + * @generated from field: optional sint64 optional_sint64 = 6; + */ + optionalSint64?: string; + + /** + * @generated from field: optional fixed32 optional_fixed32 = 7; + */ + optionalFixed32?: number; + + /** + * @generated from field: optional fixed64 optional_fixed64 = 8; + */ + optionalFixed64?: string; + + /** + * @generated from field: optional sfixed32 optional_sfixed32 = 9; + */ + optionalSfixed32?: number; + + /** + * @generated from field: optional sfixed64 optional_sfixed64 = 10; + */ + optionalSfixed64?: string; + + /** + * @generated from field: optional float optional_float = 11; + */ + optionalFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: optional double optional_double = 12; + */ + optionalDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @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?: string; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage optional_nested_message = 18; + */ + optionalNestedMessage?: TestAllTypesProto2_NestedMessageJson; + + /** + * @generated from field: optional protobuf_test_messages.proto2.ForeignMessageProto2 optional_foreign_message = 19; + */ + optionalForeignMessage?: ForeignMessageProto2Json; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum optional_nested_enum = 21; + */ + optionalNestedEnum?: TestAllTypesProto2_NestedEnumJson; + + /** + * @generated from field: optional protobuf_test_messages.proto2.ForeignEnumProto2 optional_foreign_enum = 22; + */ + optionalForeignEnum?: ForeignEnumProto2Json; + + /** + * @generated from field: optional string optional_string_piece = 24; + */ + optionalStringPiece?: string; + + /** + * @generated from field: optional string optional_cord = 25; + */ + optionalCord?: string; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2 recursive_message = 27; + */ + recursiveMessage?: TestAllTypesProto2Json; + + /** + * @generated from field: repeated int32 repeated_int32 = 31; + */ + repeatedInt32?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64 = 32; + */ + repeatedInt64?: string[]; + + /** + * @generated from field: repeated uint32 repeated_uint32 = 33; + */ + repeatedUint32?: number[]; + + /** + * @generated from field: repeated uint64 repeated_uint64 = 34; + */ + repeatedUint64?: string[]; + + /** + * @generated from field: repeated sint32 repeated_sint32 = 35; + */ + repeatedSint32?: number[]; + + /** + * @generated from field: repeated sint64 repeated_sint64 = 36; + */ + repeatedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 repeated_fixed32 = 37; + */ + repeatedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 repeated_fixed64 = 38; + */ + repeatedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 repeated_sfixed32 = 39; + */ + repeatedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64 = 40; + */ + repeatedSfixed64?: string[]; + + /** + * @generated from field: repeated float repeated_float = 41; + */ + repeatedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double repeated_double = 42; + */ + repeatedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @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?: string[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage repeated_nested_message = 48; + */ + repeatedNestedMessage?: TestAllTypesProto2_NestedMessageJson[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.ForeignMessageProto2 repeated_foreign_message = 49; + */ + repeatedForeignMessage?: ForeignMessageProto2Json[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum repeated_nested_enum = 51; + */ + repeatedNestedEnum?: TestAllTypesProto2_NestedEnumJson[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.ForeignEnumProto2 repeated_foreign_enum = 52; + */ + repeatedForeignEnum?: ForeignEnumProto2Json[]; + + /** + * @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 int32 packed_int32 = 75 [packed = true]; + */ + packedInt32?: number[]; + + /** + * @generated from field: repeated int64 packed_int64 = 76 [packed = true]; + */ + packedInt64?: string[]; + + /** + * @generated from field: repeated uint32 packed_uint32 = 77 [packed = true]; + */ + packedUint32?: number[]; + + /** + * @generated from field: repeated uint64 packed_uint64 = 78 [packed = true]; + */ + packedUint64?: string[]; + + /** + * @generated from field: repeated sint32 packed_sint32 = 79 [packed = true]; + */ + packedSint32?: number[]; + + /** + * @generated from field: repeated sint64 packed_sint64 = 80 [packed = true]; + */ + packedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 packed_fixed32 = 81 [packed = true]; + */ + packedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 packed_fixed64 = 82 [packed = true]; + */ + packedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 packed_sfixed32 = 83 [packed = true]; + */ + packedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 packed_sfixed64 = 84 [packed = true]; + */ + packedSfixed64?: string[]; + + /** + * @generated from field: repeated float packed_float = 85 [packed = true]; + */ + packedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double packed_double = 86 [packed = true]; + */ + packedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool packed_bool = 87 [packed = true]; + */ + packedBool?: boolean[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum packed_nested_enum = 88 [packed = true]; + */ + packedNestedEnum?: TestAllTypesProto2_NestedEnumJson[]; + + /** + * @generated from field: repeated int32 unpacked_int32 = 89 [packed = false]; + */ + unpackedInt32?: number[]; + + /** + * @generated from field: repeated int64 unpacked_int64 = 90 [packed = false]; + */ + unpackedInt64?: string[]; + + /** + * @generated from field: repeated uint32 unpacked_uint32 = 91 [packed = false]; + */ + unpackedUint32?: number[]; + + /** + * @generated from field: repeated uint64 unpacked_uint64 = 92 [packed = false]; + */ + unpackedUint64?: string[]; + + /** + * @generated from field: repeated sint32 unpacked_sint32 = 93 [packed = false]; + */ + unpackedSint32?: number[]; + + /** + * @generated from field: repeated sint64 unpacked_sint64 = 94 [packed = false]; + */ + unpackedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 unpacked_fixed32 = 95 [packed = false]; + */ + unpackedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 unpacked_fixed64 = 96 [packed = false]; + */ + unpackedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 unpacked_sfixed32 = 97 [packed = false]; + */ + unpackedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 unpacked_sfixed64 = 98 [packed = false]; + */ + unpackedSfixed64?: string[]; + + /** + * @generated from field: repeated float unpacked_float = 99 [packed = false]; + */ + unpackedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double = 100 [packed = false]; + */ + unpackedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool unpacked_bool = 101 [packed = false]; + */ + unpackedBool?: boolean[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum unpacked_nested_enum = 102 [packed = false]; + */ + unpackedNestedEnum?: TestAllTypesProto2_NestedEnumJson[]; + + /** + * @generated from field: map map_int32_int32 = 56; + */ + mapInt32Int32?: { [key: number]: number }; + + /** + * @generated from field: map map_int64_int64 = 57; + */ + mapInt64Int64?: { [key: string]: string }; + + /** + * @generated from field: map map_uint32_uint32 = 58; + */ + mapUint32Uint32?: { [key: number]: number }; + + /** + * @generated from field: map map_uint64_uint64 = 59; + */ + mapUint64Uint64?: { [key: string]: string }; + + /** + * @generated from field: map map_sint32_sint32 = 60; + */ + mapSint32Sint32?: { [key: number]: number }; + + /** + * @generated from field: map map_sint64_sint64 = 61; + */ + mapSint64Sint64?: { [key: string]: string }; + + /** + * @generated from field: map map_fixed32_fixed32 = 62; + */ + mapFixed32Fixed32?: { [key: number]: number }; + + /** + * @generated from field: map map_fixed64_fixed64 = 63; + */ + mapFixed64Fixed64?: { [key: string]: string }; + + /** + * @generated from field: map map_sfixed32_sfixed32 = 64; + */ + mapSfixed32Sfixed32?: { [key: number]: number }; + + /** + * @generated from field: map map_sfixed64_sfixed64 = 65; + */ + mapSfixed64Sfixed64?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_float = 66; + */ + mapInt32Float?: { [key: number]: number | "NaN" | "Infinity" | "-Infinity" }; + + /** + * @generated from field: map map_int32_double = 67; + */ + mapInt32Double?: { [key: number]: number | "NaN" | "Infinity" | "-Infinity" }; + + /** + * @generated from field: map map_bool_bool = 68; + */ + mapBoolBool?: { [key: string]: boolean }; + + /** + * @generated from field: map map_string_string = 69; + */ + mapStringString?: { [key: string]: string }; + + /** + * @generated from field: map map_string_bytes = 70; + */ + mapStringBytes?: { [key: string]: string }; + + /** + * @generated from field: map map_string_nested_message = 71; + */ + mapStringNestedMessage?: { [key: string]: TestAllTypesProto2_NestedMessageJson }; + + /** + * @generated from field: map map_string_foreign_message = 72; + */ + mapStringForeignMessage?: { [key: string]: ForeignMessageProto2Json }; + + /** + * @generated from field: map map_string_nested_enum = 73; + */ + mapStringNestedEnum?: { [key: string]: TestAllTypesProto2_NestedEnumJson }; + + /** + * @generated from field: map map_string_foreign_enum = 74; + */ + mapStringForeignEnum?: { [key: string]: ForeignEnumProto2Json }; + + /** + * @generated from field: uint32 oneof_uint32 = 111; + */ + oneofUint32?: number; + + /** + * @generated from field: protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage oneof_nested_message = 112; + */ + oneofNestedMessage?: TestAllTypesProto2_NestedMessageJson; + + /** + * @generated from field: string oneof_string = 113; + */ + oneofString?: string; + + /** + * @generated from field: bytes oneof_bytes = 114; + */ + oneofBytes?: string; + + /** + * @generated from field: bool oneof_bool = 115; + */ + oneofBool?: boolean; + + /** + * @generated from field: uint64 oneof_uint64 = 116; + */ + oneofUint64?: string; + + /** + * @generated from field: float oneof_float = 117; + */ + oneofFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: double oneof_double = 118; + */ + oneofDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum oneof_enum = 119; + */ + oneofEnum?: TestAllTypesProto2_NestedEnumJson; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.Data data = 201; + */ + data?: TestAllTypesProto2_DataJson; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField multiwordgroupfield = 204; + */ + multiwordgroupfield?: TestAllTypesProto2_MultiWordGroupFieldJson; + + /** + * @generated from field: optional int32 default_int32 = 241 [default = -123456789]; + */ + defaultInt32?: number; + + /** + * @generated from field: optional int64 default_int64 = 242 [default = -9123456789123456789]; + */ + defaultInt64?: string; + + /** + * @generated from field: optional uint32 default_uint32 = 243 [default = 2123456789]; + */ + defaultUint32?: number; + + /** + * @generated from field: optional uint64 default_uint64 = 244 [default = 10123456789123456789]; + */ + defaultUint64?: string; + + /** + * @generated from field: optional sint32 default_sint32 = 245 [default = -123456789]; + */ + defaultSint32?: number; + + /** + * @generated from field: optional sint64 default_sint64 = 246 [default = -9123456789123456789]; + */ + defaultSint64?: string; + + /** + * @generated from field: optional fixed32 default_fixed32 = 247 [default = 2123456789]; + */ + defaultFixed32?: number; + + /** + * @generated from field: optional fixed64 default_fixed64 = 248 [default = 10123456789123456789]; + */ + defaultFixed64?: string; + + /** + * @generated from field: optional sfixed32 default_sfixed32 = 249 [default = -123456789]; + */ + defaultSfixed32?: number; + + /** + * @generated from field: optional sfixed64 default_sfixed64 = 250 [default = -9123456789123456789]; + */ + defaultSfixed64?: string; + + /** + * @generated from field: optional float default_float = 251 [default = 9e+09]; + */ + defaultFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: optional double default_double = 252 [default = 7e+22]; + */ + defaultDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: optional bool default_bool = 253 [default = true]; + */ + defaultBool?: boolean; + + /** + * @generated from field: optional string default_string = 254 [default = "Rosebud"]; + */ + defaultString?: string; + + /** + * @generated from field: optional bytes default_bytes = 255 [default = "joshua"]; + */ + defaultBytes?: string; + + /** + * @generated from field: optional int32 fieldname1 = 401; + */ + fieldname1?: number; + + /** + * @generated from field: optional int32 field_name2 = 402; + */ + fieldName2?: number; + + /** + * @generated from field: optional int32 _field_name3 = 403; + */ + FieldName3?: number; + + /** + * @generated from field: optional int32 field__name4_ = 404; + */ + fieldName4?: number; + + /** + * @generated from field: optional int32 field0name5 = 405; + */ + field0name5?: number; + + /** + * @generated from field: optional int32 field_0_name6 = 406; + */ + field0Name6?: number; + + /** + * @generated from field: optional int32 fieldName7 = 407; + */ + fieldName7?: number; + + /** + * @generated from field: optional int32 FieldName8 = 408; + */ + FieldName8?: number; + + /** + * @generated from field: optional int32 field_Name9 = 409; + */ + fieldName9?: number; + + /** + * @generated from field: optional int32 Field_Name10 = 410; + */ + FieldName10?: number; + + /** + * @generated from field: optional int32 FIELD_NAME11 = 411; + */ + FIELDNAME11?: number; + + /** + * @generated from field: optional int32 FIELD_name12 = 412; + */ + FIELDName12?: number; + + /** + * @generated from field: optional int32 __field_name13 = 413; + */ + FieldName13?: number; + + /** + * @generated from field: optional int32 __Field_name14 = 414; + */ + FieldName14?: number; + + /** + * @generated from field: optional int32 field__name15 = 415; + */ + fieldName15?: number; + + /** + * @generated from field: optional int32 field__Name16 = 416; + */ + fieldName16?: number; + + /** + * @generated from field: optional int32 field_name17__ = 417; + */ + fieldName17?: number; + + /** + * @generated from field: optional int32 Field_name18__ = 418; + */ + FieldName18?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2. * Use `create(TestAllTypesProto2Desc)` to create a new message. */ -export declare const TestAllTypesProto2Desc: GenDescMessage; +export declare const TestAllTypesProto2Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage @@ -759,11 +1434,26 @@ export declare type TestAllTypesProto2_NestedMessage = Message<"protobuf_test_me corecursive?: TestAllTypesProto2; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage. + */ +export declare type TestAllTypesProto2_NestedMessageJson = { + /** + * @generated from field: optional int32 a = 1; + */ + a?: number; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllTypesProto2 corecursive = 2; + */ + corecursive?: TestAllTypesProto2Json; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage. * Use `create(TestAllTypesProto2_NestedMessageDesc)` to create a new message. */ -export declare const TestAllTypesProto2_NestedMessageDesc: GenDescMessage; +export declare const TestAllTypesProto2_NestedMessageDesc: GenDescMessage; /** * groups @@ -782,11 +1472,26 @@ export declare type TestAllTypesProto2_Data = Message<"protobuf_test_messages.pr groupUint32: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.Data. + */ +export declare type TestAllTypesProto2_DataJson = { + /** + * @generated from field: optional int32 group_int32 = 202; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 203; + */ + groupUint32?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.Data. * Use `create(TestAllTypesProto2_DataDesc)` to create a new message. */ -export declare const TestAllTypesProto2_DataDesc: GenDescMessage; +export declare const TestAllTypesProto2_DataDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField @@ -803,11 +1508,26 @@ export declare type TestAllTypesProto2_MultiWordGroupField = Message<"protobuf_t groupUint32: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField. + */ +export declare type TestAllTypesProto2_MultiWordGroupFieldJson = { + /** + * @generated from field: optional int32 group_int32 = 205; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 206; + */ + groupUint32?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.MultiWordGroupField. * Use `create(TestAllTypesProto2_MultiWordGroupFieldDesc)` to create a new message. */ -export declare const TestAllTypesProto2_MultiWordGroupFieldDesc: GenDescMessage; +export declare const TestAllTypesProto2_MultiWordGroupFieldDesc: GenDescMessage; /** * message_set test case. @@ -817,11 +1537,17 @@ export declare const TestAllTypesProto2_MultiWordGroupFieldDesc: GenDescMessage< export declare type TestAllTypesProto2_MessageSetCorrect = Message<"protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect"> & { }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect. + */ +export declare type TestAllTypesProto2_MessageSetCorrectJson = { +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect. * Use `create(TestAllTypesProto2_MessageSetCorrectDesc)` to create a new message. */ -export declare const TestAllTypesProto2_MessageSetCorrectDesc: GenDescMessage; +export declare const TestAllTypesProto2_MessageSetCorrectDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1 @@ -833,11 +1559,21 @@ export declare type TestAllTypesProto2_MessageSetCorrectExtension1 = Message<"pr str: string; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1. + */ +export declare type TestAllTypesProto2_MessageSetCorrectExtension1Json = { + /** + * @generated from field: optional string str = 25; + */ + str?: string; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1. * Use `create(TestAllTypesProto2_MessageSetCorrectExtension1Desc)` to create a new message. */ -export declare const TestAllTypesProto2_MessageSetCorrectExtension1Desc: GenDescMessage; +export declare const TestAllTypesProto2_MessageSetCorrectExtension1Desc: GenDescMessage; /** * @generated from extension: optional protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1 message_set_extension = 1547769; @@ -854,11 +1590,21 @@ export declare type TestAllTypesProto2_MessageSetCorrectExtension2 = Message<"pr i: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2. + */ +export declare type TestAllTypesProto2_MessageSetCorrectExtension2Json = { + /** + * @generated from field: optional int32 i = 9; + */ + i?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2. * Use `create(TestAllTypesProto2_MessageSetCorrectExtension2Desc)` to create a new message. */ -export declare const TestAllTypesProto2_MessageSetCorrectExtension2Desc: GenDescMessage; +export declare const TestAllTypesProto2_MessageSetCorrectExtension2Desc: GenDescMessage; /** * @generated from extension: optional protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2 message_set_extension = 4135312; @@ -892,10 +1638,15 @@ export enum TestAllTypesProto2_NestedEnum { NEG = -1, } +/** + * JSON type for the enum protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum. + */ +export declare type TestAllTypesProto2_NestedEnumJson = "FOO" | "BAR" | "BAZ" | "NEG"; + /** * Describes the enum protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum. */ -export declare const TestAllTypesProto2_NestedEnumDesc: GenDescEnum; +export declare const TestAllTypesProto2_NestedEnumDesc: GenDescEnum; /** * @generated from message protobuf_test_messages.proto2.ForeignMessageProto2 @@ -907,11 +1658,21 @@ export declare type ForeignMessageProto2 = Message<"protobuf_test_messages.proto c: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.ForeignMessageProto2. + */ +export declare type ForeignMessageProto2Json = { + /** + * @generated from field: optional int32 c = 1; + */ + c?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.ForeignMessageProto2. * Use `create(ForeignMessageProto2Desc)` to create a new message. */ -export declare const ForeignMessageProto2Desc: GenDescMessage; +export declare const ForeignMessageProto2Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.GroupField @@ -928,52 +1689,102 @@ export declare type GroupField = Message<"protobuf_test_messages.proto2.GroupFie groupUint32: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.GroupField. + */ +export declare type GroupFieldJson = { + /** + * @generated from field: optional int32 group_int32 = 122; + */ + groupInt32?: number; + + /** + * @generated from field: optional uint32 group_uint32 = 123; + */ + groupUint32?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.GroupField. * Use `create(GroupFieldDesc)` to create a new message. */ -export declare const GroupFieldDesc: GenDescMessage; +export declare const GroupFieldDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes */ -export declare type UnknownToTestAllTypes = Message<"protobuf_test_messages.proto2.UnknownToTestAllTypes"> & { +export declare type UnknownToTestAllTypes = Message<"protobuf_test_messages.proto2.UnknownToTestAllTypes"> & { + /** + * @generated from field: optional int32 optional_int32 = 1001; + */ + optionalInt32: number; + + /** + * @generated from field: optional string optional_string = 1002; + */ + optionalString: string; + + /** + * @generated from field: optional protobuf_test_messages.proto2.ForeignMessageProto2 nested_message = 1003; + */ + nestedMessage?: ForeignMessageProto2; + + /** + * @generated from field: optional protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup optionalgroup = 1004; + */ + optionalgroup?: UnknownToTestAllTypes_OptionalGroup; + + /** + * @generated from field: optional bool optional_bool = 1006; + */ + optionalBool: boolean; + + /** + * @generated from field: repeated int32 repeated_int32 = 1011; + */ + repeatedInt32: number[]; +}; + +/** + * JSON type for the message protobuf_test_messages.proto2.UnknownToTestAllTypes. + */ +export declare type UnknownToTestAllTypesJson = { /** * @generated from field: optional int32 optional_int32 = 1001; */ - optionalInt32: number; + optionalInt32?: number; /** * @generated from field: optional string optional_string = 1002; */ - optionalString: string; + optionalString?: string; /** * @generated from field: optional protobuf_test_messages.proto2.ForeignMessageProto2 nested_message = 1003; */ - nestedMessage?: ForeignMessageProto2; + nestedMessage?: ForeignMessageProto2Json; /** * @generated from field: optional protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup optionalgroup = 1004; */ - optionalgroup?: UnknownToTestAllTypes_OptionalGroup; + optionalgroup?: UnknownToTestAllTypes_OptionalGroupJson; /** * @generated from field: optional bool optional_bool = 1006; */ - optionalBool: boolean; + optionalBool?: boolean; /** * @generated from field: repeated int32 repeated_int32 = 1011; */ - repeatedInt32: number[]; + repeatedInt32?: number[]; }; /** * Describes the message protobuf_test_messages.proto2.UnknownToTestAllTypes. * Use `create(UnknownToTestAllTypesDesc)` to create a new message. */ -export declare const UnknownToTestAllTypesDesc: GenDescMessage; +export declare const UnknownToTestAllTypesDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup @@ -985,11 +1796,21 @@ export declare type UnknownToTestAllTypes_OptionalGroup = Message<"protobuf_test a: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup. + */ +export declare type UnknownToTestAllTypes_OptionalGroupJson = { + /** + * @generated from field: optional int32 a = 1; + */ + a?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup. * Use `create(UnknownToTestAllTypes_OptionalGroupDesc)` to create a new message. */ -export declare const UnknownToTestAllTypes_OptionalGroupDesc: GenDescMessage; +export declare const UnknownToTestAllTypes_OptionalGroupDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.NullHypothesisProto2 @@ -997,11 +1818,17 @@ export declare const UnknownToTestAllTypes_OptionalGroupDesc: GenDescMessage & { }; +/** + * JSON type for the message protobuf_test_messages.proto2.NullHypothesisProto2. + */ +export declare type NullHypothesisProto2Json = { +}; + /** * Describes the message protobuf_test_messages.proto2.NullHypothesisProto2. * Use `create(NullHypothesisProto2Desc)` to create a new message. */ -export declare const NullHypothesisProto2Desc: GenDescMessage; +export declare const NullHypothesisProto2Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.EnumOnlyProto2 @@ -1009,11 +1836,17 @@ export declare const NullHypothesisProto2Desc: GenDescMessage & { }; +/** + * JSON type for the message protobuf_test_messages.proto2.EnumOnlyProto2. + */ +export declare type EnumOnlyProto2Json = { +}; + /** * Describes the message protobuf_test_messages.proto2.EnumOnlyProto2. * Use `create(EnumOnlyProto2Desc)` to create a new message. */ -export declare const EnumOnlyProto2Desc: GenDescMessage; +export declare const EnumOnlyProto2Desc: GenDescMessage; /** * @generated from enum protobuf_test_messages.proto2.EnumOnlyProto2.Bool @@ -1030,10 +1863,15 @@ export enum EnumOnlyProto2_Bool { kTrue = 1, } +/** + * JSON type for the enum protobuf_test_messages.proto2.EnumOnlyProto2.Bool. + */ +export declare type EnumOnlyProto2_BoolJson = "kFalse" | "kTrue"; + /** * Describes the enum protobuf_test_messages.proto2.EnumOnlyProto2.Bool. */ -export declare const EnumOnlyProto2_BoolDesc: GenDescEnum; +export declare const EnumOnlyProto2_BoolDesc: GenDescEnum; /** * @generated from message protobuf_test_messages.proto2.OneStringProto2 @@ -1045,11 +1883,21 @@ export declare type OneStringProto2 = Message<"protobuf_test_messages.proto2.One data: string; }; +/** + * JSON type for the message protobuf_test_messages.proto2.OneStringProto2. + */ +export declare type OneStringProto2Json = { + /** + * @generated from field: optional string data = 1; + */ + data?: string; +}; + /** * Describes the message protobuf_test_messages.proto2.OneStringProto2. * Use `create(OneStringProto2Desc)` to create a new message. */ -export declare const OneStringProto2Desc: GenDescMessage; +export declare const OneStringProto2Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.ProtoWithKeywords @@ -1071,11 +1919,31 @@ export declare type ProtoWithKeywords = Message<"protobuf_test_messages.proto2.P requires: string[]; }; +/** + * JSON type for the message protobuf_test_messages.proto2.ProtoWithKeywords. + */ +export declare type ProtoWithKeywordsJson = { + /** + * @generated from field: optional int32 inline = 1; + */ + inline?: number; + + /** + * @generated from field: optional string concept = 2; + */ + concept?: string; + + /** + * @generated from field: repeated string requires = 3; + */ + requires?: string[]; +}; + /** * Describes the message protobuf_test_messages.proto2.ProtoWithKeywords. * Use `create(ProtoWithKeywordsDesc)` to create a new message. */ -export declare const ProtoWithKeywordsDesc: GenDescMessage; +export declare const ProtoWithKeywordsDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2 @@ -1281,11 +2149,211 @@ export declare type TestAllRequiredTypesProto2 = Message<"protobuf_test_messages defaultBytes: Uint8Array; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2. + */ +export declare type TestAllRequiredTypesProto2Json = { + /** + * @generated from field: required int32 required_int32 = 1; + */ + requiredInt32?: number; + + /** + * @generated from field: required int64 required_int64 = 2; + */ + requiredInt64?: string; + + /** + * @generated from field: required uint32 required_uint32 = 3; + */ + requiredUint32?: number; + + /** + * @generated from field: required uint64 required_uint64 = 4; + */ + requiredUint64?: string; + + /** + * @generated from field: required sint32 required_sint32 = 5; + */ + requiredSint32?: number; + + /** + * @generated from field: required sint64 required_sint64 = 6; + */ + requiredSint64?: string; + + /** + * @generated from field: required fixed32 required_fixed32 = 7; + */ + requiredFixed32?: number; + + /** + * @generated from field: required fixed64 required_fixed64 = 8; + */ + requiredFixed64?: string; + + /** + * @generated from field: required sfixed32 required_sfixed32 = 9; + */ + requiredSfixed32?: number; + + /** + * @generated from field: required sfixed64 required_sfixed64 = 10; + */ + requiredSfixed64?: string; + + /** + * @generated from field: required float required_float = 11; + */ + requiredFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required double required_double = 12; + */ + requiredDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required bool required_bool = 13; + */ + requiredBool?: boolean; + + /** + * @generated from field: required string required_string = 14; + */ + requiredString?: string; + + /** + * @generated from field: required bytes required_bytes = 15; + */ + requiredBytes?: string; + + /** + * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage required_nested_message = 18; + */ + requiredNestedMessage?: TestAllRequiredTypesProto2_NestedMessageJson; + + /** + * @generated from field: required protobuf_test_messages.proto2.ForeignMessageProto2 required_foreign_message = 19; + */ + requiredForeignMessage?: ForeignMessageProto2Json; + + /** + * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum required_nested_enum = 21; + */ + requiredNestedEnum?: TestAllRequiredTypesProto2_NestedEnumJson; + + /** + * @generated from field: required protobuf_test_messages.proto2.ForeignEnumProto2 required_foreign_enum = 22; + */ + requiredForeignEnum?: ForeignEnumProto2Json; + + /** + * @generated from field: required string required_string_piece = 24; + */ + requiredStringPiece?: string; + + /** + * @generated from field: required string required_cord = 25; + */ + requiredCord?: string; + + /** + * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2 recursive_message = 27; + */ + recursiveMessage?: TestAllRequiredTypesProto2Json; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2 optional_recursive_message = 28; + */ + optionalRecursiveMessage?: TestAllRequiredTypesProto2Json; + + /** + * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data data = 201; + */ + data?: TestAllRequiredTypesProto2_DataJson; + + /** + * @generated from field: required int32 default_int32 = 241 [default = -123456789]; + */ + defaultInt32?: number; + + /** + * @generated from field: required int64 default_int64 = 242 [default = -9123456789123456789]; + */ + defaultInt64?: string; + + /** + * @generated from field: required uint32 default_uint32 = 243 [default = 2123456789]; + */ + defaultUint32?: number; + + /** + * @generated from field: required uint64 default_uint64 = 244 [default = 10123456789123456789]; + */ + defaultUint64?: string; + + /** + * @generated from field: required sint32 default_sint32 = 245 [default = -123456789]; + */ + defaultSint32?: number; + + /** + * @generated from field: required sint64 default_sint64 = 246 [default = -9123456789123456789]; + */ + defaultSint64?: string; + + /** + * @generated from field: required fixed32 default_fixed32 = 247 [default = 2123456789]; + */ + defaultFixed32?: number; + + /** + * @generated from field: required fixed64 default_fixed64 = 248 [default = 10123456789123456789]; + */ + defaultFixed64?: string; + + /** + * @generated from field: required sfixed32 default_sfixed32 = 249 [default = -123456789]; + */ + defaultSfixed32?: number; + + /** + * @generated from field: required sfixed64 default_sfixed64 = 250 [default = -9123456789123456789]; + */ + defaultSfixed64?: string; + + /** + * @generated from field: required float default_float = 251 [default = 9e+09]; + */ + defaultFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required double default_double = 252 [default = 7e+22]; + */ + defaultDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: required bool default_bool = 253 [default = true]; + */ + defaultBool?: boolean; + + /** + * @generated from field: required string default_string = 254 [default = "Rosebud"]; + */ + defaultString?: string; + + /** + * @generated from field: required bytes default_bytes = 255 [default = "joshua"]; + */ + defaultBytes?: string; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2. * Use `create(TestAllRequiredTypesProto2Desc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2Desc: GenDescMessage; +export declare const TestAllRequiredTypesProto2Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage @@ -1307,11 +2375,31 @@ export declare type TestAllRequiredTypesProto2_NestedMessage = Message<"protobuf optionalCorecursive?: TestAllRequiredTypesProto2; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage. + */ +export declare type TestAllRequiredTypesProto2_NestedMessageJson = { + /** + * @generated from field: required int32 a = 1; + */ + a?: number; + + /** + * @generated from field: required protobuf_test_messages.proto2.TestAllRequiredTypesProto2 corecursive = 2; + */ + corecursive?: TestAllRequiredTypesProto2Json; + + /** + * @generated from field: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2 optional_corecursive = 3; + */ + optionalCorecursive?: TestAllRequiredTypesProto2Json; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedMessage. * Use `create(TestAllRequiredTypesProto2_NestedMessageDesc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2_NestedMessageDesc: GenDescMessage; +export declare const TestAllRequiredTypesProto2_NestedMessageDesc: GenDescMessage; /** * groups @@ -1330,11 +2418,26 @@ export declare type TestAllRequiredTypesProto2_Data = Message<"protobuf_test_mes groupUint32: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data. + */ +export declare type TestAllRequiredTypesProto2_DataJson = { + /** + * @generated from field: required int32 group_int32 = 202; + */ + groupInt32?: number; + + /** + * @generated from field: required uint32 group_uint32 = 203; + */ + groupUint32?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.Data. * Use `create(TestAllRequiredTypesProto2_DataDesc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2_DataDesc: GenDescMessage; +export declare const TestAllRequiredTypesProto2_DataDesc: GenDescMessage; /** * message_set test case. @@ -1344,11 +2447,17 @@ export declare const TestAllRequiredTypesProto2_DataDesc: GenDescMessage & { }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrect. + */ +export declare type TestAllRequiredTypesProto2_MessageSetCorrectJson = { +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrect. * Use `create(TestAllRequiredTypesProto2_MessageSetCorrectDesc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2_MessageSetCorrectDesc: GenDescMessage; +export declare const TestAllRequiredTypesProto2_MessageSetCorrectDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1 @@ -1360,11 +2469,21 @@ export declare type TestAllRequiredTypesProto2_MessageSetCorrectExtension1 = Mes str: string; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1. + */ +export declare type TestAllRequiredTypesProto2_MessageSetCorrectExtension1Json = { + /** + * @generated from field: required string str = 25; + */ + str?: string; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1. * Use `create(TestAllRequiredTypesProto2_MessageSetCorrectExtension1Desc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2_MessageSetCorrectExtension1Desc: GenDescMessage; +export declare const TestAllRequiredTypesProto2_MessageSetCorrectExtension1Desc: GenDescMessage; /** * @generated from extension: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1 message_set_extension = 1547769; @@ -1381,11 +2500,21 @@ export declare type TestAllRequiredTypesProto2_MessageSetCorrectExtension2 = Mes i: number; }; +/** + * JSON type for the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2. + */ +export declare type TestAllRequiredTypesProto2_MessageSetCorrectExtension2Json = { + /** + * @generated from field: required int32 i = 9; + */ + i?: number; +}; + /** * Describes the message protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2. * Use `create(TestAllRequiredTypesProto2_MessageSetCorrectExtension2Desc)` to create a new message. */ -export declare const TestAllRequiredTypesProto2_MessageSetCorrectExtension2Desc: GenDescMessage; +export declare const TestAllRequiredTypesProto2_MessageSetCorrectExtension2Desc: GenDescMessage; /** * @generated from extension: optional protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2 message_set_extension = 4135312; @@ -1419,10 +2548,15 @@ export enum TestAllRequiredTypesProto2_NestedEnum { NEG = -1, } +/** + * JSON type for the enum protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum. + */ +export declare type TestAllRequiredTypesProto2_NestedEnumJson = "FOO" | "BAR" | "BAZ" | "NEG"; + /** * Describes the enum protobuf_test_messages.proto2.TestAllRequiredTypesProto2.NestedEnum. */ -export declare const TestAllRequiredTypesProto2_NestedEnumDesc: GenDescEnum; +export declare const TestAllRequiredTypesProto2_NestedEnumDesc: GenDescEnum; /** * @generated from enum protobuf_test_messages.proto2.ForeignEnumProto2 @@ -1444,10 +2578,15 @@ export enum ForeignEnumProto2 { FOREIGN_BAZ = 2, } +/** + * JSON type for the enum protobuf_test_messages.proto2.ForeignEnumProto2. + */ +export declare type ForeignEnumProto2Json = "FOREIGN_FOO" | "FOREIGN_BAR" | "FOREIGN_BAZ"; + /** * Describes the enum protobuf_test_messages.proto2.ForeignEnumProto2. */ -export declare const ForeignEnumProto2Desc: GenDescEnum; +export declare const ForeignEnumProto2Desc: GenDescEnum; /** * @generated from extension: optional int32 extension_int32 = 120; diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto3_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto3_pb.d.ts index 27d0974b4..5f31c8d90 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto3_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/test_messages_proto3_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { Any, BoolValue, BytesValue, DoubleValue, Duration, FieldMask, FloatValue, Int32Value, Int64Value, ListValue, NullValue, StringValue, Struct, Timestamp, UInt32Value, UInt64Value, Value } from "@bufbuild/protobuf/wkt"; +import type { Any, AnyJson, BoolValue, BoolValueJson, BytesValue, BytesValueJson, DoubleValue, DoubleValueJson, Duration, DurationJson, FieldMask, FieldMaskJson, FloatValue, FloatValueJson, Int32Value, Int32ValueJson, Int64Value, Int64ValueJson, ListValue, ListValueJson, NullValue, NullValueJson, StringValue, StringValueJson, Struct, StructJson, Timestamp, TimestampJson, UInt32Value, UInt32ValueJson, UInt64Value, UInt64ValueJson, Value, ValueJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file google/protobuf/test_messages_proto3.proto. @@ -823,11 +823,771 @@ export declare type TestAllTypesProto3 = Message<"protobuf_test_messages.proto3. FieldName18: number; }; +/** + * JSON type for the message protobuf_test_messages.proto3.TestAllTypesProto3. + */ +export declare type TestAllTypesProto3Json = { + /** + * @generated from field: int32 optional_int32 = 1; + */ + optionalInt32?: number; + + /** + * @generated from field: int64 optional_int64 = 2; + */ + optionalInt64?: string; + + /** + * @generated from field: uint32 optional_uint32 = 3; + */ + optionalUint32?: number; + + /** + * @generated from field: uint64 optional_uint64 = 4; + */ + optionalUint64?: string; + + /** + * @generated from field: sint32 optional_sint32 = 5; + */ + optionalSint32?: number; + + /** + * @generated from field: sint64 optional_sint64 = 6; + */ + optionalSint64?: string; + + /** + * @generated from field: fixed32 optional_fixed32 = 7; + */ + optionalFixed32?: number; + + /** + * @generated from field: fixed64 optional_fixed64 = 8; + */ + optionalFixed64?: string; + + /** + * @generated from field: sfixed32 optional_sfixed32 = 9; + */ + optionalSfixed32?: number; + + /** + * @generated from field: sfixed64 optional_sfixed64 = 10; + */ + optionalSfixed64?: string; + + /** + * @generated from field: float optional_float = 11; + */ + optionalFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: double optional_double = 12; + */ + optionalDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: bool optional_bool = 13; + */ + optionalBool?: boolean; + + /** + * @generated from field: string optional_string = 14; + */ + optionalString?: string; + + /** + * @generated from field: bytes optional_bytes = 15; + */ + optionalBytes?: string; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage optional_nested_message = 18; + */ + optionalNestedMessage?: TestAllTypesProto3_NestedMessageJson; + + /** + * @generated from field: protobuf_test_messages.proto3.ForeignMessage optional_foreign_message = 19; + */ + optionalForeignMessage?: ForeignMessageJson; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum optional_nested_enum = 21; + */ + optionalNestedEnum?: TestAllTypesProto3_NestedEnumJson; + + /** + * @generated from field: protobuf_test_messages.proto3.ForeignEnum optional_foreign_enum = 22; + */ + optionalForeignEnum?: ForeignEnumJson; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum optional_aliased_enum = 23; + */ + optionalAliasedEnum?: TestAllTypesProto3_AliasedEnumJson; + + /** + * @generated from field: string optional_string_piece = 24; + */ + optionalStringPiece?: string; + + /** + * @generated from field: string optional_cord = 25; + */ + optionalCord?: string; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3 recursive_message = 27; + */ + recursiveMessage?: TestAllTypesProto3Json; + + /** + * @generated from field: repeated int32 repeated_int32 = 31; + */ + repeatedInt32?: number[]; + + /** + * @generated from field: repeated int64 repeated_int64 = 32; + */ + repeatedInt64?: string[]; + + /** + * @generated from field: repeated uint32 repeated_uint32 = 33; + */ + repeatedUint32?: number[]; + + /** + * @generated from field: repeated uint64 repeated_uint64 = 34; + */ + repeatedUint64?: string[]; + + /** + * @generated from field: repeated sint32 repeated_sint32 = 35; + */ + repeatedSint32?: number[]; + + /** + * @generated from field: repeated sint64 repeated_sint64 = 36; + */ + repeatedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 repeated_fixed32 = 37; + */ + repeatedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 repeated_fixed64 = 38; + */ + repeatedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 repeated_sfixed32 = 39; + */ + repeatedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 repeated_sfixed64 = 40; + */ + repeatedSfixed64?: string[]; + + /** + * @generated from field: repeated float repeated_float = 41; + */ + repeatedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double repeated_double = 42; + */ + repeatedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @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?: string[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage repeated_nested_message = 48; + */ + repeatedNestedMessage?: TestAllTypesProto3_NestedMessageJson[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.ForeignMessage repeated_foreign_message = 49; + */ + repeatedForeignMessage?: ForeignMessageJson[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum repeated_nested_enum = 51; + */ + repeatedNestedEnum?: TestAllTypesProto3_NestedEnumJson[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.ForeignEnum repeated_foreign_enum = 52; + */ + repeatedForeignEnum?: ForeignEnumJson[]; + + /** + * @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 int32 packed_int32 = 75 [packed = true]; + */ + packedInt32?: number[]; + + /** + * @generated from field: repeated int64 packed_int64 = 76 [packed = true]; + */ + packedInt64?: string[]; + + /** + * @generated from field: repeated uint32 packed_uint32 = 77 [packed = true]; + */ + packedUint32?: number[]; + + /** + * @generated from field: repeated uint64 packed_uint64 = 78 [packed = true]; + */ + packedUint64?: string[]; + + /** + * @generated from field: repeated sint32 packed_sint32 = 79 [packed = true]; + */ + packedSint32?: number[]; + + /** + * @generated from field: repeated sint64 packed_sint64 = 80 [packed = true]; + */ + packedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 packed_fixed32 = 81 [packed = true]; + */ + packedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 packed_fixed64 = 82 [packed = true]; + */ + packedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 packed_sfixed32 = 83 [packed = true]; + */ + packedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 packed_sfixed64 = 84 [packed = true]; + */ + packedSfixed64?: string[]; + + /** + * @generated from field: repeated float packed_float = 85 [packed = true]; + */ + packedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double packed_double = 86 [packed = true]; + */ + packedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool packed_bool = 87 [packed = true]; + */ + packedBool?: boolean[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum packed_nested_enum = 88 [packed = true]; + */ + packedNestedEnum?: TestAllTypesProto3_NestedEnumJson[]; + + /** + * @generated from field: repeated int32 unpacked_int32 = 89 [packed = false]; + */ + unpackedInt32?: number[]; + + /** + * @generated from field: repeated int64 unpacked_int64 = 90 [packed = false]; + */ + unpackedInt64?: string[]; + + /** + * @generated from field: repeated uint32 unpacked_uint32 = 91 [packed = false]; + */ + unpackedUint32?: number[]; + + /** + * @generated from field: repeated uint64 unpacked_uint64 = 92 [packed = false]; + */ + unpackedUint64?: string[]; + + /** + * @generated from field: repeated sint32 unpacked_sint32 = 93 [packed = false]; + */ + unpackedSint32?: number[]; + + /** + * @generated from field: repeated sint64 unpacked_sint64 = 94 [packed = false]; + */ + unpackedSint64?: string[]; + + /** + * @generated from field: repeated fixed32 unpacked_fixed32 = 95 [packed = false]; + */ + unpackedFixed32?: number[]; + + /** + * @generated from field: repeated fixed64 unpacked_fixed64 = 96 [packed = false]; + */ + unpackedFixed64?: string[]; + + /** + * @generated from field: repeated sfixed32 unpacked_sfixed32 = 97 [packed = false]; + */ + unpackedSfixed32?: number[]; + + /** + * @generated from field: repeated sfixed64 unpacked_sfixed64 = 98 [packed = false]; + */ + unpackedSfixed64?: string[]; + + /** + * @generated from field: repeated float unpacked_float = 99 [packed = false]; + */ + unpackedFloat?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated double unpacked_double = 100 [packed = false]; + */ + unpackedDouble?: number | "NaN" | "Infinity" | "-Infinity"[]; + + /** + * @generated from field: repeated bool unpacked_bool = 101 [packed = false]; + */ + unpackedBool?: boolean[]; + + /** + * @generated from field: repeated protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum unpacked_nested_enum = 102 [packed = false]; + */ + unpackedNestedEnum?: TestAllTypesProto3_NestedEnumJson[]; + + /** + * @generated from field: map map_int32_int32 = 56; + */ + mapInt32Int32?: { [key: number]: number }; + + /** + * @generated from field: map map_int64_int64 = 57; + */ + mapInt64Int64?: { [key: string]: string }; + + /** + * @generated from field: map map_uint32_uint32 = 58; + */ + mapUint32Uint32?: { [key: number]: number }; + + /** + * @generated from field: map map_uint64_uint64 = 59; + */ + mapUint64Uint64?: { [key: string]: string }; + + /** + * @generated from field: map map_sint32_sint32 = 60; + */ + mapSint32Sint32?: { [key: number]: number }; + + /** + * @generated from field: map map_sint64_sint64 = 61; + */ + mapSint64Sint64?: { [key: string]: string }; + + /** + * @generated from field: map map_fixed32_fixed32 = 62; + */ + mapFixed32Fixed32?: { [key: number]: number }; + + /** + * @generated from field: map map_fixed64_fixed64 = 63; + */ + mapFixed64Fixed64?: { [key: string]: string }; + + /** + * @generated from field: map map_sfixed32_sfixed32 = 64; + */ + mapSfixed32Sfixed32?: { [key: number]: number }; + + /** + * @generated from field: map map_sfixed64_sfixed64 = 65; + */ + mapSfixed64Sfixed64?: { [key: string]: string }; + + /** + * @generated from field: map map_int32_float = 66; + */ + mapInt32Float?: { [key: number]: number | "NaN" | "Infinity" | "-Infinity" }; + + /** + * @generated from field: map map_int32_double = 67; + */ + mapInt32Double?: { [key: number]: number | "NaN" | "Infinity" | "-Infinity" }; + + /** + * @generated from field: map map_bool_bool = 68; + */ + mapBoolBool?: { [key: string]: boolean }; + + /** + * @generated from field: map map_string_string = 69; + */ + mapStringString?: { [key: string]: string }; + + /** + * @generated from field: map map_string_bytes = 70; + */ + mapStringBytes?: { [key: string]: string }; + + /** + * @generated from field: map map_string_nested_message = 71; + */ + mapStringNestedMessage?: { [key: string]: TestAllTypesProto3_NestedMessageJson }; + + /** + * @generated from field: map map_string_foreign_message = 72; + */ + mapStringForeignMessage?: { [key: string]: ForeignMessageJson }; + + /** + * @generated from field: map map_string_nested_enum = 73; + */ + mapStringNestedEnum?: { [key: string]: TestAllTypesProto3_NestedEnumJson }; + + /** + * @generated from field: map map_string_foreign_enum = 74; + */ + mapStringForeignEnum?: { [key: string]: ForeignEnumJson }; + + /** + * @generated from field: uint32 oneof_uint32 = 111; + */ + oneofUint32?: number; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage oneof_nested_message = 112; + */ + oneofNestedMessage?: TestAllTypesProto3_NestedMessageJson; + + /** + * @generated from field: string oneof_string = 113; + */ + oneofString?: string; + + /** + * @generated from field: bytes oneof_bytes = 114; + */ + oneofBytes?: string; + + /** + * @generated from field: bool oneof_bool = 115; + */ + oneofBool?: boolean; + + /** + * @generated from field: uint64 oneof_uint64 = 116; + */ + oneofUint64?: string; + + /** + * @generated from field: float oneof_float = 117; + */ + oneofFloat?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: double oneof_double = 118; + */ + oneofDouble?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum oneof_enum = 119; + */ + oneofEnum?: TestAllTypesProto3_NestedEnumJson; + + /** + * @generated from field: google.protobuf.NullValue oneof_null_value = 120; + */ + oneofNullValue?: NullValueJson; + + /** + * @generated from field: google.protobuf.BoolValue optional_bool_wrapper = 201; + */ + optionalBoolWrapper?: BoolValueJson; + + /** + * @generated from field: google.protobuf.Int32Value optional_int32_wrapper = 202; + */ + optionalInt32Wrapper?: Int32ValueJson; + + /** + * @generated from field: google.protobuf.Int64Value optional_int64_wrapper = 203; + */ + optionalInt64Wrapper?: Int64ValueJson; + + /** + * @generated from field: google.protobuf.UInt32Value optional_uint32_wrapper = 204; + */ + optionalUint32Wrapper?: UInt32ValueJson; + + /** + * @generated from field: google.protobuf.UInt64Value optional_uint64_wrapper = 205; + */ + optionalUint64Wrapper?: UInt64ValueJson; + + /** + * @generated from field: google.protobuf.FloatValue optional_float_wrapper = 206; + */ + optionalFloatWrapper?: FloatValueJson; + + /** + * @generated from field: google.protobuf.DoubleValue optional_double_wrapper = 207; + */ + optionalDoubleWrapper?: DoubleValueJson; + + /** + * @generated from field: google.protobuf.StringValue optional_string_wrapper = 208; + */ + optionalStringWrapper?: StringValueJson; + + /** + * @generated from field: google.protobuf.BytesValue optional_bytes_wrapper = 209; + */ + optionalBytesWrapper?: BytesValueJson; + + /** + * @generated from field: repeated google.protobuf.BoolValue repeated_bool_wrapper = 211; + */ + repeatedBoolWrapper?: BoolValueJson[]; + + /** + * @generated from field: repeated google.protobuf.Int32Value repeated_int32_wrapper = 212; + */ + repeatedInt32Wrapper?: Int32ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.Int64Value repeated_int64_wrapper = 213; + */ + repeatedInt64Wrapper?: Int64ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214; + */ + repeatedUint32Wrapper?: UInt32ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215; + */ + repeatedUint64Wrapper?: UInt64ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.FloatValue repeated_float_wrapper = 216; + */ + repeatedFloatWrapper?: FloatValueJson[]; + + /** + * @generated from field: repeated google.protobuf.DoubleValue repeated_double_wrapper = 217; + */ + repeatedDoubleWrapper?: DoubleValueJson[]; + + /** + * @generated from field: repeated google.protobuf.StringValue repeated_string_wrapper = 218; + */ + repeatedStringWrapper?: StringValueJson[]; + + /** + * @generated from field: repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219; + */ + repeatedBytesWrapper?: BytesValueJson[]; + + /** + * @generated from field: google.protobuf.Duration optional_duration = 301; + */ + optionalDuration?: DurationJson; + + /** + * @generated from field: google.protobuf.Timestamp optional_timestamp = 302; + */ + optionalTimestamp?: TimestampJson; + + /** + * @generated from field: google.protobuf.FieldMask optional_field_mask = 303; + */ + optionalFieldMask?: FieldMaskJson; + + /** + * @generated from field: google.protobuf.Struct optional_struct = 304; + */ + optionalStruct?: StructJson; + + /** + * @generated from field: google.protobuf.Any optional_any = 305; + */ + optionalAny?: AnyJson; + + /** + * @generated from field: google.protobuf.Value optional_value = 306; + */ + optionalValue?: ValueJson; + + /** + * @generated from field: google.protobuf.NullValue optional_null_value = 307; + */ + optionalNullValue?: NullValueJson; + + /** + * @generated from field: repeated google.protobuf.Duration repeated_duration = 311; + */ + repeatedDuration?: DurationJson[]; + + /** + * @generated from field: repeated google.protobuf.Timestamp repeated_timestamp = 312; + */ + repeatedTimestamp?: TimestampJson[]; + + /** + * @generated from field: repeated google.protobuf.FieldMask repeated_fieldmask = 313; + */ + repeatedFieldmask?: FieldMaskJson[]; + + /** + * @generated from field: repeated google.protobuf.Struct repeated_struct = 324; + */ + repeatedStruct?: StructJson[]; + + /** + * @generated from field: repeated google.protobuf.Any repeated_any = 315; + */ + repeatedAny?: AnyJson[]; + + /** + * @generated from field: repeated google.protobuf.Value repeated_value = 316; + */ + repeatedValue?: ValueJson[]; + + /** + * @generated from field: repeated google.protobuf.ListValue repeated_list_value = 317; + */ + repeatedListValue?: ListValueJson[]; + + /** + * @generated from field: int32 fieldname1 = 401; + */ + fieldname1?: number; + + /** + * @generated from field: int32 field_name2 = 402; + */ + fieldName2?: number; + + /** + * @generated from field: int32 _field_name3 = 403; + */ + FieldName3?: number; + + /** + * @generated from field: int32 field__name4_ = 404; + */ + fieldName4?: number; + + /** + * @generated from field: int32 field0name5 = 405; + */ + field0name5?: number; + + /** + * @generated from field: int32 field_0_name6 = 406; + */ + field0Name6?: number; + + /** + * @generated from field: int32 fieldName7 = 407; + */ + fieldName7?: number; + + /** + * @generated from field: int32 FieldName8 = 408; + */ + FieldName8?: number; + + /** + * @generated from field: int32 field_Name9 = 409; + */ + fieldName9?: number; + + /** + * @generated from field: int32 Field_Name10 = 410; + */ + FieldName10?: number; + + /** + * @generated from field: int32 FIELD_NAME11 = 411; + */ + FIELDNAME11?: number; + + /** + * @generated from field: int32 FIELD_name12 = 412; + */ + FIELDName12?: number; + + /** + * @generated from field: int32 __field_name13 = 413; + */ + FieldName13?: number; + + /** + * @generated from field: int32 __Field_name14 = 414; + */ + FieldName14?: number; + + /** + * @generated from field: int32 field__name15 = 415; + */ + fieldName15?: number; + + /** + * @generated from field: int32 field__Name16 = 416; + */ + fieldName16?: number; + + /** + * @generated from field: int32 field_name17__ = 417; + */ + fieldName17?: number; + + /** + * @generated from field: int32 Field_name18__ = 418; + */ + FieldName18?: number; +}; + /** * Describes the message protobuf_test_messages.proto3.TestAllTypesProto3. * Use `create(TestAllTypesProto3Desc)` to create a new message. */ -export declare const TestAllTypesProto3Desc: GenDescMessage; +export declare const TestAllTypesProto3Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage @@ -844,11 +1604,26 @@ export declare type TestAllTypesProto3_NestedMessage = Message<"protobuf_test_me corecursive?: TestAllTypesProto3; }; +/** + * JSON type for the message protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage. + */ +export declare type TestAllTypesProto3_NestedMessageJson = { + /** + * @generated from field: int32 a = 1; + */ + a?: number; + + /** + * @generated from field: protobuf_test_messages.proto3.TestAllTypesProto3 corecursive = 2; + */ + corecursive?: TestAllTypesProto3Json; +}; + /** * Describes the message protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage. * Use `create(TestAllTypesProto3_NestedMessageDesc)` to create a new message. */ -export declare const TestAllTypesProto3_NestedMessageDesc: GenDescMessage; +export declare const TestAllTypesProto3_NestedMessageDesc: GenDescMessage; /** * @generated from enum protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum @@ -877,10 +1652,15 @@ export enum TestAllTypesProto3_NestedEnum { NEG = -1, } +/** + * JSON type for the enum protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum. + */ +export declare type TestAllTypesProto3_NestedEnumJson = "FOO" | "BAR" | "BAZ" | "NEG"; + /** * Describes the enum protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum. */ -export declare const TestAllTypesProto3_NestedEnumDesc: GenDescEnum; +export declare const TestAllTypesProto3_NestedEnumDesc: GenDescEnum; /** * @generated from enum protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum @@ -917,10 +1697,15 @@ export enum TestAllTypesProto3_AliasedEnum { bAz = 2, } +/** + * JSON type for the enum protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum. + */ +export declare type TestAllTypesProto3_AliasedEnumJson = "ALIAS_FOO" | "ALIAS_BAR" | "ALIAS_BAZ" | "MOO" | "moo" | "bAz"; + /** * Describes the enum protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum. */ -export declare const TestAllTypesProto3_AliasedEnumDesc: GenDescEnum; +export declare const TestAllTypesProto3_AliasedEnumDesc: GenDescEnum; /** * @generated from message protobuf_test_messages.proto3.ForeignMessage @@ -932,11 +1717,21 @@ export declare type ForeignMessage = Message<"protobuf_test_messages.proto3.Fore c: number; }; +/** + * JSON type for the message protobuf_test_messages.proto3.ForeignMessage. + */ +export declare type ForeignMessageJson = { + /** + * @generated from field: int32 c = 1; + */ + c?: number; +}; + /** * Describes the message protobuf_test_messages.proto3.ForeignMessage. * Use `create(ForeignMessageDesc)` to create a new message. */ -export declare const ForeignMessageDesc: GenDescMessage; +export declare const ForeignMessageDesc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto3.NullHypothesisProto3 @@ -944,11 +1739,17 @@ export declare const ForeignMessageDesc: GenDescMessage; export declare type NullHypothesisProto3 = Message<"protobuf_test_messages.proto3.NullHypothesisProto3"> & { }; +/** + * JSON type for the message protobuf_test_messages.proto3.NullHypothesisProto3. + */ +export declare type NullHypothesisProto3Json = { +}; + /** * Describes the message protobuf_test_messages.proto3.NullHypothesisProto3. * Use `create(NullHypothesisProto3Desc)` to create a new message. */ -export declare const NullHypothesisProto3Desc: GenDescMessage; +export declare const NullHypothesisProto3Desc: GenDescMessage; /** * @generated from message protobuf_test_messages.proto3.EnumOnlyProto3 @@ -956,11 +1757,17 @@ export declare const NullHypothesisProto3Desc: GenDescMessage & { }; +/** + * JSON type for the message protobuf_test_messages.proto3.EnumOnlyProto3. + */ +export declare type EnumOnlyProto3Json = { +}; + /** * Describes the message protobuf_test_messages.proto3.EnumOnlyProto3. * Use `create(EnumOnlyProto3Desc)` to create a new message. */ -export declare const EnumOnlyProto3Desc: GenDescMessage; +export declare const EnumOnlyProto3Desc: GenDescMessage; /** * @generated from enum protobuf_test_messages.proto3.EnumOnlyProto3.Bool @@ -977,10 +1784,15 @@ export enum EnumOnlyProto3_Bool { kTrue = 1, } +/** + * JSON type for the enum protobuf_test_messages.proto3.EnumOnlyProto3.Bool. + */ +export declare type EnumOnlyProto3_BoolJson = "kFalse" | "kTrue"; + /** * Describes the enum protobuf_test_messages.proto3.EnumOnlyProto3.Bool. */ -export declare const EnumOnlyProto3_BoolDesc: GenDescEnum; +export declare const EnumOnlyProto3_BoolDesc: GenDescEnum; /** * @generated from enum protobuf_test_messages.proto3.ForeignEnum @@ -1002,8 +1814,13 @@ export enum ForeignEnum { FOREIGN_BAZ = 2, } +/** + * JSON type for the enum protobuf_test_messages.proto3.ForeignEnum. + */ +export declare type ForeignEnumJson = "FOREIGN_FOO" | "FOREIGN_BAR" | "FOREIGN_BAZ"; + /** * Describes the enum protobuf_test_messages.proto3.ForeignEnum. */ -export declare const ForeignEnumDesc: GenDescEnum; +export declare const ForeignEnumDesc: GenDescEnum; diff --git a/packages/protobuf-test/src/gen/js/google/protobuf/type_pb.d.ts b/packages/protobuf-test/src/gen/js/google/protobuf/type_pb.d.ts index 7bda949f7..91d2592f6 100644 --- a/packages/protobuf-test/src/gen/js/google/protobuf/type_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/google/protobuf/type_pb.d.ts @@ -18,7 +18,7 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "@bufbuild/protobuf/codegenv1"; import type { Message } from "@bufbuild/protobuf"; -import type { Any, SourceContext } from "@bufbuild/protobuf/wkt"; +import type { Any, AnyJson, SourceContext, SourceContextJson } from "@bufbuild/protobuf/wkt"; /** * Describes the file google/protobuf/type.proto. @@ -81,11 +81,51 @@ export declare type Type = Message<"google.protobuf.Type"> & { edition: string; }; +/** + * JSON type for the message google.protobuf.Type. + */ +export declare type TypeJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; + + /** + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields?: FieldJson[]; + + /** + * @generated from field: repeated string oneofs = 3; + */ + oneofs?: string[]; + + /** + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options?: OptionJson[]; + + /** + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContextJson; + + /** + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax?: SyntaxJson; + + /** + * @generated from field: string edition = 7; + */ + edition?: string; +}; + /** * Describes the message google.protobuf.Type. * Use `create(TypeDesc)` to create a new message. */ -export declare const TypeDesc: GenDescMessage; +export declare const TypeDesc: GenDescMessage; /** * A single field of a message type. @@ -166,11 +206,66 @@ export declare type Field = Message<"google.protobuf.Field"> & { defaultValue: string; }; +/** + * JSON type for the message google.protobuf.Field. + */ +export declare type FieldJson = { + /** + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind?: Field_KindJson; + + /** + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality?: Field_CardinalityJson; + + /** + * @generated from field: int32 number = 3; + */ + number?: number; + + /** + * @generated from field: string name = 4; + */ + name?: string; + + /** + * @generated from field: string type_url = 6; + */ + typeUrl?: string; + + /** + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex?: number; + + /** + * @generated from field: bool packed = 8; + */ + packed?: boolean; + + /** + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options?: OptionJson[]; + + /** + * @generated from field: string json_name = 10; + */ + jsonName?: string; + + /** + * @generated from field: string default_value = 11; + */ + defaultValue?: string; +}; + /** * Describes the message google.protobuf.Field. * Use `create(FieldDesc)` to create a new message. */ -export declare const FieldDesc: GenDescMessage; +export declare const FieldDesc: GenDescMessage; /** * Basic field types. @@ -312,10 +407,15 @@ export enum Field_Kind { TYPE_SINT64 = 18, } +/** + * JSON type for the enum google.protobuf.Field.Kind. + */ +export declare type Field_KindJson = "TYPE_UNKNOWN" | "TYPE_DOUBLE" | "TYPE_FLOAT" | "TYPE_INT64" | "TYPE_UINT64" | "TYPE_INT32" | "TYPE_FIXED64" | "TYPE_FIXED32" | "TYPE_BOOL" | "TYPE_STRING" | "TYPE_GROUP" | "TYPE_MESSAGE" | "TYPE_BYTES" | "TYPE_UINT32" | "TYPE_ENUM" | "TYPE_SFIXED32" | "TYPE_SFIXED64" | "TYPE_SINT32" | "TYPE_SINT64"; + /** * Describes the enum google.protobuf.Field.Kind. */ -export declare const Field_KindDesc: GenDescEnum; +export declare const Field_KindDesc: GenDescEnum; /** * Whether a field is optional, required, or repeated. @@ -352,10 +452,15 @@ export enum Field_Cardinality { REPEATED = 3, } +/** + * JSON type for the enum google.protobuf.Field.Cardinality. + */ +export declare type Field_CardinalityJson = "CARDINALITY_UNKNOWN" | "CARDINALITY_OPTIONAL" | "CARDINALITY_REQUIRED" | "CARDINALITY_REPEATED"; + /** * Describes the enum google.protobuf.Field.Cardinality. */ -export declare const Field_CardinalityDesc: GenDescEnum; +export declare const Field_CardinalityDesc: GenDescEnum; /** * Enum type definition. @@ -406,11 +511,46 @@ export declare type Enum = Message<"google.protobuf.Enum"> & { edition: string; }; +/** + * JSON type for the message google.protobuf.Enum. + */ +export declare type EnumJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; + + /** + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue?: EnumValueJson[]; + + /** + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; + + /** + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContextJson; + + /** + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax?: SyntaxJson; + + /** + * @generated from field: string edition = 6; + */ + edition?: string; +}; + /** * Describes the message google.protobuf.Enum. * Use `create(EnumDesc)` to create a new message. */ -export declare const EnumDesc: GenDescMessage; +export declare const EnumDesc: GenDescMessage; /** * Enum value definition. @@ -440,11 +580,31 @@ export declare type EnumValue = Message<"google.protobuf.EnumValue"> & { options: Option[]; }; +/** + * JSON type for the message google.protobuf.EnumValue. + */ +export declare type EnumValueJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; + + /** + * @generated from field: int32 number = 2; + */ + number?: number; + + /** + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; +}; + /** * Describes the message google.protobuf.EnumValue. * Use `create(EnumValueDesc)` to create a new message. */ -export declare const EnumValueDesc: GenDescMessage; +export declare const EnumValueDesc: GenDescMessage; /** * A protocol buffer option, which can be attached to a message, field, @@ -474,11 +634,26 @@ export declare type Option = Message<"google.protobuf.Option"> & { value?: Any; }; +/** + * JSON type for the message google.protobuf.Option. + */ +export declare type OptionJson = { + /** + * @generated from field: string name = 1; + */ + name?: string; + + /** + * @generated from field: google.protobuf.Any value = 2; + */ + value?: AnyJson; +}; + /** * Describes the message google.protobuf.Option. * Use `create(OptionDesc)` to create a new message. */ -export declare const OptionDesc: GenDescMessage