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

from collections.abc import Iterator, MutableMapping
from typing import Generic, Self, TYPE_CHECKING, TypeVar
from tree_sitter import Node as TSNode
from graph_sitter.core.expressions.builtin import Builtin
from graph_sitter.core.expressions.expression import Expression
from graph_sitter.core.expressions.unpack import Unpack
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.interfaces.has_value import HasValue
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.symbol_groups.collection import Collection
from graph_sitter.writer_decorators import apidoc, noapidoc
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.interfaces.importable import Importable

if TYPE_CHECKING:
    ...
TExpression = TypeVar("TExpression", bound="Expression")
Parent = TypeVar("Parent", bound="Editable")
@apidoc
class Pair(Editable[Parent], HasValue, Generic[TExpression, Parent]):
    """An abstract representation of a key, value pair belonging to a `Dict`"""
    key: TExpression
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent) -> None:
        ...
    
    @property
    def name(self) -> str:
        """Returns the source text of the key expression in the pair.

        This property provides access to the textual representation of the pair's key, which is
        stored in the `key` attribute. The key is expected to be an Expression type that has
        a `source` property containing the original source code text.

        Returns:
            str: The source text of the key expression.

        Note:
            This property assumes that self.key has been properly initialized in __init__
            and has a valid `source` attribute. In cases where key initialization failed
            (key is None), accessing this property may raise an AttributeError.
        """
        ...
    


TExpression = TypeVar("TExpression", bound="Expression")
Parent = TypeVar("Parent", bound="Editable")
@apidoc
class Dict(Expression[Parent], Builtin, MutableMapping[str, TExpression], Generic[TExpression, Parent]):
    """A dict object.

    You can use standard operations to operate on this dict (IE len, del, set, get, etc)
    """
    _underlying: Collection[Pair[TExpression, Self] | Unpack[Self], Parent]
    unpack: Unpack[Self] | None = ...
    def __init__(self, ts_node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent, delimiter: str = ..., pair_type: type[Pair] = ...) -> None:
        ...
    
    def __bool__(self) -> bool:
        ...
    
    def __len__(self) -> int:
        ...
    
    def __iter__(self) -> Iterator[str]:
        ...
    
    def __getitem__(self, __key) -> TExpression:
        ...
    
    def __setitem__(self, __key, __value: TExpression) -> None:
        ...
    
    def __delitem__(self, __key) -> None:
        ...
    
    @property
    @noapidoc
    def descendant_symbols(self) -> list[Importable]:
        ...
    


