finalize api for plugin events in backend

just need frontend impl now
This commit is contained in:
AAGaming
2023-12-31 20:29:19 -05:00
parent db96121304
commit c5ea95a787
8 changed files with 93 additions and 50 deletions
@@ -16,7 +16,7 @@ __version__ = '0.1.0'
import logging
from typing import Dict, Any
from typing import TypeVar, Type
"""
Constants
@@ -177,8 +177,9 @@ logger: logging.Logger
"""
Event handling
"""
DataType = TypeVar("DataType")
# TODO better docstring im lazy
async def emit_message(message: Dict[Any, Any]) -> None:
async def emit(event: str, data: DataType | None = None, data_type: Type[DataType] | None = None) -> None:
"""
Send a message to the frontend.
Send an event to the frontend.
"""