@bufbuild/protobuf 0.0.1-alpha.1 → 0.0.2-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 (138) hide show
  1. package/dist/cjs/binary-encoding.js +414 -409
  2. package/dist/cjs/binary-format.js +13 -0
  3. package/dist/cjs/descriptor-registry.js +420 -449
  4. package/dist/cjs/descriptor-set.js +429 -513
  5. package/dist/cjs/enum.js +13 -0
  6. package/dist/cjs/field-list.js +13 -0
  7. package/dist/cjs/field.js +43 -30
  8. package/dist/cjs/google/protobuf/any_pb.js +122 -140
  9. package/dist/cjs/google/protobuf/api_pb.js +177 -224
  10. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
  11. package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
  12. package/dist/cjs/google/protobuf/duration_pb.js +72 -88
  13. package/dist/cjs/google/protobuf/empty_pb.js +17 -17
  14. package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
  15. package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
  16. package/dist/cjs/google/protobuf/struct_pb.js +144 -181
  17. package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
  18. package/dist/cjs/google/protobuf/type_pb.js +406 -462
  19. package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
  20. package/dist/cjs/google/varint.js +166 -171
  21. package/dist/cjs/index.js +41 -122
  22. package/dist/cjs/json-format.js +13 -0
  23. package/dist/cjs/message-type.js +13 -0
  24. package/dist/cjs/message.js +89 -85
  25. package/dist/cjs/private/assert.js +33 -26
  26. package/dist/cjs/private/base64.js +93 -79
  27. package/dist/cjs/private/binary-format-common.js +208 -208
  28. package/dist/cjs/private/binary-format-proto2.js +88 -109
  29. package/dist/cjs/private/binary-format-proto3.js +70 -90
  30. package/dist/cjs/private/enum.js +77 -44
  31. package/dist/cjs/private/field-list.js +64 -50
  32. package/dist/cjs/private/field-wrapper.js +21 -10
  33. package/dist/cjs/private/field.js +35 -25
  34. package/dist/cjs/private/json-format-common.js +427 -440
  35. package/dist/cjs/private/json-format-proto2.js +91 -89
  36. package/dist/cjs/private/json-format-proto3.js +82 -93
  37. package/dist/cjs/private/message-type.js +39 -27
  38. package/dist/cjs/private/names.js +71 -62
  39. package/dist/cjs/private/options-map.js +13 -0
  40. package/dist/cjs/private/proto-runtime.js +25 -16
  41. package/dist/cjs/private/scalars.js +113 -103
  42. package/dist/cjs/private/util-common.js +193 -210
  43. package/dist/cjs/private/util.js +13 -0
  44. package/dist/cjs/proto-int64.js +123 -111
  45. package/dist/cjs/proto2.js +63 -63
  46. package/dist/cjs/proto3.js +74 -74
  47. package/dist/cjs/service-type.js +27 -17
  48. package/dist/cjs/type-registry.js +46 -31
  49. package/dist/esm/binary-encoding.js +414 -414
  50. package/dist/esm/binary-format.js +13 -0
  51. package/dist/esm/descriptor-registry.js +422 -458
  52. package/dist/esm/descriptor-set.js +430 -478
  53. package/dist/esm/enum.js +13 -0
  54. package/dist/esm/field-list.js +13 -0
  55. package/dist/esm/field.js +42 -29
  56. package/dist/esm/google/protobuf/any_pb.js +122 -140
  57. package/dist/esm/google/protobuf/api_pb.js +177 -197
  58. package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
  59. package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
  60. package/dist/esm/google/protobuf/duration_pb.js +72 -88
  61. package/dist/esm/google/protobuf/empty_pb.js +17 -17
  62. package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
  63. package/dist/esm/google/protobuf/source_context_pb.js +25 -25
  64. package/dist/esm/google/protobuf/struct_pb.js +143 -180
  65. package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
  66. package/dist/esm/google/protobuf/type_pb.js +401 -421
  67. package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
  68. package/dist/esm/google/varint.js +165 -164
  69. package/dist/esm/index.js +14 -1
  70. package/dist/esm/json-format.js +13 -0
  71. package/dist/esm/message-type.js +13 -0
  72. package/dist/esm/message.js +89 -85
  73. package/dist/esm/private/assert.js +32 -21
  74. package/dist/esm/private/base64.js +92 -78
  75. package/dist/esm/private/binary-format-common.js +209 -207
  76. package/dist/esm/private/binary-format-proto2.js +89 -81
  77. package/dist/esm/private/binary-format-proto3.js +71 -67
  78. package/dist/esm/private/enum.js +75 -43
  79. package/dist/esm/private/field-list.js +64 -50
  80. package/dist/esm/private/field-wrapper.js +21 -10
  81. package/dist/esm/private/field.js +35 -22
  82. package/dist/esm/private/json-format-common.js +427 -435
  83. package/dist/esm/private/json-format-proto2.js +89 -81
  84. package/dist/esm/private/json-format-proto3.js +79 -80
  85. package/dist/esm/private/message-type.js +40 -28
  86. package/dist/esm/private/names.js +70 -57
  87. package/dist/esm/private/options-map.js +13 -0
  88. package/dist/esm/private/proto-runtime.js +26 -12
  89. package/dist/esm/private/scalars.js +112 -99
  90. package/dist/esm/private/util-common.js +193 -192
  91. package/dist/esm/private/util.js +13 -0
  92. package/dist/esm/proto-int64.js +123 -111
  93. package/dist/esm/proto2.js +63 -57
  94. package/dist/esm/proto3.js +74 -68
  95. package/dist/esm/service-type.js +25 -12
  96. package/dist/esm/type-registry.js +46 -31
  97. package/dist/types/binary-encoding.d.ts +398 -398
  98. package/dist/types/binary-format.d.ts +69 -91
  99. package/dist/types/descriptor-registry.d.ts +23 -29
  100. package/dist/types/descriptor-set.d.ts +107 -128
  101. package/dist/types/enum.d.ts +21 -21
  102. package/dist/types/field-list.d.ts +21 -21
  103. package/dist/types/field.d.ts +191 -231
  104. package/dist/types/google/protobuf/any_pb.d.ts +56 -77
  105. package/dist/types/google/protobuf/api_pb.d.ts +144 -187
  106. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
  107. package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
  108. package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
  109. package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
  110. package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
  111. package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
  112. package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
  113. package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
  114. package/dist/types/google/protobuf/type_pb.d.ts +355 -422
  115. package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
  116. package/dist/types/google/varint.d.ts +6 -13
  117. package/dist/types/index.d.ts +4 -27
  118. package/dist/types/json-format.d.ts +70 -89
  119. package/dist/types/message-type.d.ts +37 -45
  120. package/dist/types/message.d.ts +62 -87
  121. package/dist/types/private/assert.d.ts +1 -4
  122. package/dist/types/private/binary-format-common.d.ts +6 -32
  123. package/dist/types/private/enum.d.ts +13 -11
  124. package/dist/types/private/field-list.d.ts +14 -21
  125. package/dist/types/private/field-wrapper.d.ts +4 -10
  126. package/dist/types/private/field.d.ts +12 -12
  127. package/dist/types/private/json-format-common.d.ts +5 -27
  128. package/dist/types/private/message-type.d.ts +12 -7
  129. package/dist/types/private/names.d.ts +1 -4
  130. package/dist/types/private/options-map.d.ts +1 -1
  131. package/dist/types/private/proto-runtime.d.ts +34 -42
  132. package/dist/types/private/scalars.d.ts +5 -12
  133. package/dist/types/private/util-common.d.ts +1 -4
  134. package/dist/types/private/util.d.ts +29 -41
  135. package/dist/types/proto-int64.d.ts +42 -42
  136. package/dist/types/service-type.d.ts +36 -56
  137. package/dist/types/type-registry.d.ts +13 -15
  138. package/package.json +2 -3
