from typing import Any, ClassVar

from django.contrib import admin
from django.db.models import QuerySet
from django.http import HttpRequest, HttpResponse, HttpResponseBadRequest
from django.urls.resolvers import URLPattern
from treebeard.forms import MoveNodeForm
from treebeard.models import Node

def check_empty_dict(GET_dict: dict[str, str]) -> bool: ...

class TreeAdmin(admin.ModelAdmin[Node]):
    change_list_template: ClassVar[str]  # type: ignore[assignment]
    def get_queryset(self, request: HttpRequest) -> QuerySet[Node]: ...
    def changelist_view(self, request: HttpRequest, extra_context: dict[str, Any] | None = ...) -> HttpResponse: ...
    def get_urls(self) -> list[URLPattern]: ...
    def get_node(self, node_id: str) -> Node: ...
    def try_to_move_node(
        self, as_child: bool, node: Node, pos: str, request: HttpRequest, target: Node
    ) -> HttpResponse | HttpResponseBadRequest: ...
    def move_node(self, request: HttpRequest) -> HttpResponse | HttpResponseBadRequest: ...

def admin_factory(form_class: type[MoveNodeForm]) -> type[TreeAdmin]: ...
