from __future__ import annotations

from collections.abc import Callable
from types import TracebackType
from typing import Any

def set_enabled(enabled: bool) -> None: ...
def enabled() -> bool: ...

class Ghost:
    def __init__(self, initial: Any = None) -> None: ...
    def __enter__(self) -> Ghost: ...
    def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None) -> None: ...
    def stats(self) -> dict[str, int]: ...
    def stats_tuple(self) -> tuple[int, int, int]: ...
    def get(self) -> Any: ...
    def set(self, value: Any) -> None: ...
    def add(self, delta: Any) -> Any: ...
    def iadd(self, delta: Any) -> None: ...
    def update(self, fn: Callable[[Any], Any]) -> Any: ...

class Counter:
    def __init__(self, initial: int = 0, shards: int = 64) -> None: ...
    def __enter__(self) -> Counter: ...
    def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None) -> None: ...
    def add(self, delta: int) -> None: ...
    def get(self) -> int: ...
    def set(self, value: int) -> None: ...
    def stats(self) -> dict[str, int]: ...
    def stats_tuple(self) -> tuple[int, int, int]: ...