@@ -24,11 +24,7 @@ import type { MessageType } from "./message-type.js";
24
24
  * - "oneof": If the field is member of a oneof group.
25
25
  * - "default": Only proto2: An explicit default value.
26
26
  */
27
- export declare type FieldInfo =
28
- | fiRules<fiScalar>
29
- | fiRules<fiEnum>
30
- | fiRules<fiMessage>
31
- | fiRules<fiMap>;
27
+ export declare type FieldInfo = fiRules<fiScalar> | fiRules<fiEnum> | fiRules<fiMessage> | fiRules<fiMap>;
32
28
  /**
33
29
  * Version of `FieldInfo` that allows the following properties
34
30
  * to be omitted:
@@ -38,258 +34,222 @@ export declare type FieldInfo =
38
34
  * - "repeated": Can be omitted if false.
39
35
  * - "packed": Can be omitted if equal to the standard packing of the field.
40
36
  */
41
- export declare type PartialFieldInfo =
42
- | fiPartialRules<fiScalar>
43
- | fiPartialRules<fiEnum>
44
- | fiPartialRules<fiMessage>
45
- | fiPartialRules<fiMap>;
37
+ export declare type PartialFieldInfo = fiPartialRules<fiScalar> | fiPartialRules<fiEnum> | fiPartialRules<fiMessage> | fiPartialRules<fiMap>;
46
38
  /**
47
39
  * Provides convenient access to field information of a oneof.
48
40
  */
