Skip to content

Commit f264162

Browse files
committed
Add types and Alignment enum
1 parent 60ab432 commit f264162

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

twitchio/ext/overlays/enums.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from enum import Enum
2626

2727

28-
__all__ = ("Animation", "AnimationSpeed", "Font")
28+
__all__ = ("Alignment", "Animation", "AnimationSpeed", "Font")
2929

3030

3131
class Animation(Enum):
@@ -349,3 +349,9 @@ class EventPosition(Enum):
349349
bottom_left = "bl"
350350
bottom_center = "bc"
351351
bottom_right = "br"
352+
353+
354+
class Alignment(Enum):
355+
left = "s"
356+
center = "c"
357+
right = "e"

twitchio/ext/overlays/types_.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,30 @@
2424

2525
from __future__ import annotations
2626

27-
from typing import NotRequired, TypedDict
27+
from typing import NotRequired, TypeAlias, TypedDict
28+
29+
30+
ImageDimensions: TypeAlias = tuple[int, int]
2831

2932

3033
class OverlayPartT(TypedDict):
3134
content: str
3235
size: NotRequired[int]
36+
dimensions: NotRequired[ImageDimensions | None]
3337
speed: NotRequired[str | None]
3438
animation: NotRequired[str | None]
3539
colour: NotRequired[str]
40+
is_image: NotRequired[bool | None]
41+
alignment: NotRequired[str | None]
3642

3743

3844
class OverlayEventT(TypedDict):
3945
parts: list[OverlayPartT]
4046
audio: str
47+
volume: float
4148
duration: int | None
4249
duration_is_audio: bool
4350
force_override: bool
4451
stack_event: bool
52+
speed: NotRequired[str | None]
53+
animation: NotRequired[str | None]

0 commit comments

Comments
 (0)