Skip to content

Commit

Permalink
Import types_ as types.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Jan 3, 2025
1 parent 973b517 commit 77a6a91
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
1 change: 1 addition & 0 deletions twitchio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
__copyright__ = "Copyright 2017-Present (c) TwitchIO, PythonistaGuild"
__version__ = "3.0.0dev"

from . import types_ as types

Check failure on line 31 in twitchio/__init__.py

View workflow job for this annotation

GitHub Actions / Type Coverage and Linting @ 3.x

Import "types" is not accessed (reportUnusedImport)

from . import authentication as authentication, eventsub as eventsub, utils as utils, web as web
from .assets import Asset as Asset
Expand Down
8 changes: 8 additions & 0 deletions twitchio/types_/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from .colours import *
from .conduits import *
from .eventsub import *
from .options import *
from .requests import *
from .responses import *
from .tokens import *
3 changes: 3 additions & 0 deletions twitchio/types_/colours.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from typing import TypedDict


__all__ = ("Colours", "Colors")


class Colours(TypedDict):
code: int
hex: str
Expand Down
33 changes: 30 additions & 3 deletions twitchio/types_/conduits.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@

from typing import Any, Literal, Never, NotRequired, TypeAlias, TypedDict

__all__ = (
"WelcomeMetaData",
"KeepAliveMetaData",
"NotificationMetaData",
"ReconnectMetaData",
"RevocationMetaData",
"WelcomeSession",
"WelcomePayload",
"WelcomeMessage",
"KeepAliveMessage",
"Condition",
"NotificationTransport",
"NotificationSubscription",
"NotificationPayload",
"NotificationMessage",
"ReconnectSession",
"ReconnectPayload",
"ReconnectMessage",
"RevocationTransport",
"RevocationPayload",
"RevocationMessage",
"RevocationSubscription",
"WebsocketMessages",
"MetaData",
"MessageTypes",
)


class ShardTransport(TypedDict):
method: Literal["websocket", "webhook"]
Expand Down Expand Up @@ -76,7 +103,7 @@ class NotificationMetaData(TypedDict):
subscription_version: str


class ReconnectMetadata(TypedDict):
class ReconnectMetaData(TypedDict):
message_id: str
message_type: Literal["session_reconnect"]
message_timestamp: str
Expand Down Expand Up @@ -166,7 +193,7 @@ class ReconnectPayload(TypedDict):


class ReconnectMessage(TypedDict):
metadata: ReconnectMetadata
metadata: ReconnectMetaData
payload: ReconnectPayload


Expand Down Expand Up @@ -197,5 +224,5 @@ class RevocationMessage(TypedDict):


WebsocketMessages: TypeAlias = WelcomeMessage | ReconnectMessage | RevocationMessage | NotificationMessage | KeepAliveMessage
MetaData: TypeAlias = WelcomeMetaData | ReconnectMetadata | RevocationMetaData | NotificationMetaData | KeepAliveMetaData
MetaData: TypeAlias = WelcomeMetaData | ReconnectMetaData | RevocationMetaData | NotificationMetaData | KeepAliveMetaData
MessageTypes: TypeAlias = Literal["session_welcome", "session_reconnect", "session_keepalive", "notification", "revocation"]
3 changes: 3 additions & 0 deletions twitchio/types_/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
from ..web.utils import BaseAdapter


__all__ = ("ClientOptions", "WaitPredicateT")


class ClientOptions(TypedDict, total=False):
redirect_uri: str | None
scopes: Scopes | None
Expand Down

0 comments on commit 77a6a91

Please sign in to comment.