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

from dataclasses import dataclass
from typing import Generic, Protocol, Self, TYPE_CHECKING, TypeVar
from rich.console import Console
from tree_sitter import Node as TSNode
from graph_sitter.codebase.node_classes.node_classes import NodeClasses
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.statements.statement import Statement
from graph_sitter.codebase.codebase_graph import CodebaseGraph
from graph_sitter.core.expressions.type import Type
from graph_sitter.core.symbol import Symbol
from graph_sitter.python.detached_symbols.code_block import PyCodeBlock
from graph_sitter.typescript.detached_symbols.code_block import TSCodeBlock

if TYPE_CHECKING:
    ...
Parent = TypeVar("Parent", bound="Editable")
class CanParse(Protocol, Generic[Parent]):
    def __init__(self, node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent) -> None:
        ...
    


Expression = TypeVar("Expression", bound="CanParse")
Parent = TypeVar("Parent", bound="Editable")
@dataclass
class Parser(Generic[Expression]):
    symbol_map: dict[str, type[Symbol]]
    expressions: dict[str, type[Expression]]
    types: dict[str, type[Type] | dict[str, type[Type]]]
    type_node: str
    _uncovered_nodes: set[str] = ...
    _should_log: bool = ...
    _console: Console = ...
    @classmethod
    def from_node_classes(cls, node_classes: NodeClasses, log_parse_warnings: bool = ...) -> Self:
        ...
    
    def parse_expression(self, node: TSNode | None, file_node_id: NodeId, G: CodebaseGraph, parent: Parent, *args, default: type[Expression] = ..., **kwargs) -> Expression[Parent] | None:
        ...
    
    def log_unparsed(self, node: TSNode) -> None:
        ...
    
    def parse_type(self, node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: Parent) -> Type:
        ...
    
    def parse_ts_statements(self, node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: TSCodeBlock) -> list[Statement]:
        ...
    
    def parse_py_statements(self, node: TSNode, file_node_id: NodeId, G: CodebaseGraph, parent: PyCodeBlock) -> list[Statement]:
        ...
    
    def report(self): # -> None:
        ...
    
    def log(self, message: str, *args): # -> None:
        ...
    


