@bufbuild/protobuf 1.6.0 → 1.7.1

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 (153) hide show
  1. package/dist/cjs/binary-encoding.js +2 -3
  2. package/dist/cjs/binary-format.d.ts +17 -0
  3. package/dist/cjs/binary-format.js +1 -1
  4. package/dist/cjs/codegen-info.d.ts +4 -4
  5. package/dist/cjs/codegen-info.js +2 -1
  6. package/dist/cjs/create-descriptor-set.d.ts +7 -1
  7. package/dist/cjs/create-descriptor-set.js +56 -50
  8. package/dist/cjs/create-registry-from-desc.d.ts +2 -2
  9. package/dist/cjs/create-registry-from-desc.js +53 -9
  10. package/dist/cjs/create-registry.d.ts +3 -2
  11. package/dist/cjs/create-registry.js +56 -37
  12. package/dist/cjs/descriptor-set.js +1 -1
  13. package/dist/cjs/enum.js +1 -1
  14. package/dist/cjs/extension-accessor.d.ts +35 -0
  15. package/dist/cjs/extension-accessor.js +108 -0
  16. package/dist/cjs/extension.d.ts +24 -0
  17. package/dist/cjs/extension.js +15 -0
  18. package/dist/cjs/field-list.js +1 -1
  19. package/dist/cjs/field.js +1 -1
  20. package/dist/cjs/google/protobuf/any_pb.js +1 -1
  21. package/dist/cjs/google/protobuf/api_pb.js +1 -1
  22. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +1 -1
  23. package/dist/cjs/google/protobuf/descriptor_pb.js +2 -2
  24. package/dist/cjs/google/protobuf/duration_pb.js +1 -1
  25. package/dist/cjs/google/protobuf/empty_pb.js +1 -1
  26. package/dist/cjs/google/protobuf/field_mask_pb.js +1 -1
  27. package/dist/cjs/google/protobuf/source_context_pb.js +1 -1
  28. package/dist/cjs/google/protobuf/struct_pb.js +2 -2
  29. package/dist/cjs/google/protobuf/timestamp_pb.js +1 -1
  30. package/dist/cjs/google/protobuf/type_pb.js +2 -2
  31. package/dist/cjs/google/protobuf/wrappers_pb.js +1 -1
  32. package/dist/cjs/index.d.ts +3 -1
  33. package/dist/cjs/index.js +7 -2
  34. package/dist/cjs/json-format.d.ts +5 -5
  35. package/dist/cjs/json-format.js +1 -1
  36. package/dist/cjs/message-type.js +1 -1
  37. package/dist/cjs/message.js +1 -1
  38. package/dist/cjs/private/assert.js +1 -1
  39. package/dist/cjs/private/binary-format-common.d.ts +2 -3
  40. package/dist/cjs/private/binary-format-common.js +80 -78
  41. package/dist/cjs/private/binary-format-proto2.js +59 -64
  42. package/dist/cjs/private/binary-format-proto3.js +44 -40
  43. package/dist/cjs/private/enum.js +1 -1
  44. package/dist/cjs/private/extensions.d.ts +34 -0
  45. package/dist/cjs/private/extensions.js +86 -0
  46. package/dist/cjs/private/feature-set.d.ts +6 -8
  47. package/dist/cjs/private/feature-set.js +41 -42
  48. package/dist/cjs/private/field-list.js +1 -1
  49. package/dist/cjs/private/field-wrapper.d.ts +2 -2
  50. package/dist/cjs/private/field-wrapper.js +1 -1
  51. package/dist/cjs/private/field.js +1 -1
  52. package/dist/cjs/private/json-format-common.d.ts +3 -3
  53. package/dist/cjs/private/json-format-common.js +228 -173
  54. package/dist/cjs/private/json-format-proto2.js +3 -2
  55. package/dist/cjs/private/json-format-proto3.js +8 -6
  56. package/dist/cjs/private/message-type.js +1 -1
  57. package/dist/cjs/private/names.d.ts +2 -2
  58. package/dist/cjs/private/names.js +3 -2
  59. package/dist/cjs/private/options-map.js +1 -1
  60. package/dist/cjs/private/proto-runtime.d.ts +6 -0
  61. package/dist/cjs/private/proto-runtime.js +5 -1
  62. package/dist/cjs/private/reify-wkt.js +1 -1
  63. package/dist/cjs/private/scalars.js +1 -1
  64. package/dist/cjs/private/text-format.js +1 -1
  65. package/dist/cjs/private/util-common.js +1 -1
  66. package/dist/cjs/private/util.js +1 -1
  67. package/dist/cjs/proto-base64.js +1 -1
  68. package/dist/cjs/proto-delimited.js +1 -1
  69. package/dist/cjs/proto-double.js +1 -1
  70. package/dist/cjs/proto-int64.js +1 -1
  71. package/dist/cjs/proto2.js +1 -1
  72. package/dist/cjs/proto3.js +1 -1
  73. package/dist/cjs/service-type.js +1 -1
  74. package/dist/cjs/to-plain-message.js +1 -1
  75. package/dist/cjs/type-registry.d.ts +14 -0
  76. package/dist/cjs/type-registry.js +1 -1
  77. package/dist/esm/binary-encoding.js +2 -3
  78. package/dist/esm/binary-format.d.ts +17 -0
  79. package/dist/esm/binary-format.js +1 -1
  80. package/dist/esm/codegen-info.d.ts +4 -4
  81. package/dist/esm/codegen-info.js +2 -1
  82. package/dist/esm/create-descriptor-set.d.ts +7 -1
  83. package/dist/esm/create-descriptor-set.js +57 -51
  84. package/dist/esm/create-registry-from-desc.d.ts +2 -2
  85. package/dist/esm/create-registry-from-desc.js +53 -9
  86. package/dist/esm/create-registry.d.ts +3 -2
  87. package/dist/esm/create-registry.js +56 -37
  88. package/dist/esm/descriptor-set.js +1 -1
  89. package/dist/esm/enum.js +1 -1
  90. package/dist/esm/extension-accessor.d.ts +35 -0
  91. package/dist/esm/extension-accessor.js +101 -0
  92. package/dist/esm/extension.d.ts +24 -0
  93. package/dist/esm/extension.js +14 -0
  94. package/dist/esm/field-list.js +1 -1
  95. package/dist/esm/field.js +1 -1
  96. package/dist/esm/google/protobuf/any_pb.js +1 -1
  97. package/dist/esm/google/protobuf/api_pb.js +1 -1
  98. package/dist/esm/google/protobuf/compiler/plugin_pb.js +1 -1
  99. package/dist/esm/google/protobuf/descriptor_pb.js +2 -2
  100. package/dist/esm/google/protobuf/duration_pb.js +1 -1
  101. package/dist/esm/google/protobuf/empty_pb.js +1 -1
  102. package/dist/esm/google/protobuf/field_mask_pb.js +1 -1
  103. package/dist/esm/google/protobuf/source_context_pb.js +1 -1
  104. package/dist/esm/google/protobuf/struct_pb.js +2 -2
  105. package/dist/esm/google/protobuf/timestamp_pb.js +1 -1
  106. package/dist/esm/google/protobuf/type_pb.js +2 -2
  107. package/dist/esm/google/protobuf/wrappers_pb.js +1 -1
  108. package/dist/esm/index.d.ts +3 -1
  109. package/dist/esm/index.js +2 -1
  110. package/dist/esm/json-format.d.ts +5 -5
  111. package/dist/esm/json-format.js +1 -1
  112. package/dist/esm/message-type.js +1 -1
  113. package/dist/esm/message.js +1 -1
  114. package/dist/esm/private/assert.js +1 -1
  115. package/dist/esm/private/binary-format-common.d.ts +2 -3
  116. package/dist/esm/private/binary-format-common.js +80 -77
  117. package/dist/esm/private/binary-format-proto2.js +59 -64
  118. package/dist/esm/private/binary-format-proto3.js +44 -40
  119. package/dist/esm/private/enum.js +1 -1
  120. package/dist/esm/private/extensions.d.ts +34 -0
  121. package/dist/esm/private/extensions.js +81 -0
  122. package/dist/esm/private/feature-set.d.ts +6 -8
  123. package/dist/esm/private/feature-set.js +40 -41
  124. package/dist/esm/private/field-list.js +1 -1
  125. package/dist/esm/private/field-wrapper.d.ts +2 -2
  126. package/dist/esm/private/field-wrapper.js +1 -1
  127. package/dist/esm/private/field.js +1 -1
  128. package/dist/esm/private/json-format-common.d.ts +3 -3
  129. package/dist/esm/private/json-format-common.js +228 -173
  130. package/dist/esm/private/json-format-proto2.js +3 -2
  131. package/dist/esm/private/json-format-proto3.js +8 -6
  132. package/dist/esm/private/message-type.js +1 -1
  133. package/dist/esm/private/names.d.ts +2 -2
  134. package/dist/esm/private/names.js +3 -2
  135. package/dist/esm/private/options-map.js +1 -1
  136. package/dist/esm/private/proto-runtime.d.ts +6 -0
  137. package/dist/esm/private/proto-runtime.js +5 -1
  138. package/dist/esm/private/reify-wkt.js +1 -1
  139. package/dist/esm/private/scalars.js +1 -1
  140. package/dist/esm/private/text-format.js +1 -1
  141. package/dist/esm/private/util-common.js +1 -1
  142. package/dist/esm/private/util.js +1 -1
  143. package/dist/esm/proto-base64.js +1 -1
  144. package/dist/esm/proto-delimited.js +1 -1
  145. package/dist/esm/proto-double.js +1 -1
  146. package/dist/esm/proto-int64.js +1 -1
  147. package/dist/esm/proto2.js +1 -1
  148. package/dist/esm/proto3.js +1 -1
  149. package/dist/esm/service-type.js +1 -1
  150. package/dist/esm/to-plain-message.js +1 -1
  151. package/dist/esm/type-registry.d.ts +14 -0
  152. package/dist/esm/type-registry.js +1 -1
  153. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -30,7 +30,8 @@ function localName(desc) {
30
30
  return localOneofName(desc.name);
31
31
  case "enum":
32
32
  case "message":
33
- case "service": {
33
+ case "service":
34
+ case "extension": {
34
35
  const pkg = desc.file.proto.package;
35
36
  const offset = pkg === undefined ? 0 : pkg.length + 1;
36
37
  const name = desc.typeName.substring(offset).replace(/\./g, "_");
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -7,6 +7,8 @@ import type { MessageType } from "../message-type.js";
7
7
  import type { FieldListSource } from "./field-list.js";
8
8
  import type { EnumObject } from "./enum.js";
9
9
  import type { Util } from "./util.js";
10
+ import type { Extension } from "../extension.js";
11
+ import type { ExtensionFieldSource } from "./extensions.js";
10
12
  /**
11
13
  * A facade that provides serialization and other internal functionality.
12
14
  */
@@ -43,5 +45,9 @@ export interface ProtoRuntime {
43
45
  * enum, or an enum constructed with makeEnum(), it raises an error.
44
46
  */
45
47
  getEnumType(enumObject: EnumObject): EnumType;
48
+ /**
49
+ * Create an extension at runtime, without generating code.
50
+ */
51
+ makeExtension<E extends Message<E> = AnyMessage, V = unknown>(typeName: string, extendee: MessageType<E>, field: ExtensionFieldSource): Extension<E, V>;
46
52
  }
47
53
  export declare function makeProtoRuntime(syntax: string, json: JsonFormat, bin: BinaryFormat, util: Util): ProtoRuntime;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.makeProtoRuntime = void 0;
17
17
  const enum_js_1 = require("./enum.js");
18
18
  const message_type_js_1 = require("./message-type.js");
19
+ const extensions_js_1 = require("./extensions.js");
19
20
  function makeProtoRuntime(syntax, json, bin, util) {
20
21
  return {
21
22
  syntax,
@@ -28,6 +29,9 @@ function makeProtoRuntime(syntax, json, bin, util) {
28
29
  makeEnum: enum_js_1.makeEnum,
29
30
  makeEnumType: enum_js_1.makeEnumType,
30
31
  getEnumType: enum_js_1.getEnumType,
32
+ makeExtension(typeName, extendee, field) {
33
+ return (0, extensions_js_1.makeExtension)(this, typeName, extendee, field);
34
+ },
31
35
  };
32
36
  }
33
37
  exports.makeProtoRuntime = makeProtoRuntime;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,6 +1,7 @@
1
1
  import type { MessageType } from "./message-type.js";
2
2
  import type { EnumType } from "./enum.js";
3
3
  import type { ServiceType } from "./service-type.js";
4
+ import type { Extension } from "./extension.js";
4
5
  /**
5
6
  * IMessageTypeRegistry provides look-up for message types.
6
7
  *
@@ -41,3 +42,16 @@ export interface IServiceTypeRegistry {
41
42
  */
42
43
  findService(typeName: string): ServiceType | undefined;
43
44
  }
45
+ /**
46
+ * IExtensionRegistry provides look-up for extensions.
47
+ */
48
+ export interface IExtensionRegistry {
49
+ /**
50
+ * Find an extension by the extendee type name and the extension number.
51
+ */
52
+ findExtensionFor(extendee: string, no: number): Extension | undefined;
53
+ /**
54
+ * Find an extension type by its protobuf type name.
55
+ */
56
+ findExtension(typeName: string): Extension | undefined;
57
+ }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2023 Buf Technologies, Inc.
2
+ // Copyright 2021-2024 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2023 Buf Technologies, Inc.
1
+ // Copyright 2021-2024 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -315,8 +315,7 @@ export class BinaryReader {
315
315
  this.pos += len;
316
316
  break;
317
317
  case WireType.StartGroup:
318
- // From descriptor.proto: Group type is deprecated, not supported in proto3.
319
- // But we must still be able to parse and treat as unknown.
318
+ // TODO check for matching field numbers in StartGroup / EndGroup tags
320
319
  let t;
321
320
  while ((t = this.tag()[1]) !== WireType.EndGroup) {
322
321
  this.skip(t);
@@ -1,5 +1,6 @@
1
1
  import type { Message } from "./message.js";
2
2
  import type { IBinaryReader, IBinaryWriter, WireType } from "./binary-encoding.js";
3
+ import type { FieldInfo } from "./field.js";
3
4
  /**
4
5
  * BinaryFormat is the contract for serializing messages to and from binary
5
6
  * data. Implementations may be specific to a proto syntax, and can be
@@ -27,10 +28,26 @@ export interface BinaryFormat {
27
28
  * delimitedMessageEncoding is optional for backwards compatibility.
28
29
  */
29
30
  readMessage(message: Message, reader: IBinaryReader, lengthOrEndTagFieldNo: number, options: BinaryReadOptions, delimitedMessageEncoding?: boolean): void;
31
+ /**
32
+ * Parse a field from binary data, and store it in the given target.
33
+ *
34
+ * The target must be an initialized message object, with oneof groups,
35
+ * repeated fields and maps already present.
36
+ */
37
+ readField(target: Record<string, any>, // eslint-disable-line @typescript-eslint/no-explicit-any -- `any` is the best choice for dynamic access
38
+ reader: IBinaryReader, field: FieldInfo, wireType: WireType, options: BinaryReadOptions): void;
30
39
  /**
31
40
  * Serialize a message to binary data.
32
41
  */
33
42
  writeMessage(message: Message, writer: IBinaryWriter, options: BinaryWriteOptions): void;
43
+ /**
44
+ * Serialize a field value to binary data.
45
+ *
46
+ * The value must be an array for repeated fields, a record object for map
47
+ * fields. Only selected oneof fields should be passed to this method.
48
+ */
49
+ writeField(field: FieldInfo, value: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- `any` is the best choice for dynamic access
50
+ writer: IBinaryWriter, options: BinaryWriteOptions): void;
34
51
  /**
35
52
  * Retrieve the unknown fields for the given message.
36
53
  *
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2023 Buf Technologies, Inc.
1
+ // Copyright 2021-2024 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,14 +1,14 @@
1
1
  import { reifyWkt } from "./private/reify-wkt.js";
2
- import type { DescEnum, DescEnumValue, DescField, DescMessage, DescMethod, DescOneof, DescService } from "./descriptor-set";
2
+ import type { DescEnum, DescEnumValue, DescField, DescExtension, DescMessage, DescMethod, DescOneof, DescService } from "./descriptor-set";
3
3
  import { LongType, ScalarType } from "./field.js";
4
4
  interface CodegenInfo {
5
5
  /**
6
6
  * Name of the runtime library NPM package.
7
7
  */
8
8
  readonly packageName: string;
9
- readonly localName: (desc: DescEnum | DescEnumValue | DescMessage | DescOneof | DescField | DescService | DescMethod) => string;
9
+ readonly localName: (desc: DescEnum | DescEnumValue | DescMessage | DescExtension | DescOneof | DescField | DescService | DescMethod) => string;
10
10
  readonly symbols: Record<RuntimeSymbolName, RuntimeSymbolInfo>;
11
- readonly getUnwrappedFieldType: (field: DescField) => ScalarType | undefined;
11
+ readonly getUnwrappedFieldType: (field: DescField | DescExtension) => ScalarType | undefined;
12
12
  readonly wktSourceFiles: readonly string[];
13
13
  readonly scalarDefaultValue: (type: ScalarType, longType: LongType) => any;
14
14
  /**
@@ -18,7 +18,7 @@ interface CodegenInfo {
18
18
  readonly safeIdentifier: (name: string) => string;
19
19
  readonly safeObjectProperty: (name: string) => string;
20
20
  }
21
- type RuntimeSymbolName = "proto2" | "proto3" | "Message" | "PartialMessage" | "PlainMessage" | "FieldList" | "MessageType" | "BinaryReadOptions" | "BinaryWriteOptions" | "JsonReadOptions" | "JsonWriteOptions" | "JsonValue" | "JsonObject" | "protoDouble" | "protoInt64" | "ScalarType" | "LongType" | "MethodKind" | "MethodIdempotency" | "IMessageTypeRegistry";
21
+ type RuntimeSymbolName = "proto2" | "proto3" | "Message" | "PartialMessage" | "PlainMessage" | "FieldList" | "MessageType" | "Extension" | "BinaryReadOptions" | "BinaryWriteOptions" | "JsonReadOptions" | "JsonWriteOptions" | "JsonValue" | "JsonObject" | "protoDouble" | "protoInt64" | "ScalarType" | "LongType" | "MethodKind" | "MethodIdempotency" | "IMessageTypeRegistry";
22
22
  type RuntimeSymbolInfo = {
23
23
  typeOnly: boolean;
24
24
  publicImportPath: string;
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2023 Buf Technologies, Inc.
1
+ // Copyright 2021-2024 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ export const codegenInfo = {
34
34
  PlainMessage: { typeOnly: true, privateImportPath: "./message.js", publicImportPath: packageName },
35
35
  FieldList: { typeOnly: true, privateImportPath: "./field-list.js", publicImportPath: packageName },
36
36
  MessageType: { typeOnly: true, privateImportPath: "./message-type.js", publicImportPath: packageName },
37
+ Extension: { typeOnly: true, privateImportPath: "./extension.js", publicImportPath: packageName },
37
38
  BinaryReadOptions: { typeOnly: true, privateImportPath: "./binary-format.js", publicImportPath: packageName },
38
39
  BinaryWriteOptions: { typeOnly: true, privateImportPath: "./binary-format.js", publicImportPath: packageName },
39
40
  JsonReadOptions: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName },
@@ -1,5 +1,6 @@
1
1
  import { FeatureSetDefaults, FileDescriptorProto, FileDescriptorSet } from "./google/protobuf/descriptor_pb.js";
2
2
  import type { DescriptorSet } from "./descriptor-set.js";
3
+ import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js";
3
4
  /**
4
5
  * Create a DescriptorSet, a convenient interface for working with a set of
5
6
  * google.protobuf.FileDescriptorProto.
@@ -20,11 +21,16 @@ interface CreateDescriptorSetOptions {
20
21
  *
21
22
  * To create a DescriptorSet that provides your language-specific features,
22
23
  * you have to provide a google.protobuf.FeatureSetDefaults message in this
23
- * option.
24
+ * option. It can also specify the minimum and maximum supported edition.
24
25
  *
25
26
  * The defaults can be generated with `protoc` - see the flag
26
27
  * `--experimental_edition_defaults_out`.
27
28
  */
28
29
  featureSetDefaults?: FeatureSetDefaults;
30
+ /**
31
+ * Internally, data is serialized when features are resolved. The
32
+ * serialization options given here will be used for feature resolution.
33
+ */
34
+ serializationOptions?: Partial<BinaryReadOptions & BinaryWriteOptions>;
29
35
  }
30
36
  export {};