summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-06-14 22:44:51 +0000
committerParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-06-14 22:45:02 +0000
commit6bd3951d31f791cb05d835d10ddcc0146ff50bfc (patch)
tree05af7c028e4e07e13c6d405998de633d6d31ffbf /backend
parent48e79f803a93d8ec52c54f8844a5671f34a4cbe7 (diff)
downloaddecky-loader-6bd3951d31f791cb05d835d10ddcc0146ff50bfc.tar.gz
decky-loader-6bd3951d31f791cb05d835d10ddcc0146ff50bfc.zip
add docstring for emit
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