"""Type stubs for networkxr.classes.digraph."""

from typing import Any, Iterator

from networkxr.classes.graph import Graph
from networkxr.classes.views import DiEdgeView, NodeView

class DiGraph(Graph):
    """Directed graph with self-loops but no parallel edges."""

    _pred: dict[Any, dict[Any, dict[str, Any]]]

    def __init__(self, incoming_graph_data: Any = None, **attr: Any) -> None: ...
    def add_node(self, node_for_adding: Any, **attr: Any) -> None: ...
    def remove_node(self, n: Any) -> None: ...
    def add_edge(self, u_of_edge: Any, v_of_edge: Any, **attr: Any) -> None: ...
    def remove_edge(self, u: Any, v: Any) -> None: ...
    def has_edge(self, u: Any, v: Any) -> bool: ...
    def successors(self, n: Any) -> Iterator[Any]: ...
    def predecessors(self, n: Any) -> Iterator[Any]: ...
    def neighbors(self, n: Any) -> Iterator[Any]: ...
    @property
    def nodes(self) -> NodeView: ...  # type: ignore[override]
    @property
    def edges(self) -> DiEdgeView: ...  # type: ignore[override]
    def degree(self, nbunch: Any = None) -> Any: ...  # type: ignore[override]
    def in_degree(self, nbunch: Any = None) -> Any: ...
    def out_degree(self, nbunch: Any = None) -> Any: ...
    def number_of_edges(self) -> int: ...
    def is_directed(self) -> bool: ...
    def copy(self) -> DiGraph: ...  # type: ignore[override]
    def clear(self) -> None: ...
    def clear_edges(self) -> None: ...
    def reverse(self, copy: bool = True) -> DiGraph: ...
    def to_undirected(self) -> Graph: ...
    def subgraph(self, nodes: Any) -> DiGraph: ...  # type: ignore[override]
