@bufbuild/protobuf 2.0.0-alpha.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/cjs/codegenv1/embed.d.ts +2 -2
  2. package/dist/cjs/codegenv1/embed.js +25 -25
  3. package/dist/cjs/codegenv1/enum.js +2 -4
  4. package/dist/cjs/codegenv1/restore-json-names.d.ts +3 -0
  5. package/dist/cjs/codegenv1/restore-json-names.js +3 -0
  6. package/dist/cjs/codegenv1/symbols.d.ts +9 -0
  7. package/dist/cjs/codegenv1/symbols.js +9 -0
  8. package/dist/cjs/codegenv1/types.d.ts +55 -2
  9. package/dist/cjs/create.js +7 -18
  10. package/dist/cjs/desc-types.d.ts +27 -10
  11. package/dist/cjs/extensions.d.ts +21 -1
  12. package/dist/cjs/extensions.js +38 -7
  13. package/dist/cjs/fields.d.ts +17 -16
  14. package/dist/cjs/fields.js +17 -10
  15. package/dist/cjs/from-binary.js +9 -19
  16. package/dist/cjs/from-json.js +9 -13
  17. package/dist/cjs/index.d.ts +1 -1
  18. package/dist/cjs/index.js +3 -1
  19. package/dist/cjs/reflect/names.d.ts +0 -12
  20. package/dist/cjs/reflect/names.js +1 -39
  21. package/dist/cjs/reflect/nested-types.d.ts +11 -1
  22. package/dist/cjs/reflect/nested-types.js +34 -1
  23. package/dist/cjs/reflect/reflect-types.d.ts +158 -10
  24. package/dist/cjs/reflect/reflect.d.ts +11 -2
  25. package/dist/cjs/reflect/reflect.js +306 -281
  26. package/dist/cjs/reflect/registry.js +50 -41
  27. package/dist/cjs/reflect/unsafe.js +38 -43
  28. package/dist/cjs/to-binary.js +1 -3
  29. package/dist/cjs/to-json.js +7 -27
  30. package/dist/cjs/wire/base64-encoding.js +2 -2
  31. package/dist/cjs/wire/binary-encoding.d.ts +5 -3
  32. package/dist/cjs/wire/binary-encoding.js +16 -10
  33. package/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts +7 -0
  34. package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +7 -2
  35. package/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +15 -0
  36. package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +15 -6
  37. package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +22 -0
  38. package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +22 -9
  39. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +186 -0
  40. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +186 -83
  41. package/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts +7 -0
  42. package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +7 -2
  43. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts +7 -0
  44. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +7 -2
  45. package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +7 -0
  46. package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +7 -2
  47. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts +7 -0
  48. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +7 -2
  49. package/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts +18 -0
  50. package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +18 -7
  51. package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +7 -0
  52. package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +7 -2
  53. package/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts +32 -0
  54. package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +32 -13
  55. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +39 -0
  56. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +39 -18
  57. package/dist/esm/codegenv1/embed.d.ts +2 -2
  58. package/dist/esm/codegenv1/embed.js +25 -25
  59. package/dist/esm/codegenv1/enum.js +2 -4
  60. package/dist/esm/codegenv1/restore-json-names.d.ts +3 -0
  61. package/dist/esm/codegenv1/restore-json-names.js +3 -0
  62. package/dist/esm/codegenv1/symbols.d.ts +9 -0
  63. package/dist/esm/codegenv1/symbols.js +9 -0
  64. package/dist/esm/codegenv1/types.d.ts +55 -2
  65. package/dist/esm/create.js +7 -18
  66. package/dist/esm/desc-types.d.ts +27 -10
  67. package/dist/esm/extensions.d.ts +21 -1
  68. package/dist/esm/extensions.js +35 -6
  69. package/dist/esm/fields.d.ts +17 -16
  70. package/dist/esm/fields.js +17 -10
  71. package/dist/esm/from-binary.js +9 -19
  72. package/dist/esm/from-json.js +11 -15
  73. package/dist/esm/index.d.ts +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/reflect/names.d.ts +0 -12
  76. package/dist/esm/reflect/names.js +0 -37
  77. package/dist/esm/reflect/nested-types.d.ts +11 -1
  78. package/dist/esm/reflect/nested-types.js +32 -0
  79. package/dist/esm/reflect/reflect-types.d.ts +158 -10
  80. package/dist/esm/reflect/reflect.d.ts +11 -2
  81. package/dist/esm/reflect/reflect.js +304 -279
  82. package/dist/esm/reflect/registry.js +50 -41
  83. package/dist/esm/reflect/unsafe.js +38 -43
  84. package/dist/esm/to-binary.js +1 -3
  85. package/dist/esm/to-json.js +7 -27
  86. package/dist/esm/wire/base64-encoding.js +2 -2
  87. package/dist/esm/wire/binary-encoding.d.ts +5 -3
  88. package/dist/esm/wire/binary-encoding.js +16 -10
  89. package/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +7 -0
  90. package/dist/esm/wkt/gen/google/protobuf/any_pb.js +7 -2
  91. package/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +15 -0
  92. package/dist/esm/wkt/gen/google/protobuf/api_pb.js +15 -6
  93. package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +22 -0
  94. package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +22 -9
  95. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +186 -0
  96. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +186 -83
  97. package/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +7 -0
  98. package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +7 -2
  99. package/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +7 -0
  100. package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +7 -2
  101. package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +7 -0
  102. package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +7 -2
  103. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +7 -0
  104. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +7 -2
  105. package/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +18 -0
  106. package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +18 -7
  107. package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +7 -0
  108. package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +7 -2
  109. package/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +32 -0
  110. package/dist/esm/wkt/gen/google/protobuf/type_pb.js +32 -13
  111. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +39 -0
  112. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +39 -18
  113. package/package.json +2 -2
