summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-01 20:54:10 +0100
committermathieui <mathieui@mathieui.net>2021-03-01 20:54:10 +0100
commit9561a2a305d2e2343612cd86112f89e70de55e5b (patch)
tree8efe912dbe7a3b53b874a3651ed0894db8e9624f
parent2dac77e6801382dbab70732f6cb541874d7c125b (diff)
downloadslixmpp-9561a2a305d2e2343612cd86112f89e70de55e5b.tar.gz
slixmpp-9561a2a305d2e2343612cd86112f89e70de55e5b.tar.bz2
slixmpp-9561a2a305d2e2343612cd86112f89e70de55e5b.tar.xz
slixmpp-9561a2a305d2e2343612cd86112f89e70de55e5b.zip
types: add some often-used types
-rw-r--r--slixmpp/types.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/slixmpp/types.py b/slixmpp/types.py
index c8ab640c..b9a1d319 100644
--- a/slixmpp/types.py
+++ b/slixmpp/types.py
@@ -7,7 +7,10 @@
This file contains boilerplate to define types relevant to slixmpp.
"""
-from typing import Optional
+from typing import (
+ Optional,
+ Union,
+)
try:
from typing import (
@@ -31,7 +34,6 @@ PresenceShows = Literal[
'away', 'chat', 'dnd', 'xa',
]
-
MessageTypes = Literal[
'chat', 'error', 'groupchat',
'headline', 'normal',
@@ -70,3 +72,7 @@ class MucRoomItem(TypedDict, total=False):
MucRoomItemKeys = Literal[
'jid', 'role', 'affiliation', 'show', 'status', 'alt_nick',
]
+
+OptJid = Optional[JID]
+JidStr = Union[str, JID]
+OptJidStr = Optional[Union[str, JID]]