add docstring for emit

This commit is contained in:
Party Wumpus
2024-06-14 22:44:51 +00:00
parent 48e79f803a
commit 6bd3951d31
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -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
@@ -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`)
"""