From 6bd3951d31f791cb05d835d10ddcc0146ff50bfc Mon Sep 17 00:00:00 2001 From: Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:44:51 +0000 Subject: add docstring for emit --- backend/decky_loader/plugin/imports/decky.py | 6 ++++-- backend/decky_loader/plugin/imports/decky.pyi | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'backend') diff --git a/backend/decky_loader/plugin/imports/decky.py b/backend/decky_loader/plugin/imports/decky.py index 94c3b57a..f49bad5c 100644 --- a/backend/decky_loader/plugin/imports/decky.py +++ b/backend/decky_loader/plugin/imports/decky.py @@ -215,9 +215,11 @@ logger.setLevel(logging.INFO) """ Event handling """ -# TODO better docstring im lazy +# This is overriden with an actual implementation before being passed to any plugins +# in ../sandboxed_plugin.py 's initialize function async def emit(event: str, *args: Any) -> None: """ - Send an event to the frontend. + Triggers all event listeners in the frontend waiting for `event`, passing the remaining `*args` as the arguments to each listener function. + (Event listeners are set up in the frontend via the `addEventListener` function from `@decky/api`) """ pass \ No newline at end of file diff --git a/backend/decky_loader/plugin/imports/decky.pyi b/backend/decky_loader/plugin/imports/decky.pyi index a72c74c0..2c8006b3 100644 --- a/backend/decky_loader/plugin/imports/decky.pyi +++ b/backend/decky_loader/plugin/imports/decky.pyi @@ -177,8 +177,9 @@ logger: logging.Logger """ Event handling """ -# TODO better docstring im lazy + async def emit(event: str, *args: Any) -> None: """ - Send an event to the frontend. + Triggers all event listeners in the frontend waiting for `event`, passing the remaining `*args` as the arguments to each listener function. + (Event listeners are set up in the frontend via the `addEventListener` function from `@decky/api`) """ \ No newline at end of file -- cgit v1.2.3