from typing import Any, Protocol, Iterable


class BaseAdapter(Protocol):
    """Protocol for parameter adapters."""

    # __init__(base: nn.Module) is required by convention (not enforced by Protocol).
    active_adapter: str | None
    def add_adapter(self, adapter_name: str, cfg: dict | Any, activate: bool = True) -> None: ...
    def delete_adapter(self, adapter_name: str, **kwargs) -> None: ...
    def activate_adapter(self, adapter_name: str) -> None: ...
    def freeze_adapter(self, adapter_names: str | Iterable[str]) -> None: ...
    def unfreeze_adapter(self, adapter_names: str | Iterable[str]) -> None: ...
    def to_config(self) -> dict: ...
    def load_from_meta(self, meta: dict) -> None: ...
