from abc import ABC, abstractmethod from typing import Generic, TypeVar T = TypeVar("T") class CredentialStore(ABC, Generic[T]): @abstractmethod def load(self) -> T | None: ... @abstractmethod def save(self, credentials: T) -> None: ... @abstractmethod def clear(self) -> None: ...