@@ -1,5 +1,8 @@
1
1
  import type { GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Message } from "../../../../types.js";
3
+ /**
4
+ * Describes the file google/protobuf/source_context.proto.
5
+ */
3
6
  export declare const fileDesc_google_protobuf_source_context: GenDescFile;
4
7
  /**
5
8
  * `SourceContext` represents information about the source of a
@@ -16,4 +19,8 @@ export type SourceContext = Message<"google.protobuf.SourceContext"> & {
16
19
  */
17
20
  fileName: string;
18
21
  };
22
+ /**
23
+ * Describes the message google.protobuf.SourceContext.
24
+ * Use `create(SourceContextDesc)` to create a new message.
25
+ */
19
26
  export declare const SourceContextDesc: GenDescMessage<SourceContext>;
@@ -16,7 +16,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SourceContextDesc = exports.fileDesc_google_protobuf_source_context = void 0;
17
17
  const file_js_1 = require("../../../../codegenv1/file.js");
18
18
  const message_js_1 = require("../../../../codegenv1/message.js");
19
+ /**
20
+ * Describes the file google/protobuf/source_context.proto.
21
+ */
19
22
  exports.fileDesc_google_protobuf_source_context = (0, file_js_1.fileDesc)("CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEoCUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3RvUAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3NvdXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z");
20
- // Describes the message google.protobuf.SourceContext.
21
- // Use `create(SourceContextDesc)` to create a new SourceContext.
23
+ /**
24
+ * Describes the message google.protobuf.SourceContext.
25
+ * Use `create(SourceContextDesc)` to create a new message.
26
+ */
22
27
  exports.SourceContextDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_source_context, 0);
@@ -1,5 +1,8 @@
1
1
  import type { GenDescEnum, GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Message } from "../../../../types.js";
3
+ /**
4
+ * Describes the file google/protobuf/struct.proto.
5
+ */
3
6
  export declare const fileDesc_google_protobuf_struct: GenDescFile;
4
7
  /**
5
8
  * `Struct` represents a structured data value, consisting of fields
@@ -23,6 +26,10 @@ export type Struct = Message<"google.protobuf.Struct"> & {
23
26
  [key: string]: Value;
24
27
  };
25
28
  };
29
+ /**
30
+ * Describes the message google.protobuf.Struct.
31
+ * Use `create(StructDesc)` to create a new message.
32
+ */
26
33
  export declare const StructDesc: GenDescMessage<Struct>;
27
34
  /**
28
35
  * `Value` represents a dynamically typed value which can be either
@@ -93,6 +100,10 @@ export type Value = Message<"google.protobuf.Value"> & {
93
100
  value?: undefined;
94
101
  };
95
102
  };
103
+ /**
104
+ * Describes the message google.protobuf.Value.
105
+ * Use `create(ValueDesc)` to create a new message.
106
+ */
96
107
  export declare const ValueDesc: GenDescMessage<Value>;
97
108
  /**
98
109
  * `ListValue` is a wrapper around a repeated field of values.
@@ -109,6 +120,10 @@ export type ListValue = Message<"google.protobuf.ListValue"> & {
109
120
  */
110
121
  values: Value[];
111
122
  };
123
+ /**
124
+ * Describes the message google.protobuf.ListValue.
125
+ * Use `create(ListValueDesc)` to create a new message.
126
+ */
112
127
  export declare const ListValueDesc: GenDescMessage<ListValue>;
113
128
  /**
114
129
  * `NullValue` is a singleton enumeration to represent the null value for the
@@ -126,4 +141,7 @@ export declare enum NullValue {
126
141
  */
127
142
  NULL_VALUE = 0
128
143
  }
144
+ /**
145
+ * Describes the enum google.protobuf.NullValue.
146
+ */
129
147
  export declare const NullValueDesc: GenDescEnum<NullValue>;
@@ -17,15 +17,24 @@ exports.NullValueDesc = exports.NullValue = exports.ListValueDesc = exports.Valu
17
17
  const file_js_1 = require("../../../../codegenv1/file.js");
18
18
  const message_js_1 = require("../../../../codegenv1/message.js");
19
19
  const enum_js_1 = require("../../../../codegenv1/enum.js");
