"""
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.detached_symbols.function_call import FunctionCall
from graph_sitter.core.interfaces.has_value import HasValue
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.statement import Statement
from graph_sitter.extensions.autocommit import reader
from graph_sitter.writer_decorators import apidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.detached_symbols.code_block import CodeBlock
from graph_sitter.core.interfaces.has_block import HasBlock

if TYPE_CHECKING:
    ...
Parent = TypeVar("Parent", bound="HasBlock")
TCodeBlock = TypeVar("TCodeBlock", bound="CodeBlock")
@apidoc
class ReturnStatement(Statement, HasValue, Generic[Parent, TCodeBlock]):
    """Abstract representation of return statements, e.g. in Python:

    ```python
    def f(x):
        if x:
            return x**2  # ReturnStatement
        else:
            return 1  # ReturnStatement
    ```
    """
    statement_type = ...
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent, pos: int | None = ...) -> None:
        ...
    
    @property
    @reader
    def function_calls(self) -> list[FunctionCall]:
        """Returns a list of function calls contained within this return statement.

        If the return statement has no value, an empty list is returned. Otherwise, returns the function calls contained in the value expression of the return statement.

        Returns:
            list[FunctionCall]: A list of function calls contained in the return statement's value expression.
        """
        ...
    