49
41
  export interface OneofInfo {
50
- readonly kind: "oneof";
51
- readonly name: string;
52
- readonly localName: string;
53
- readonly repeated: false;
54
- readonly packed: false;
55
- readonly opt: false;
56
- readonly default: undefined;
57
- readonly fields: readonly FieldInfo[];
58
- /**
59
- * Return field information by local name.
60
- */
61
- findField(localName: string): FieldInfo | undefined;
42
+ readonly kind: "oneof";
43
+ readonly name: string;
44
+ readonly localName: string;
45
+ readonly repeated: false;
46
+ readonly packed: false;
47
+ readonly opt: false;
48
+ readonly default: undefined;
49
+ readonly fields: readonly FieldInfo[];
50
+ /**
51
+ * Return field information by local name.
52
+ */
53
+ findField(localName: string): FieldInfo | undefined;
62
54
  }
63
55
  interface fiShared {
64
- /**
65
- * The field number of the .proto field.
66
- */
67
- readonly no: number;
68
- /**
69
- * The original name of the .proto field.
70
- */
71
- readonly name: string;
72
- /**
73
- * The name of the field as used in generated code.
74
- */
75
- readonly localName: string;
76
- /**
77
- * The name for JSON serialization / deserialization.
78
- */
79
- readonly jsonName: string;
80
- /**
81
- * The `oneof` group, if this field belongs to one.
82
- */
83
- readonly oneof?: OneofInfo | undefined;
56
+ /**
57
+ * The field number of the .proto field.
58
+ */
59
+ readonly no: number;
60
+ /**
61
+ * The original name of the .proto field.
62
+ */
63
+ readonly name: string;
64
+ /**
65
+ * The name of the field as used in generated code.
66
+ */
67
+ readonly localName: string;
68
+ /**
69
+ * The name for JSON serialization / deserialization.
70
+ */
71
+ readonly jsonName: string;
72
+ /**
73
+ * The `oneof` group, if this field belongs to one.
74
+ */
75
+ readonly oneof?: OneofInfo | undefined;
84
76
  }
85
77
  interface fiScalar extends fiShared {
86
- readonly kind: "scalar";
87
- /**
88
- * Scalar type of the field.
89
- */
90
- readonly T: ScalarType;
91
- /**
92
- * Is the field repeated?
93
- */
94
- readonly repeated: boolean;
95
- /**
96
- * Is this repeated field packed?
97
- * BYTES and STRING can never be packed, since they are length-delimited.
98
- * Other types can be packed with the field option "packed".
99
- * For proto3, fields are packed by default.
100
- */
101
- readonly packed: boolean;
102
- /**
103
- * Is the field optional?
104
- */
105
- readonly opt: boolean;
106
- /**
107
- * Only proto2: An explicit default value.
108
- */
109
- readonly default: number | boolean | string | bigint | Uint8Array | undefined;
78
+ readonly kind: "scalar";
79
+ /**
80
+ * Scalar type of the field.
81
+ */
82
+ readonly T: ScalarType;
83
+ /**
84
+ * Is the field repeated?
85
+ */
86
+ readonly repeated: boolean;
87
+ /**
88
+ * Is this repeated field packed?
89
+ * BYTES and STRING can never be packed, since they are length-delimited.
90
+ * Other types can be packed with the field option "packed".
91
+ * For proto3, fields are packed by default.
92
+ */
93
+ readonly packed: boolean;
94
+ /**
95
+ * Is the field optional?
96
+ */
97
+ readonly opt: boolean;
98
+ /**
99
+ * Only proto2: An explicit default value.
100
+ */
101
+ readonly default: number | boolean | string | bigint | Uint8Array | undefined;
110
102
  }