20
+ /**
21
+ * Describes the file google/protobuf/struct.proto.
22
+ */
20
23
  exports.fileDesc_google_protobuf_struct = (0, file_js_1.fileDesc)("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");
21
- // Describes the message google.protobuf.Struct.
22
- // Use `create(StructDesc)` to create a new Struct.
24
+ /**
25
+ * Describes the message google.protobuf.Struct.
26
+ * Use `create(StructDesc)` to create a new message.
27
+ */
23
28
  exports.StructDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_struct, 0);
24
- // Describes the message google.protobuf.Value.
25
- // Use `create(ValueDesc)` to create a new Value.
29
+ /**
30
+ * Describes the message google.protobuf.Value.
31
+ * Use `create(ValueDesc)` to create a new message.
32
+ */
26
33
  exports.ValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_struct, 1);
27
- // Describes the message google.protobuf.ListValue.
28
- // Use `create(ListValueDesc)` to create a new ListValue.
34
+ /**
35
+ * Describes the message google.protobuf.ListValue.
36
+ * Use `create(ListValueDesc)` to create a new message.
37
+ */
29
38
  exports.ListValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_struct, 2);
30
39
  /**
31
40
  * `NullValue` is a singleton enumeration to represent the null value for the
@@ -44,5 +53,7 @@ var NullValue;
44
53
  */
45
54
  NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
46
55
  })(NullValue || (exports.NullValue = NullValue = {}));
47
- // Describes the enum google.protobuf.NullValue.
56
+ /**
57
+ * Describes the enum google.protobuf.NullValue.
58
+ */
48
59
  exports.NullValueDesc = (0, enum_js_1.enumDesc)(exports.fileDesc_google_protobuf_struct, 0);
@@ -1,5 +1,8 @@
1
1
  import type { GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Message } from "../../../../types.js";
3
+ /**
4
+ * Describes the file google/protobuf/timestamp.proto.
5
+ */
3
6
  export declare const fileDesc_google_protobuf_timestamp: GenDescFile;
4
7
  /**
5
8
  * A Timestamp represents a point in time independent of any time zone or local
@@ -114,4 +117,8 @@ export type Timestamp = Message<"google.protobuf.Timestamp"> & {
114
117
  */
115
118
  nanos: number;
116
119
  };
120
+ /**
121
+ * Describes the message google.protobuf.Timestamp.
122
+ * Use `create(TimestampDesc)` to create a new message.
123
+ */
117
124
  export declare const TimestampDesc: GenDescMessage<Timestamp>;
@@ -16,7 +16,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.TimestampDesc = exports.fileDesc_google_protobuf_timestamp = void 0;
17
17
  const file_js_1 = require("../../../../codegenv1/file.js");
18
18
  const message_js_1 = require("../../../../codegenv1/message.js");
19
+ /**
20
+ * Describes the file google/protobuf/timestamp.proto.
21
+ */
19
22
  exports.fileDesc_google_protobuf_timestamp = (0, file_js_1.fileDesc)("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");
20
- // Describes the message google.protobuf.Timestamp.
21
- // Use `create(TimestampDesc)` to create a new Timestamp.
23
+ /**
24
+ * Describes the message google.protobuf.Timestamp.
25
+ * Use `create(TimestampDesc)` to create a new message.
26
+ */
22
27
  exports.TimestampDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_timestamp, 0);
@@ -2,6 +2,9 @@ import type { GenDescEnum, GenDescFile, GenDescMessage } from "../../../../codeg
2
2
  import type { Any } from "./any_pb.js";
3
3
  import type { SourceContext } from "./source_context_pb.js";
4
4
  import type { Message } from "../../../../types.js";
5
+ /**
6
+ * Describes the file google/protobuf/type.proto.
7
+ */
5
8
  export declare const fileDesc_google_protobuf_type: GenDescFile;
6
9
  /**
7
10
  * A protocol buffer message type.
@@ -52,6 +55,10 @@ export type Type = Message<"google.protobuf.Type"> & {
52
55
  */
53
56
  edition: string;
54
57
  };
58
+ /**
59
+ * Describes the message google.protobuf.Type.
60
+ * Use `create(TypeDesc)` to create a new message.
61
+ */
55
62
  export declare const TypeDesc: GenDescMessage<Type>;
56
63
  /**
57
64
  * A single field of a message type.
@@ -122,6 +129,10 @@ export type Field = Message<"google.protobuf.Field"> & {
122
129
  */
123
130
  defaultValue: string;
124
131
  };
132
+ /**
133
+ * Describes the message google.protobuf.Field.
134
+ * Use `create(FieldDesc)` to create a new message.
135
+ */
125
136
  export declare const FieldDesc: GenDescMessage<Field>;
126
137
  /**
127
138
  * Basic field types.
@@ -244,6 +255,9 @@ export declare enum Field_Kind {
244
255
  */
245
256
  TYPE_SINT64 = 18
246
257
  }
258
+ /**
259
+ * Describes the enum google.protobuf.Field.Kind.
260
+ */
247
261
  export declare const Field_KindDesc: GenDescEnum<Field_Kind>;
