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

from typing import Generic, Self, TYPE_CHECKING, TypeVar
from tree_sitter import Node as TSNode
from graph_sitter.core.autocommit import reader, writer
from graph_sitter.core.expressions.type import Type
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.symbol_groups.collection import Collection
from graph_sitter.typescript.detached_symbols.parameter import TSParameter
from graph_sitter.typescript.placeholder.placeholder_return_type import TSReturnTypePlaceholder
from graph_sitter.writer_decorators import noapidoc, ts_apidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.typescript.expressions.type import TSType

if TYPE_CHECKING:
    ...
Parent = TypeVar("Parent")
@ts_apidoc
class TSFunctionType(Type[Parent], Generic[Parent]):
    """Function type definition.

    Attributes:
        return_type: Return type of the function.

    Examples:
        a: (a: number) => number
    """
    return_type: TSType[Self] | TSReturnTypePlaceholder[Self]
    _parameters: Collection[TSParameter, Self]
    name: None = ...
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent) -> None:
        ...
    
    @property
    @reader
    def parameters(self) -> Collection[TSParameter, Self]:
        """Retrieves the parameters of a function type.

        Returns the collection of parameters associated with this function type. These parameters represent the arguments that can be passed to the function.

        Returns:
            Collection[TSParameter, Self]: A collection of TSParameter objects representing the function's parameters.
        """
        ...
    
    @writer
    def asyncify(self) -> None:
        """Modifies the function type to be asynchronous by wrapping its return type in a Promise.

        This method transforms a synchronous function type into an asynchronous one by modifying
        its return type. It wraps the existing return type in a Promise, effectively changing
        'T' to 'Promise<T>'.

        Args:
            self: The TSFunctionType instance to modify.

        Returns:
            None
        """
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    


