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

from typing import Final, NamedTuple
from streamlit.runtime.media_file_storage import MediaFileKind, MediaFileStorage
from streamlit.runtime.stats import CacheStat, CacheStatsProvider

"""MediaFileStorage implementation that stores files in memory."""
_LOGGER: Final = ...
PREFERRED_MIMETYPE_EXTENSION_MAP: Final = ...
def get_extension_for_mimetype(mimetype: str) -> str:
    ...

class MemoryFile(NamedTuple):
    """A MediaFile stored in memory."""
    content: bytes
    mimetype: str
    kind: MediaFileKind
    filename: str | None
    @property
    def content_size(self) -> int:
        ...
    


class MemoryMediaFileStorage(MediaFileStorage, CacheStatsProvider):
    def __init__(self, media_endpoint: str) -> None:
        """Create a new MemoryMediaFileStorage instance.

        Parameters
        ----------
        media_endpoint
            The name of the local endpoint that media is served from.
            This endpoint should start with a forward-slash (e.g. "/media").
        """
        ...
    
    def load_and_get_id(self, path_or_data: str | bytes, mimetype: str, kind: MediaFileKind, filename: str | None = ...) -> str:
        """Add a file to the manager and return its ID."""
        ...
    
    def get_file(self, filename: str) -> MemoryFile:
        """Return the MemoryFile with the given filename. Filenames are of the
        form "file_id.extension". (Note that this is *not* the optional
        user-specified filename for download files.).

        Raises a MediaFileStorageError if no such file exists.
        """
        ...
    
    def get_url(self, file_id: str) -> str:
        """Get a URL for a given media file. Raise a MediaFileStorageError if
        no such file exists.
        """
        ...
    
    def delete_file(self, file_id: str) -> None:
        """Delete the file with the given ID."""
        ...
    
    def get_stats(self) -> list[CacheStat]:
        ...
    


