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

from typing import Self, TYPE_CHECKING, override
from tree_sitter import Node as TSNode
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.try_catch_statement import TryCatchStatement
from graph_sitter.extensions.autocommit import reader
from graph_sitter.typescript.statements.block_statement import TSBlockStatement
from graph_sitter.typescript.statements.catch_statement import TSCatchStatement
from graph_sitter.writer_decorators import noapidoc, ts_apidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.typescript.detached_symbols.code_block import TSCodeBlock

if TYPE_CHECKING:
    ...
@ts_apidoc
class TSTryCatchStatement(TryCatchStatement["TSCodeBlock"], TSBlockStatement):
    """Abstract representation of the try/catch/finally block in TypeScript.

    Attributes:
        catch: The catch block.
    """
    catch: TSCatchStatement[Self] | None = ...
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: TSCodeBlock, pos: int | None = ...) -> None:
        ...
    
    @property
    @reader
    def function_calls(self) -> list[FunctionCall]:
        """Gets all function calls within a try-catch-finally statement.

        This property retrieves all function calls from the try block, catch block (if present), and finally block (if present).

        Returns:
            list[FunctionCall]: A list of function calls found within the try-catch-finally statement, including those from
            the try block, catch block (if it exists), and finally block (if it exists).
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    
    @property
    @reader
    @override
    def nested_code_blocks(self) -> list[TSCodeBlock]:
        """Returns all nested CodeBlocks within the statement.

        Retrieves a list of all the code blocks nested within this try/catch/finally statement, including the catch and finally blocks if they exist.

        Returns:
            list[TSCodeBlock]: A list of nested code blocks, including the catch and finally blocks.
        """
        ...
    


