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

from typing import TYPE_CHECKING
from streamlit.runtime.session_manager import SessionInfo, SessionStorage

if TYPE_CHECKING:
    ...
class MemorySessionStorage(SessionStorage):
    """A SessionStorage that stores sessions in memory.

    At most maxsize sessions are stored with a TTL of ttl seconds. This class is really
    just a thin wrapper around cachetools.TTLCache that complies with the SessionStorage
    protocol.
    """
    def __init__(self, maxsize: int = ..., ttl_seconds: int = ...) -> None:
        """Instantiate a new MemorySessionStorage.

        Parameters
        ----------
        maxsize
            The maximum number of sessions we allow to be stored in this
            MemorySessionStorage. If an entry needs to be removed because we have
            exceeded this number, either
            - an expired entry is removed, or
            - the least recently used entry is removed (if no entries have expired).

        ttl_seconds
            The time in seconds for an entry added to a MemorySessionStorage to live.
            After this amount of time has passed for a given entry, it becomes
            inaccessible and will be removed eventually.
        """
        ...
    
    def get(self, session_id: str) -> SessionInfo | None:
        ...
    
    def save(self, session_info: SessionInfo) -> None:
        ...
    
    def delete(self, session_id: str) -> None:
        ...
    
    def list(self) -> list[SessionInfo]:
        ...
    


