from typing import Any

from django.db import models
from django.utils.functional import cached_property
from wagtail.admin.ui import tables
from wagtail.admin.widgets.button import HeaderButton
from wagtail.models.reference_index import ReferenceGroups

from .base import BaseListingView, BaseObjectMixin
from .permissions import PermissionCheckedMixin

class TitleColumn(tables.TitleColumn):
    def get_link_attrs(self, instance: dict[str, Any], parent_context: dict[str, Any]) -> dict[str, Any]: ...

class UsageView(PermissionCheckedMixin, BaseObjectMixin, BaseListingView):
    paginate_by: int
    page_title: str
    index_url_name: str | None
    edit_url_name: str | None
    usage_url_name: str | None
    permission_required: str
    @cached_property
    def describe_on_delete(self) -> bool: ...
    def get_object(self) -> models.Model: ...
    def get_edit_url(self, instance: models.Model) -> str | None: ...
    def get_usage_url(self, instance: models.Model) -> str | None: ...
    def get_index_url(self) -> str | None: ...
    def get_page_subtitle(self) -> str: ...
    def get_breadcrumbs_items(self) -> list[dict[str, Any]]: ...
    @cached_property
    def header_buttons(self) -> list[HeaderButton]: ...
    def get_queryset(self) -> ReferenceGroups: ...
    @cached_property
    def columns(self) -> list[tables.Column]: ...
    def get_table(self, object_list: ReferenceGroups, **kwargs: Any) -> tables.Table: ...
    def get_context_data(
        self, *args: Any, object_list: list[dict[str, Any]] | None = None, **kwargs: Any
    ) -> dict[str, Any]: ...
