-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from maniek2332/ft/typing
Typing stubs
- Loading branch information
Showing
17 changed files
with
2,838 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
from __future__ import annotations | ||
|
||
from typing import final | ||
|
||
import enum | ||
|
||
|
||
class AudioStatus(enum.IntEnum): | ||
paused: AudioStatus | ||
playing: AudioStatus | ||
stopped: AudioStatus | ||
|
||
|
||
@final | ||
class Sound: | ||
def __init__(self, sound_filepath: str, volume: float = ...) -> None: | ||
... | ||
|
||
@property | ||
def volume(self) -> float: | ||
... | ||
|
||
def play(self, volume: float = 1.) -> None: | ||
... | ||
|
||
def __eq__(self, other) -> bool: | ||
... | ||
|
||
def __hash__(self) -> int: | ||
... | ||
|
||
|
||
@final | ||
class SoundPlayback: | ||
def __init__(self, sound: Sound, volume: float = ...) -> None: | ||
... | ||
|
||
@property | ||
def is_paused(self) -> bool: | ||
... | ||
|
||
@property | ||
def is_playing(self) -> bool: | ||
... | ||
|
||
@property | ||
def sound(self) -> Sound: | ||
... | ||
|
||
@property | ||
def status(self) -> AudioStatus: | ||
... | ||
|
||
@property | ||
def volume(self) -> float: | ||
... | ||
|
||
@volume.setter | ||
def volume(self, value: float) -> None: | ||
... | ||
|
||
def pause(self) -> None: | ||
... | ||
|
||
def play(self, loops: int = 1) -> None: | ||
... | ||
|
||
def resume(self) -> None: | ||
... | ||
|
||
def stop(self) -> None: | ||
... | ||
|
||
|
||
@final | ||
class Music: | ||
def __init__(self, music_filepath: str, volume: float = ...) -> None: | ||
... | ||
|
||
@staticmethod | ||
def get_current() -> Music: | ||
... | ||
|
||
@property | ||
def is_paused(self) -> bool: | ||
... | ||
|
||
@property | ||
def is_playing(self) -> bool: | ||
... | ||
|
||
@property | ||
def status(self) -> AudioStatus: | ||
... | ||
|
||
@property | ||
def volume(self) -> float: | ||
... | ||
|
||
def pause(self) -> None: | ||
... | ||
|
||
def play(self, volume: float = 1.) -> None: | ||
... | ||
|
||
def resume(self) -> None: | ||
... | ||
|
||
def stop(self) -> None: | ||
... | ||
|
||
def __eq__(self, other) -> bool: | ||
... | ||
|
||
def __hash__(self) -> int: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from __future__ import annotations | ||
|
||
from typing import final | ||
|
||
|
||
@final | ||
class Color: | ||
def __init__( | ||
self, r: float = 0., g: float = 0., | ||
b: float = 0., a: float = 1., | ||
) -> None: | ||
... | ||
|
||
@classmethod | ||
def from_int( | ||
self, r: int = 0, g: int = 0, | ||
b: int = 0, a: int = 255, | ||
) -> Color: | ||
... | ||
|
||
@property | ||
def r(self) -> float: | ||
... | ||
|
||
@property | ||
def g(self) -> float: | ||
... | ||
|
||
@property | ||
def b(self) -> float: | ||
... | ||
|
||
@property | ||
def a(self) -> float: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from __future__ import annotations | ||
|
||
import enum | ||
from typing import overload | ||
|
||
from .geometry import Vector | ||
|
||
|
||
class Easing(enum.IntEnum): | ||
none: Easing | ||
back_in: Easing | ||
back_in_out: Easing | ||
back_out: Easing | ||
bounce_in: Easing | ||
bounce_in_out: Easing | ||
bounce_out: Easing | ||
circular_in: Easing | ||
circular_in_out: Easing | ||
circular_out: Easing | ||
cubic_in: Easing | ||
cubic_in_out: Easing | ||
cubic_out: Easing | ||
elastic_in: Easing | ||
elastic_in_out: Easing | ||
elastic_out: Easing | ||
exponential_in: Easing | ||
exponential_in_out: Easing | ||
exponential_out: Easing | ||
quadratic_in: Easing | ||
quadratic_in_out: Easing | ||
quadratic_out: Easing | ||
quartic_in: Easing | ||
quartic_in_out: Easing | ||
quartic_out: Easing | ||
quintic_in: Easing | ||
quintic_in_out: Easing | ||
quintic_out: Easing | ||
sine_in: Easing | ||
sine_in_out: Easing | ||
sine_out: Easing | ||
|
||
|
||
def ease(easing: Easing, progress: float) -> float: | ||
... | ||
|
||
|
||
@overload | ||
def ease_between(easing: Easing, progress: float, a: float, b: float) -> float: | ||
... | ||
|
||
|
||
@overload | ||
def ease_between(easing: Easing, progress: float, a: Vector, b: Vector) -> Vector: | ||
... |
Oops, something went wrong.