111
103
  interface fiMessage extends fiShared {
112
- readonly kind: "message";
113
- /**
114
- * Message handler for the field.
115
- */
116
- readonly T: MessageType;
117
- /**
118
- * Is the field repeated?
119
- */
120
- readonly repeated: boolean;
121
- /**
122
- * Is this repeated field packed? Never true for messages.
123
- */
124
- readonly packed: false;
125
- /**
126
- * An explicit default value (only proto2). Never set for messages.
127
- */
128
- readonly default: undefined;
104
+ readonly kind: "message";
105
+ /**
106
+ * Message handler for the field.
107
+ */
108
+ readonly T: MessageType;
109
+ /**
110
+ * Is the field repeated?
111
+ */
112
+ readonly repeated: boolean;
113
+ /**
114
+ * Is this repeated field packed? Never true for messages.
115
+ */
116
+ readonly packed: false;
117
+ /**
118
+ * An explicit default value (only proto2). Never set for messages.
119
+ */
120
+ readonly default: undefined;
129
121
  }
130
122
  interface fiEnum extends fiShared {
131
- readonly kind: "enum";
132
- /**
133
- * Enum type information for the field.
134
- */
135
- readonly T: EnumType;
136
- /**
137
- * Is the field repeated?
138
- */
139
- readonly repeated: boolean;
140
- /**
141
- * Is this repeated field packed?
142
- * Repeated enums can be packed with the field option "packed".
143
- * For proto3, they are packed by default.
144
- */
145
- readonly packed: boolean;
146
- /**
147
- * Is the field optional?
148
- */
149
- readonly opt: boolean;
150
- /**
151
- * Only proto2: An explicit default value.
152
- */
153
- readonly default: number | undefined;
123
+ readonly kind: "enum";
124
+ /**
125
+ * Enum type information for the field.
126
+ */
127
+ readonly T: EnumType;
128
+ /**
129
+ * Is the field repeated?
130
+ */
131
+ readonly repeated: boolean;
132
+ /**
133
+ * Is this repeated field packed?
134
+ * Repeated enums can be packed with the field option "packed".
135
+ * For proto3, they are packed by default.
136
+ */
137
+ readonly packed: boolean;
138
+ /**
139
+ * Is the field optional?
140
+ */
141
+ readonly opt: boolean;
142
+ /**
143
+ * Only proto2: An explicit default value.
144
+ */
145
+ readonly default: number | undefined;
154
146
  }
155
147
  interface fiMap extends fiShared {
156
- readonly kind: "map";
157
- /**
158
- * Map key type.
159
- *
160
- * The key_type can be any integral or string type
161
- * (so, any scalar type except for floating point
162
- * types and bytes)
163
- */
164
- readonly K: Exclude<
165
- ScalarType,
166
- ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES
167
- >;
168
- /**
169
- * Map value type. Can be scalar, enum, or message.
170
- */
171
- readonly V:
172
- | {
148
+ readonly kind: "map";
149
+ /**
150
+ * Map key type.
151
+ *
152
+ * The key_type can be any integral or string type
153
+ * (so, any scalar type except for floating point
154
+ * types and bytes)
155
+ */
156
+ readonly K: Exclude<ScalarType, ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES>;
157
+ /**
158
+ * Map value type. Can be scalar, enum, or message.
159
+ */
160
+ readonly V: {
173
161
  readonly kind: "scalar";
174
162
  readonly T: ScalarType;
175
- }
176
- | {
163
+ } | {
177
164
  readonly kind: "enum";
178
165
  readonly T: EnumType;
179
- }
180
- | {
166
+ } | {
181
167
  readonly kind: "message";
182
168
  readonly T: MessageType;
183
- };
184
- /**
185
- * Is the field repeated? Never true for maps.
186
- */
187
- readonly repeated: false;
188
- /**
189
- * Is this repeated field packed? Never true for maps.
190
- */
191
- readonly packed: false;
192
- /**
193
- * An explicit default value (only proto2). Never set for maps.
194
- */
195
- readonly default: undefined;
169
+ };
170
+ /**
171
+ * Is the field repeated? Never true for maps.
172
+ */
173
+ readonly repeated: false;
174
+ /**
175
+ * Is this repeated field packed? Never true for maps.
176
+ */
177
+ readonly packed: false;
178
+ /**
179
+ * An explicit default value (only proto2). Never set for maps.
180
+ */
181
+ readonly default: undefined;
196
182
  }
197
- declare type fiRules<T> = Omit<
198
- T,
199
- "oneof" | "repeat" | "repeated" | "packed" | "opt"
200
- > &
201
- (
202
- | {
203
- readonly repeated: false;
204
- readonly packed: false;
205
- readonly opt: false;
206
- readonly oneof: undefined;
207
- }
208
- | {
209
- readonly repeated: false;
210
- readonly packed: false;
211
- readonly opt: true;
212
- readonly oneof: undefined;
213
- }
214
- | {
215
- readonly repeated: boolean;
216
- readonly packed: boolean;
217
- readonly opt: false;
218
- readonly oneof: undefined;
219
- }
220
- | {
221
- readonly repeated: false;
222
- readonly packed: false;
223
- readonly opt: false;
224
- readonly oneof: OneofInfo;
225
- }
226
- );
227
- declare type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> =
228
- Omit<
229
- T,
230
- | "jsonName"
231
- | "localName"
232
- | "oneof"
233
- | "repeat"
234
- | "repeated"
235
- | "packed"
236
- | "opt"
237
- | "default"
238
- > &
239
- (
240
- | {
241
- readonly jsonName?: string;
242
- readonly repeated?: false;
243
- readonly packed?: false;
244
- readonly opt?: false;
245
- readonly oneof?: undefined;
246
- default?: T["default"];
247
- }
248
- | {
249
- readonly jsonName?: string;
250
- readonly repeated?: false;
251
- readonly packed?: false;
252
- readonly opt: true;
253
- readonly oneof?: undefined;
254
- default?: T["default"];
255
- }
256
- | {
257
- readonly jsonName?: string;
258
- readonly repeated?: boolean;
259
- readonly packed?: boolean;
260
- readonly opt?: false;
261
- readonly oneof?: undefined;
262
- default?: T["default"];
263
- }
264
- | {
265
- readonly jsonName?: string;
266
- readonly repeated?: false;
267
- readonly packed?: false;
268
- readonly opt?: false;
269
- readonly oneof: string;
270
- default?: T["default"];
271
- }
272
- );
183
+ declare type fiRules<T> = Omit<T, "oneof" | "repeat" | "repeated" | "packed" | "opt"> & ({
184
+ readonly repeated: false;
185
+ readonly packed: false;
186
+ readonly opt: false;
187
+ readonly oneof: undefined;
188
+ } | {
189
+ readonly repeated: false;
190
+ readonly packed: false;
191
+ readonly opt: true;
192
+ readonly oneof: undefined;
193
+ } | {
194
+ readonly repeated: boolean;
195
+ readonly packed: boolean;
196
+ readonly opt: false;
197
+ readonly oneof: undefined;
198
+ } | {
199
+ readonly repeated: false;
200
+ readonly packed: false;
201
+ readonly opt: false;
202
+ readonly oneof: OneofInfo;
203
+ });
204
+ declare type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "jsonName" | "localName" | "oneof" | "repeat" | "repeated" | "packed" | "opt" | "default"> & ({
205
+ readonly jsonName?: string;
206
+ readonly repeated?: false;
207
+ readonly packed?: false;
208
+ readonly opt?: false;
209
+ readonly oneof?: undefined;
210
+ default?: T["default"];
211
+ } | {
212
+ readonly jsonName?: string;
213
+ readonly repeated?: false;
214
+ readonly packed?: false;
215
+ readonly opt: true;
216
+ readonly oneof?: undefined;
217
+ default?: T["default"];
218
+ } | {
219
+ readonly jsonName?: string;
220
+ readonly repeated?: boolean;
221
+ readonly packed?: boolean;
222
+ readonly opt?: false;
223
+ readonly oneof?: undefined;
224
+ default?: T["default"];
225
+ } | {
226
+ readonly jsonName?: string;
227
+ readonly repeated?: false;
228
+ readonly packed?: false;
229
+ readonly opt?: false;
230
+ readonly oneof: string;
231
+ default?: T["default"];
232
+ });
273
233
  /**
274
234
  * Scalar value types. This is a subset of field types declared by protobuf
275
235
  * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
276
236
  * are omitted, but the numerical values are identical.
277
237
  */
