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

from collections.abc import Iterable
from contextlib import contextmanager
from typing import TYPE_CHECKING, TypeVar
from tree_sitter import Node as TSNode
from graph_sitter.enums import ProgrammingLanguage
from graph_sitter.core.interfaces.editable import Editable

if TYPE_CHECKING:
    ...
class XMLUtils:
    @staticmethod
    def dict_to_xml(data: dict | list, format: bool = ..., **kwargs) -> str:
        ...
    
    @staticmethod
    def add_cdata_to_function_body(xml_string): # -> str:
        ...
    
    @staticmethod
    def add_cdata_to_tags(xml_string: str, tags: Iterable[str]) -> str:
        ...
    
    @staticmethod
    def xml_to_dict(xml_string: str, **kwargs) -> dict:
        ...
    
    @staticmethod
    def strip_after_tag(xml_string, tag):
        ...
    
    @staticmethod
    def strip_tag(xml_string: str, tag: str): # -> str:
        ...
    
    @staticmethod
    def strip_all_tags(xml_string: str): # -> str:
        ...
    
    @staticmethod
    def extract_elements(xml_string: str, tag: str, keep_tag: bool = ...) -> list[str]:
        ...
    


def find_first_function_descendant(node: TSNode) -> TSNode:
    ...

def find_index(target: TSNode, siblings: list[TSNode]) -> int:
    """Returns the index of the target node in the list of siblings, or -1 if not found. Recursive implementation."""
    ...

def find_first_ancestor(node: TSNode, type_names: list[str], max_depth: int | None = ...) -> TSNode | None:
    ...

def find_first_child_by_field_name(node: TSNode, field_name: str) -> TSNode | None:
    ...

def has_descendant(node: TSNode, type_name: str) -> bool:
    ...

def get_first_identifier(node: TSNode) -> TSNode | None:
    """Get the text of the first identifier child of a tree-sitter node. Recursive implementation"""
    ...

def descendant_for_byte_range(node: TSNode, start_byte: int, end_byte: int, allow_comment_boundaries: bool = ...) -> TSNode | None:
    """Proper implementation of descendant_for_byte_range, which returns the lowest node that contains the byte range."""
    ...

@contextmanager
def shadow_files(files: str | list[str]): # -> Generator[dict_values[Any, Any], Any, None]:
    """Creates shadow copies of the given files. Restores the original files after the context manager is exited.

    Returns list of filenames of shadowed files.
    """
    ...

E = TypeVar("E", bound="Editable")
def calculate_base_path(full_path, relative_path): # -> str:
    """Calculate the base path represented by './' in a relative path.

    :param full_path: The full path to a file or directory
    :param relative_path: A relative path starting with './'
    :return: The base path represented by './' in the relative path
    """
    ...

__all__ = ["find_all_descendants", "find_first_ancestor", "find_first_child_by_field_name", "find_first_descendant", "get_all_identifiers", "has_descendant"]
def get_language_file_extensions(language: ProgrammingLanguage): # -> set[str] | None:
    """Returns the file extensions for the given language."""
    ...

def determine_project_language(folder_path: str): # -> Literal[ProgrammingLanguage.UNSUPPORTED]:
    ...

def create_file(file_path: str, content: str | bytes) -> str:
    ...

def create_files(base_dir: str, files: dict[str, str]) -> None:
    ...

def truncate_line(input: str, max_chars: int) -> str:
    ...

def humanize_duration(seconds: float) -> str:
    """Converts a duration in seconds to a human-readable string.
    Example: humanize_duration(60) -> "1 minute"
    """
    ...

