diff --git a/stubs/aiocache/__init__.pyi b/stubs/aiocache/__init__.pyi new file mode 100644 index 0000000..b243596 --- /dev/null +++ b/stubs/aiocache/__init__.pyi @@ -0,0 +1 @@ +from .factory import Cache as Cache diff --git a/stubs/aiocache/factory.pyi b/stubs/aiocache/factory.pyi new file mode 100644 index 0000000..e1f7226 --- /dev/null +++ b/stubs/aiocache/factory.pyi @@ -0,0 +1,8 @@ +from typing import Generic, Optional, TypeVar + +T = TypeVar('T') + +class Cache(Generic[T]): + async def add(self, key: str, value: T, ttl: Optional[int]) -> None: ... + async def set(self, key: str, value: T, ttl: Optional[int]) -> None: ... # noqa: A003 + async def get(self, key: str, default: T | None = None) -> T | None: ...