Source code for vuer.types
from typing import NamedTuple, Callable, Union, Coroutine
from math import pi
from typing import NamedTuple, Callable, Union, Coroutine
from uuid import UUID
from vuer.events import ClientEvent
IDType = Union[UUID, str]
"""IDType is either a UUID or a string. Not in use."""
CoroutineFn = Callable[[], Coroutine]
"""A function that returns a coroutine. Not in use."""
# SendProxy = Callable[[ServerEvent], None]
EventHandler = Callable[[ClientEvent, "VuerProxy"], None]
"""Defines a function that handles a client event. Second argument is the VuerProxy instance bound
to a specific client connected through a websocket session."""
SocketHandler = Callable[["VuerProxy"], Coroutine]
"""Defines a function that spawns a new entity. Argument is the VuerProxy instance."""
if __name__ == "__main__":
e = Euler(x=1, y=2, z=3)
assert e[:3] == (1, 2, 3)
assert e == (1, 2, 3, "XYZ")