@aptre/protobuf-es-lite 0.2.7 → 0.2.8

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 (121) hide show
  1. package/.ignore +1 -0
  2. package/README.md +23 -24
  3. package/bin/protoc-gen-es-lite +3 -3
  4. package/dist/binary-encoding.d.ts +420 -0
  5. package/dist/binary-encoding.js +437 -0
  6. package/dist/binary.d.ts +35 -2
  7. package/dist/binary.js +64 -65
  8. package/dist/codegen-info.d.ts +43 -0
  9. package/dist/codegen-info.js +72 -0
  10. package/dist/create-descriptor-set.d.ts +36 -0
  11. package/dist/create-descriptor-set.js +936 -0
  12. package/dist/descriptor-set.d.ts +672 -0
  13. package/dist/{editions.js → descriptor-set.js} +0 -11
  14. package/dist/enum.d.ts +35 -1
  15. package/dist/feature-set.d.ts +19 -0
  16. package/dist/feature-set.js +103 -0
  17. package/dist/field-wrapper.d.ts +7 -3
  18. package/dist/field-wrapper.js +30 -1
  19. package/dist/field.d.ts +8 -19
  20. package/dist/field.js +15 -117
  21. package/dist/google/index.d.ts +9 -0
  22. package/dist/google/index.js +41 -0
  23. package/dist/google/protobuf/any.pb.d.ts +139 -0
  24. package/dist/google/protobuf/any.pb.js +42 -0
  25. package/dist/google/protobuf/api.pb.d.ts +252 -0
  26. package/dist/google/protobuf/api.pb.js +70 -0
  27. package/dist/google/protobuf/compiler/plugin.pb.d.ts +240 -0
  28. package/dist/google/protobuf/compiler/plugin.pb.js +203 -0
  29. package/dist/google/protobuf/descriptor.pb.d.ts +2132 -0
  30. package/dist/google/protobuf/descriptor.pb.js +1080 -0
  31. package/dist/google/protobuf/duration.pb.d.ts +92 -0
  32. package/dist/google/protobuf/duration.pb.js +42 -0
  33. package/dist/google/protobuf/empty.pb.d.ts +18 -0
  34. package/dist/google/protobuf/empty.pb.js +39 -0
  35. package/dist/google/protobuf/source_context.pb.d.ts +21 -0
  36. package/dist/google/protobuf/source_context.pb.js +41 -0
  37. package/dist/google/protobuf/struct.pb.d.ts +121 -0
  38. package/dist/google/protobuf/struct.pb.js +83 -0
  39. package/dist/google/protobuf/timestamp.pb.d.ts +121 -0
  40. package/dist/google/protobuf/timestamp.pb.js +42 -0
  41. package/dist/google/protobuf/type.pb.d.ts +464 -0
  42. package/dist/google/protobuf/type.pb.js +338 -0
  43. package/dist/google/protobuf/wrappers.pb.d.ts +183 -0
  44. package/dist/google/protobuf/wrappers.pb.js +107 -0
  45. package/dist/index.d.ts +8 -3
  46. package/dist/index.js +38 -8
  47. package/dist/is-message.d.ts +10 -2
  48. package/dist/is-message.js +74 -3
  49. package/dist/json.d.ts +68 -1
  50. package/dist/json.js +57 -81
  51. package/dist/message.d.ts +30 -61
  52. package/dist/message.js +61 -20
  53. package/dist/names.d.ts +43 -0
  54. package/dist/names.js +276 -0
  55. package/dist/partial.js +14 -15
  56. package/dist/proto-base64.d.ts +18 -0
  57. package/dist/proto-base64.js +128 -0
  58. package/dist/proto-double.d.ts +5 -0
  59. package/dist/proto-double.js +29 -0
  60. package/dist/proto-int64.d.ts +95 -0
  61. package/dist/proto-int64.js +116 -0
  62. package/dist/protoc-gen-es-lite/protoc-gen-es-lite-plugin.d.ts +1 -0
  63. package/dist/{protoc-gen-es-lite-plugin.js → protoc-gen-es-lite/protoc-gen-es-lite-plugin.js} +2 -2
  64. package/dist/{typescript.d.ts → protoc-gen-es-lite/typescript.d.ts} +3 -2
  65. package/dist/{typescript.js → protoc-gen-es-lite/typescript.js} +46 -34
  66. package/dist/protoplugin/create-es-plugin.d.ts +83 -0
  67. package/dist/protoplugin/create-es-plugin.js +119 -0
  68. package/dist/protoplugin/ecmascript/file-preamble.d.ts +2 -0
  69. package/dist/protoplugin/ecmascript/file-preamble.js +74 -0
  70. package/dist/protoplugin/ecmascript/generated-file.d.ts +116 -0
  71. package/dist/protoplugin/ecmascript/generated-file.js +407 -0
  72. package/dist/protoplugin/ecmascript/import-path.d.ts +65 -0
  73. package/dist/protoplugin/ecmascript/import-path.js +156 -0
  74. package/dist/protoplugin/ecmascript/import-symbol.d.ts +39 -0
  75. package/dist/protoplugin/ecmascript/import-symbol.js +37 -0
  76. package/dist/protoplugin/ecmascript/index.d.ts +7 -0
  77. package/dist/protoplugin/ecmascript/index.js +20 -0
  78. package/dist/protoplugin/ecmascript/jsdoc.d.ts +14 -0
  79. package/dist/protoplugin/ecmascript/jsdoc.js +93 -0
  80. package/dist/protoplugin/ecmascript/opaque-printables.d.ts +27 -0
  81. package/dist/protoplugin/ecmascript/opaque-printables.js +15 -0
  82. package/dist/protoplugin/ecmascript/parameter.d.ts +13 -0
  83. package/dist/protoplugin/ecmascript/parameter.js +161 -0
  84. package/dist/protoplugin/ecmascript/reify-wkt.d.ts +100 -0
  85. package/dist/protoplugin/ecmascript/reify-wkt.js +170 -0
  86. package/dist/protoplugin/ecmascript/runtime-imports.d.ts +6 -0
  87. package/dist/protoplugin/ecmascript/runtime-imports.js +28 -0
  88. package/dist/protoplugin/ecmascript/schema.d.ts +43 -0
  89. package/dist/protoplugin/ecmascript/schema.js +73 -0
  90. package/dist/protoplugin/ecmascript/target.d.ts +4 -0
  91. package/dist/protoplugin/ecmascript/target.js +15 -0
  92. package/dist/protoplugin/ecmascript/transpile.d.ts +2 -0
  93. package/dist/protoplugin/ecmascript/transpile.js +149 -0
  94. package/dist/protoplugin/error.d.ts +6 -0
  95. package/dist/protoplugin/error.js +43 -0
  96. package/dist/protoplugin/index.d.ts +8 -0
  97. package/dist/protoplugin/index.js +20 -0
  98. package/dist/protoplugin/plugin.d.ts +18 -0
  99. package/dist/protoplugin/plugin.js +15 -0
  100. package/dist/protoplugin/run-node.d.ts +12 -0
  101. package/dist/protoplugin/run-node.js +83 -0
  102. package/dist/scalar.d.ts +53 -1
  103. package/dist/scalar.js +87 -22
  104. package/dist/service-type.d.ts +95 -0
  105. package/dist/service-type.js +53 -0
  106. package/dist/text-format.d.ts +4 -0
  107. package/dist/text-format.js +189 -0
  108. package/dist/type-registry.d.ts +43 -0
  109. package/dist/type-registry.js +15 -0
  110. package/dist/unknown.d.ts +1 -1
  111. package/dist/util.d.ts +2 -2
  112. package/dist/util.js +46 -44
  113. package/dist/varint.d.ts +70 -0
  114. package/dist/varint.js +324 -0
  115. package/example/example.pb.ts +87 -0
  116. package/example/example.proto +1 -0
  117. package/example/tsconfig.json +8 -2
  118. package/package.json +19 -12
  119. package/tsconfig.json +4 -4
  120. package/dist/editions.d.ts +0 -6
  121. package/dist/protoc-gen-es-lite-plugin.d.ts +0 -1
