You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #306 (comment) it seems like it should be possible to store and retrieve custom EnumOptions and EnumValueOptions by having the generated code hold onto a reference to the custom options in a WeakMap.
// generated codeimport{registerEnumOptions}from"@protobuf-ts/runtime";exportenumExampleEnum{/** * @generated from protobuf enum value: EXAMPLE = 0; */EXAMPLE=0,};registerEnumOptions(ExampleEnum,{options: {"foo.bar": {"baz_qux": 123,}},valueOptions: {"EXAMPLE": {// Use enum "label" instead of "value" to avoid collisions with `allow_alias`"my.example"{"enum_value_option": true,},},},});
Similar to #306 (comment) it seems like it should be possible to store and retrieve custom
EnumOptions
andEnumValueOptions
by having the generated code hold onto a reference to the custom options in aWeakMap
.This same method could be used to provide access to
OneofOptions
as well:The text was updated successfully, but these errors were encountered: