mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Fix protobuf json_format signatures. (#5226)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict, Text, TypeVar, Union
|
||||
from typing import Any, Dict, Optional, Text, TypeVar, Union
|
||||
|
||||
from google.protobuf.descriptor_pool import DescriptorPool
|
||||
from google.protobuf.message import Message
|
||||
|
||||
_MessageT = TypeVar("_MessageT", bound=Message)
|
||||
@@ -15,12 +16,26 @@ def MessageToJson(
|
||||
indent: int = ...,
|
||||
sort_keys: bool = ...,
|
||||
use_integers_for_enums: bool = ...,
|
||||
descriptor_pool: Optional[DescriptorPool] = ...,
|
||||
float_precision: Optional[int] = ...,
|
||||
) -> str: ...
|
||||
def MessageToDict(
|
||||
message: Message,
|
||||
including_default_value_fields: bool = ...,
|
||||
preserving_proto_field_name: bool = ...,
|
||||
use_integers_for_enums: bool = ...,
|
||||
descriptor_pool: Optional[DescriptorPool] = ...,
|
||||
float_precision: Optional[int] = ...,
|
||||
) -> Dict[Text, Any]: ...
|
||||
def Parse(text: Union[bytes, Text], message: _MessageT, ignore_unknown_fields: bool = ...) -> _MessageT: ...
|
||||
def ParseDict(js_dict: Any, message: _MessageT, ignore_unknown_fields: bool = ...) -> _MessageT: ...
|
||||
def Parse(
|
||||
text: Union[bytes, Text],
|
||||
message: _MessageT,
|
||||
ignore_unknown_fields: bool = ...,
|
||||
descriptor_pool: Optional[DescriptorPool] = ...,
|
||||
) -> _MessageT: ...
|
||||
def ParseDict(
|
||||
js_dict: Any,
|
||||
message: _MessageT,
|
||||
ignore_unknown_fields: bool = ...,
|
||||
descriptor_pool: Optional[DescriptorPool] = ...,
|
||||
) -> _MessageT: ...
|
||||
|
||||
Reference in New Issue
Block a user