@bufbuild/protobuf 1.9.0 → 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 (429) hide show
  1. package/dist/cjs/clone.d.ts +6 -0
  2. package/dist/cjs/clone.js +77 -0
  3. package/dist/cjs/codegenv1/boot.d.ts +63 -0
  4. package/dist/cjs/codegenv1/boot.js +102 -0
  5. package/dist/cjs/codegenv1/embed.d.ts +43 -0
  6. package/dist/cjs/codegenv1/embed.js +238 -0
  7. package/dist/cjs/codegenv1/enum.d.ts +17 -0
  8. package/dist/cjs/codegenv1/enum.js +41 -0
  9. package/dist/cjs/codegenv1/extension.d.ts +9 -0
  10. package/dist/cjs/codegenv1/extension.js +29 -0
  11. package/dist/cjs/codegenv1/file.d.ts +7 -0
  12. package/dist/cjs/codegenv1/file.js +38 -0
  13. package/dist/cjs/codegenv1/index.d.ts +9 -0
  14. package/dist/cjs/codegenv1/index.js +38 -0
  15. package/dist/cjs/codegenv1/message.d.ts +9 -0
  16. package/dist/cjs/codegenv1/message.js +25 -0
  17. package/dist/cjs/codegenv1/restore-json-names.d.ts +5 -0
  18. package/dist/cjs/codegenv1/restore-json-names.js +30 -0
  19. package/dist/cjs/codegenv1/service.d.ts +8 -0
  20. package/dist/cjs/codegenv1/service.js +28 -0
  21. package/dist/cjs/codegenv1/symbols.d.ts +125 -0
  22. package/dist/cjs/codegenv1/symbols.js +67 -0
  23. package/dist/cjs/codegenv1/types.d.ts +72 -0
  24. package/dist/cjs/codegenv1/types.js +21 -0
  25. package/dist/cjs/create.d.ts +9 -0
  26. package/dist/cjs/create.js +231 -0
  27. package/dist/{esm/descriptor-set.d.ts → cjs/desc-types.d.ts} +162 -243
  28. package/dist/cjs/equals.d.ts +9 -0
  29. package/dist/cjs/equals.js +133 -0
  30. package/dist/cjs/extensions.d.ts +59 -0
  31. package/dist/cjs/extensions.js +169 -0
  32. package/dist/cjs/fields.d.ts +23 -0
  33. package/dist/cjs/fields.js +46 -0
  34. package/dist/cjs/from-binary.d.ts +34 -0
  35. package/dist/cjs/from-binary.js +211 -0
  36. package/dist/cjs/from-json.d.ts +48 -0
  37. package/dist/cjs/from-json.js +610 -0
  38. package/dist/cjs/index.d.ts +16 -42
  39. package/dist/cjs/index.js +23 -55
  40. package/dist/cjs/is-message.d.ts +5 -20
  41. package/dist/cjs/is-message.js +11 -29
  42. package/dist/cjs/json-value.d.ts +16 -0
  43. package/dist/cjs/proto-int64.js +2 -2
  44. package/dist/cjs/reflect/error.d.ts +9 -0
  45. package/dist/cjs/reflect/error.js +36 -0
  46. package/dist/cjs/reflect/guard.d.ts +20 -0
  47. package/dist/cjs/reflect/guard.js +78 -0
  48. package/dist/cjs/reflect/index.d.ts +8 -0
  49. package/dist/cjs/reflect/index.js +41 -0
  50. package/dist/cjs/reflect/names.d.ts +11 -0
  51. package/dist/cjs/reflect/names.js +74 -0
  52. package/dist/cjs/reflect/nested-types.d.ts +12 -0
  53. package/dist/cjs/reflect/nested-types.js +71 -0
  54. package/dist/cjs/reflect/reflect-check.d.ts +10 -0
  55. package/dist/cjs/reflect/reflect-check.js +150 -0
  56. package/dist/cjs/reflect/reflect-types.d.ts +284 -0
  57. package/dist/cjs/{extension.js → reflect/reflect-types.js} +1 -0
  58. package/dist/cjs/reflect/reflect.d.ts +32 -0
  59. package/dist/cjs/reflect/reflect.js +434 -0
  60. package/dist/cjs/reflect/registry.d.ts +82 -0
  61. package/dist/cjs/reflect/registry.js +879 -0
  62. package/dist/{esm → cjs/reflect}/scalar.d.ts +21 -1
  63. package/dist/cjs/reflect/scalar.js +298 -0
  64. package/dist/cjs/reflect/unsafe.d.ts +58 -0
  65. package/dist/cjs/reflect/unsafe.js +166 -0
  66. package/dist/cjs/to-binary.d.ts +24 -0
  67. package/dist/cjs/to-binary.js +192 -0
  68. package/dist/cjs/to-json.d.ts +50 -0
  69. package/dist/cjs/to-json.js +364 -0
  70. package/dist/cjs/types.d.ts +68 -0
  71. package/dist/cjs/wire/base64-encoding.d.ts +23 -0
  72. package/dist/cjs/wire/base64-encoding.js +156 -0
  73. package/dist/cjs/wire/binary-encoding.d.ts +244 -0
  74. package/dist/cjs/{binary-encoding.js → wire/binary-encoding.js} +27 -20
  75. package/dist/cjs/wire/index.d.ts +5 -0
  76. package/dist/cjs/wire/index.js +34 -0
  77. package/dist/cjs/wire/size-delimited.d.ts +51 -0
  78. package/dist/cjs/wire/size-delimited.js +154 -0
  79. package/dist/cjs/wire/text-encoding.d.ts +26 -0
  80. package/dist/cjs/wire/text-encoding.js +55 -0
  81. package/dist/cjs/wire/text-format.d.ts +14 -0
  82. package/dist/cjs/{private → wire}/text-format.js +12 -2
  83. package/dist/{esm/google → cjs/wire}/varint.d.ts +2 -2
  84. package/dist/cjs/{google → wire}/varint.js +11 -10
  85. package/dist/cjs/wkt/any.d.ts +38 -0
  86. package/dist/cjs/wkt/any.js +76 -0
  87. package/dist/{esm → cjs/wkt/gen}/google/protobuf/any_pb.d.ts +13 -27
  88. package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +27 -0
  89. package/dist/cjs/{google → wkt/gen/google}/protobuf/api_pb.d.ts +29 -38
  90. package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +39 -0
  91. package/dist/cjs/{google → wkt/gen/google}/protobuf/compiler/plugin_pb.d.ts +67 -75
  92. package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
  93. package/dist/cjs/{google → wkt/gen/google}/protobuf/descriptor_pb.d.ts +564 -527
  94. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +794 -0
  95. package/dist/cjs/{google → wkt/gen/google}/protobuf/duration_pb.d.ts +13 -18
  96. package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
  97. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts +24 -0
  98. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
  99. package/dist/{esm → cjs/wkt/gen}/google/protobuf/field_mask_pb.d.ts +13 -18
  100. package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
  101. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts +26 -0
  102. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
  103. package/dist/{esm → cjs/wkt/gen}/google/protobuf/struct_pb.d.ts +44 -55
  104. package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
  105. package/dist/cjs/{google → wkt/gen/google}/protobuf/timestamp_pb.d.ts +13 -21
  106. package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
  107. package/dist/{esm → cjs/wkt/gen}/google/protobuf/type_pb.d.ts +77 -80
  108. package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +242 -0
  109. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +186 -0
  110. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
  111. package/dist/cjs/wkt/index.d.ts +15 -0
  112. package/dist/cjs/wkt/index.js +44 -0
  113. package/dist/cjs/wkt/timestamp.d.ts +21 -0
  114. package/dist/cjs/wkt/timestamp.js +58 -0
  115. package/dist/cjs/wkt/wrappers.d.ts +15 -0
  116. package/dist/cjs/wkt/wrappers.js +43 -0
  117. package/dist/esm/clone.d.ts +6 -0
  118. package/dist/esm/clone.js +73 -0
  119. package/dist/esm/codegenv1/boot.d.ts +63 -0
  120. package/dist/esm/codegenv1/boot.js +97 -0
  121. package/dist/esm/codegenv1/embed.d.ts +43 -0
  122. package/dist/esm/codegenv1/embed.js +232 -0
  123. package/dist/esm/codegenv1/enum.d.ts +17 -0
  124. package/dist/esm/codegenv1/enum.js +36 -0
  125. package/dist/esm/codegenv1/extension.d.ts +9 -0
  126. package/dist/esm/codegenv1/extension.js +25 -0
  127. package/dist/esm/codegenv1/file.d.ts +7 -0
  128. package/dist/esm/codegenv1/file.js +34 -0
  129. package/dist/esm/codegenv1/index.d.ts +9 -0
  130. package/dist/esm/codegenv1/index.js +22 -0
  131. package/dist/esm/codegenv1/message.d.ts +9 -0
  132. package/dist/esm/codegenv1/message.js +21 -0
  133. package/dist/esm/codegenv1/restore-json-names.d.ts +5 -0
  134. package/dist/esm/codegenv1/restore-json-names.js +26 -0
  135. package/dist/esm/codegenv1/service.d.ts +8 -0
  136. package/dist/esm/codegenv1/service.js +24 -0
  137. package/dist/esm/codegenv1/symbols.d.ts +125 -0
  138. package/dist/esm/codegenv1/symbols.js +64 -0
  139. package/dist/esm/codegenv1/types.d.ts +72 -0
  140. package/dist/esm/{field-list.js → codegenv1/types.js} +6 -0
  141. package/dist/esm/create.d.ts +9 -0
  142. package/dist/esm/create.js +228 -0
  143. package/dist/{cjs/descriptor-set.d.ts → esm/desc-types.d.ts} +162 -243
  144. package/dist/esm/equals.d.ts +9 -0
  145. package/dist/esm/equals.js +129 -0
  146. package/dist/esm/extensions.d.ts +59 -0
  147. package/dist/esm/extensions.js +159 -0
  148. package/dist/esm/fields.d.ts +23 -0
  149. package/dist/esm/fields.js +41 -0
  150. package/dist/esm/from-binary.d.ts +34 -0
  151. package/dist/esm/from-binary.js +205 -0
  152. package/dist/esm/from-json.d.ts +48 -0
  153. package/dist/esm/from-json.js +603 -0
  154. package/dist/esm/index.d.ts +16 -42
  155. package/dist/esm/index.js +13 -30
  156. package/dist/esm/is-message.d.ts +5 -20
  157. package/dist/esm/is-message.js +11 -29
  158. package/dist/esm/json-value.d.ts +16 -0
  159. package/dist/esm/proto-int64.js +2 -2
  160. package/dist/esm/reflect/error.d.ts +9 -0
  161. package/dist/esm/reflect/error.js +31 -0
  162. package/dist/esm/reflect/guard.d.ts +20 -0
  163. package/dist/esm/reflect/guard.js +70 -0
  164. package/dist/esm/reflect/index.d.ts +8 -0
  165. package/dist/esm/reflect/index.js +21 -0
  166. package/dist/esm/reflect/names.d.ts +11 -0
  167. package/dist/esm/reflect/names.js +69 -0
  168. package/dist/esm/reflect/nested-types.d.ts +12 -0
  169. package/dist/esm/reflect/nested-types.js +66 -0
  170. package/dist/esm/reflect/reflect-check.d.ts +10 -0
  171. package/dist/esm/reflect/reflect-check.js +143 -0
  172. package/dist/esm/reflect/reflect-types.d.ts +284 -0
  173. package/dist/esm/reflect/reflect-types.js +15 -0
  174. package/dist/esm/reflect/reflect.d.ts +32 -0
  175. package/dist/esm/reflect/reflect.js +428 -0
  176. package/dist/esm/reflect/registry.d.ts +82 -0
  177. package/dist/esm/reflect/registry.js +874 -0
  178. package/dist/{cjs → esm/reflect}/scalar.d.ts +21 -1
  179. package/dist/esm/reflect/scalar.js +289 -0
  180. package/dist/esm/reflect/unsafe.d.ts +58 -0
  181. package/dist/esm/reflect/unsafe.js +155 -0
  182. package/dist/esm/to-binary.d.ts +24 -0
  183. package/dist/esm/to-binary.js +187 -0
  184. package/dist/esm/to-json.d.ts +50 -0
  185. package/dist/esm/to-json.js +359 -0
  186. package/dist/esm/types.d.ts +68 -0
  187. package/dist/esm/wire/base64-encoding.d.ts +23 -0
  188. package/dist/esm/wire/base64-encoding.js +151 -0
  189. package/dist/esm/wire/binary-encoding.d.ts +244 -0
  190. package/dist/esm/{binary-encoding.js → wire/binary-encoding.js} +27 -20
  191. package/dist/esm/wire/index.d.ts +5 -0
  192. package/dist/esm/wire/index.js +18 -0
  193. package/dist/esm/wire/size-delimited.d.ts +51 -0
  194. package/dist/esm/wire/size-delimited.js +148 -0
  195. package/dist/esm/wire/text-encoding.d.ts +26 -0
  196. package/dist/esm/wire/text-encoding.js +50 -0
  197. package/dist/esm/wire/text-format.d.ts +14 -0
  198. package/dist/esm/{private → wire}/text-format.js +12 -2
  199. package/dist/{cjs/google → esm/wire}/varint.d.ts +2 -2
  200. package/dist/esm/{google → wire}/varint.js +11 -10
  201. package/dist/esm/wkt/any.d.ts +38 -0
  202. package/dist/esm/wkt/any.js +69 -0
  203. package/dist/{cjs → esm/wkt/gen}/google/protobuf/any_pb.d.ts +13 -27
  204. package/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
  205. package/dist/esm/{google → wkt/gen/google}/protobuf/api_pb.d.ts +29 -38
  206. package/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
  207. package/dist/esm/{google → wkt/gen/google}/protobuf/compiler/plugin_pb.d.ts +67 -75
  208. package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
  209. package/dist/esm/{google → wkt/gen/google}/protobuf/descriptor_pb.d.ts +564 -527
  210. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +790 -0
  211. package/dist/esm/{google → wkt/gen/google}/protobuf/duration_pb.d.ts +13 -18
  212. package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
  213. package/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +24 -0
  214. package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
  215. package/dist/{cjs → esm/wkt/gen}/google/protobuf/field_mask_pb.d.ts +13 -18
  216. package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
  217. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +26 -0
  218. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
  219. package/dist/{cjs → esm/wkt/gen}/google/protobuf/struct_pb.d.ts +44 -55
  220. package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
  221. package/dist/esm/{google → wkt/gen/google}/protobuf/timestamp_pb.d.ts +13 -21
  222. package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
  223. package/dist/{cjs → esm/wkt/gen}/google/protobuf/type_pb.d.ts +77 -80
  224. package/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
  225. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +186 -0
  226. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
  227. package/dist/esm/wkt/index.d.ts +15 -0
  228. package/dist/esm/wkt/index.js +28 -0
  229. package/dist/esm/wkt/timestamp.d.ts +21 -0
  230. package/dist/esm/wkt/timestamp.js +50 -0
  231. package/dist/esm/wkt/wrappers.d.ts +15 -0
  232. package/dist/esm/wkt/wrappers.js +38 -0
  233. package/package.json +37 -5
  234. package/dist/cjs/binary-encoding.d.ts +0 -420
  235. package/dist/cjs/binary-format.d.ts +0 -113
  236. package/dist/cjs/codegen-info.d.ts +0 -33
  237. package/dist/cjs/codegen-info.js +0 -69
  238. package/dist/cjs/create-descriptor-set.d.ts +0 -36
  239. package/dist/cjs/create-descriptor-set.js +0 -910
  240. package/dist/cjs/create-registry-from-desc.d.ts +0 -15
  241. package/dist/cjs/create-registry-from-desc.js +0 -264
  242. package/dist/cjs/create-registry.d.ts +0 -9
  243. package/dist/cjs/create-registry.js +0 -94
  244. package/dist/cjs/enum.d.ts +0 -35
  245. package/dist/cjs/extension-accessor.d.ts +0 -35
  246. package/dist/cjs/extension-accessor.js +0 -114
  247. package/dist/cjs/extension.d.ts +0 -24
  248. package/dist/cjs/field-list.d.ts +0 -27
  249. package/dist/cjs/field-list.js +0 -15
  250. package/dist/cjs/field.d.ts +0 -314
  251. package/dist/cjs/field.js +0 -15
  252. package/dist/cjs/google/protobuf/any_pb.js +0 -273
  253. package/dist/cjs/google/protobuf/api_pb.js +0 -316
  254. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +0 -219
  255. package/dist/cjs/google/protobuf/descriptor_pb.js +0 -2034
  256. package/dist/cjs/google/protobuf/duration_pb.js +0 -169
  257. package/dist/cjs/google/protobuf/empty_pb.d.ts +0 -28
  258. package/dist/cjs/google/protobuf/empty_pb.js +0 -52
  259. package/dist/cjs/google/protobuf/field_mask_pb.js +0 -311
  260. package/dist/cjs/google/protobuf/source_context_pb.d.ts +0 -29
  261. package/dist/cjs/google/protobuf/source_context_pb.js +0 -55
  262. package/dist/cjs/google/protobuf/struct_pb.js +0 -240
  263. package/dist/cjs/google/protobuf/timestamp_pb.js +0 -213
  264. package/dist/cjs/google/protobuf/type_pb.js +0 -562
  265. package/dist/cjs/google/protobuf/wrappers_pb.d.ts +0 -267
  266. package/dist/cjs/google/protobuf/wrappers_pb.js +0 -569
  267. package/dist/cjs/json-format.d.ts +0 -111
  268. package/dist/cjs/json-format.js +0 -15
  269. package/dist/cjs/message-type.d.ts +0 -51
  270. package/dist/cjs/message-type.js +0 -15
  271. package/dist/cjs/message.d.ts +0 -131
  272. package/dist/cjs/message.js +0 -129
  273. package/dist/cjs/private/binary-format.d.ts +0 -7
  274. package/dist/cjs/private/binary-format.js +0 -430
  275. package/dist/cjs/private/enum.d.ts +0 -27
  276. package/dist/cjs/private/enum.js +0 -94
  277. package/dist/cjs/private/extensions.d.ts +0 -34
  278. package/dist/cjs/private/extensions.js +0 -86
  279. package/dist/cjs/private/feature-set.d.ts +0 -19
  280. package/dist/cjs/private/feature-set.js +0 -106
  281. package/dist/cjs/private/field-list.d.ts +0 -18
  282. package/dist/cjs/private/field-list.js +0 -76
  283. package/dist/cjs/private/field-normalize.d.ts +0 -9
  284. package/dist/cjs/private/field-normalize.js +0 -69
  285. package/dist/cjs/private/field-wrapper.d.ts +0 -25
  286. package/dist/cjs/private/field-wrapper.js +0 -57
  287. package/dist/cjs/private/field.d.ts +0 -16
  288. package/dist/cjs/private/field.js +0 -45
  289. package/dist/cjs/private/json-format.d.ts +0 -2
  290. package/dist/cjs/private/json-format.js +0 -626
  291. package/dist/cjs/private/message-type.d.ts +0 -18
  292. package/dist/cjs/private/message-type.js +0 -50
  293. package/dist/cjs/private/names.d.ts +0 -43
  294. package/dist/cjs/private/names.js +0 -278
  295. package/dist/cjs/private/options-map.d.ts +0 -7
  296. package/dist/cjs/private/options-map.js +0 -15
  297. package/dist/cjs/private/proto-runtime.d.ts +0 -53
  298. package/dist/cjs/private/proto-runtime.js +0 -41
  299. package/dist/cjs/private/reflect.d.ts +0 -9
  300. package/dist/cjs/private/reflect.js +0 -79
  301. package/dist/cjs/private/reify-wkt.d.ts +0 -102
  302. package/dist/cjs/private/reify-wkt.js +0 -172
  303. package/dist/cjs/private/scalars.d.ts +0 -18
  304. package/dist/cjs/private/scalars.js +0 -105
  305. package/dist/cjs/private/text-format.d.ts +0 -4
  306. package/dist/cjs/private/util-common.d.ts +0 -2
  307. package/dist/cjs/private/util-common.js +0 -237
  308. package/dist/cjs/private/util.d.ts +0 -38
  309. package/dist/cjs/private/util.js +0 -15
  310. package/dist/cjs/proto-base64.d.ts +0 -18
  311. package/dist/cjs/proto-base64.js +0 -128
  312. package/dist/cjs/proto-delimited.d.ts +0 -54
  313. package/dist/cjs/proto-delimited.js +0 -155
  314. package/dist/cjs/proto-double.d.ts +0 -5
  315. package/dist/cjs/proto-double.js +0 -29
  316. package/dist/cjs/proto2.d.ts +0 -4
  317. package/dist/cjs/proto2.js +0 -53
  318. package/dist/cjs/proto3.d.ts +0 -4
  319. package/dist/cjs/proto3.js +0 -56
  320. package/dist/cjs/scalar.js +0 -81
  321. package/dist/cjs/service-type.d.ts +0 -96
  322. package/dist/cjs/service-type.js +0 -53
  323. package/dist/cjs/to-plain-message.d.ts +0 -12
  324. package/dist/cjs/to-plain-message.js +0 -72
  325. package/dist/cjs/type-registry.d.ts +0 -57
  326. package/dist/cjs/type-registry.js +0 -15
  327. package/dist/esm/binary-encoding.d.ts +0 -420
  328. package/dist/esm/binary-format.d.ts +0 -113
  329. package/dist/esm/codegen-info.d.ts +0 -33
  330. package/dist/esm/codegen-info.js +0 -67
  331. package/dist/esm/create-descriptor-set.d.ts +0 -36
  332. package/dist/esm/create-descriptor-set.js +0 -906
  333. package/dist/esm/create-registry-from-desc.d.ts +0 -15
  334. package/dist/esm/create-registry-from-desc.js +0 -261
  335. package/dist/esm/create-registry.d.ts +0 -9
  336. package/dist/esm/create-registry.js +0 -90
  337. package/dist/esm/descriptor-set.js +0 -14
  338. package/dist/esm/enum.d.ts +0 -35
  339. package/dist/esm/extension-accessor.d.ts +0 -35
  340. package/dist/esm/extension-accessor.js +0 -107
  341. package/dist/esm/extension.d.ts +0 -24
  342. package/dist/esm/field-list.d.ts +0 -27
  343. package/dist/esm/field.d.ts +0 -314
  344. package/dist/esm/field.js +0 -14
  345. package/dist/esm/google/protobuf/any_pb.js +0 -269
  346. package/dist/esm/google/protobuf/api_pb.js +0 -310
  347. package/dist/esm/google/protobuf/compiler/plugin_pb.js +0 -212
  348. package/dist/esm/google/protobuf/descriptor_pb.js +0 -1999
  349. package/dist/esm/google/protobuf/duration_pb.js +0 -165
  350. package/dist/esm/google/protobuf/empty_pb.d.ts +0 -28
  351. package/dist/esm/google/protobuf/empty_pb.js +0 -48
  352. package/dist/esm/google/protobuf/field_mask_pb.js +0 -307
  353. package/dist/esm/google/protobuf/source_context_pb.d.ts +0 -29
  354. package/dist/esm/google/protobuf/source_context_pb.js +0 -51
  355. package/dist/esm/google/protobuf/struct_pb.js +0 -234
  356. package/dist/esm/google/protobuf/timestamp_pb.js +0 -209
  357. package/dist/esm/google/protobuf/type_pb.js +0 -554
  358. package/dist/esm/google/protobuf/wrappers_pb.d.ts +0 -267
  359. package/dist/esm/google/protobuf/wrappers_pb.js +0 -557
  360. package/dist/esm/json-format.d.ts +0 -111
  361. package/dist/esm/json-format.js +0 -14
  362. package/dist/esm/message-type.d.ts +0 -51
  363. package/dist/esm/message-type.js +0 -14
  364. package/dist/esm/message.d.ts +0 -131
  365. package/dist/esm/message.js +0 -125
  366. package/dist/esm/private/binary-format.d.ts +0 -7
  367. package/dist/esm/private/binary-format.js +0 -426
  368. package/dist/esm/private/enum.d.ts +0 -27
  369. package/dist/esm/private/enum.js +0 -87
  370. package/dist/esm/private/extensions.d.ts +0 -34
  371. package/dist/esm/private/extensions.js +0 -81
  372. package/dist/esm/private/feature-set.d.ts +0 -19
  373. package/dist/esm/private/feature-set.js +0 -102
  374. package/dist/esm/private/field-list.d.ts +0 -18
  375. package/dist/esm/private/field-list.js +0 -72
  376. package/dist/esm/private/field-normalize.d.ts +0 -9
  377. package/dist/esm/private/field-normalize.js +0 -65
  378. package/dist/esm/private/field-wrapper.d.ts +0 -25
  379. package/dist/esm/private/field-wrapper.js +0 -53
  380. package/dist/esm/private/field.d.ts +0 -16
  381. package/dist/esm/private/field.js +0 -41
  382. package/dist/esm/private/json-format.d.ts +0 -2
  383. package/dist/esm/private/json-format.js +0 -623
  384. package/dist/esm/private/message-type.d.ts +0 -18
  385. package/dist/esm/private/message-type.js +0 -46
  386. package/dist/esm/private/names.d.ts +0 -43
  387. package/dist/esm/private/names.js +0 -269
  388. package/dist/esm/private/options-map.d.ts +0 -7
  389. package/dist/esm/private/options-map.js +0 -14
  390. package/dist/esm/private/proto-runtime.d.ts +0 -53
  391. package/dist/esm/private/proto-runtime.js +0 -37
  392. package/dist/esm/private/reflect.d.ts +0 -9
  393. package/dist/esm/private/reflect.js +0 -74
  394. package/dist/esm/private/reify-wkt.d.ts +0 -102
  395. package/dist/esm/private/reify-wkt.js +0 -168
  396. package/dist/esm/private/scalars.d.ts +0 -18
  397. package/dist/esm/private/scalars.js +0 -99
  398. package/dist/esm/private/text-format.d.ts +0 -4
  399. package/dist/esm/private/util-common.d.ts +0 -2
  400. package/dist/esm/private/util-common.js +0 -234
  401. package/dist/esm/private/util.d.ts +0 -38
  402. package/dist/esm/private/util.js +0 -14
  403. package/dist/esm/proto-base64.d.ts +0 -18
  404. package/dist/esm/proto-base64.js +0 -125
  405. package/dist/esm/proto-delimited.d.ts +0 -54
  406. package/dist/esm/proto-delimited.js +0 -152
  407. package/dist/esm/proto-double.d.ts +0 -5
  408. package/dist/esm/proto-double.js +0 -26
  409. package/dist/esm/proto2.d.ts +0 -4
  410. package/dist/esm/proto2.js +0 -50
  411. package/dist/esm/proto3.d.ts +0 -4
  412. package/dist/esm/proto3.js +0 -53
  413. package/dist/esm/scalar.js +0 -78
  414. package/dist/esm/service-type.d.ts +0 -96
  415. package/dist/esm/service-type.js +0 -50
  416. package/dist/esm/to-plain-message.d.ts +0 -12
  417. package/dist/esm/to-plain-message.js +0 -70
  418. package/dist/esm/type-registry.d.ts +0 -57
  419. package/dist/esm/type-registry.js +0 -14
  420. /package/dist/cjs/{binary-format.js → desc-types.js} +0 -0
  421. /package/dist/cjs/{descriptor-set.js → json-value.js} +0 -0
  422. /package/dist/cjs/{private → reflect}/assert.d.ts +0 -0
  423. /package/dist/cjs/{private → reflect}/assert.js +0 -0
  424. /package/dist/cjs/{enum.js → types.js} +0 -0
  425. /package/dist/esm/{binary-format.js → desc-types.js} +0 -0
  426. /package/dist/esm/{enum.js → json-value.js} +0 -0
  427. /package/dist/esm/{private → reflect}/assert.d.ts +0 -0
  428. /package/dist/esm/{private → reflect}/assert.js +0 -0
  429. /package/dist/esm/{extension.js → types.js} +0 -0
