mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add more specific types to protobuf
This commit is contained in:
committed by
Łukasz Langa
parent
6a15963e7d
commit
c34f11d569
4
third_party/2/google/protobuf/descriptor.pyi
vendored
4
third_party/2/google/protobuf/descriptor.pyi
vendored
@@ -4,6 +4,8 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .message import Message
|
||||
|
||||
class Error(Exception): ...
|
||||
class TypeTransformationError(Error): ...
|
||||
|
||||
@@ -160,4 +162,4 @@ class FileDescriptor(DescriptorBase):
|
||||
def CopyToProto(self, proto): ...
|
||||
|
||||
def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ...
|
||||
def _ParseOptions(message, string): ...
|
||||
def _ParseOptions(message: Message, string: str) -> Message: ...
|
||||
|
||||
22
third_party/2/google/protobuf/descriptor_pool.pyi
vendored
Normal file
22
third_party/2/google/protobuf/descriptor_pool.pyi
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Stubs for google.protobuf.descriptor_pool (Python 3.5)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
class DescriptorPool:
|
||||
def __new__(cls, descriptor_db: Optional[Any] = ...): ...
|
||||
def __init__(self, descriptor_db: Optional[Any] = ...) -> None: ...
|
||||
def Add(self, file_desc_proto): ...
|
||||
def AddSerializedFile(self, serialized_file_desc_proto): ...
|
||||
def AddDescriptor(self, desc): ...
|
||||
def AddEnumDescriptor(self, enum_desc): ...
|
||||
def AddFileDescriptor(self, file_desc): ...
|
||||
def FindFileByName(self, file_name): ...
|
||||
def FindFileContainingSymbol(self, symbol): ...
|
||||
def FindMessageTypeByName(self, full_name): ...
|
||||
def FindEnumTypeByName(self, full_name): ...
|
||||
def FindFieldByName(self, full_name): ...
|
||||
def FindExtensionByName(self, full_name): ...
|
||||
|
||||
def Default(): ...
|
||||
17
third_party/2/google/protobuf/message_factory.pyi
vendored
Normal file
17
third_party/2/google/protobuf/message_factory.pyi
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Stubs for google.protobuf.message_factory (Python 3.5)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Dict, Iterable, Optional, Type
|
||||
|
||||
from .message import Message
|
||||
from .descriptor import Descriptor
|
||||
from .descriptor_pool import DescriptorPool
|
||||
|
||||
class MessageFactory:
|
||||
pool = ... # type: Any
|
||||
def __init__(self, pool: DescriptorPool=None) -> None: ...
|
||||
def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ...
|
||||
def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ...
|
||||
|
||||
def GetMessages(file_protos: Iterable[str]) -> Dict[str, Type[Message]]: ...
|
||||
18
third_party/2/google/protobuf/symbol_database.pyi
vendored
Normal file
18
third_party/2/google/protobuf/symbol_database.pyi
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# Stubs for google.protobuf.symbol_database
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Dict, Iterable, Type
|
||||
|
||||
from .descriptor import EnumDescriptor, FileDescriptor
|
||||
from .message import Message
|
||||
from .message_factory import MessageFactory
|
||||
|
||||
class SymbolDatabase(MessageFactory):
|
||||
def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ...
|
||||
def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ...
|
||||
def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ...
|
||||
def GetSymbol(self, symbol: str) -> Type[Message]: ...
|
||||
def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ...
|
||||
|
||||
def Default(): ...
|
||||
Reference in New Issue
Block a user