from collections.abc import Generator
from contextlib import contextmanager
from typing import Any

from django.db.models import Model
from wagtail.models.i18n import Locale
from wagtail.models.pages import Page
from wagtail.models.sites import Site

def post_save_site_signal_handler(instance: Site, update_fields: list[str] | None = None, **kwargs: Any) -> None: ...
def post_delete_site_signal_handler(instance: Site, **kwargs: Any) -> None: ...
def pre_delete_page_unpublish(sender: type, instance: Page, **kwargs: Any) -> None: ...
def post_delete_page_log_deletion(sender: type, instance: Page, **kwargs: Any) -> None: ...
def reset_locales_display_names_cache(sender: type, instance: Locale, **kwargs: Any) -> None: ...
@contextmanager
def disable_reference_index_auto_update() -> Generator[None]: ...
def update_reference_index_on_save(instance: Model, **kwargs: Any) -> None: ...
def remove_reference_index_on_delete(instance: Model, **kwargs: Any) -> None: ...
def connect_reference_index_signal_handlers_for_model(model: type[Model]) -> None: ...
def connect_reference_index_signal_handlers(**kwargs: Any) -> None: ...
def disconnect_reference_index_signal_handlers_for_model(model: type[Model]) -> None: ...
def disconnect_reference_index_signal_handlers(**kwargs: Any) -> None: ...
def register_signal_handlers() -> None: ...