248
262
  /**
249
263
  * Whether a field is optional, required, or repeated.
@@ -276,6 +290,9 @@ export declare enum Field_Cardinality {
276
290
  */
277
291
  REPEATED = 3
278
292
  }
293
+ /**
294
+ * Describes the enum google.protobuf.Field.Cardinality.
295
+ */
279
296
  export declare const Field_CardinalityDesc: GenDescEnum<Field_Cardinality>;
280
297
  /**
281
298
  * Enum type definition.
@@ -320,6 +337,10 @@ export type Enum = Message<"google.protobuf.Enum"> & {
320
337
  */
321
338
  edition: string;
322
339
  };
340
+ /**
341
+ * Describes the message google.protobuf.Enum.
342
+ * Use `create(EnumDesc)` to create a new message.
343
+ */
323
344
  export declare const EnumDesc: GenDescMessage<Enum>;
324
345
  /**
325
346
  * Enum value definition.
@@ -346,6 +367,10 @@ export type EnumValue = Message<"google.protobuf.EnumValue"> & {
346
367
  */
347
368
  options: Option[];
348
369
  };
370
+ /**
371
+ * Describes the message google.protobuf.EnumValue.
372
+ * Use `create(EnumValueDesc)` to create a new message.
373
+ */
349
374
  export declare const EnumValueDesc: GenDescMessage<EnumValue>;
350
375
  /**
351
376
  * A protocol buffer option, which can be attached to a message, field,
@@ -373,6 +398,10 @@ export type Option = Message<"google.protobuf.Option"> & {
373
398
  */
374
399
  value?: Any;
375
400
  };
401
+ /**
402
+ * Describes the message google.protobuf.Option.
403
+ * Use `create(OptionDesc)` to create a new message.
404
+ */
376
405
  export declare const OptionDesc: GenDescMessage<Option>;
377
406
  /**
378
407
  * The syntax in which a protocol buffer element is defined.
@@ -399,4 +428,7 @@ export declare enum Syntax {
399
428
  */
400
429
  EDITIONS = 2
401
430
  }
431
+ /**
432
+ * Describes the enum google.protobuf.Syntax.
433
+ */
402
434
  export declare const SyntaxDesc: GenDescEnum<Syntax>;
@@ -19,12 +19,19 @@ const any_pb_js_1 = require("./any_pb.js");
19
19
  const source_context_pb_js_1 = require("./source_context_pb.js");
20
20
  const message_js_1 = require("../../../../codegenv1/message.js");
21
21
  const enum_js_1 = require("../../../../codegenv1/enum.js");
22
+ /**
23
+ * Describes the file google/protobuf/type.proto.
24
+ */
22
25
  exports.fileDesc_google_protobuf_type = (0, file_js_1.fileDesc)("Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIugBCgRUeXBlEgwKBG5hbWUYASABKAkSJgoGZmllbGRzGAIgAygLMhYuZ29vZ2xlLnByb3RvYnVmLkZpZWxkEg4KBm9uZW9mcxgDIAMoCRIoCgdvcHRpb25zGAQgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgFIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgGIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgHIAEoCSLVBQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2dsZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIuZ29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgDIAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9mX2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIRCglqc29uX25hbWUYCiABKAkSFQoNZGVmYXVsdF92YWx1ZRgLIAEoCSLIAgoES2luZBIQCgxUWVBFX1VOS05PV04QABIPCgtUWVBFX0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoLVFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9TVFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoKVFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4SEQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBFX1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIidAoLQ2FyZGluYWxpdHkSFwoTQ0FSRElOQUxJVFlfVU5LTk9XThAAEhgKFENBUkRJTkFMSVRZX09QVElPTkFMEAESGAoUQ0FSRElOQUxJVFlfUkVRVUlSRUQQAhIYChRDQVJESU5BTElUWV9SRVBFQVRFRBADIt8BCgRFbnVtEgwKBG5hbWUYASABKAkSLQoJZW51bXZhbHVlGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZRIoCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgFIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgGIAEoCSJTCglFbnVtVmFsdWUSDAoEbmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSKAoHb3B0aW9ucxgDIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb24iOwoGT3B0aW9uEgwKBG5hbWUYASABKAkSIwoFdmFsdWUYAiABKAsyFC5nb29nbGUucHJvdG9idWYuQW55KkMKBlN5bnRheBIRCg1TWU5UQVhfUFJPVE8yEAASEQoNU1lOVEFYX1BST1RPMxABEhMKD1NZTlRBWF9FRElUSU9OUxACQnsKE2NvbS5nb29nbGUucHJvdG9idWZCCVR5cGVQcm90b1ABWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi90eXBlcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw", [any_pb_js_1.fileDesc_google_protobuf_any, source_context_pb_js_1.fileDesc_google_protobuf_source_context]);
