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

import wrapt
from collections.abc import Callable
from typing import ParamSpec, TYPE_CHECKING, TypeVar, Union, overload
from graph_sitter.core.autocommit.constants import enabled
from graph_sitter.core.node_id_factory import NodeId
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.symbol import Symbol

if TYPE_CHECKING:
    ...
logger = ...
P = ParamSpec("P")
T = TypeVar("T")
@overload
def writer(wrapped: Callable[P, T]) -> Callable[P, T]:
    ...

@overload
def writer(wrapped: None = ..., *, commit: bool = ...) -> Callable[[Callable[P, T]], Callable[P, T]]:
    ...

def writer(wrapped: Callable[P, T] | None = ..., *, commit: bool = ...) -> Callable[P, T] | Callable[[Callable[P, T]], Callable[P, T]]:
    """Indicates the method is a writer. This will automatically update if the original is out of
    date.

    Args:
    ----
        commit: Whether to commit if there is an update. Do not set this to False unless you are absolutely sure the method can be retried with commit as True safely.
    """
    ...

@wrapt.decorator(enabled=enabled)
def remover(wrapped: Callable[P, T], instance: Union[Symbol, None] = ..., args: P.args = ..., kwargs: P.kwargs = ...) -> Callable[P, T]:
    """Indicates the node will be removed at the end of this method.

    Further usage of the node will result in undefined behaviour and a warning.
    """
    ...

@wrapt.decorator(enabled=enabled)
def repr_func(wrapped: Callable[P, T], instance: Union[Editable, None] = ..., args: P.args = ..., kwargs: P.kwargs = ...) -> Callable[P, T]:
    """Indicates the method is use in debugging/logs."""
    ...

@wrapt.decorator(enabled=enabled)
def mover(wrapped: Callable[P, tuple[NodeId, NodeId]], instance: Union[Symbol, None] = ..., args: P.args = ..., kwargs: P.kwargs = ...) -> Callable[P, None]:
    """Indicates the Node will be moved by the end of this method.

    It should also return the node_id of itself and the new file
    """
    ...

