diff options
Diffstat (limited to 'slixmpp/types.py')
-rw-r--r-- | slixmpp/types.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/slixmpp/types.py b/slixmpp/types.py index 44e24a1e..c8ab640c 100644 --- a/slixmpp/types.py +++ b/slixmpp/types.py @@ -7,15 +7,21 @@ This file contains boilerplate to define types relevant to slixmpp. """ +from typing import Optional + try: from typing import ( Literal, + TypedDict, ) except ImportError: from typing_extensions import ( Literal, + TypedDict, ) +from slixmpp.jid import JID + PresenceTypes = Literal[ 'error', 'probe', 'subscribe', 'subscribed', 'unavailable', 'unsubscribe', 'unsubscribed', @@ -35,3 +41,32 @@ IqTypes = Literal[ "error", "get", "set", "result", ] +MucRole = Literal[ + 'moderator', 'participant', 'visitor', 'none' +] + +MucAffiliation = Literal[ + 'outcast', 'member', 'admin', 'owner', 'none' +] + + +class PresenceArgs(TypedDict, total=False): + pfrom: JID + pto: JID + pshow: PresenceShows + ptype: PresenceTypes + pstatus: str + + +class MucRoomItem(TypedDict, total=False): + jid: JID + role: MucRole + affiliation: MucAffiliation + show: Optional[PresenceShows] + status: str + alt_nick: str + + +MucRoomItemKeys = Literal[ + 'jid', 'role', 'affiliation', 'show', 'status', 'alt_nick', +] |