from typing import TypeVar, Optional, Generic

T = TypeVar("T")

class Moka(Generic[T]):
    def __init__(self, ttl: Optional[float] = None, tti: Optional[float] = None): ...
    def insert(self, key: str, value: T) -> None: ...
    def get(self, key: str) -> Optional[T]: ...
    def invalidate(self, key: str) -> None: ...
    def clear(self) -> None: ...
    def count(self) -> int: ...
