summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/decky_loader/plugin/imports/decky.py6
-rw-r--r--backend/decky_loader/plugin/imports/decky.pyi5
-rw-r--r--frontend/src/components/DeckyToasterState.tsx1
3 files changed, 7 insertions, 5 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
diff --git a/frontend/src/components/DeckyToasterState.tsx b/frontend/src/components/DeckyToasterState.tsx
index 715ed76d..ebe90b23 100644
--- a/frontend/src/components/DeckyToasterState.tsx
+++ b/frontend/src/components/DeckyToasterState.tsx
@@ -6,7 +6,6 @@ interface PublicDeckyToasterState {
}
export class DeckyToasterState {
- // TODO a set would be better
private _toasts: Set<ToastData> = new Set();
public eventBus = new EventTarget();