from typing import Any, ClassVar, Self

from django.db import models
from django.db.models import QuerySet
from treebeard.models import Node

class AL_NodeManager(models.Manager["AL_Node"]):
    def get_queryset(self) -> QuerySet[AL_Node]: ...

class AL_Node(Node):
    objects: ClassVar[AL_NodeManager]  # type: ignore[assignment]
    node_order_by: list[str] | None

    TREEBEARD_IDENTIFYING_FIELD: str
    MOVENODE_FORM_EXCLUDED_FIELDS: tuple[str, ...]

    parent: models.ForeignKey[Self | None, Self | None]
    sib_order: models.PositiveIntegerField[int, int]

    @classmethod
    def add_root(cls, **kwargs: Any) -> Self: ...
    @classmethod
    def get_root_nodes(cls) -> QuerySet[Self]: ...
    def get_depth(self, update: bool = ...) -> int: ...
    def get_children(self) -> QuerySet[Self]: ...
    def get_parent(self, update: bool = ...) -> Self | None: ...
    def get_ancestors(self) -> list[Self]: ...
    def get_root(self) -> Self: ...
    def is_descendant_of(self, node: Self) -> bool: ...
    @classmethod
    def dump_bulk(cls, parent: Self | None = ..., keep_ids: bool = ...) -> list[dict[str, Any]]: ...
    def add_child(self, **kwargs: Any) -> Self: ...
    @classmethod
    def get_tree(cls, parent: Self | None = ...) -> list[Self]: ...
    def get_descendants(self, include_self: bool = ...) -> list[Self]: ...
    def get_descendant_count(self) -> int: ...
    def get_siblings(self) -> QuerySet[Self]: ...
    def get_prev_sibling(self) -> Self | None: ...
    def get_next_sibling(self) -> Self | None: ...
    def add_sibling(self, pos: str | None = ..., **kwargs: Any) -> Self: ...
    def move(self, target: Self, pos: str | None = ...) -> None: ...

    class Meta:
        abstract: bool
