"""
This type stub file was generated by pyright.
"""

from typing import Generic, Self, TYPE_CHECKING, TypeVar
from graph_sitter.writer_decorators import apidoc
from graph_sitter.core.assignment import Assignment
from graph_sitter.core.class_definition import Class
from graph_sitter.core.file import File
from graph_sitter.core.function import Function
from graph_sitter.core.import_resolution import ImportStatement
from graph_sitter.core.symbol import Symbol

if TYPE_CHECKING:
    ...
logger = ...
TFile = TypeVar("TFile", bound="File")
TSymbol = TypeVar("TSymbol", bound="Symbol")
TImportStatement = TypeVar("TImportStatement", bound="ImportStatement")
TGlobalVar = TypeVar("TGlobalVar", bound="Assignment")
TClass = TypeVar("TClass", bound="Class")
TFunction = TypeVar("TFunction", bound="Function")
@apidoc
class Directory(Generic[TFile, TSymbol, TImportStatement, TGlobalVar, TClass, TFunction]):
    """Directory representation for codebase.
    GraphSitter abstraction of a file directory that can be used to look for files and symbols within a specific directory.
    """
    path: str
    parent: Self | None
    items: dict[str, TFile | Self]
    def __init__(self, path: str, parent: Self | None) -> None:
        ...
    
    def __iter__(self): # -> Iterator[TFile | Self]:
        ...
    
    def __contains__(self, item: str | TFile | Self) -> bool:
        ...
    
    def __len__(self) -> int:
        ...
    
    def __getitem__(self, item_name: str) -> TFile | Self:
        ...
    
    def __setitem__(self, item_name: str, item: TFile | Self) -> None:
        ...
    
    def __delitem__(self, item_name: str) -> None:
        ...
    
    def __repr__(self) -> str:
        ...
    
    @property
    def name(self) -> str:
        """Get the base name of the directory's path.

        Extracts the final component of the directory path. For example, for a path '/home/user/project', returns 'project'.

        Returns:
            str: The directory's base name.
        """
        ...
    
    @property
    def files(self) -> list[TFile]:
        """Get a recursive list of all files in the directory and its subdirectories."""
        ...
    
    @property
    def subdirectories(self) -> list[Self]:
        """Get a recursive list of all subdirectories in the directory and its subdirectories."""
        ...
    
    @property
    def symbols(self) -> list[TSymbol]:
        """Get a recursive list of all symbols in the directory and its subdirectories."""
        ...
    
    @property
    def import_statements(self) -> list[TImportStatement]:
        """Get a recursive list of all import statements in the directory and its subdirectories."""
        ...
    
    @property
    def global_vars(self) -> list[TGlobalVar]:
        """Get a recursive list of all global variables in the directory and its subdirectories."""
        ...
    
    @property
    def classes(self) -> list[TClass]:
        """Get a recursive list of all classes in the directory and its subdirectories."""
        ...
    
    @property
    def functions(self) -> list[TFunction]:
        """Get a recursive list of all functions in the directory and its subdirectories."""
        ...
    
    def get_symbol(self, name: str) -> TSymbol | None:
        """Get a symbol by name in the directory and its subdirectories."""
        ...
    
    def get_import_statement(self, name: str) -> TImportStatement | None:
        """Get an import statement by name in the directory and its subdirectories."""
        ...
    
    def get_global_var(self, name: str) -> TGlobalVar | None:
        """Get a global variable by name in the directory and its subdirectories."""
        ...
    
    def get_class(self, name: str) -> TClass | None:
        """Get a class by name in the directory and its subdirectories."""
        ...
    
    def get_function(self, name: str) -> TFunction | None:
        """Get a function by name in the directory and its subdirectories."""
        ...
    
    def add_file(self, file: TFile) -> None:
        """Add a file to the directory."""
        ...
    
    def remove_file(self, file: TFile) -> None:
        """Remove a file from the directory."""
        ...
    
    def remove_file_by_path(self, file_path: str) -> None:
        """Remove a file from the directory by its path."""
        ...
    
    def get_file(self, filename: str, ignore_case: bool = ...) -> TFile | None:
        """Get a file by its name relative to the directory."""
        ...
    
    def add_subdirectory(self, subdirectory: Self) -> None:
        """Add a subdirectory to the directory."""
        ...
    
    def remove_subdirectory(self, subdirectory: Self) -> None:
        """Remove a subdirectory from the directory."""
        ...
    
    def remove_subdirectory_by_path(self, subdirectory_path: str) -> None:
        """Remove a subdirectory from the directory by its path."""
        ...
    
    def get_subdirectory(self, subdirectory_name: str) -> Self | None:
        """Get a subdirectory by its path relative to the directory."""
        ...
    
    def remove(self): # -> None:
        """Remove the directory and all its files and subdirectories."""
        ...
    
    def update_filepath(self, new_filepath: str) -> None:
        """Update the filepath of the directory."""
        ...
    
    def rename(self, new_name: str) -> None:
        """Rename the directory."""
        ...
    


