from typing import Any, List, FrozenSet
from typing import Optional

# Parser module
class parser:
    def parse(source: str) -> List[dict]: ...

class DepNode:
    # Derived
    @property
    def name(self) -> str: ...
    @property
    def spec(self) -> Any: ... # TODO: Update
    @property
    def dependents(self) -> FrozenSet[str]: ...
    @property
    def depth(self) -> Optional[int]: ...

    # Custom
    @property
    def dependencies(self) -> int: ...

class DepGraph:
    def size(self) -> int: ...
    def num_dependencies(self) -> int: ...

    def keys(self) -> FrozenSet[str]: ...
    def get(self) -> DepNode: ...
    def get_all_scoped(self, scope: str) -> List[DepNode]: ...
    def origins(self) -> List[str]: ...
    def names(self) -> List[str]: ...

class GraphBuilder:
    def __init__(self, verbose: Optional[bool] = False): ...
    def build(self, source: str, package: Optional[str] = None) -> DepGraph: ...