summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/decky_loader/plugin/imports/decky.py6
-rw-r--r--backend/decky_loader/plugin/imports/decky.pyi5
2 files changed, 7 insertions, 4 deletions
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