import typing as t


@t.runtime_checkable
class CacheBackend(t.Protocol):
    async def get(self, key: str) -> t.Any: ...

    async def set(
        self, key: str, value: t.Any, timeout: float | None = None
    ) -> None: ...

    async def delete(self, key: str) -> None: ...

    async def incr(self, key: str, delta: int = 1) -> int: ...

    async def decr(self, key: str, delta: int = 1) -> int: ...

    async def has_key(self, key: str) -> bool: ...

    def make_key(self, key: str) -> str: ...
