from _typeshed import Incomplete
from typing import Any

class _CommonFile:
    encoding: Any
    return_unicode: Any
    autosave: bool
    @classmethod
    def from_string(cls, data, **kwds): ...
    @classmethod
    def from_path(cls, path, **kwds): ...
    def __init__(
        self,
        path: Incomplete | None = None,
        new: bool = False,
        autoload: bool = True,
        autosave: bool = False,
        encoding: str = "utf-8",
        return_unicode=True,
    ) -> None: ...
    @property
    def path(self): ...
    @path.setter
    def path(self, value) -> None: ...
    @property
    def mtime(self): ...
    def load_if_changed(self): ...
    def load(self, path: Incomplete | None = None, force: bool = True): ...
    def load_string(self, data) -> None: ...
    def save(self, path: Incomplete | None = None) -> None: ...
    def to_string(self): ...

class HtpasswdFile(_CommonFile):
    context: Any
    def __init__(self, path: Incomplete | None = None, default_scheme: Incomplete | None = None, context=..., **kwds) -> None: ...
    def users(self): ...
    def set_password(self, user, password): ...
    def update(self, user, password): ...
    def get_hash(self, user): ...
    def set_hash(self, user, hash): ...
    def find(self, user): ...
    def delete(self, user): ...
    def check_password(self, user, password): ...
    def verify(self, user, password): ...

class HtdigestFile(_CommonFile):
    default_realm: Any
    def __init__(self, path: Incomplete | None = None, default_realm: Incomplete | None = None, **kwds) -> None: ...
    def realms(self): ...
    def users(self, realm: Incomplete | None = None): ...
    def set_password(self, user, realm: Incomplete | None = None, password=...): ...
    def update(self, user, realm, password): ...
    def get_hash(self, user, realm: Incomplete | None = None): ...
    def set_hash(self, user, realm: Incomplete | None = None, hash=...): ...
    def find(self, user, realm): ...
    def delete(self, user, realm: Incomplete | None = None): ...
    def delete_realm(self, realm): ...
    def check_password(self, user, realm: Incomplete | None = None, password=...): ...
    def verify(self, user, realm, password): ...
