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

from streamlit.runtime.caching.storage.cache_storage_protocol import CacheStorage, CacheStorageContext
from streamlit.runtime.stats import CacheStat

_LOGGER = ...
class InMemoryCacheStorageWrapper(CacheStorage):
    """
    In-memory cache storage wrapper.

    This class wraps a cache storage and adds an in-memory cache front layer,
    which is used to reduce the number of calls to the storage.

    The in-memory cache is a TTL cache, which means that the entries are
    automatically removed if a given time to live (TTL) has passed.

    The in-memory cache is also an LRU cache, which means that the entries
    are automatically removed if the cache size exceeds a given maxsize.

    If the storage implements its strategy for maxsize, it is recommended
    (but not necessary) that the storage implement the same LRU strategy,
    otherwise a situation may arise when different items are deleted from
    the memory cache and from the storage.

    Notes
    -----
    Threading: in-memory caching layer is thread safe: we hold self._mem_cache_lock for
    working with this self._mem_cache object.
    However, we do not hold this lock when calling into the underlying storage,
    so it is the responsibility of the that storage to ensure that it is safe to use
    it from multiple threads.
    """
    def __init__(self, persist_storage: CacheStorage, context: CacheStorageContext) -> None:
        ...
    
    @property
    def ttl_seconds(self) -> float:
        ...
    
    @property
    def max_entries(self) -> float:
        ...
    
    def get(self, key: str) -> bytes:
        """
        Returns the stored value for the key or raise CacheStorageKeyNotFoundError if
        the key is not found.
        """
        ...
    
    def set(self, key: str, value: bytes) -> None:
        """Sets the value for a given key."""
        ...
    
    def delete(self, key: str) -> None:
        """Delete a given key."""
        ...
    
    def clear(self) -> None:
        """Delete all keys for the in memory cache, and also the persistent storage."""
        ...
    
    def get_stats(self) -> list[CacheStat]:
        """Returns a list of stats in bytes for the cache memory storage per item."""
        ...
    
    def close(self) -> None:
        """Closes the cache storage."""
        ...
    