23
- // Describes the message google.protobuf.Type.
24
- // Use `create(TypeDesc)` to create a new Type.
26
+ /**
27
+ * Describes the message google.protobuf.Type.
28
+ * Use `create(TypeDesc)` to create a new message.
29
+ */
25
30
  exports.TypeDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_type, 0);
26
- // Describes the message google.protobuf.Field.
27
- // Use `create(FieldDesc)` to create a new Field.
31
+ /**
32
+ * Describes the message google.protobuf.Field.
33
+ * Use `create(FieldDesc)` to create a new message.
34
+ */
28
35
  exports.FieldDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_type, 1);
29
36
  /**
30
37
  * Basic field types.
@@ -148,7 +155,9 @@ var Field_Kind;
148
155
  */
149
156
  Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64";
150
157
  })(Field_Kind || (exports.Field_Kind = Field_Kind = {}));
151
- // Describes the enum google.protobuf.Field.Kind.
158
+ /**
159
+ * Describes the enum google.protobuf.Field.Kind.
160
+ */
152
161
  exports.Field_KindDesc = (0, enum_js_1.enumDesc)(exports.fileDesc_google_protobuf_type, 1, 0);
153
162
  /**
154
163
  * Whether a field is optional, required, or repeated.
@@ -182,16 +191,24 @@ var Field_Cardinality;
182
191
  */
183
192
  Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED";
184
193
  })(Field_Cardinality || (exports.Field_Cardinality = Field_Cardinality = {}));
185
- // Describes the enum google.protobuf.Field.Cardinality.
194
+ /**
195
+ * Describes the enum google.protobuf.Field.Cardinality.
196
+ */
186
197
  exports.Field_CardinalityDesc = (0, enum_js_1.enumDesc)(exports.fileDesc_google_protobuf_type, 1, 1);
187
- // Describes the message google.protobuf.Enum.
188
- // Use `create(EnumDesc)` to create a new Enum.
198
+ /**
199
+ * Describes the message google.protobuf.Enum.
200
+ * Use `create(EnumDesc)` to create a new message.
201
+ */
189
202
  exports.EnumDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_type, 2);
190
- // Describes the message google.protobuf.EnumValue.
191
- // Use `create(EnumValueDesc)` to create a new EnumValue.
203
+ /**
204
+ * Describes the message google.protobuf.EnumValue.
205
+ * Use `create(EnumValueDesc)` to create a new message.
206
+ */
192
207
  exports.EnumValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_type, 3);
193
- // Describes the message google.protobuf.Option.
194
- // Use `create(OptionDesc)` to create a new Option.
208
+ /**
209
+ * Describes the message google.protobuf.Option.
210
+ * Use `create(OptionDesc)` to create a new message.
211
+ */
195
212
  exports.OptionDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_type, 4);
196
213
  /**
197
214
  * The syntax in which a protocol buffer element is defined.
@@ -219,5 +236,7 @@ var Syntax;
219
236
  */
220
237
  Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS";
221
238
  })(Syntax || (exports.Syntax = Syntax = {}));
222
- // Describes the enum google.protobuf.Syntax.
239
+ /**
240
+ * Describes the enum google.protobuf.Syntax.
241
+ */
223
242
  exports.SyntaxDesc = (0, enum_js_1.enumDesc)(exports.fileDesc_google_protobuf_type, 0);
@@ -1,5 +1,8 @@
1
1
  import type { GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Message } from "../../../../types.js";
3
+ /**
4
+ * Describes the file google/protobuf/wrappers.proto.
5
+ */
3
6
  export declare const fileDesc_google_protobuf_wrappers: GenDescFile;
4
7
  /**
5
8
  * Wrapper message for `double`.
@@ -16,6 +19,10 @@ export type DoubleValue = Message<"google.protobuf.DoubleValue"> & {
16
19
  */
17
20
  value: number;
18
21
  };
22
+ /**
23
+ * Describes the message google.protobuf.DoubleValue.
24
+ * Use `create(DoubleValueDesc)` to create a new message.
25
+ */
19
26
  export declare const DoubleValueDesc: GenDescMessage<DoubleValue>;
20
27
  /**
21
28
  * Wrapper message for `float`.
@@ -32,6 +39,10 @@ export type FloatValue = Message<"google.protobuf.FloatValue"> & {
32
39
  */
33
40
  value: number;
34
41
  };
42
+ /**
43
+ * Describes the message google.protobuf.FloatValue.
44
+ * Use `create(FloatValueDesc)` to create a new message.
45
+ */
35
46
  export declare const FloatValueDesc: GenDescMessage<FloatValue>;
36
47
  /**
37
48
  * Wrapper message for `int64`.
@@ -48,6 +59,10 @@ export type Int64Value = Message<"google.protobuf.Int64Value"> & {
48
59
  */
49
60
  value: bigint;
50
61
  };
62
+ /**
63
+ * Describes the message google.protobuf.Int64Value.
64
+ * Use `create(Int64ValueDesc)` to create a new message.
65
+ */
51
66
  export declare const Int64ValueDesc: GenDescMessage<Int64Value>;