278
238
  export declare enum ScalarType {
279
- DOUBLE = 1,
280
- FLOAT = 2,
281
- INT64 = 3,
282
- UINT64 = 4,
283
- INT32 = 5,
284
- FIXED64 = 6,
285
- FIXED32 = 7,
286
- BOOL = 8,
287
- STRING = 9,
288
- BYTES = 12,
289
- UINT32 = 13,
290
- SFIXED32 = 15,
291
- SFIXED64 = 16,
292
- SINT32 = 17,
293
- SINT64 = 18,
239
+ DOUBLE = 1,
240
+ FLOAT = 2,
241
+ INT64 = 3,
242
+ UINT64 = 4,
243
+ INT32 = 5,
244
+ FIXED64 = 6,
245
+ FIXED32 = 7,
246
+ BOOL = 8,
247
+ STRING = 9,
248
+ BYTES = 12,
249
+ UINT32 = 13,
250
+ SFIXED32 = 15,
251
+ SFIXED64 = 16,
252
+ SINT32 = 17,
253
+ SINT64 = 18
294
254
  }
295
255
  export {};
@@ -1,13 +1,4 @@
1
- import type {
2
- BinaryReadOptions,
3
- FieldList,
4
- JsonReadOptions,
5
- JsonValue,
6
- JsonWriteOptions,
7
- MessageType,
8
- PartialMessage,
9
- PlainMessage,
10
- } from "../../index.js";
1
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, JsonWriteOptions, MessageType, PartialMessage, PlainMessage } from "../../index.js";
11
2
  import { Message } from "../../index.js";
12
3
  /**
13
4
  * `Any` contains an arbitrary serialized protocol buffer message along with a
@@ -97,71 +88,59 @@ import { Message } from "../../index.js";
97
88
  * @generated from message google.protobuf.Any
98
89
  */
