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
+4 -3
View File
@@ -19,7 +19,7 @@ import subprocess
import logging
import time
from typing import Dict, Any
from typing import TypeVar, Type
"""
Constants
@@ -213,9 +213,10 @@ logger.setLevel(logging.INFO)
"""
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.
"""
pass