52
67
  /**
53
68
  * Wrapper message for `uint64`.
@@ -64,6 +79,10 @@ export type UInt64Value = Message<"google.protobuf.UInt64Value"> & {
64
79
  */
65
80
  value: bigint;
66
81
  };
82
+ /**
83
+ * Describes the message google.protobuf.UInt64Value.
84
+ * Use `create(UInt64ValueDesc)` to create a new message.
85
+ */
67
86
  export declare const UInt64ValueDesc: GenDescMessage<UInt64Value>;
68
87
  /**
69
88
  * Wrapper message for `int32`.
@@ -80,6 +99,10 @@ export type Int32Value = Message<"google.protobuf.Int32Value"> & {
80
99
  */
81
100
  value: number;
82
101
  };
102
+ /**
103
+ * Describes the message google.protobuf.Int32Value.
104
+ * Use `create(Int32ValueDesc)` to create a new message.
105
+ */
83
106
  export declare const Int32ValueDesc: GenDescMessage<Int32Value>;
84
107
  /**
85
108
  * Wrapper message for `uint32`.
@@ -96,6 +119,10 @@ export type UInt32Value = Message<"google.protobuf.UInt32Value"> & {
96
119
  */
97
120
  value: number;
98
121
  };
122
+ /**
123
+ * Describes the message google.protobuf.UInt32Value.
124
+ * Use `create(UInt32ValueDesc)` to create a new message.
125
+ */
99
126
  export declare const UInt32ValueDesc: GenDescMessage<UInt32Value>;
100
127
  /**
101
128
  * Wrapper message for `bool`.
@@ -112,6 +139,10 @@ export type BoolValue = Message<"google.protobuf.BoolValue"> & {
112
139
  */
113
140
  value: boolean;
114
141
  };
142
+ /**
143
+ * Describes the message google.protobuf.BoolValue.
144
+ * Use `create(BoolValueDesc)` to create a new message.
145
+ */
115
146
  export declare const BoolValueDesc: GenDescMessage<BoolValue>;
116
147
  /**
117
148
  * Wrapper message for `string`.
@@ -128,6 +159,10 @@ export type StringValue = Message<"google.protobuf.StringValue"> & {
128
159
  */
129
160
  value: string;
130
161
  };
162
+ /**
163
+ * Describes the message google.protobuf.StringValue.
164
+ * Use `create(StringValueDesc)` to create a new message.
165
+ */
131
166
  export declare const StringValueDesc: GenDescMessage<StringValue>;
132
167
  /**
133
168
  * Wrapper message for `bytes`.
@@ -144,4 +179,8 @@ export type BytesValue = Message<"google.protobuf.BytesValue"> & {
144
179
  */
145
180
  value: Uint8Array;
146
181
  };
182
+ /**
183
+ * Describes the message google.protobuf.BytesValue.
184
+ * Use `create(BytesValueDesc)` to create a new message.
185
+ */
147
186
  export declare const BytesValueDesc: GenDescMessage<BytesValue>;
@@ -16,31 +16,52 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.BytesValueDesc = exports.StringValueDesc = exports.BoolValueDesc = exports.UInt32ValueDesc = exports.Int32ValueDesc = exports.UInt64ValueDesc = exports.Int64ValueDesc = exports.FloatValueDesc = exports.DoubleValueDesc = exports.fileDesc_google_protobuf_wrappers = void 0;
17
17
  const file_js_1 = require("../../../../codegenv1/file.js");
18
18
  const message_js_1 = require("../../../../codegenv1/message.js");
19
+ /**
20
+ * Describes the file google/protobuf/wrappers.proto.
21
+ */
19
22
  exports.fileDesc_google_protobuf_wrappers = (0, file_js_1.fileDesc)("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");
20
- // Describes the message google.protobuf.DoubleValue.
21
- // Use `create(DoubleValueDesc)` to create a new DoubleValue.
23
+ /**
24
+ * Describes the message google.protobuf.DoubleValue.
25
+ * Use `create(DoubleValueDesc)` to create a new message.
26
+ */
22
27
  exports.DoubleValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 0);
23
- // Describes the message google.protobuf.FloatValue.
24
- // Use `create(FloatValueDesc)` to create a new FloatValue.
28
+ /**
29
+ * Describes the message google.protobuf.FloatValue.
30
+ * Use `create(FloatValueDesc)` to create a new message.
31
+ */
25
32
  exports.FloatValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 1);
26
- // Describes the message google.protobuf.Int64Value.
27
- // Use `create(Int64ValueDesc)` to create a new Int64Value.
33
+ /**
34
+ * Describes the message google.protobuf.Int64Value.
35
+ * Use `create(Int64ValueDesc)` to create a new message.
36
+ */
28
37
  exports.Int64ValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 2);
29
- // Describes the message google.protobuf.UInt64Value.
30
- // Use `create(UInt64ValueDesc)` to create a new UInt64Value.
38
+ /**
39
+ * Describes the message google.protobuf.UInt64Value.
40
+ * Use `create(UInt64ValueDesc)` to create a new message.
41
+ */
31
42
  exports.UInt64ValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 3);
