"""
Shared storage interface protocols.
"""

from __future__ import annotations

from typing import Protocol, Iterable


class BlacklistStore(Protocol):
    def block_ip(self, ip: str, reason: str, extended_request_info: dict | None = None): ...
    def is_blocked(self, ip: str) -> bool: ...
    def unblock_ip(self, ip: str): ...
    def get_all_blocked_ips(self) -> list[str]: ...


class ExemptionStore(Protocol):
    def is_exempted(self, ip: str) -> bool: ...
    def add_exempt(self, ip: str): ...
    def get_all(self) -> Iterable[dict]: ...


class KeywordStore(Protocol):
    def add_keyword(self, kw: str, count: int = 1): ...
    def remove_keyword(self, kw: str): ...
    def get_top_keywords(self, n: int = 10) -> list[str]: ...
