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

from typing import TYPE_CHECKING
from tree_sitter import Node as TSNode
from graph_sitter._proxy import proxy_property
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.autocommit import reader
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.attribute import Attribute
from graph_sitter.typescript.assignment import TSAssignment
from graph_sitter.typescript.detached_symbols.code_block import TSCodeBlock
from graph_sitter.typescript.statements.assignment_statement import TSAssignmentStatement
from graph_sitter.writer_decorators import ts_apidoc
from graph_sitter.typescript.interfaces.has_block import TSHasBlock

if TYPE_CHECKING:
    ...
@ts_apidoc
class TSAttribute(Attribute[TSCodeBlock, TSAssignment], TSAssignmentStatement):
    """Typescript implementation of Attribute detached symbol."""
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: TSCodeBlock, pos: int) -> None:
        ...
    
    @proxy_property
    @reader
    def local_usages(self: TSAttribute[TSHasBlock, TSCodeBlock]) -> list[Editable]:
        """Returns local usages of a TypeScript attribute within its code block.

        Searches through all statements in the attribute's parent code block and finds instances where the attribute is referenced with 'this.' prefix. Excludes the attribute's own
        declaration/assignment.

        Args:
            self (TSAttribute[TSHasBlock, TSCodeBlock]): The TypeScript attribute instance.

        Returns:
            list[Editable]: A sorted list of unique Editable instances representing local usages of the attribute, ordered by their position in the source code.

        Note:
            This method can be called as both a property or a method. If used as a property, it is equivalent to invoking it without arguments.
        """
        ...
    
    @property
    def is_private(self) -> bool:
        """Determines if this attribute has a private accessibility modifier.

        Args:
            self: The TypeScript attribute instance.

        Returns:
            bool: True if the attribute has a 'private' accessibility modifier, False otherwise.
        """
        ...
    
    @property
    def is_optional(self) -> bool:
        """Returns True if this attribute is marked as optional in TypeScript.

        Checks if the attribute has a question mark (`?`) symbol after its name, indicating it's an optional field.

        Returns:
            bool: True if the attribute is optional, False otherwise.
        """
        ...
    