32
- // Describes the message google.protobuf.Int32Value.
33
- // Use `create(Int32ValueDesc)` to create a new Int32Value.
43
+ /**
44
+ * Describes the message google.protobuf.Int32Value.
45
+ * Use `create(Int32ValueDesc)` to create a new message.
46
+ */
34
47
  exports.Int32ValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 4);
35
- // Describes the message google.protobuf.UInt32Value.
36
- // Use `create(UInt32ValueDesc)` to create a new UInt32Value.
48
+ /**
49
+ * Describes the message google.protobuf.UInt32Value.
50
+ * Use `create(UInt32ValueDesc)` to create a new message.
51
+ */
37
52
  exports.UInt32ValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 5);
38
- // Describes the message google.protobuf.BoolValue.
39
- // Use `create(BoolValueDesc)` to create a new BoolValue.
53
+ /**
54
+ * Describes the message google.protobuf.BoolValue.
55
+ * Use `create(BoolValueDesc)` to create a new message.
56
+ */
40
57
  exports.BoolValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 6);
41
- // Describes the message google.protobuf.StringValue.
42
- // Use `create(StringValueDesc)` to create a new StringValue.
58
+ /**
59
+ * Describes the message google.protobuf.StringValue.
60
+ * Use `create(StringValueDesc)` to create a new message.
61
+ */
43
62
  exports.StringValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 7);
44
- // Describes the message google.protobuf.BytesValue.
45
- // Use `create(BytesValueDesc)` to create a new BytesValue.
63
+ /**
64
+ * Describes the message google.protobuf.BytesValue.
65
+ * Use `create(BytesValueDesc)` to create a new message.
66
+ */
46
67
  exports.BytesValueDesc = (0, message_js_1.messageDesc)(exports.fileDesc_google_protobuf_wrappers, 8);
