from typing import TypeVar, Optional, Generic

T = TypeVar("T")

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