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

from typing import Generic, TYPE_CHECKING, TypeVar
from tree_sitter import Node as TSNode
from graph_sitter.core.autocommit import reader, writer
from graph_sitter.core.detached_symbols.parameter import Parameter
from graph_sitter.core.expressions import Expression
from graph_sitter.core.expressions.multi_expression import MultiExpression
from graph_sitter.core.interfaces.has_name import HasName
from graph_sitter.core.interfaces.has_value import HasValue
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.writer_decorators import apidoc, noapidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.detached_symbols.function_call import FunctionCall

if TYPE_CHECKING:
    ...
Parent = TypeVar("Parent", bound="FunctionCall")
TParameter = TypeVar("TParameter", bound="Parameter")
@apidoc
class Argument(Expression[Parent], HasName, HasValue, Generic[Parent, TParameter]):
    """Interface to the arguments being passed into a function call."""
    _pos: int
    def __init__(self, node: TSNode, positional_idx: int, parent: FunctionCall) -> None:
        ...
    
    @noapidoc
    @classmethod
    def from_argument_list(cls, node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: FunctionCall) -> MultiExpression[Parent, Argument]:
        ...
    
    @property
    @reader
    def index(self) -> int:
        """Returns the zero-based index of this argument within its parent function call.

        Args:
            None

        Returns:
            int: The zero-based position of this argument in the function call's argument list.
        """
        ...
    
    @property
    @reader
    def type(self) -> str:
        """Gets the TreeSitter type of the argument's value node.

        Returns the type string of the underlying TreeSitter node that represents this argument's value.
        This can be useful for checking if the argument is a specific type of expression or literal.

        Returns:
            str: The TreeSitter node type of the argument's value.
        """
        ...
    
    @property
    @reader
    def is_named(self) -> bool:
        """Determines if an argument is being passed as a named keyword argument.

        Args:
            None

        Returns:
            bool: True if the argument is being passed with a name (e.g., param=value), False if it's a positional argument.
        """
        ...
    
    @writer
    def add_keyword(self, keyword: str) -> None:
        """Converts an unnamed argument to a named argument by adding a keyword.

        Adds the specified keyword to an unnamed argument in a function call, making it a named argument.
        For example, turning a positional argument 'value' into a named argument 'param=value'.

        Args:
            keyword (str): The keyword name to be added to the argument.

        Raises:
            ValueError: If the argument is already a named argument.
        """
        ...
    
    @property
    @reader
    @noapidoc
    def parameter(self) -> TParameter | None:
        """Find the corresponding parameter to this node."""
        ...
    
    @property
    @reader
    def function_calls(self) -> list[FunctionCall]:
        """Returns a list of function calls present in the value of this argument.

        Retrieves all function call nodes that are present within the value of this argument. This is useful for call graph analysis and tracking function usage within arguments.

        Returns:
            list[FunctionCall]: A list containing all function calls within the argument's value.
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    


