1 from typing import Generic, List, Text, Tuple, TypeVar
3 from google.protobuf.descriptor import EnumDescriptor
5 _V = TypeVar("_V", bound=int)
7 # Expose a generic version so that those using mypy-protobuf
8 # can get autogenerated NewType wrapper around the int values
9 class _EnumTypeWrapper(Generic[_V]):
10 DESCRIPTOR: EnumDescriptor
11 def __init__(self, enum_type: EnumDescriptor) -> None: ...
12 def Name(self, number: _V) -> str: ...
13 def Value(self, name: Text | bytes) -> _V: ...
14 def keys(self) -> List[str]: ...
15 def values(self) -> List[_V]: ...
16 def items(self) -> List[Tuple[str, _V]]: ...
18 class EnumTypeWrapper(_EnumTypeWrapper[int]): ...