@@ -0,0 +1,672 @@
1
+ import type { DescriptorProto, Edition, EnumDescriptorProto, EnumValueDescriptorProto, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, OneofDescriptorProto, ServiceDescriptorProto } from "./google/protobuf/descriptor.pb.js";
2
+ import { LongType, ScalarType } from "./scalar.js";
3
+ import type { MethodIdempotency, MethodKind } from "./service-type.js";
4
+ import type { MergedFeatureSet } from "./feature-set.js";
5
+ /**
6
+ * DescriptorSet provides a convenient interface for working with a set
7
+ * of google.protobuf.FileDescriptorProto.
8
+ *
9
+ * When protobuf sources are compiled, each file is parsed into a
10
+ * google.protobuf.FileDescriptorProto. Those messages describe all parts
11
+ * of the source file that are required to generate code for them.
12
+ *
13
+ * DescriptorSet resolves references between the descriptors, hides
14
+ * implementation details like synthetic map entry messages, and provides
15
+ * simple access to comments.
16
+ */
17
+ export interface DescriptorSet {
18
+ /**
19
+ * All files, in the order they were added to the set.
20
+ */
21
+ readonly files: DescFile[];
22
+ /**
23
+ * All enumerations, indexed by their fully qualified type name.
24
+ * (We omit the leading dot.)
25
+ */
26
+ readonly enums: ReadonlyMap<string, DescEnum>;
27
+ /**
28
+ * All messages, indexed by their fully qualified type name.
29
+ * (We omit the leading dot.)
30
+ */
31
+ readonly messages: ReadonlyMap<string, DescMessage>;
32
+ /**
33
+ * All services, indexed by their fully qualified type name.
34
+ * (We omit the leading dot.)
35
+ */
36
+ readonly services: ReadonlyMap<string, DescService>;
37
+ /**
38
+ * All extensions, indexed by their fully qualified type name.
39
+ */
40
+ readonly extensions: ReadonlyMap<string, DescExtension>;
41
+ }
42
+ /**
43
+ * A union of all descriptors, discriminated by a `kind` property.
44
+ */
45
+ export type AnyDesc = DescFile | DescEnum | DescEnumValue | DescMessage | DescField | DescExtension | DescOneof | DescService | DescMethod;
46
+ /**
47
+ * Describes a protobuf source file.
48
+ */
49
+ export interface DescFile {
50
+ readonly kind: "file";
51
+ /**
52
+ * The syntax specified in the protobuf source.
53
+ */
54
+ readonly syntax: "proto3" | "proto2" | "editions";
55
+ /**
56
+ * The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2",
57
+ * EDITION_PROTO3 for syntax="proto3";
58
+ */
59
+ readonly edition: Exclude<Edition, Edition.EDITION_1_TEST_ONLY | Edition.EDITION_2_TEST_ONLY | Edition.EDITION_99997_TEST_ONLY | Edition.EDITION_99998_TEST_ONLY | Edition.EDITION_99999_TEST_ONLY>;
60
+ /**
61
+ * The name of the file, excluding the .proto suffix.
62
+ * For a protobuf file `foo/bar.proto`, this is `foo/bar`.
63
+ */
64
+ readonly name: string;
65
+ /**
66
+ * Files imported by this file.
67
+ */
68
+ readonly dependencies: DescFile[];
69
+ /**
70
+ * Top-level enumerations declared in this file.
71
+ * Note that more enumerations might be declared within message declarations.
72
+ */
73
+ readonly enums: DescEnum[];
74
+ /**
75
+ * Top-level messages declared in this file.
76
+ * Note that more messages might be declared within message declarations.
77
+ */
78
+ readonly messages: DescMessage[];
79
+ /**
80
+ * Top-level extensions declared in this file.
81
+ * Note that more extensions might be declared within message declarations.
82
+ */
83
+ readonly extensions: DescExtension[];
84
+ /**
85
+ * Services declared in this file.
86
+ */
87
+ readonly services: DescService[];
88
+ /**
89
+ * Marked as deprecated in the protobuf source.
90
+ */
91
+ readonly deprecated: boolean;
92
+ /**
93
+ * The compiler-generated descriptor.
94
+ */
95
+ readonly proto: FileDescriptorProto;
96
+ /**
97
+ * Get comments on the syntax element in the protobuf source.
98
+ */
99
+ getSyntaxComments(): DescComments;
100
+ /**
101
+ * Get comments on the package element in the protobuf source.
102
+ */
103
+ getPackageComments(): DescComments;
104
+ /**
105
+ * Get the edition features for this protobuf element.
106
+ */
107
+ getFeatures(): MergedFeatureSet;
108
+ toString(): string;
109
+ }
110
+ /**
111
+ * Describes an enumeration in a protobuf source file.
112
+ */
113
+ export interface DescEnum {
114
+ readonly kind: "enum";
115
+ /**
116
+ * The fully qualified name of the enumeration. (We omit the leading dot.)
117
+ */
118
+ readonly typeName: string;
119
+ /**
120
+ * The name of the enumeration, as declared in the protobuf source.
121
+ */
122
+ readonly name: string;
123
+ /**
124
+ * The file this enumeration was declared in.
125
+ */
126
+ readonly file: DescFile;
127
+ /**
128
+ * The parent message, if this enumeration was declared inside a message declaration.
129
+ */
130
+ readonly parent: DescMessage | undefined;
131
+ /**
132
+ * Values declared for this enumeration.
133
+ */
134
+ readonly values: DescEnumValue[];
135
+ /**
136
+ * A prefix shared by all enum values.
137
+ * For example, `MY_ENUM_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`
138
+ */
139
+ readonly sharedPrefix?: string;
140
+ /**
141
+ * Marked as deprecated in the protobuf source.
142
+ */
143
+ readonly deprecated: boolean;
144
+ /**
145
+ * The compiler-generated descriptor.
146
+ */
147
+ readonly proto: EnumDescriptorProto;
148
+ /**
149
+ * Get comments on the element in the protobuf source.
150
+ */
151
+ getComments(): DescComments;
152
+ /**
153
+ * Get the edition features for this protobuf element.
154
+ */
155
+ getFeatures(): MergedFeatureSet;
156
+ toString(): string;
157
+ }
158
+ /**
159
+ * Describes an individual value of an enumeration in a protobuf source file.
160
+ */
161
+ export interface DescEnumValue {
162
+ kind: "enum_value";
163
+ /**
164
+ * The name of the enumeration value, as specified in the protobuf source.
165
+ */
166
+ readonly name: string;
167
+ /**
168
+ * The enumeration this value belongs to.
169
+ */
170
+ readonly parent: DescEnum;
171
+ /**
172
+ * The numeric enumeration value, as specified in the protobuf source.
173
+ */
174
+ readonly number: number;
175
+ /**
176
+ * Marked as deprecated in the protobuf source.
177
+ */
178
+ readonly deprecated: boolean;
179
+ /**
180
+ * The compiler-generated descriptor.
181
+ */
182
+ readonly proto: EnumValueDescriptorProto;
183
+ /**
184
+ * Return a string that (closely) matches the definition of the enumeration
185
+ * value in the protobuf source.
186
+ */
187
+ declarationString(): string;
188
+ /**
189
+ * Get comments on the element in the protobuf source.
190
+ */
191
+ getComments(): DescComments;
192
+ /**
193
+ * Get the edition features for this protobuf element.
194
+ */
195
+ getFeatures(): MergedFeatureSet;
196
+ toString(): string;
197
+ }
198
+ /**
199
+ * Describes a message declaration in a protobuf source file.
200
+ */
201
+ export interface DescMessage {
202
+ readonly kind: "message";
203
+ /**
204
+ * The fully qualified name of the message. (We omit the leading dot.)
205
+ */
206
+ readonly typeName: string;
207
+ /**
208
+ * The name of the message, as specified in the protobuf source.
209
+ */
210
+ readonly name: string;
211
+ /**
212
+ * The file this message was declared in.
213
+ */
214
+ readonly file: DescFile;
215
+ /**
216
+ * The parent message, if this message was declared inside a message declaration.
217
+ */
218
+ readonly parent: DescMessage | undefined;
219
+ /**
220
+ * Fields declared for this message, including fields declared in a oneof
221
+ * group.
222
+ */
223
+ readonly fields: DescField[];
224
+ /**
225
+ * Oneof groups declared for this message.
226
+ * This does not include synthetic oneofs for proto3 optionals.
227
+ */
228
+ readonly oneofs: DescOneof[];
229
+ /**
230
+ * Fields and oneof groups for this message, ordered by their appearance in the
231
+ * protobuf source.
232
+ */
233
+ readonly members: (DescField | DescOneof)[];
234
+ /**
235
+ * Enumerations declared within the message, if any.
236
+ */
237
+ readonly nestedEnums: DescEnum[];
238
+ /**
239
+ * Messages declared within the message, if any.
240
+ * This does not include synthetic messages like map entries.
241
+ */
242
+ readonly nestedMessages: DescMessage[];
243
+ /**
244
+ * Extensions declared within the message, if any.
245
+ */
246
+ readonly nestedExtensions: DescExtension[];
247
+ /**
248
+ * Marked as deprecated in the protobuf source.
249
+ */
250
+ readonly deprecated: boolean;
251
+ /**
252
+ * The compiler-generated descriptor.
253
+ */
254
+ readonly proto: DescriptorProto;
255
+ /**
256
+ * Get comments on the element in the protobuf source.
257
+ */
258
+ getComments(): DescComments;
259
+ /**
260
+ * Get the edition features for this protobuf element.
261
+ */
262
+ getFeatures(): MergedFeatureSet;
263
+ toString(): string;
264
+ }
265
+ /**
266
+ * Describes a field declaration in a protobuf source file.
267
+ */
268
+ export type DescField = DescFieldCommon & (DescFieldScalar | DescFieldMessage | DescFieldEnum | DescFieldMap) & {
269
+ readonly kind: "field";
270
+ /**
271
+ * The message this field is declared on.
272
+ */
273
+ readonly parent: DescMessage;
274
+ };
275
+ /**
276
+ * Describes an extension in a protobuf source file.
277
+ */
278
+ export type DescExtension = DescFieldCommon & (DescFieldScalar | DescFieldMessage | DescFieldEnum | DescFieldMap) & {
279
+ readonly kind: "extension";
280
+ /**
281
+ * The fully qualified name of the extension.
282
+ */
283
+ readonly typeName: string;
284
+ /**
285
+ * The file this extension was declared in.
286
+ */
287
+ readonly file: DescFile;
288
+ /**
289
+ * The parent message, if this extension was declared inside a message declaration.
290
+ */
291
+ readonly parent: DescMessage | undefined;
292
+ /**
293
+ * The message that this extension extends.
294
+ */
295
+ readonly extendee: DescMessage;
296
+ };
297
+ interface DescFieldCommon {
298
+ /**
299
+ * The field name, as specified in the protobuf source
300
+ */
301
+ readonly name: string;
302
+ /**
303
+ * The field number, as specified in the protobuf source.
304
+ */
305
+ readonly number: number;
306
+ /**
307
+ * The `oneof` group this field belongs to, if any.
308
+ */
309
+ readonly oneof: DescOneof | undefined;
310
+ /**
311
+ * Whether this field was declared with `optional` in the protobuf source.
312
+ */
313
+ readonly optional: boolean;
314
+ /**
315
+ * Pack this repeated field?
316
+ */
317
+ readonly packed: boolean;
318
+ /**
319
+ * Is this field packed by default? Only valid for repeated enum fields, and
320
+ * for repeated scalar fields except BYTES and STRING.
321
+ *
322
+ * In proto3 syntax, fields are packed by default. In proto2 syntax, fields
323
+ * are unpacked by default.
324
+ *
325
+ * With editions, the default is whatever the edition specifies as a default.
326
+ * In edition 2023, fields are packed by default.
327
+ */
328
+ readonly packedByDefault: boolean;
329
+ /**
330
+ * A user-defined name for the JSON format, set with the field option
331
+ * [json_name="foo"].
332
+ */
333
+ readonly jsonName: string | undefined;
334
+ /**
335
+ * Marked as deprecated in the protobuf source.
336
+ */
337
+ readonly deprecated: boolean;
338
+ /**
339
+ * The compiler-generated descriptor.
340
+ */
341
+ readonly proto: FieldDescriptorProto;
342
+ /**
343
+ * Get comments on the element in the protobuf source.
344
+ */
345
+ getComments(): DescComments;
346
+ /**
347
+ * Return a string that (closely) matches the definition of the field in the
348
+ * protobuf source.
349
+ */
350
+ declarationString(): string;
351
+ /**
352
+ * Get the edition features for this protobuf element.
353
+ */
354
+ getFeatures(): MergedFeatureSet;
355
+ toString(): string;
356
+ }
357
+ interface DescFieldScalar {
358
+ readonly fieldKind: "scalar";
359
+ /**
360
+ * Is the field repeated?
361
+ */
362
+ readonly repeated: boolean;
363
+ /**
364
+ * Scalar type, if it is a scalar field.
365
+ */
366
+ readonly scalar: ScalarType;
367
+ /**
368
+ * JavaScript type for 64 bit integral types (int64, uint64,
369
+ * sint64, fixed64, sfixed64).
370
+ */
371
+ readonly longType: LongType;
372
+ /**
373
+ * The message type, if it is a message field.
374
+ */
375
+ readonly message: undefined;
376
+ /**
377
+ * The enum type, if it is an enum field.
378
+ */
379
+ readonly enum: undefined;
380
+ /**
381
+ * The map key type, if this is a map field.
382
+ */
383
+ readonly mapKey: undefined;
384
+ /**
385
+ * The map value type, if this is a map field.
386
+ */
387
+ readonly mapValue: undefined;
388
+ /**
389
+ * Return the default value specified in the protobuf source.
390
+ * Only valid for proto2 syntax.
391
+ */
392
+ getDefaultValue(): number | boolean | string | bigint | Uint8Array | undefined;
393
+ }
394
+ interface DescFieldMessage {
395
+ readonly fieldKind: "message";
396
+ /**
397
+ * Is the field repeated?
398
+ */
399
+ readonly repeated: boolean;
400
+ /**
401
+ * Scalar type, if it is a scalar field.
402
+ */
403
+ readonly scalar: undefined;
404
+ /**
405
+ * JavaScript type for 64 bit integral types (int64, uint64,
406
+ * sint64, fixed64, sfixed64).
407
+ */
408
+ readonly longType: undefined;
409
+ /**
410
+ * The message type, if it is a message field.
411
+ */
412
+ readonly message: DescMessage;
413
+ /**
414
+ * The enum type, if it is an enum field.
415
+ */
416
+ readonly enum: undefined;
417
+ /**
418
+ * The map key type, if this is a map field.
419
+ */
420
+ readonly mapKey: undefined;
421
+ /**
422
+ * The map value type, if this is a map field.
423
+ */
424
+ readonly mapValue: undefined;
425
+ }
426
+ interface DescFieldEnum {
427
+ readonly fieldKind: "enum";
428
+ /**
429
+ * Is the field repeated?
430
+ */
431
+ readonly repeated: boolean;
432
+ /**
433
+ * Scalar type, if it is a scalar field.
434
+ */
435
+ readonly scalar: undefined;
436
+ /**
437
+ * JavaScript type for 64 bit integral types (int64, uint64,
438
+ * sint64, fixed64, sfixed64).
439
+ */
440
+ readonly longType: undefined;
441
+ /**
442
+ * The message type, if it is a message field.
443
+ */
444
+ readonly message: undefined;
445
+ /**
446
+ * The enum type, if it is an enum field.
447
+ */
448
+ readonly enum: DescEnum;
449
+ /**
450
+ * The map key type, if this is a map field.
451
+ */
452
+ readonly mapKey: undefined;
453
+ /**
454
+ * The map value type, if this is a map field.
455
+ */
456
+ readonly mapValue: undefined;
457
+ /**
458
+ * Return the default value specified in the protobuf source.
459
+ * Only valid for proto2 syntax.
460
+ */
461
+ getDefaultValue(): number | boolean | string | bigint | Uint8Array | undefined;
462
+ }
463
+ interface DescFieldMap {
464
+ readonly fieldKind: "map";
465
+ /**
466
+ * Is the field repeated?
467
+ */
468
+ readonly repeated: false;
469
+ /**
470
+ * Scalar type, if it is a scalar field.
471
+ */
472
+ readonly scalar: undefined;
473
+ /**
474
+ * JavaScript type for 64 bit integral types (int64, uint64,
475
+ * sint64, fixed64, sfixed64).
476
+ */
477
+ readonly longType: undefined;
478
+ /**
479
+ * The message type, if it is a message field.
480
+ */
481
+ readonly message: undefined;
482
+ /**
483
+ * The enum type, if it is an enum field.
484
+ */
485
+ readonly enum: undefined;
486
+ /**
487
+ * The map key type, if this is a map field.
488
+ */
489
+ readonly mapKey: Exclude<ScalarType, ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES>;
490
+ /**
491
+ * The map value type, if this is a map field.
492
+ */
493
+ readonly mapValue: DescFieldMapValueEnum | DescFieldMapValueMessage | DescFieldMapValueScalar;
494
+ }
495
+ interface DescFieldMapValueEnum {
496
+ readonly kind: "enum";
497
+ /**
498
+ * The enum type, if this is a map field with enum values.
499
+ */
500
+ readonly enum: DescEnum;
501
+ /**
502
+ * The message this message field uses.
503
+ */
504
+ readonly message: undefined;
505
+ /**
506
+ * Scalar type, if this is a map field with scalar values.
507
+ */
508
+ readonly scalar: undefined;
509
+ }
510
+ interface DescFieldMapValueMessage {
511
+ readonly kind: "message";
512
+ /**
513
+ * The enum type, if this is a map field with enum values.
514
+ */
515
+ readonly enum: undefined;
516
+ /**
517
+ * The message type, if this is a map field with message values.
518
+ */
519
+ readonly message: DescMessage;
520
+ /**
521
+ * Scalar type, if this is a map field with scalar values.
522
+ */
523
+ readonly scalar: undefined;
524
+ }
525
+ interface DescFieldMapValueScalar {
526
+ readonly kind: "scalar";
527
+ /**
528
+ * The enum type, if this is a map field with enum values.
529
+ */
530
+ readonly enum: undefined;
531
+ /**
532
+ * The message type, if this is a map field with message values.
533
+ */
534
+ readonly message: undefined;
535
+ /**
536
+ * Scalar type, if this is a map field with scalar values.
537
+ */
538
+ readonly scalar: ScalarType;
539
+ }
540
+ /**
541
+ * Describes a oneof group in a protobuf source file.
542
+ */
543
+ export interface DescOneof {
544
+ readonly kind: "oneof";
545
+ /**
546
+ * The name of the oneof group, as specified in the protobuf source.
547
+ */
548
+ readonly name: string;
549
+ /**
550
+ * The message this oneof group was declared in.
551
+ */
552
+ readonly parent: DescMessage;
553
+ /**
554
+ * The fields declared in this oneof group.
555
+ */
556
+ readonly fields: DescField[];
557
+ /**
558
+ * Marked as deprecated in the protobuf source.
559
+ * Note that oneof groups cannot be marked as deprecated, this property
560
+ * only exists for consistency and will always be false.
561
+ */
562
+ readonly deprecated: boolean;
563
+ /**
564
+ * The compiler-generated descriptor.
565
+ */
566
+ readonly proto: OneofDescriptorProto;
567
+ /**
568
+ * Get comments on the element in the protobuf source.
569
+ */
570
+ getComments(): DescComments;
571
+ /**
572
+ * Get the edition features for this protobuf element.
573
+ */
574
+ getFeatures(): MergedFeatureSet;
575
+ toString(): string;
576
+ }
577
+ /**
578
+ * Describes a service declaration in a protobuf source file.
579
+ */
580
+ export interface DescService {
581
+ readonly kind: "service";
582
+ /**
583
+ * The fully qualified name of the service. (We omit the leading dot.)
584
+ */
585
+ readonly typeName: string;
586
+ /**
587
+ * The name of the service, as specified in the protobuf source.
588
+ */
589
+ readonly name: string;
590
+ /**
591
+ * The file this service was declared in.
592
+ */
593
+ readonly file: DescFile;
594
+ /**
595
+ * The RPCs this service declares.
596
+ */
597
+ readonly methods: DescMethod[];
598
+ /**
599
+ * Marked as deprecated in the protobuf source.
600
+ */
601
+ readonly deprecated: boolean;
602
+ /**
603
+ * The compiler-generated descriptor.
604
+ */
605
+ readonly proto: ServiceDescriptorProto;
606
+ /**
607
+ * Get comments on the element in the protobuf source.
608
+ */
609
+ getComments(): DescComments;
610
+ /**
611
+ * Get the edition features for this protobuf element.
612
+ */
613
+ getFeatures(): MergedFeatureSet;
614
+ toString(): string;
615
+ }
616
+ /**
617
+ * Describes an RPC declaration in a protobuf source file.
618
+ */
619
+ export interface DescMethod {
620
+ readonly kind: "rpc";
621
+ /**
622
+ * The name of the RPC, as specified in the protobuf source.
623
+ */
624
+ readonly name: string;
625
+ /**
626
+ * The parent service.
627
+ */
628
+ readonly parent: DescService;
629
+ /**
630
+ * One of the four available method types.
631
+ */
632
+ readonly methodKind: MethodKind;
633
+ /**
634
+ * The message type for requests.
635
+ */
636
+ readonly input: DescMessage;
637
+ /**
638
+ * The message type for responses.
639
+ */
640
+ readonly output: DescMessage;
641
+ /**
642
+ * The idempotency level declared in the protobuf source, if any.
643
+ */
644
+ readonly idempotency?: MethodIdempotency;
645
+ /**
646
+ * Marked as deprecated in the protobuf source.
647
+ */
648
+ readonly deprecated: boolean;
649
+ /**
650
+ * The compiler-generated descriptor.
651
+ */
652
+ readonly proto: MethodDescriptorProto;
653
+ /**
654
+ * Get comments on the element in the protobuf source.
655
+ */
656
+ getComments(): DescComments;
657
+ /**
658
+ * Get the edition features for this protobuf element.
659
+ */
660
+ getFeatures(): MergedFeatureSet;
661
+ toString(): string;
662
+ }
663
+ /**
664
+ * Comments on an element in a protobuf source file.
665
+ */
666
+ export interface DescComments {
667
+ readonly leadingDetached: readonly string[];
668
+ readonly leading?: string;
669
+ readonly trailing?: string;
670
+ readonly sourcePath: readonly number[];
671
+ }
672
+ export {};
@@ -13,14 +13,3 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.getNonEditionRuntime = void 0;
17
- /**
18
- * For syntax "editions", this function raises and error.
19
- */
20
- function getNonEditionRuntime(schema, file) {
21
- if (file.syntax === "editions") {
22
- throw new Error(`${file.proto.name ?? ""}: syntax "editions" is not supported`);
23
- }
24
- return schema.runtime[file.syntax];
25
- }
26
- exports.getNonEditionRuntime = getNonEditionRuntime;