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

from typing import Final, Literal, TYPE_CHECKING
from tornado.web import RequestHandler

"""Server related utility functions."""
if TYPE_CHECKING:
    ...
DEVELOPMENT_PORT: Final = ...
AUTH_COOKIE_NAME: Final = ...
def is_url_from_allowed_origins(url: str) -> bool:
    """Return True if URL is from allowed origins (for CORS purpose).

    Allowed origins:
    1. localhost
    2. The internal and external IP addresses of the machine where this
       function was called from.

    If `server.enableCORS` is False, this allows all origins.
    """
    ...

def get_cookie_secret() -> str:
    """Get the cookie secret.

    If the user has not set a cookie secret, we generate a random one.
    """
    ...

def is_xsrf_enabled(): # -> Any | bool:
    ...

def make_url_path_regex(*path, trailing_slash: Literal["optional", "required", "prohibited"] = ...) -> str:
    """Get a regex of the form ^/foo/bar/baz/?$ for a path (foo, bar, baz)."""
    ...

def get_url(host_ip: str) -> str:
    """Get the URL for any app served at the given host_ip.

    Parameters
    ----------
    host_ip : str
        The IP address of the machine that is running the Streamlit Server.

    Returns
    -------
    str
        The URL.
    """
    ...

def emit_endpoint_deprecation_notice(handler: RequestHandler, new_path: str) -> None:
    """Emits the warning about deprecation of HTTP endpoint in the HTTP header."""
    ...

