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

from typing_extensions import deprecated
from graph_sitter.core.autocommit import reader, writer
from graph_sitter.core.detached_symbols.parameter import Parameter
from graph_sitter.core.symbol_groups.collection import Collection
from graph_sitter.python.expressions.type import PyType
from graph_sitter.writer_decorators import py_apidoc

@py_apidoc
class PyParameter(Parameter[PyType, Collection["PyParameter", "PyFunction"]]):
    """Extends Parameter for Python codebases."""
    @property
    @reader
    def is_optional(self) -> bool:
        """Determines if the parameter is optional in Python code.

        A parameter is considered optional if it has a default value or if it is a list/dictionary splat pattern.
        This includes default parameters, typed default parameters, and list/dictionary splat patterns.

        Returns:
            bool: True if the parameter is optional, False otherwise.
        """
        ...
    
    @property
    @reader
    def is_variadic(self) -> bool:
        """Determines if a parameter is a variadic parameter.

        Checks if this parameter is defined as a variadic parameter using the splat operator (*args or **kwargs).

        Returns:
            bool: True if the parameter is variadic (uses * or ** syntax), False otherwise.
        """
        ...
    
    @deprecated("Use `type.edit` instead")
    @writer
    def set_type_annotation(self, type_annotation: str, include_comment: str = ...) -> None:
        """Sets the type annotation of a parameter.

        Sets or updates the type annotation for this parameter. This method is deprecated in favor of using `type.edit` directly.

        Args:
            type_annotation (str): The type annotation to set for the parameter.
            include_comment (str, optional): A comment to include with the type annotation. Defaults to "".

        Returns:
            None

        Deprecated:
            Use `type.edit` instead.
        """
        ...
    
    @writer
    def add_trailing_comment(self, comment: str) -> None:
        """Add a trailing comment to a parameter in a function signature.

        Adds a trailing comment after the specified parameter in the parent function's signature, followed by a newline.

        Args:
            comment (str): The comment text to be added after the parameter.

        Returns:
            None
        """
        ...
    


