from typing import Any

from django.http import HttpRequest
from wagtail import hooks as hooks
from wagtail.admin.ui.components import Component as Component
from wagtail.admin.utils import get_admin_base_url as get_admin_base_url
from wagtail.coreutils import accepts_kwarg as accepts_kwarg
from wagtail.models import Revision as Revision
from wagtail.models.pages import Page as Page
from wagtail.users.models import UserProfile as UserProfile
from wagtail.utils.deprecation import RemovedInWagtail80Warning as RemovedInWagtail80Warning

class BaseItem:
    template: str
    def get_context_data(self, request: HttpRequest) -> dict[str, Any]: ...
    def render(self, request: HttpRequest) -> str: ...

class AdminItem(BaseItem):
    template: str
    def render(self, request: HttpRequest) -> str: ...

class AccessibilityItem(BaseItem):
    in_editor: bool
    def __init__(self, in_editor: bool = False) -> None: ...
    template: str
    axe_include: list[str]
    axe_exclude: list[str | dict[str, list[str]]]
    axe_run_only: list[str] | None
    axe_rules: dict[str, dict[str, bool]]
    axe_custom_rules: list[dict[str, Any]]
    axe_custom_checks: list[dict[str, Any]]
    axe_messages: dict[str, dict[str, str]]
    def get_axe_include(self, request: HttpRequest) -> list[str]: ...
    def get_axe_exclude(self, request: HttpRequest) -> list[str | dict[str, list[str]]]: ...
    def get_axe_run_only(self, request: HttpRequest) -> list[str] | None: ...
    def get_axe_rules(self, request: HttpRequest) -> dict[str, dict[str, bool]]: ...
    def get_axe_custom_rules(self, request: HttpRequest) -> list[dict[str, Any]]: ...
    def get_axe_custom_checks(self, request: HttpRequest) -> list[dict[str, Any]]: ...
    def get_axe_messages(self, request: HttpRequest) -> dict[str, dict[str, str]]: ...
    def get_axe_context(self, request: HttpRequest) -> dict[str, Any]: ...
    def get_axe_options(self, request: HttpRequest) -> dict[str, Any]: ...
    def get_axe_spec(self, request: HttpRequest) -> dict[str, Any]: ...
    def get_axe_configuration(self, request: HttpRequest) -> dict[str, Any]: ...
    def get_context_data(self, request: HttpRequest) -> dict[str, Any]: ...  # type: ignore[override]
    def render(self, request: HttpRequest) -> str: ...

class AddPageItem(BaseItem):
    template: str
    page: Page
    parent_page: Page | None
    def __init__(self, page: Page) -> None: ...
    def render(self, request: HttpRequest) -> str: ...

class ExplorePageItem(BaseItem):
    template: str
    page: Page
    parent_page: Page | None
    def __init__(self, page: Page) -> None: ...
    def render(self, request: HttpRequest) -> str: ...

class EditPageItem(BaseItem):
    template: str
    page: Page
    def __init__(self, page: Page) -> None: ...
    def render(self, request: HttpRequest) -> str: ...

def apply_userbar_hooks(request: HttpRequest, items: list[BaseItem], page: Page | None) -> None: ...

class Userbar(Component):
    template_name: str
    object: Page | None
    position: str
    def __init__(self, *, object: Page | None = None, position: str = "bottom-right") -> None: ...
    def get_context_data(self, parent_context: dict[str, Any]) -> dict[str, Any]: ...
