from __future__ import annotations

from collections.abc import Callable
from typing import Any

Observer = Callable[[dict[str, Any]], None]

def emit(event: dict[str, Any]) -> None: ...
def get_observer() -> Observer | None: ...
def set_observer(fn: Observer | None) -> None: ...

class span:
    def __init__(self, op: str, **fields: Any) -> None: ...
    def __enter__(self) -> span: ...
    def __exit__(self, exc_type: Any, exc: Any, tb: Any) -> None: ...

def trace_enabled() -> bool: ...

__all__ = ["Observer", "emit", "get_observer", "set_observer", "span", "trace_enabled"]