@@ -1,557 +0,0 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- import { Message } from "../../message.js";
15
- import { proto3 } from "../../proto3.js";
16
- import { ScalarType } from "../../scalar.js";
17
- import { protoInt64 } from "../../proto-int64.js";
18
- /**
19
- * Wrapper message for `double`.
20
- *
21
- * The JSON representation for `DoubleValue` is JSON number.
22
- *
23
- * @generated from message google.protobuf.DoubleValue
24
- */
25
- export class DoubleValue extends Message {
26
- constructor(data) {
27
- super();
28
- /**
29
- * The double value.
30
- *
31
- * @generated from field: double value = 1;
32
- */
33
- this.value = 0;
34
- proto3.util.initPartial(data, this);
35
- }
36
- toJson(options) {
37
- return proto3.json.writeScalar(ScalarType.DOUBLE, this.value, true);
38
- }
39
- fromJson(json, options) {
40
- try {
41
- this.value = proto3.json.readScalar(ScalarType.DOUBLE, json);
42
- }
43
- catch (e) {
44
- let m = `cannot decode message google.protobuf.DoubleValue from JSON"`;
45
- if (e instanceof Error && e.message.length > 0) {
46
- m += `: ${e.message}`;
47
- }
48
- throw new Error(m);
49
- }
50
- return this;
51
- }
52
- static fromBinary(bytes, options) {
53
- return new DoubleValue().fromBinary(bytes, options);
54
- }
55
- static fromJson(jsonValue, options) {
56
- return new DoubleValue().fromJson(jsonValue, options);
57
- }
58
- static fromJsonString(jsonString, options) {
59
- return new DoubleValue().fromJsonString(jsonString, options);
60
- }
61
- static equals(a, b) {
62
- return proto3.util.equals(DoubleValue, a, b);
63
- }
64
- }
65
- DoubleValue.runtime = proto3;
66
- DoubleValue.typeName = "google.protobuf.DoubleValue";
67
- DoubleValue.fields = proto3.util.newFieldList(() => [
68
- { no: 1, name: "value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
69
- ]);
70
- DoubleValue.fieldWrapper = {
71
- wrapField(value) {
72
- return new DoubleValue({ value });
73
- },
74
- unwrapField(value) {
75
- return value.value;
76
- }
77
- };
78
- /**
79
- * Wrapper message for `float`.
80
- *
81
- * The JSON representation for `FloatValue` is JSON number.
82
- *
83
- * @generated from message google.protobuf.FloatValue
84
- */
85
- export class FloatValue extends Message {
86
- constructor(data) {
87
- super();
88
- /**
89
- * The float value.
90
- *
91
- * @generated from field: float value = 1;
92
- */
93
- this.value = 0;
94
- proto3.util.initPartial(data, this);
95
- }
96
- toJson(options) {
97
- return proto3.json.writeScalar(ScalarType.FLOAT, this.value, true);
98
- }
99
- fromJson(json, options) {
100
- try {
101
- this.value = proto3.json.readScalar(ScalarType.FLOAT, json);
102
- }
103
- catch (e) {
104
- let m = `cannot decode message google.protobuf.FloatValue from JSON"`;
105
- if (e instanceof Error && e.message.length > 0) {
106
- m += `: ${e.message}`;
107
- }
108
- throw new Error(m);
109
- }
110
- return this;
111
- }
112
- static fromBinary(bytes, options) {
113
- return new FloatValue().fromBinary(bytes, options);
114
- }
115
- static fromJson(jsonValue, options) {
116
- return new FloatValue().fromJson(jsonValue, options);
117
- }
118
- static fromJsonString(jsonString, options) {
119
- return new FloatValue().fromJsonString(jsonString, options);
120
- }
121
- static equals(a, b) {
122
- return proto3.util.equals(FloatValue, a, b);
123
- }
124
- }
125
- FloatValue.runtime = proto3;
126
- FloatValue.typeName = "google.protobuf.FloatValue";
127
- FloatValue.fields = proto3.util.newFieldList(() => [
128
- { no: 1, name: "value", kind: "scalar", T: 2 /* ScalarType.FLOAT */ },
129
- ]);
130
- FloatValue.fieldWrapper = {
131
- wrapField(value) {
132
- return new FloatValue({ value });
133
- },
134
- unwrapField(value) {
135
- return value.value;
136
- }
137
- };
138
- /**
139
- * Wrapper message for `int64`.
140
- *
141
- * The JSON representation for `Int64Value` is JSON string.
142
- *
143
- * @generated from message google.protobuf.Int64Value
144
- */
145
- export class Int64Value extends Message {
146
- constructor(data) {
147
- super();
148
- /**
149
- * The int64 value.
150
- *
151
- * @generated from field: int64 value = 1;
152
- */
153
- this.value = protoInt64.zero;
154
- proto3.util.initPartial(data, this);
155
- }
156
- toJson(options) {
157
- return proto3.json.writeScalar(ScalarType.INT64, this.value, true);
158
- }
159
- fromJson(json, options) {
160
- try {
161
- this.value = proto3.json.readScalar(ScalarType.INT64, json);
162
- }
163
- catch (e) {
164
- let m = `cannot decode message google.protobuf.Int64Value from JSON"`;
165
- if (e instanceof Error && e.message.length > 0) {
166
- m += `: ${e.message}`;
167
- }
168
- throw new Error(m);
169
- }
170
- return this;
171
- }
172
- static fromBinary(bytes, options) {
173
- return new Int64Value().fromBinary(bytes, options);
174
- }
175
- static fromJson(jsonValue, options) {
176
- return new Int64Value().fromJson(jsonValue, options);
177
- }
178
- static fromJsonString(jsonString, options) {
179
- return new Int64Value().fromJsonString(jsonString, options);
180
- }
181
- static equals(a, b) {
182
- return proto3.util.equals(Int64Value, a, b);
183
- }
184
- }
185
- Int64Value.runtime = proto3;
186
- Int64Value.typeName = "google.protobuf.Int64Value";
187
- Int64Value.fields = proto3.util.newFieldList(() => [
188
- { no: 1, name: "value", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
189
- ]);
190
- Int64Value.fieldWrapper = {
191
- wrapField(value) {
192
- return new Int64Value({ value });
193
- },
194
- unwrapField(value) {
195
- return value.value;
196
- }
197
- };
198
- /**
199
- * Wrapper message for `uint64`.
200
- *
201
- * The JSON representation for `UInt64Value` is JSON string.
202
- *
203
- * @generated from message google.protobuf.UInt64Value
204
- */
205
- export class UInt64Value extends Message {
206
- constructor(data) {
207
- super();
208
- /**
209
- * The uint64 value.
210
- *
211
- * @generated from field: uint64 value = 1;
212
- */
213
- this.value = protoInt64.zero;
214
- proto3.util.initPartial(data, this);
215
- }
216
- toJson(options) {
217
- return proto3.json.writeScalar(ScalarType.UINT64, this.value, true);
218
- }
219
- fromJson(json, options) {
220
- try {
221
- this.value = proto3.json.readScalar(ScalarType.UINT64, json);
222
- }
223
- catch (e) {
224
- let m = `cannot decode message google.protobuf.UInt64Value from JSON"`;
225
- if (e instanceof Error && e.message.length > 0) {
226
- m += `: ${e.message}`;
227
- }
228
- throw new Error(m);
229
- }
230
- return this;
231
- }
232
- static fromBinary(bytes, options) {
233
- return new UInt64Value().fromBinary(bytes, options);
234
- }
235
- static fromJson(jsonValue, options) {
236
- return new UInt64Value().fromJson(jsonValue, options);
237
- }
238
- static fromJsonString(jsonString, options) {
239
- return new UInt64Value().fromJsonString(jsonString, options);
240
- }
241
- static equals(a, b) {
242
- return proto3.util.equals(UInt64Value, a, b);
243
- }
244
- }
245
- UInt64Value.runtime = proto3;
246
- UInt64Value.typeName = "google.protobuf.UInt64Value";
247
- UInt64Value.fields = proto3.util.newFieldList(() => [
248
- { no: 1, name: "value", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
249
- ]);
250
- UInt64Value.fieldWrapper = {
251
- wrapField(value) {
252
- return new UInt64Value({ value });
253
- },
254
- unwrapField(value) {
255
- return value.value;
256
- }
257
- };
258
- /**
259
- * Wrapper message for `int32`.
260
- *
261
- * The JSON representation for `Int32Value` is JSON number.
262
- *
263
- * @generated from message google.protobuf.Int32Value
264
- */
265
- export class Int32Value extends Message {
266
- constructor(data) {
267
- super();
268
- /**
269
- * The int32 value.
270
- *
271
- * @generated from field: int32 value = 1;
272
- */
273
- this.value = 0;
274
- proto3.util.initPartial(data, this);
275
- }
276
- toJson(options) {
277
- return proto3.json.writeScalar(ScalarType.INT32, this.value, true);
278
- }
279
- fromJson(json, options) {
280
- try {
281
- this.value = proto3.json.readScalar(ScalarType.INT32, json);
282
- }
283
- catch (e) {
284
- let m = `cannot decode message google.protobuf.Int32Value from JSON"`;
285
- if (e instanceof Error && e.message.length > 0) {
286
- m += `: ${e.message}`;
287
- }
288
- throw new Error(m);
289
- }
290
- return this;
291
- }
292
- static fromBinary(bytes, options) {
293
- return new Int32Value().fromBinary(bytes, options);
294
- }
295
- static fromJson(jsonValue, options) {
296
- return new Int32Value().fromJson(jsonValue, options);
297
- }
298
- static fromJsonString(jsonString, options) {
299
- return new Int32Value().fromJsonString(jsonString, options);
300
- }
301
- static equals(a, b) {
302
- return proto3.util.equals(Int32Value, a, b);
303
- }
304
- }
305
- Int32Value.runtime = proto3;
306
- Int32Value.typeName = "google.protobuf.Int32Value";
307
- Int32Value.fields = proto3.util.newFieldList(() => [
308
- { no: 1, name: "value", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
309
- ]);
310
- Int32Value.fieldWrapper = {
311
- wrapField(value) {
312
- return new Int32Value({ value });
313
- },
314
- unwrapField(value) {
315
- return value.value;
316
- }
317
- };
318
- /**
319
- * Wrapper message for `uint32`.
320
- *
321
- * The JSON representation for `UInt32Value` is JSON number.
322
- *
323
- * @generated from message google.protobuf.UInt32Value
324
- */
325
- export class UInt32Value extends Message {
326
- constructor(data) {
327
- super();
328
- /**
329
- * The uint32 value.
330
- *
331
- * @generated from field: uint32 value = 1;
332
- */
333
- this.value = 0;
334
- proto3.util.initPartial(data, this);
335
- }
336
- toJson(options) {
337
- return proto3.json.writeScalar(ScalarType.UINT32, this.value, true);
338
- }
339
- fromJson(json, options) {
340
- try {
341
- this.value = proto3.json.readScalar(ScalarType.UINT32, json);
342
- }
343
- catch (e) {
344
- let m = `cannot decode message google.protobuf.UInt32Value from JSON"`;
345
- if (e instanceof Error && e.message.length > 0) {
346
- m += `: ${e.message}`;
347
- }
348
- throw new Error(m);
349
- }
350
- return this;
351
- }
352
- static fromBinary(bytes, options) {
353
- return new UInt32Value().fromBinary(bytes, options);
354
- }
355
- static fromJson(jsonValue, options) {
356
- return new UInt32Value().fromJson(jsonValue, options);
357
- }
358
- static fromJsonString(jsonString, options) {
359
- return new UInt32Value().fromJsonString(jsonString, options);
360
- }
361
- static equals(a, b) {
362
- return proto3.util.equals(UInt32Value, a, b);
363
- }
364
- }
365
- UInt32Value.runtime = proto3;
366
- UInt32Value.typeName = "google.protobuf.UInt32Value";
367
- UInt32Value.fields = proto3.util.newFieldList(() => [
368
- { no: 1, name: "value", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
369
- ]);
370
- UInt32Value.fieldWrapper = {
371
- wrapField(value) {
372
- return new UInt32Value({ value });
373
- },
374
- unwrapField(value) {
375
- return value.value;
376
- }
377
- };
378
- /**
379
- * Wrapper message for `bool`.
380
- *
381
- * The JSON representation for `BoolValue` is JSON `true` and `false`.
382
- *
383
- * @generated from message google.protobuf.BoolValue
384
- */
385
- export class BoolValue extends Message {
386
- constructor(data) {
387
- super();
388
- /**
389
- * The bool value.
390
- *
391
- * @generated from field: bool value = 1;
392
- */
393
- this.value = false;
394
- proto3.util.initPartial(data, this);
395
- }
396
- toJson(options) {
397
- return proto3.json.writeScalar(ScalarType.BOOL, this.value, true);
398
- }
399
- fromJson(json, options) {
400
- try {
401
- this.value = proto3.json.readScalar(ScalarType.BOOL, json);
402
- }
403
- catch (e) {
404
- let m = `cannot decode message google.protobuf.BoolValue from JSON"`;
405
- if (e instanceof Error && e.message.length > 0) {
406
- m += `: ${e.message}`;
407
- }
408
- throw new Error(m);
409
- }
410
- return this;
411
- }
412
- static fromBinary(bytes, options) {
413
- return new BoolValue().fromBinary(bytes, options);
414
- }
415
- static fromJson(jsonValue, options) {
416
- return new BoolValue().fromJson(jsonValue, options);
417
- }
418
- static fromJsonString(jsonString, options) {
419
- return new BoolValue().fromJsonString(jsonString, options);
420
- }
421
- static equals(a, b) {
422
- return proto3.util.equals(BoolValue, a, b);
423
- }
424
- }
425
- BoolValue.runtime = proto3;
426
- BoolValue.typeName = "google.protobuf.BoolValue";
427
- BoolValue.fields = proto3.util.newFieldList(() => [
428
- { no: 1, name: "value", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
429
- ]);
430
- BoolValue.fieldWrapper = {
431
- wrapField(value) {
432
- return new BoolValue({ value });
433
- },
434
- unwrapField(value) {
435
- return value.value;
436
- }
437
- };
438
- /**
439
- * Wrapper message for `string`.
440
- *
441
- * The JSON representation for `StringValue` is JSON string.
442
- *
443
- * @generated from message google.protobuf.StringValue
444
- */
445
- export class StringValue extends Message {
446
- constructor(data) {
447
- super();
448
- /**
449
- * The string value.
450
- *
451
- * @generated from field: string value = 1;
452
- */
453
- this.value = "";
454
- proto3.util.initPartial(data, this);
455
- }
456
- toJson(options) {
457
- return proto3.json.writeScalar(ScalarType.STRING, this.value, true);
458
- }
459
- fromJson(json, options) {
460
- try {
461
- this.value = proto3.json.readScalar(ScalarType.STRING, json);
462
- }
463
- catch (e) {
464
- let m = `cannot decode message google.protobuf.StringValue from JSON"`;
465
- if (e instanceof Error && e.message.length > 0) {
466
- m += `: ${e.message}`;
467
- }
468
- throw new Error(m);
469
- }
470
- return this;
471
- }
472
- static fromBinary(bytes, options) {
473
- return new StringValue().fromBinary(bytes, options);
474
- }
475
- static fromJson(jsonValue, options) {
476
- return new StringValue().fromJson(jsonValue, options);
477
- }
478
- static fromJsonString(jsonString, options) {
479
- return new StringValue().fromJsonString(jsonString, options);
480
- }
481
- static equals(a, b) {
482
- return proto3.util.equals(StringValue, a, b);
483
- }
484
- }
485
- StringValue.runtime = proto3;
486
- StringValue.typeName = "google.protobuf.StringValue";
487
- StringValue.fields = proto3.util.newFieldList(() => [
488
- { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
489
- ]);
490
- StringValue.fieldWrapper = {
491
- wrapField(value) {
492
- return new StringValue({ value });
493
- },
494
- unwrapField(value) {
495
- return value.value;
496
- }
497
- };
498
- /**
499
- * Wrapper message for `bytes`.
500
- *
501
- * The JSON representation for `BytesValue` is JSON string.
502
- *
503
- * @generated from message google.protobuf.BytesValue
504
- */
505
- export class BytesValue extends Message {
506
- constructor(data) {
507
- super();
508
- /**
509
- * The bytes value.
510
- *
511
- * @generated from field: bytes value = 1;
512
- */
513
- this.value = new Uint8Array(0);
514
- proto3.util.initPartial(data, this);
515
- }
516
- toJson(options) {
517
- return proto3.json.writeScalar(ScalarType.BYTES, this.value, true);
518
- }
519
- fromJson(json, options) {
520
- try {
521
- this.value = proto3.json.readScalar(ScalarType.BYTES, json);
522
- }
523
- catch (e) {
524
- let m = `cannot decode message google.protobuf.BytesValue from JSON"`;
525
- if (e instanceof Error && e.message.length > 0) {
526
- m += `: ${e.message}`;
527
- }
528
- throw new Error(m);
529
- }
530
- return this;
531
- }
532
- static fromBinary(bytes, options) {
533
- return new BytesValue().fromBinary(bytes, options);
534
- }
535
- static fromJson(jsonValue, options) {
536
- return new BytesValue().fromJson(jsonValue, options);
537
- }
538
- static fromJsonString(jsonString, options) {
539
- return new BytesValue().fromJsonString(jsonString, options);
540
- }
541
- static equals(a, b) {
542
- return proto3.util.equals(BytesValue, a, b);
543
- }
544
- }
545
- BytesValue.runtime = proto3;
546
- BytesValue.typeName = "google.protobuf.BytesValue";
547
- BytesValue.fields = proto3.util.newFieldList(() => [
548
- { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
549
- ]);
550
- BytesValue.fieldWrapper = {
551
- wrapField(value) {
552
- return new BytesValue({ value });
553
- },
554
- unwrapField(value) {
555
- return value.value;
556
- }
557
- };
@@ -1,111 +0,0 @@
1
- import type { Message } from "./message.js";
2
- import type { MessageType } from "./message-type.js";
3
- import type { ScalarType, LongType } from "./scalar.js";
4
- import type { IExtensionRegistry, IMessageTypeRegistry } from "./type-registry.js";
5
- /**
6
- * JsonFormat is the contract for serializing messages to and from JSON.
7
- * Implementations may be specific to a proto syntax, and can be reflection
8
- * based, or delegate to speed optimized generated code.
9
- */
10
- export interface JsonFormat {
11
- /**
12
- * Provide options for parsing JSON data.
13
- */
14
- makeReadOptions(options?: Partial<JsonReadOptions>): Readonly<JsonReadOptions>;
15
- /**
16
- * Provide options for serializing to JSON.
17
- */
18
- makeWriteOptions(options?: Partial<JsonWriteStringOptions>): Readonly<JsonWriteStringOptions>;
19
- /**
20
- * Parse a message from JSON.
21
- */
22
- readMessage<T extends Message<T>>(type: MessageType<T>, jsonValue: JsonValue, options: JsonReadOptions, message?: T): T;
23
- /**
24
- * Serialize a message to JSON.
25
- */
26
- writeMessage(message: Message, options: JsonWriteOptions): JsonValue;
27
- /**
28
- * Parse a single scalar value from JSON.
29
- *
30
- * This method may throw an error, but it may have a blank error message.
31
- * Callers are expected to provide context.
32
- */
33
- readScalar(type: ScalarType, json: JsonValue, longType?: LongType): any;
34
- /**
35
- * Serialize a single scalar value to JSON.
36
- */
37
- writeScalar(type: ScalarType, value: any, emitDefaultValues: boolean): JsonValue | undefined;
38
- /**
39
- * Returns a short string representation of a JSON value, suitable for error messages.
40
- */
41
- debug(json: JsonValue): string;
42
- }
43
- /**
44
- * Options for parsing JSON data.
45
- */
46
- export interface JsonReadOptions {
47
- /**
48
- * Ignore unknown fields: Proto3 JSON parser should reject unknown fields
49
- * by default. This option ignores unknown fields in parsing, as well as
50
- * unrecognized enum string representations.
51
- */
52
- ignoreUnknownFields: boolean;
53
- /**
54
- * This option is required to read `google.protobuf.Any` and extensions
55
- * from JSON format.
56
- */
57
- typeRegistry?: IMessageTypeRegistry & Partial<IExtensionRegistry>;
58
- }
59
- /**
60
- * Options for serializing to JSON.
61
- */
62
- export interface JsonWriteOptions {
63
- /**
64
- * Emit fields with default values: Fields with default values are omitted
65
- * by default in proto3 JSON output. This option overrides this behavior
66
- * and outputs fields with their default values.
67
- */
68
- emitDefaultValues: boolean;
69
- /**
70
- * Emit enum values as integers instead of strings: The name of an enum
71
- * value is used by default in JSON output. An option may be provided to
72
- * use the numeric value of the enum value instead.
73
- */
74
- enumAsInteger: boolean;
75
- /**
76
- * Use proto field name instead of lowerCamelCase name: By default proto3
77
- * JSON printer should convert the field name to lowerCamelCase and use
78
- * that as the JSON name. An implementation may provide an option to use
79
- * proto field name as the JSON name instead. Proto3 JSON parsers are
80
- * required to accept both the converted lowerCamelCase name and the proto
81
- * field name.
82
- */
83
- useProtoFieldName: boolean;
84
- /**
85
- * This option is required to write `google.protobuf.Any` and extensions
86
- * to JSON format.
87
- */
88
- typeRegistry?: IMessageTypeRegistry & Partial<IExtensionRegistry>;
89
- }
90
- /**
91
- * Options for serializing to JSON.
92
- */
93
- export interface JsonWriteStringOptions extends JsonWriteOptions {
94
- prettySpaces: number;
95
- }
96
- /**
97
- * Represents any possible JSON value:
98
- * - number
99
- * - string
100
- * - boolean
101
- * - null
102
- * - object (with any JSON value as property)
103
- * - array (with any JSON value as element)
104
- */
105
- export type JsonValue = number | string | boolean | null | JsonObject | JsonValue[];
106
- /**
107
- * Represents a JSON object.
108
- */
109
- export type JsonObject = {
110
- [k: string]: JsonValue;
111
- };
@@ -1,14 +0,0 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- export {};