@@ -1,4 +1,4 @@
1
- import type { DescEnum, DescExtension, DescFile, DescMessage, DescService } from "../desc-types.js";
1
+ import type { DescEnum, DescExtension, DescMessage, DescService } from "../desc-types.js";
2
2
  import type { FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
3
3
  import type { FileDescriptorProtoBoot } from "./boot.js";
4
4
  type EmbedUnknown = {
@@ -16,7 +16,7 @@ type EmbedDescriptorProto = Omit<EmbedUnknown, "bootable"> & {
16
16
  *
17
17
  * @private
18
18
  */
19
- export declare function embedFileDesc(file: DescFile): EmbedUnknown | EmbedDescriptorProto;
19
+ export declare function embedFileDesc(file: FileDescriptorProto): EmbedUnknown | EmbedDescriptorProto;
20
20
  /**
21
21
  * Compute the path to a message, enumeration, extension, or service in a
22
22
  * file descriptor.
@@ -28,9 +28,9 @@ export function embedFileDesc(file) {
28
28
  const embed = {
29
29
  bootable: false,
30
30
  proto() {
31
- const stripped = clone(FileDescriptorProtoDesc, file.proto);
32
- clearField(FileDescriptorProtoDesc, stripped, "dependency");
33
- clearField(FileDescriptorProtoDesc, stripped, "sourceCodeInfo");
31
+ const stripped = clone(FileDescriptorProtoDesc, file);
32
+ clearField(stripped, FileDescriptorProtoDesc.field.dependency);
33
+ clearField(stripped, FileDescriptorProtoDesc.field.sourceCodeInfo);
34
34
  stripped.messageType.map(stripJsonNames);
35
35
  return stripped;
36
36
  },
@@ -39,7 +39,7 @@ export function embedFileDesc(file) {
39
39
  return base64Encode(bytes, "std_raw");
40
40
  },
41
41
  };
42
- return file.proto.name == "google/protobuf/descriptor.proto"
42
+ return file.name == "google/protobuf/descriptor.proto"
43
43
  ? Object.assign(Object.assign({}, embed), { bootable: true, boot() {
44
44
  return createFileDescriptorProtoBoot(this.proto());
45
45
  } }) : embed;
@@ -47,7 +47,7 @@ export function embedFileDesc(file) {
47
47
  function stripJsonNames(d) {
48
48
  for (const f of d.field) {
49
49
  if (f.jsonName === protoCamelCase(f.name)) {
50
- clearField(FieldDescriptorProtoDesc, f, "jsonName");
50
+ clearField(f, FieldDescriptorProtoDesc.field.jsonName);
51
51
  }
52
52
  }
53
53
  for (const n of d.nestedType) {
@@ -157,27 +157,27 @@ function createDescriptorBoot(proto) {
157
157
  return b;
158
158
  }
159
159
  function createFieldDescriptorBoot(proto) {
160
- assert(isFieldSet(FieldDescriptorProtoDesc, proto, "name"));
161
- assert(isFieldSet(FieldDescriptorProtoDesc, proto, "number"));
162
- assert(isFieldSet(FieldDescriptorProtoDesc, proto, "type"));
163
- assert(!isFieldSet(FieldDescriptorProtoDesc, proto, "oneofIndex"));
164
- assert(!isFieldSet(FieldDescriptorProtoDesc, proto, "jsonName") ||
160
+ assert(isFieldSet(proto, FieldDescriptorProtoDesc.field.name));
161
+ assert(isFieldSet(proto, FieldDescriptorProtoDesc.field.number));
162
+ assert(isFieldSet(proto, FieldDescriptorProtoDesc.field.type));
163
+ assert(!isFieldSet(proto, FieldDescriptorProtoDesc.field.oneofIndex));
164
+ assert(!isFieldSet(proto, FieldDescriptorProtoDesc.field.jsonName) ||
165
165
  proto.jsonName === protoCamelCase(proto.name));
166
166
  const b = {
167
167
  name: proto.name,
168
168
  number: proto.number,
169
169
  type: proto.type,
170
170
  };
171
- if (isFieldSet(FieldDescriptorProtoDesc, proto, "label")) {
171
+ if (isFieldSet(proto, FieldDescriptorProtoDesc.field.label)) {
172
172
  b.label = proto.label;
173
173
  }
174
- if (isFieldSet(FieldDescriptorProtoDesc, proto, "typeName")) {
174
+ if (isFieldSet(proto, FieldDescriptorProtoDesc.field.typeName)) {
175
175
  b.typeName = proto.typeName;
176
176
  }
177
- if (isFieldSet(FieldDescriptorProtoDesc, proto, "extendee")) {
177
+ if (isFieldSet(proto, FieldDescriptorProtoDesc.field.extendee)) {
178
178
  b.extendee = proto.extendee;
179
179
  }
180
- if (isFieldSet(FieldDescriptorProtoDesc, proto, "defaultValue")) {
180
+ if (isFieldSet(proto, FieldDescriptorProtoDesc.field.defaultValue)) {
181
181
  b.defaultValue = proto.defaultValue;
182
182
  }
183
183
  if (proto.options) {
@@ -187,19 +187,19 @@ function createFieldDescriptorBoot(proto) {
187
187
  }
188
188
  function createFieldOptionsBoot(proto) {
189
189
  const b = {};
190
- assert(!isFieldSet(FieldOptionsDesc, proto, "ctype"));
191
- if (isFieldSet(FieldOptionsDesc, proto, "packed")) {
190
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.ctype));
191
+ if (isFieldSet(proto, FieldOptionsDesc.field.packed)) {
192
192
  b.packed = proto.packed;
193
193
  }
194
- assert(!isFieldSet(FieldOptionsDesc, proto, "jstype"));
195
- assert(!isFieldSet(FieldOptionsDesc, proto, "lazy"));
196
- assert(!isFieldSet(FieldOptionsDesc, proto, "unverifiedLazy"));
197
- if (isFieldSet(FieldOptionsDesc, proto, "deprecated")) {
194
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.jstype));
195
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.lazy));
196
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.unverifiedLazy));
197
+ if (isFieldSet(proto, FieldOptionsDesc.field.deprecated)) {
198
198
  b.deprecated = proto.deprecated;
199
199
  }
200
- assert(!isFieldSet(FieldOptionsDesc, proto, "weak"));
201
- assert(!isFieldSet(FieldOptionsDesc, proto, "debugRedact"));
202
- if (isFieldSet(FieldOptionsDesc, proto, "retention")) {
200
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.weak));
201
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.debugRedact));
202
+ if (isFieldSet(proto, FieldOptionsDesc.field.retention)) {
203
203
  b.retention = proto.retention;
204
204
  }
205
205
  if (proto.targets.length) {
@@ -211,8 +211,8 @@ function createFieldOptionsBoot(proto) {
211
211
  edition: d.edition,
212
212
  }));
213
213
  }
214
- assert(!isFieldSet(FieldOptionsDesc, proto, "features"));
215
- assert(!isFieldSet(FieldOptionsDesc, proto, "uninterpretedOption"));
214
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.features));
215
+ assert(!isFieldSet(proto, FieldOptionsDesc.field.uninterpretedOption));
216
216
  return b;
217
217
  }
218
218
  function createEnumDescriptorBoot(proto) {
@@ -11,7 +11,6 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { localName } from "../reflect/names.js";
15
14
  /**
16
15
  * Hydrate an enum descriptor.
17
16
  *
@@ -30,9 +29,8 @@ export function enumDesc(file, path, ...paths) {
30
29
  export function tsEnum(desc) {
31
30
  const enumObject = {};
32
31
  for (const value of desc.values) {
33
- const name = localName(value);
34
- enumObject[name] = value.number;
35
- enumObject[value.number] = name;
32
+ enumObject[value.localName] = value.number;
33
+ enumObject[value.number] = value.localName;
36
34
  }
37
35
  return enumObject;
38
36
  }
@@ -1,2 +1,5 @@
1
1
  import type { DescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
2
+ /**
3
+ * @private
4
+ */
2
5
  export declare function restoreJsonNames(message: DescriptorProto): void;