types: add some often-used types
This commit is contained in:
parent
2dac77e680
commit
9561a2a305
@ -7,7 +7,10 @@
|
|||||||
This file contains boilerplate to define types relevant to slixmpp.
|
This file contains boilerplate to define types relevant to slixmpp.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional
|
from typing import (
|
||||||
|
Optional,
|
||||||
|
Union,
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import (
|
from typing import (
|
||||||
@ -31,7 +34,6 @@ PresenceShows = Literal[
|
|||||||
'away', 'chat', 'dnd', 'xa',
|
'away', 'chat', 'dnd', 'xa',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
MessageTypes = Literal[
|
MessageTypes = Literal[
|
||||||
'chat', 'error', 'groupchat',
|
'chat', 'error', 'groupchat',
|
||||||
'headline', 'normal',
|
'headline', 'normal',
|
||||||
@ -70,3 +72,7 @@ class MucRoomItem(TypedDict, total=False):
|
|||||||
MucRoomItemKeys = Literal[
|
MucRoomItemKeys = Literal[
|
||||||
'jid', 'role', 'affiliation', 'show', 'status', 'alt_nick',
|
'jid', 'role', 'affiliation', 'show', 'status', 'alt_nick',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
OptJid = Optional[JID]
|
||||||
|
JidStr = Union[str, JID]
|
||||||
|
OptJidStr = Optional[Union[str, JID]]
|
||||||
|
Loading…
Reference in New Issue
Block a user