mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 00:37:49 +00:00
attempt to add plugin events to the plugin frontend api.
unable to test right now though
This commit is contained in:
committed by
PartyWumpus
parent
de9d2144a6
commit
f9ff518e6d
@@ -14,7 +14,7 @@ from ..localplatform.localplatform import setgid, setuid, get_username, get_home
|
||||
from ..enums import UserType
|
||||
from .. import helpers
|
||||
|
||||
from typing import List, TypeVar, Type
|
||||
from typing import List, TypeVar, Any
|
||||
|
||||
DataType = TypeVar("DataType")
|
||||
|
||||
@@ -83,11 +83,11 @@ class SandboxedPlugin:
|
||||
sysmodules[key.replace("decky_loader.", "")] = sysmodules[key]
|
||||
|
||||
from .imports import decky
|
||||
async def emit(event: str, data: DataType | None = None, data_type: Type[DataType] | None = None) -> None:
|
||||
async def emit(event: str, *args: Any) -> None:
|
||||
await self._socket.write_single_line_server(dumps({
|
||||
"type": SocketMessageType.EVENT,
|
||||
"event": event,
|
||||
"data": data
|
||||
"args": args
|
||||
}))
|
||||
# copy the docstring over so we don't have to duplicate it
|
||||
emit.__doc__ = decky.emit.__doc__
|
||||
|
||||
Reference in New Issue
Block a user