"""
This type stub file was generated by pyright.
"""

from typing import Any, Final, TYPE_CHECKING
from streamlit.errors import MarkdownFormattedException, StreamlitAPIException
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg

"""Runtime-related utility functions."""
if TYPE_CHECKING:
    ...
_LOGGER: Final = ...
class MessageSizeError(MarkdownFormattedException):
    """Exception raised when a websocket message is larger than the configured limit."""
    def __init__(self, failed_msg_str: Any) -> None:
        ...
    


class BadDurationStringError(StreamlitAPIException):
    """Raised when a bad duration argument string is passed."""
    def __init__(self, duration: str) -> None:
        ...
    


def serialize_forward_msg(msg: ForwardMsg) -> bytes:
    """Serialize a ForwardMsg to send to a client.

    If the message is too large, it will be converted to an exception message
    instead.
    """
    ...

_max_message_size_bytes: int | None = ...
def get_max_message_size_bytes() -> int:
    """Returns the max websocket message size in bytes.

    This will lazyload the value from the config and store it in the global symbol table.
    """
    ...

