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

from abc import abstractmethod
from typing import Generic, TYPE_CHECKING, TypeVar
from tree_sitter import Node as TSNode
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.assignment import Assignment
from graph_sitter.core.autocommit import writer
from graph_sitter.core.interfaces.chainable import Chainable
from graph_sitter.core.interfaces.importable import Importable
from graph_sitter.core.interfaces.usable import Usable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.assignment_statement import AssignmentStatement
from graph_sitter.writer_decorators import apidoc, noapidoc
from graph_sitter.core.detached_symbols.code_block import CodeBlock

if TYPE_CHECKING:
    ...
TCodeBlock = TypeVar("TCodeBlock", bound="CodeBlock | None")
TAssignment = TypeVar("TAssignment", bound="Assignment")
@apidoc
class Attribute(AssignmentStatement[TCodeBlock, TAssignment], Usable, Chainable, Generic[TCodeBlock, TAssignment]):
    """Abstract representation of an attribute on a class definition."""
    statement_type = ...
    assignment: TAssignment
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: TCodeBlock, pos: int, assignment_node: TSNode) -> None:
        ...
    
    @property
    @abstractmethod
    def is_private(self) -> bool:
        """Indicates whether the attribute is private.

        Determines if the attribute is a private class attribute by checking if it follows Python's private naming convention (i.e., starts with an underscore).

        Returns:
            bool: True if the attribute is private (starts with underscore), False otherwise.
        """
        ...
    
    @property
    @abstractmethod
    def is_optional(self) -> bool:
        """Returns whether the attribute is optional.

        Determines if an attribute's type annotation indicates it is optional/nullable. For example,
        if the attribute's type is `Optional[str]` or `str | None`, this will return True.

        Returns:
            bool: True if the attribute is marked as optional/nullable, False otherwise.
        """
        ...
    
    @writer
    def set_value(self, value: str) -> None:
        """Sets the value of a node's assignment.

        Updates the value of a node's assignment to the specified string value.

        Args:
            value (str): The new value to set for the assignment.

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


