# Copyright 2025 Softwell S.r.l.
# Licensed under the Apache License, Version 2.0

"""ASGI type aliases for genro-asgi.

Type aliases following the ASGI spec (MutableMapping, not TypedDict, for extensibility):
    Scope — connection metadata (type, method, path, headers, ...)
    Message — messages between app and server (type key identifies the message)
    Receive — async callable to get next message
    Send — async callable to send a message
    ASGIApp — the standard ASGI application signature
"""

from typing import Any, Awaitable, Callable, MutableMapping

__all__ = ["Scope", "Message", "Receive", "Send", "ASGIApp"]

# ASGI Scope - connection metadata
Scope = MutableMapping[str, Any]

# ASGI Message - sent/received data
Message = MutableMapping[str, Any]

# ASGI Receive - callable to receive messages
Receive = Callable[[], Awaitable[Message]]

# ASGI Send - callable to send messages
Send = Callable[[Message], Awaitable[None]]

# ASGI Application - the main callable
ASGIApp = Callable[[Scope, Receive, Send], Awaitable[None]]
