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

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.writer_decorators import apidoc, noapidoc

Parent = TypeVar("Parent", bound="Editable")
@apidoc
class TernaryExpression(Expression[Parent], Chainable, Generic[Parent]):
    """Any ternary expression in the code where a condition will determine branched execution."""
    condition: Expression[Self] | None
    consequence: Expression[Self] | None
    alternative: Expression[Self] | None
    @writer
    def reduce_condition(self, bool_condition: bool, node: Editable | None = ...) -> None:
        """Simplifies a ternary expression based on a boolean condition.

        Args:
            bool_condition (bool): The boolean value to reduce the condition to. If True, keeps the consequence branch. If False, keeps the alternative branch.
            node (Editable | None, optional): The node to be edited. Defaults to None.

        Returns:
            None: Modifies the ternary expression in place.
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    


