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

from functools import cached_property
from typing import Generic, Self, TypeVar
from graph_sitter.core.autocommit import writer
from graph_sitter.core.expressions import Expression
from graph_sitter.core.interfaces.chainable import Chainable
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.core.symbol_groups.expression_group import ExpressionGroup
from graph_sitter.writer_decorators import apidoc, noapidoc

Parent = TypeVar("Parent", bound="Editable")
@apidoc
class BinaryExpression(Expression[Parent], Chainable, Generic[Parent]):
    """Any binary expression in the code.

    Includes all set of +,-,*,/, as well as logic operations (and, or) etc.
    """
    left: Expression[Self] | None
    right: Expression[Self] | None
    def __init__(self, ts_node, file_node_id, G, parent: Parent) -> None:
        ...
    
    @property
    @noapidoc
    def operator(self) -> ExpressionGroup[Expression[Self], Self]:
        """Returns the operator of the binary expression."""
        ...
    
    @property
    def operators(self) -> list[ExpressionGroup[Expression[Self], Self]]:
        """Returns a list of operators in a chain of binary operations.

        Returns all operators found in a chain of binary operations, maintaining the order in which they appear. For example,
        in the expression "a + b - c * d / e", it would return the operators [+, -, *, /] in that order.

        Returns:
            list[ExpressionGroup[Expression[Self], Self]]: The list of operators in the binary expression chain, ordered as they appear in the code.
        """
        ...
    
    @cached_property
    def elements(self) -> list[Expression[Self]]:
        """Returns all elements in a binary expression chain.

        Retrieves all elements that appear in a chain of binary operations in the expression,
        traversing through nested binary expressions to extract individual elements.

        Args:
            None

        Returns:
            list[Expression[Self]]: A sorted list of non-binary expression elements in the chain.
            For example, in the expression 'a + b - c * d / e', returns [a, b, c, d, e] in order.
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    
    @writer
    def reduce_condition(self, bool_condition: bool, node: Editable) -> None:
        """Simplifies a binary expression by reducing it based on a boolean condition.


        Args:
            bool_condition (bool): The boolean value to reduce the condition to.

        """
        ...
    


