from _typeshed import Self
from collections.abc import Iterable
from typing import Any, overload

from docutils.transforms import Transformer

class Node:
    parent: Node | None
    source: str | None
    line: int | None
    document: document | None
    def __getattr__(self, __name: str) -> Any: ...  # incomplete

class Element(Node):
    children: list[Node]
    def __init__(self, rawsource: str = ..., *children: Node, **attributes): ...
    def __len__(self) -> int: ...
    def __contains__(self, key: str | Node) -> bool: ...
    @overload
    def __getitem__(self, key: str) -> Any: ...
    @overload
    def __getitem__(self, key: int) -> Node: ...
    @overload
    def __getitem__(self, key: slice) -> list[Node]: ...
    @overload
    def __setitem__(self, key: str, item: Any) -> None: ...
    @overload
    def __setitem__(self, key: int, item: Node) -> None: ...
    @overload
    def __setitem__(self, key: slice, item: Iterable[Node]) -> None: ...
    def __delitem__(self, key: str | int | slice) -> None: ...
    def __add__(self, other: list[Node]) -> list[Node]: ...
    def __radd__(self, other: list[Node]) -> list[Node]: ...
    def __iadd__(self: Self, other: Node | Iterable[Node]) -> Self: ...
    def __getattr__(self, __name: str) -> Any: ...  # incomplete

class Structural: ...
class Root: ...

class document(Root, Structural, Element):
    transformer: Transformer
    def __getattr__(self, __name: str) -> Any: ...  # incomplete

def __getattr__(name: str) -> Any: ...  # incomplete
