from collections.abc import Generator
from typing import Any

from .resource import Collection, Model

class Plugin(Model):
    @property
    def name(self) -> str | None: ...
    @property
    def enabled(self) -> bool | None: ...
    @property
    def settings(self) -> dict[str, Any] | None: ...
    def configure(self, options: dict[str, Any]) -> None: ...
    def disable(self, force: bool = False) -> None: ...
    def enable(self, timeout: int = 0) -> None: ...
    def push(self) -> Generator[dict[str, Any]]: ...
    def remove(self, force: bool = False) -> bool: ...
    def upgrade(self, remote: str | None = None) -> Generator[dict[str, Any]]: ...

class PluginCollection(Collection[Plugin]):
    model: type[Plugin]
    def create(self, name, plugin_data_dir, gzip: bool = False): ...  # type: ignore[override]
    def get(self, name): ...
    def install(self, remote_name, local_name=None): ...
    def list(self): ...
