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

import tornado.web
from typing import Callable, TYPE_CHECKING
from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager

if TYPE_CHECKING:
    ...
class UploadFileRequestHandler(tornado.web.RequestHandler):
    """Implements the POST /upload_file endpoint."""
    def initialize(self, file_mgr: MemoryUploadedFileManager, is_active_session: Callable[[str], bool]): # -> None:
        """
        Parameters
        ----------
        file_mgr : UploadedFileManager
            The server's singleton UploadedFileManager. All file uploads
            go here.
        is_active_session:
            A function that returns true if a session_id belongs to an active
            session.
        """
        ...
    
    def set_default_headers(self): # -> None:
        ...
    
    def options(self, **kwargs): # -> 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
        """
        ...
    
    def put(self, **kwargs): # -> None:
        """Receive an uploaded file and add it to our UploadedFileManager."""
        ...
    
    def delete(self, **kwargs): # -> None:
        """Delete file request handler."""
        ...
    


