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

import tornado.web
from typing import TYPE_CHECKING
from collections.abc import Sequence

if TYPE_CHECKING:
    ...
def allow_cross_origin_requests() -> bool:
    """True if cross-origin requests are allowed.

    We only allow cross-origin requests when CORS protection has been disabled
    with server.enableCORS=False or if using the Node server. When using the
    Node server, we have a dev and prod port, which count as two origins.

    """
    ...

class StaticFileHandler(tornado.web.StaticFileHandler):
    def initialize(self, path: str, default_filename: str | None = ..., reserved_paths: Sequence[str] = ...): # -> None:
        ...
    
    def set_extra_headers(self, path: str) -> None:
        """Disable cache for HTML files.

        Other assets like JS and CSS are suffixed with their hash, so they can
        be cached indefinitely.
        """
        ...
    
    def validate_absolute_path(self, root: str, absolute_path: str) -> str | None:
        ...
    
    def write_error(self, status_code: int, **kwargs) -> None:
        ...
    


class AddSlashHandler(tornado.web.RequestHandler):
    @tornado.web.addslash
    def get(self): # -> None:
        ...
    


class RemoveSlashHandler(tornado.web.RequestHandler):
    @tornado.web.removeslash
    def get(self): # -> None:
        ...
    


class _SpecialRequestHandler(tornado.web.RequestHandler):
    """Superclass for "special" endpoints, like /healthz."""
    def set_default_headers(self): # -> None:
        ...
    
    def options(self): # -> None:
        """/OPTIONS handler for preflight CORS checks.

        When a browser is making a CORS request, it may sometimes first
        send an OPTIONS request, to check whether the server understands the
        CORS protocol. This is optional, and doesn't happen for every request
        or in every browser. If an OPTIONS request does get sent, and is not
        then handled by the server, the browser will fail the underlying
        request.

        The proper way to handle this is to send a 204 response ("no content")
        with the CORS headers attached. (These headers are automatically added
        to every outgoing response, including OPTIONS responses,
        via set_default_headers().)

        See https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
        """
        ...
    


class HealthHandler(_SpecialRequestHandler):
    def initialize(self, callback): # -> None:
        """Initialize the handler.

        Parameters
        ----------
        callback : callable
            A function that returns True if the server is healthy

        """
        ...
    
    async def get(self): # -> None:
        ...
    
    async def head(self): # -> None:
        ...
    
    async def handle_request(self): # -> None:
        ...
    


_DEFAULT_ALLOWED_MESSAGE_ORIGINS = ...
class HostConfigHandler(_SpecialRequestHandler):
    def initialize(self): # -> None:
        ...
    
    async def get(self) -> None:
        ...
    