99
90
  export declare class Any extends Message<Any> {
100
- /**
101
- * A URL/resource name that uniquely identifies the type of the serialized
102
- * protocol buffer message. This string must contain at least
103
- * one "/" character. The last segment of the URL's path must represent
104
- * the fully qualified name of the type (as in
105
- * `path/google.protobuf.Duration`). The name should be in a canonical form
106
- * (e.g., leading "." is not accepted).
107
- *
108
- * In practice, teams usually precompile into the binary all types that they
109
- * expect it to use in the context of Any. However, for URLs which use the
110
- * scheme `http`, `https`, or no scheme, one can optionally set up a type
111
- * server that maps type URLs to message definitions as follows:
112
- *
113
- * * If no scheme is provided, `https` is assumed.
114
- * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
115
- * value in binary format, or produce an error.
116
- * * Applications are allowed to cache lookup results based on the
117
- * URL, or have them precompiled into a binary to avoid any
118
- * lookup. Therefore, binary compatibility needs to be preserved
119
- * on changes to types. (Use versioned type names to manage
120
- * breaking changes.)
121
- *
122
- * Note: this functionality is not currently available in the official
123
- * protobuf release, and it is not used for type URLs beginning with
124
- * type.googleapis.com.
125
- *
126
- * Schemes other than `http`, `https` (or the empty scheme) might be
127
- * used with implementation specific semantics.
128
- *
129
- *
130
- * @generated from field: string type_url = 1;
131
- */
132
- typeUrl: string;
133
- /**
134
- * Must be a valid serialized protocol buffer of the above specified type.
135
- *
136
- * @generated from field: bytes value = 2;
137
- */
138
- value: Uint8Array;
139
- constructor(data?: PartialMessage<Any>);
140
- toJson(options?: Partial<JsonWriteOptions>): JsonValue;
141
- fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
142
- packFrom(message: Message): void;
143
- unpackTo(target: Message): boolean;
144
- is(type: MessageType): boolean;
145
- private typeNameToUrl;
146
- private typeUrlToName;
147
- static readonly runtime: import("../../private/proto-runtime.js").ProtoRuntime;
148
- static readonly typeName = "google.protobuf.Any";
149
- static readonly fields: FieldList;
150
- static pack(message: Message): Any;
151
- static fromBinary(
152
- bytes: Uint8Array,
153
- options?: Partial<BinaryReadOptions>
154
- ): Any;
155
- static fromJson(
156
- jsonValue: JsonValue,
157
- options?: Partial<JsonReadOptions>
158
- ): Any;
159
- static fromJsonString(
160
- jsonString: string,
161
- options?: Partial<JsonReadOptions>
162
- ): Any;
163
- static equals(
164
- a: Any | PlainMessage<Any> | undefined,
165
- b: Any | PlainMessage<Any> | undefined
166
- ): boolean;
91
+ /**
92
+ * A URL/resource name that uniquely identifies the type of the serialized
93
+ * protocol buffer message. This string must contain at least
94
+ * one "/" character. The last segment of the URL's path must represent
95
+ * the fully qualified name of the type (as in
96
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
97
+ * (e.g., leading "." is not accepted).
98
+ *
99
+ * In practice, teams usually precompile into the binary all types that they
100
+ * expect it to use in the context of Any. However, for URLs which use the
101
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
102
+ * server that maps type URLs to message definitions as follows:
103
+ *
104
+ * * If no scheme is provided, `https` is assumed.
105
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
106
+ * value in binary format, or produce an error.
107
+ * * Applications are allowed to cache lookup results based on the
108
+ * URL, or have them precompiled into a binary to avoid any
109
+ * lookup. Therefore, binary compatibility needs to be preserved
110
+ * on changes to types. (Use versioned type names to manage
111
+ * breaking changes.)
112
+ *
113
+ * Note: this functionality is not currently available in the official
114
+ * protobuf release, and it is not used for type URLs beginning with
115
+ * type.googleapis.com.
116
+ *
117
+ * Schemes other than `http`, `https` (or the empty scheme) might be
118
+ * used with implementation specific semantics.
119
+ *
120
+ *
121
+ * @generated from field: string type_url = 1;
122
+ */
123
+ typeUrl: string;
124
+ /**
125
+ * Must be a valid serialized protocol buffer of the above specified type.
126
+ *
127
+ * @generated from field: bytes value = 2;
128
+ */
129
+ value: Uint8Array;
130
+ constructor(data?: PartialMessage<Any>);
131
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
132
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
133
+ packFrom(message: Message): void;
134
+ unpackTo(target: Message): boolean;
135
+ is(type: MessageType): boolean;
136
+ private typeNameToUrl;
137
+ private typeUrlToName;
138
+ static readonly runtime: import("../../private/proto-runtime.js").ProtoRuntime;
139
+ static readonly typeName = "google.protobuf.Any";
140
+ static readonly fields: FieldList;
141
+ static pack(message: Message): Any;
142
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Any;
143
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Any;
144
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Any;
145
+ static equals(a: Any | PlainMessage<Any> | undefined, b: Any | PlainMessage<Any> | undefined): boolean;
167
146
  }