from typing import TypeVar

from google.protobuf.any_pb2 import Any
from google.protobuf.descriptor import Descriptor
from google.protobuf.message import Message

_MessageT = TypeVar("_MessageT", bound=Message)

def pack(msg: Message, type_url_prefix: str | None = "type.googleapis.com/", deterministic: bool | None = None) -> Any: ...
def unpack(any_msg: Any, msg: Message) -> bool: ...
def unpack_as(any_msg: Any, message_type: type[_MessageT]) -> _MessageT: ...
def type_name(any_msg: Any) -> str: ...
def is_type(any_msg: Any, des: Descriptor) -> bool: ...
