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

from typing import TYPE_CHECKING
from tree_sitter import Node as TSNode
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.expressions import Expression
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.for_loop_statement import ForLoopStatement
from graph_sitter.extensions.autocommit import reader
from graph_sitter.typescript.statements.block_statement import TSBlockStatement
from graph_sitter.writer_decorators import noapidoc, ts_apidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.typescript.detached_symbols.code_block import TSCodeBlock

if TYPE_CHECKING:
    ...
@ts_apidoc
class TSForLoopStatement(ForLoopStatement["TSCodeBlock"], TSBlockStatement["TSCodeBlock"]):
    """Abstract representation of the for loop in TypeScript.

    Attributes:
        item: An item in the iterable object. Only applicable for `for...of` loops.
        iterable: The iterable that is being iterated over. Only applicable for `for...of` loops.

        initializer: The counter variable. Applicable for traditional for loops.
        condition: The condition for the loop. Applicable for traditional for loops.
        increment: The increment expression. Applicable for traditional for loops.
    """
    item: Expression[TSForLoopStatement] | None = ...
    iterable: Expression[TSForLoopStatement] | None = ...
    initializer: Expression[TSForLoopStatement] | None = ...
    condition: Expression[TSForLoopStatement] | None = ...
    increment: Expression[TSForLoopStatement] | None = ...
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: TSCodeBlock, pos: int | None = ...) -> None:
        ...
    
    @property
    @reader
    def is_for_in_loop(self) -> bool:
        """Determines whether the current for loop is a `for...in` loop.

        A property that identifies if the current for loop is a 'for...in' loop by checking its tree-sitter node type.

        Returns:
            bool: True if the for loop is a 'for...in' loop, False otherwise.
        """
        ...
    
    @property
    @reader
    def function_calls(self) -> list[FunctionCall]:
        """Retrieves all function calls within a for loop statement.

        For a for...in loop, collects function calls from the iterable expression.
        For a traditional for loop, collects function calls from the initializer,
        condition, and increment expressions. Also includes function calls from
        the superclass implementation.

        Returns:
            list[FunctionCall]: A list of all FunctionCall objects found within the for loop statement.
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    


