[+] builtins mod
This commit is contained in:
parent
8f8d4dbfef
commit
e5c84f962a
35
builtins.event.pyi
Normal file
35
builtins.event.pyi
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
|
class event:
|
||||||
|
@staticmethod
|
||||||
|
def register(event_name, callback) -> None:
|
||||||
|
"""
|
||||||
|
Registers a callback for a given event name.
|
||||||
|
|
||||||
|
:param event_name: Name of the event.
|
||||||
|
:param callback: Callable to be executed when the event occurs.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def unregister(event_name, callback) -> None:
|
||||||
|
"""
|
||||||
|
Unregisters a callback for a given event name.
|
||||||
|
|
||||||
|
:param event_name: Name of the event.
|
||||||
|
:param callback: Callable to be unregistered.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def call(event_name, *data, **kwargs) -> list[Any]:
|
||||||
|
"""
|
||||||
|
Call all callbacks for a given event name.
|
||||||
|
|
||||||
|
:param event_name: Name of the event.
|
||||||
|
:param args: Data to be passed to callbacks.
|
||||||
|
:param kwargs: Additional data to be passed to callbacks.
|
||||||
|
:return: List of data returned by callbacks.
|
||||||
|
"""
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user